Skip to content

Commit

Permalink
Update common_test.py
Browse files Browse the repository at this point in the history
  • Loading branch information
makslevental committed Dec 10, 2024
1 parent e151c65 commit e268dfb
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 15 deletions.
18 changes: 10 additions & 8 deletions tuner/tuner/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,14 @@

from iree.compiler import ir

# substitute replace=True so that colliding registration don't error
def register_attribute_builder(kind, replace=True):
def decorator_builder(func):
ir.AttrBuilder.insert(kind, func, replace=replace)
return func

return decorator_builder

ir.register_attribute_builder = register_attribute_builder
# # substitute replace=True so that colliding registration don't error
# def register_attribute_builder(kind, replace=True):
# def decorator_builder(func):
# ir.AttrBuilder.insert(kind, func, replace=replace)
# return func
#
# return decorator_builder
#
#
# ir.register_attribute_builder = register_attribute_builder
7 changes: 0 additions & 7 deletions tuner/tuner/common_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -217,10 +217,3 @@ def test_get_lowering_config(tuner_ctx: common.TunerContext) -> None:

assert config.lowering_config.mma_kind is None
assert config.lowering_config.subgroup_count_mn == (1, 1)


def test_enum_collision():
from iree.compiler.dialects import linalg, vector

linalg_iter_type_e = linalg._iteratortype(0, None)
vector_iter_type_e = vector._vector_iteratortype(0, None)
4 changes: 4 additions & 0 deletions tuner/tuner/libtuner_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -499,3 +499,7 @@ def test_validate_devices_with_invalid_device() -> None:
exit_program=True,
)
assert expected_call in mock_handle_error.call_args_list


def test_enum_collision():
from iree.compiler.dialects import linalg, vector

0 comments on commit e268dfb

Please sign in to comment.