Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add TaggedExpression #688

Open
wants to merge 49 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
49 commits
Select commit Hold shift + click to select a range
9233385
add WithTag
matthiasdiener Oct 11, 2022
679d269
Merge branch 'main' into withtag
matthiasdiener Oct 18, 2022
45e14e7
rename to TaggedExpression
matthiasdiener Oct 18, 2022
50adbc4
better tags propagation
matthiasdiener Oct 18, 2022
06ab987
add to memaccess
matthiasdiener Oct 18, 2022
d50f908
Merge branch 'main' into withtag
matthiasdiener Oct 18, 2022
ee395c1
Merge branch 'main' into withtag
matthiasdiener Oct 27, 2022
04d0739
Merge branch 'main' into withtag
matthiasdiener Nov 9, 2022
9ae8936
spelling fixes
matthiasdiener Nov 9, 2022
0bbbaec
provide default value for tags in map_ functions
matthiasdiener Nov 9, 2022
9529588
better doc
matthiasdiener Nov 9, 2022
9e24cd6
attempt to fix doctest
matthiasdiener Nov 9, 2022
e72dec0
add Sync
matthiasdiener Nov 9, 2022
c7f9ad0
Merge branch 'main' into withtag
matthiasdiener Nov 11, 2022
df7ed9b
no default tags arguments
matthiasdiener Nov 11, 2022
857e268
lint fix
matthiasdiener Nov 11, 2022
d5f3f5d
small arg fixes
matthiasdiener Nov 11, 2022
3d7df9f
Add some types to loopy.translation_unit
inducer Nov 28, 2022
6142a3b
Stats: fix tags passing, add types
inducer Nov 28, 2022
b060d55
Merge branch 'main' into withtag
matthiasdiener Nov 4, 2024
cc7efdc
ruff
matthiasdiener Nov 4, 2024
56527b4
misc updates
matthiasdiener Nov 7, 2024
af5d019
Merge branch 'main' into withtag
matthiasdiener Nov 7, 2024
f461722
Merge branch 'main' into withtag
matthiasdiener Nov 7, 2024
3f9df15
fix(?) MemoryAccessCounter
matthiasdiener Nov 8, 2024
2248b0e
fix remaining issues
matthiasdiener Nov 8, 2024
bb758ad
doctest fixes
matthiasdiener Nov 8, 2024
5aabe8f
small doc fix
matthiasdiener Nov 8, 2024
119e789
make {Sync,MemAccess}.__repr__ more consistent, fix doctest errors
matthiasdiener Nov 11, 2024
372e48f
fix docs
matthiasdiener Nov 11, 2024
0ef534e
gitlab->github in CI
matthiasdiener Nov 11, 2024
5e5be1d
mypy fixes
matthiasdiener Nov 11, 2024
b54217d
pylint github
matthiasdiener Nov 11, 2024
a693fb0
fix (?) remaining mypy errors, somewhat sketchy in parts
matthiasdiener Nov 11, 2024
4b5a8f4
Revert "pylint github"
matthiasdiener Nov 11, 2024
1a48a34
minor cleanup
matthiasdiener Nov 11, 2024
dd419b0
revert CI changes
matthiasdiener Nov 12, 2024
ad08e3e
minor
matthiasdiener Nov 12, 2024
123a457
Merge branch 'main' into withtag
matthiasdiener Nov 14, 2024
7b60f42
Merge branch 'main' into withtag
matthiasdiener Nov 20, 2024
da547b6
Merge branch 'main' into withtag
matthiasdiener Jan 10, 2025
c67eea6
ruff
matthiasdiener Jan 10, 2025
9dce573
ExpressionT
matthiasdiener Jan 13, 2025
17ba240
Merge branch 'main' into withtag
matthiasdiener Jan 13, 2025
9f93401
lint
matthiasdiener Jan 13, 2025
c3b4a82
more lint fixes
matthiasdiener Jan 13, 2025
04ae5c0
remove init_arg_names
matthiasdiener Jan 13, 2025
4ca4db4
more typing
matthiasdiener Jan 13, 2025
854b4a2
Merge branch 'main' into withtag
matthiasdiener Jan 22, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
99 changes: 49 additions & 50 deletions doc/tutorial.rst
Original file line number Diff line number Diff line change
Expand Up @@ -1574,7 +1574,7 @@ information provided. Now we will count the operations:

>>> op_map = lp.get_op_map(knl, subgroup_size=32)
>>> print(op_map)
Op(np:dtype('float32'), add, subgroup, "stats_knl"): ...
Op(np:dtype('float32'), OpType.ADD, CountGranularity.SUBGROUP, "stats_knl", frozenset()): ...

Each line of output will look roughly like::

Expand All @@ -1599,13 +1599,13 @@ One way to evaluate these polynomials is with :meth:`islpy.PwQPolynomial.eval_wi
.. doctest::

>>> param_dict = {'n': 256, 'm': 256, 'l': 8}
>>> from loopy.statistics import CountGranularity as CG
>>> f32add = op_map[lp.Op(np.float32, 'add', CG.SUBGROUP, "stats_knl")].eval_with_dict(param_dict)
>>> f32div = op_map[lp.Op(np.float32, 'div', CG.SUBGROUP, "stats_knl")].eval_with_dict(param_dict)
>>> f32mul = op_map[lp.Op(np.float32, 'mul', CG.SUBGROUP, "stats_knl")].eval_with_dict(param_dict)
>>> f64add = op_map[lp.Op(np.float64, 'add', CG.SUBGROUP, "stats_knl")].eval_with_dict(param_dict)
>>> f64mul = op_map[lp.Op(np.float64, 'mul', CG.SUBGROUP, "stats_knl")].eval_with_dict(param_dict)
>>> i32add = op_map[lp.Op(np.int32, 'add', CG.SUBGROUP, "stats_knl")].eval_with_dict(param_dict)
>>> from loopy.statistics import CountGranularity as CG, OpType, AddressSpace, AccessDirection, SynchronizationKind
>>> f32add = op_map[lp.Op(np.float32, OpType.ADD, CG.SUBGROUP, "stats_knl")].eval_with_dict(param_dict)
>>> f32div = op_map[lp.Op(np.float32, OpType.DIV, CG.SUBGROUP, "stats_knl")].eval_with_dict(param_dict)
>>> f32mul = op_map[lp.Op(np.float32, OpType.MUL, CG.SUBGROUP, "stats_knl")].eval_with_dict(param_dict)
>>> f64add = op_map[lp.Op(np.float64, OpType.ADD, CG.SUBGROUP, "stats_knl")].eval_with_dict(param_dict)
>>> f64mul = op_map[lp.Op(np.float64, OpType.MUL, CG.SUBGROUP, "stats_knl")].eval_with_dict(param_dict)
>>> i32add = op_map[lp.Op(np.int32, OpType.ADD, CG.SUBGROUP, "stats_knl")].eval_with_dict(param_dict)
>>> print("%i\n%i\n%i\n%i\n%i\n%i" %
... (f32add, f32div, f32mul, f64add, f64mul, i32add))
524288
Expand Down Expand Up @@ -1636,7 +1636,7 @@ together into keys containing only the specified fields:

>>> op_map_dtype = op_map.group_by('dtype')
>>> print(op_map_dtype)
Op(np:dtype('float32'), None, None): ...
Op(np:dtype('float32'), None, None, frozenset()): ...
>>> f32op_count = op_map_dtype[lp.Op(dtype=np.float32)
... ].eval_with_dict(param_dict)
>>> print(f32op_count)
Expand All @@ -1661,7 +1661,7 @@ we'll continue using the kernel from the previous example:

>>> mem_map = lp.get_mem_access_map(knl, subgroup_size=32)
>>> print(mem_map)
MemAccess(global, np:dtype('float32'), {}, {}, load, a, None, subgroup, 'stats_knl'): ...
MemAccess(AddressSpace.GLOBAL, np:dtype('float32'), {}, {}, AccessDirection.READ, a, frozenset(), CountGranularity.SUBGROUP, 'stats_knl', frozenset()): ...

Each line of output will look roughly like::

Expand Down Expand Up @@ -1703,17 +1703,17 @@ We can evaluate these polynomials using :meth:`islpy.PwQPolynomial.eval_with_dic

.. doctest::

>>> f64ld_g = mem_map[lp.MemAccess('global', np.float64, {}, {}, 'load', 'g',
... variable_tags=None, count_granularity=CG.SUBGROUP, kernel_name="stats_knl")
>>> f64ld_g = mem_map[lp.MemAccess(AddressSpace.GLOBAL, np.float64, {}, {}, AccessDirection.READ, 'g',
... variable_tags=frozenset(), count_granularity=CG.SUBGROUP, kernel_name="stats_knl")
... ].eval_with_dict(param_dict)
>>> f64st_e = mem_map[lp.MemAccess('global', np.float64, {}, {}, 'store', 'e',
... variable_tags=None, count_granularity=CG.SUBGROUP, kernel_name="stats_knl")
>>> f64st_e = mem_map[lp.MemAccess(AddressSpace.GLOBAL, np.float64, {}, {}, AccessDirection.WRITE, 'e',
... variable_tags=frozenset(), count_granularity=CG.SUBGROUP, kernel_name="stats_knl")
... ].eval_with_dict(param_dict)
>>> f32ld_a = mem_map[lp.MemAccess('global', np.float32, {}, {}, 'load', 'a',
... variable_tags=None, count_granularity=CG.SUBGROUP, kernel_name="stats_knl")
>>> f32ld_a = mem_map[lp.MemAccess(AddressSpace.GLOBAL, np.float32, {}, {}, AccessDirection.READ, 'a',
... variable_tags=frozenset(), count_granularity=CG.SUBGROUP, kernel_name="stats_knl")
... ].eval_with_dict(param_dict)
>>> f32st_c = mem_map[lp.MemAccess('global', np.float32, {}, {}, 'store', 'c',
... variable_tags=None, count_granularity=CG.SUBGROUP, kernel_name="stats_knl")
>>> f32st_c = mem_map[lp.MemAccess(AddressSpace.GLOBAL, np.float32, {}, {}, AccessDirection.WRITE, 'c',
... variable_tags=frozenset(), count_granularity=CG.SUBGROUP, kernel_name="stats_knl")
... ].eval_with_dict(param_dict)
>>> print("f32 ld a: %i\nf32 st c: %i\nf64 ld g: %i\nf64 st e: %i" %
... (f32ld_a, f32st_c, f64ld_g, f64st_e))
Expand All @@ -1731,15 +1731,15 @@ using :func:`loopy.ToCountMap.to_bytes` and :func:`loopy.ToCountMap.group_by`:

>>> bytes_map = mem_map.to_bytes()
>>> print(bytes_map)
MemAccess(global, np:dtype('float32'), {}, {}, load, a, None, subgroup, 'stats_knl'): ...
>>> global_ld_st_bytes = bytes_map.filter_by(mtype=['global']
... ).group_by('direction')
MemAccess(AddressSpace.GLOBAL, np:dtype('float32'), {}, {}, AccessDirection.READ, a, frozenset(), CountGranularity.SUBGROUP, 'stats_knl', frozenset()): ...
>>> global_ld_st_bytes = bytes_map.filter_by(address_space=[AddressSpace.GLOBAL]
... ).group_by('read_write')
>>> print(global_ld_st_bytes)
MemAccess(None, None, None, None, load, None, None, None, None): ...
MemAccess(None, None, None, None, store, None, None, None, None): ...
>>> loaded = global_ld_st_bytes[lp.MemAccess(direction='load')
MemAccess(None, None, None, None, AccessDirection.READ, None, frozenset(), None, None, frozenset()): ...
MemAccess(None, None, None, None, AccessDirection.WRITE, None, frozenset(), None, None, frozenset()): ...
>>> loaded = global_ld_st_bytes[lp.MemAccess(read_write=AccessDirection.READ)
... ].eval_with_dict(param_dict)
>>> stored = global_ld_st_bytes[lp.MemAccess(direction='store')
>>> stored = global_ld_st_bytes[lp.MemAccess(read_write=AccessDirection.WRITE)
... ].eval_with_dict(param_dict)
>>> print("bytes loaded: %s\nbytes stored: %s" % (loaded, stored))
bytes loaded: 7340032
Expand Down Expand Up @@ -1772,30 +1772,29 @@ this time.
... outer_tag="l.1", inner_tag="l.0")
>>> mem_map = lp.get_mem_access_map(knl_consec, subgroup_size=32)
>>> print(mem_map)
MemAccess(global, np:dtype('float32'), {0: 1, 1: 128}, {}, load, a, None, workitem, 'stats_knl'): ...
MemAccess(global, np:dtype('float32'), {0: 1, 1: 128}, {}, load, b, None, workitem, 'stats_knl'): ...
MemAccess(global, np:dtype('float32'), {0: 1, 1: 128}, {}, store, c, None, workitem, 'stats_knl'): ...
MemAccess(global, np:dtype('float64'), {0: 1, 1: 128}, {}, load, g, None, workitem, 'stats_knl'): ...
MemAccess(global, np:dtype('float64'), {0: 1, 1: 128}, {}, load, h, None, workitem, 'stats_knl'): ...
MemAccess(global, np:dtype('float64'), {0: 1, 1: 128}, {}, store, e, None, workitem, 'stats_knl'): ...
MemAccess(AddressSpace.GLOBAL, np:dtype('float32'), {0: 1, 1: 128}, {}, AccessDirection.READ, a, frozenset(), CountGranularity.WORKITEM, 'stats_knl', frozenset()): ...
MemAccess(AddressSpace.GLOBAL, np:dtype('float32'), {0: 1, 1: 128}, {}, AccessDirection.READ, b, frozenset(), CountGranularity.WORKITEM, 'stats_knl', frozenset()): ...
MemAccess(AddressSpace.GLOBAL, np:dtype('float32'), {0: 1, 1: 128}, {}, AccessDirection.WRITE, c, frozenset(), CountGranularity.WORKITEM, 'stats_knl', frozenset()): ...
MemAccess(AddressSpace.GLOBAL, np:dtype('float64'), {0: 1, 1: 128}, {}, AccessDirection.READ, g, frozenset(), CountGranularity.WORKITEM, 'stats_knl', frozenset()): ...
MemAccess(AddressSpace.GLOBAL, np:dtype('float64'), {0: 1, 1: 128}, {}, AccessDirection.READ, h, frozenset(), CountGranularity.WORKITEM, 'stats_knl', frozenset()): ...
MemAccess(AddressSpace.GLOBAL, np:dtype('float64'), {0: 1, 1: 128}, {}, AccessDirection.WRITE, e, frozenset(), CountGranularity.WORKITEM, 'stats_knl', frozenset()): ...

With this parallelization, consecutive work-items will access consecutive array
elements in memory. The polynomials are a bit more complicated now due to the
parallelization, but when we evaluate them, we see that the total number of
array accesses has not changed:

.. doctest::

>>> f64ld_g = mem_map[lp.MemAccess('global', np.float64, {0: 1, 1: 128}, {}, 'load', 'g',
>>> f64ld_g = mem_map[lp.MemAccess(AddressSpace.GLOBAL, np.dtype(np.float64), {0: 1, 1: 128}, {}, AccessDirection.READ, 'g',
... variable_tags=None, count_granularity=CG.WORKITEM, kernel_name="stats_knl")
... ].eval_with_dict(param_dict)
>>> f64st_e = mem_map[lp.MemAccess('global', np.float64, {0: 1, 1: 128}, {}, 'store', 'e',
>>> f64st_e = mem_map[lp.MemAccess(AddressSpace.GLOBAL, np.float64, {0: 1, 1: 128}, {}, AccessDirection.WRITE, 'e',
... variable_tags=None, count_granularity=CG.WORKITEM, kernel_name="stats_knl")
... ].eval_with_dict(param_dict)
>>> f32ld_a = mem_map[lp.MemAccess('global', np.float32, {0: 1, 1: 128}, {}, 'load', 'a',
>>> f32ld_a = mem_map[lp.MemAccess(AddressSpace.GLOBAL, np.float32, {0: 1, 1: 128}, {}, AccessDirection.READ, 'a',
... variable_tags=None, count_granularity=CG.WORKITEM, kernel_name="stats_knl")
... ].eval_with_dict(param_dict)
>>> f32st_c = mem_map[lp.MemAccess('global', np.float32, {0: 1, 1: 128}, {}, 'store', 'c',
>>> f32st_c = mem_map[lp.MemAccess(AddressSpace.GLOBAL, np.float32, {0: 1, 1: 128}, {}, AccessDirection.WRITE, 'c',
... variable_tags=None, count_granularity=CG.WORKITEM, kernel_name="stats_knl")
... ].eval_with_dict(param_dict)
>>> print("f32 ld a: %i\nf32 st c: %i\nf64 ld g: %i\nf64 st e: %i" %
Expand All @@ -1816,29 +1815,29 @@ we'll switch the inner and outer tags in our parallelization of the kernel:
... outer_tag="l.0", inner_tag="l.1")
>>> mem_map = lp.get_mem_access_map(knl_nonconsec, subgroup_size=32)
>>> print(mem_map)
MemAccess(global, np:dtype('float32'), {0: 128, 1: 1}, {}, load, a, None, workitem, 'stats_knl'): ...
MemAccess(global, np:dtype('float32'), {0: 128, 1: 1}, {}, load, b, None, workitem, 'stats_knl'): ...
MemAccess(global, np:dtype('float32'), {0: 128, 1: 1}, {}, store, c, None, workitem, 'stats_knl'): ...
MemAccess(global, np:dtype('float64'), {0: 128, 1: 1}, {}, load, g, None, workitem, 'stats_knl'): ...
MemAccess(global, np:dtype('float64'), {0: 128, 1: 1}, {}, load, h, None, workitem, 'stats_knl'): ...
MemAccess(global, np:dtype('float64'), {0: 128, 1: 1}, {}, store, e, None, workitem, 'stats_knl'): ...
MemAccess(AddressSpace.GLOBAL, np:dtype('float32'), {0: 128, 1: 1}, {}, AccessDirection.READ, a, frozenset(), CountGranularity.WORKITEM, 'stats_knl', frozenset()): ...
MemAccess(AddressSpace.GLOBAL, np:dtype('float32'), {0: 128, 1: 1}, {}, AccessDirection.READ, b, frozenset(), CountGranularity.WORKITEM, 'stats_knl', frozenset()): ...
MemAccess(AddressSpace.GLOBAL, np:dtype('float32'), {0: 128, 1: 1}, {}, AccessDirection.WRITE, c, frozenset(), CountGranularity.WORKITEM, 'stats_knl', frozenset()): ...
MemAccess(AddressSpace.GLOBAL, np:dtype('float64'), {0: 128, 1: 1}, {}, AccessDirection.READ, g, frozenset(), CountGranularity.WORKITEM, 'stats_knl', frozenset()): ...
MemAccess(AddressSpace.GLOBAL, np:dtype('float64'), {0: 128, 1: 1}, {}, AccessDirection.READ, h, frozenset(), CountGranularity.WORKITEM, 'stats_knl', frozenset()): ...
MemAccess(AddressSpace.GLOBAL, np:dtype('float64'), {0: 128, 1: 1}, {}, AccessDirection.WRITE, e, frozenset(), CountGranularity.WORKITEM, 'stats_knl', frozenset()): ...

With this parallelization, consecutive work-items will access *nonconsecutive*
array elements in memory. The total number of array accesses still has not
changed:

.. doctest::

>>> f64ld_g = mem_map[lp.MemAccess('global', np.float64, {0: 128, 1: 1}, {}, 'load', 'g',
>>> f64ld_g = mem_map[lp.MemAccess(AddressSpace.GLOBAL, np.float64, {0: 128, 1: 1}, {}, AccessDirection.READ, 'g',
... variable_tags=None, count_granularity=CG.WORKITEM, kernel_name="stats_knl")
... ].eval_with_dict(param_dict)
>>> f64st_e = mem_map[lp.MemAccess('global', np.float64, {0: 128, 1: 1}, {}, 'store', 'e',
>>> f64st_e = mem_map[lp.MemAccess(AddressSpace.GLOBAL, np.float64, {0: 128, 1: 1}, {}, AccessDirection.WRITE, 'e',
... variable_tags=None, count_granularity=CG.WORKITEM, kernel_name="stats_knl")
... ].eval_with_dict(param_dict)
>>> f32ld_a = mem_map[lp.MemAccess('global', np.float32, {0: 128, 1: 1}, {}, 'load', 'a',
>>> f32ld_a = mem_map[lp.MemAccess(AddressSpace.GLOBAL, np.float32, {0: 128, 1: 1}, {}, AccessDirection.READ, 'a',
... variable_tags=None, count_granularity=CG.WORKITEM, kernel_name="stats_knl")
... ].eval_with_dict(param_dict)
>>> f32st_c = mem_map[lp.MemAccess('global', np.float32, {0: 128, 1: 1}, {}, 'store', 'c',
>>> f32st_c = mem_map[lp.MemAccess(AddressSpace.GLOBAL, np.float32, {0: 128, 1: 1}, {}, AccessDirection.WRITE, 'c',
... variable_tags=None, count_granularity=CG.WORKITEM, kernel_name="stats_knl")
... ].eval_with_dict(param_dict)
>>> print("f32 ld a: %i\nf32 st c: %i\nf64 ld g: %i\nf64 st e: %i" %
Expand Down Expand Up @@ -1873,13 +1872,13 @@ kernel from the previous example:

>>> sync_map = lp.get_synchronization_map(knl)
>>> print(sync_map)
Sync(kernel_launch, stats_knl): [l, m, n] -> { 1 }
Sync(SynchronizationKind.KERNEL_LAUNCH, 'stats_knl', frozenset()): [l, m, n] -> { 1 }

We can evaluate this polynomial using :meth:`islpy.PwQPolynomial.eval_with_dict`:

.. doctest::

>>> launch_count = sync_map[lp.Sync("kernel_launch", "stats_knl")].eval_with_dict(param_dict)
>>> launch_count = sync_map[lp.Sync(sync_kind=SynchronizationKind.KERNEL_LAUNCH, kernel_name="stats_knl")].eval_with_dict(param_dict)
>>> print("Kernel launch count: %s" % launch_count)
Kernel launch count: 1

Expand Down Expand Up @@ -1930,8 +1929,8 @@ count the barriers using :func:`loopy.get_synchronization_map`:

>>> sync_map = lp.get_synchronization_map(knl)
>>> print(sync_map)
Sync(barrier_local, loopy_kernel): { 1000 }
Sync(kernel_launch, loopy_kernel): { 1 }
Sync(SynchronizationKind.BARRIER_LOCAL, 'loopy_kernel', frozenset()): { 1000 }
Sync(SynchronizationKind.KERNEL_LAUNCH, 'loopy_kernel', frozenset()): { 1 }

Based on the kernel code printed above, we would expect each work-item to
encounter 50x10x2 barriers, which matches the result from
Expand Down
15 changes: 14 additions & 1 deletion loopy/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -90,10 +90,13 @@
linearize,
)
from loopy.statistics import (
AccessDirection,
CountGranularity,
MemAccess,
Op,
OpType,
Sync,
SynchronizationKind,
ToCountMap,
ToCountPolynomialMap,
gather_access_footprint_bytes,
Expand All @@ -102,7 +105,13 @@
get_op_map,
get_synchronization_map,
)
from loopy.symbolic import LinearSubscript, Reduction, TaggedVariable, TypeCast
from loopy.symbolic import (
LinearSubscript,
Reduction,
TaggedExpression,
TaggedVariable,
TypeCast,
)
from loopy.target import ASTBuilderBase, TargetBase
from loopy.target.c import (
CFamilyTarget,
Expand Down Expand Up @@ -217,6 +226,7 @@
"MOST_RECENT_LANGUAGE_VERSION",
"VERSION",
"ASTBuilderBase",
"AccessDirection",
"AddressSpace",
"ArrayArg",
"Assignment",
Expand Down Expand Up @@ -260,6 +270,7 @@
"NoOpInstruction",
"NumpyType",
"Op",
"OpType",
"OpenCLTarget",
"Optional",
"Options",
Expand All @@ -270,6 +281,8 @@
"ScalarCallable",
"SubstitutionRule",
"Sync",
"SynchronizationKind",
"TaggedExpression",
"TaggedVariable",
"TargetBase",
"TemporaryVariable",
Expand Down
6 changes: 5 additions & 1 deletion loopy/kernel/data.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@


from dataclasses import dataclass, replace
from enum import IntEnum
from enum import Enum, IntEnum
from sys import intern
from typing import (
TYPE_CHECKING,
Expand Down Expand Up @@ -380,6 +380,10 @@ def stringify(cls, val: AddressSpace | type[auto]) -> str:
else:
raise ValueError("unexpected value of AddressSpace")

# IntEnum.__repr__ only prints the integer values
__repr__ = Enum.__repr__
__str__ = Enum.__str__

# }}}


Expand Down
Loading
Loading