Skip to content

Commit

Permalink
PoolAllocator: Remove key constructor argument from PoolAllocator
Browse files Browse the repository at this point in the history
  • Loading branch information
mlange05 committed Apr 9, 2024
1 parent a04e615 commit aecb669
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 8 deletions.
3 changes: 1 addition & 2 deletions transformations/tests/test_pool_allocator.py
Original file line number Diff line number Diff line change
Expand Up @@ -518,7 +518,7 @@ def test_pool_allocator_temporaries_kernel_sequence(frontend, block_dim, directi
for item in SFilter(scheduler.sgraph, item_filter=ProcedureItem):
normalize_range_indexing(item.ir)

transformation = TemporariesPoolAllocatorTransformation(block_dim=block_dim, directive=directive, key='some_key')
transformation = TemporariesPoolAllocatorTransformation(block_dim=block_dim, directive=directive)
scheduler.process(transformation=transformation)
kernel_item = scheduler['kernel_mod#kernel']
kernel2_item = scheduler['kernel_mod#kernel2']
Expand All @@ -537,7 +537,6 @@ def test_pool_allocator_temporaries_kernel_sequence(frontend, block_dim, directi
tsize_int = f'max(c_sizeof(int(1, kind={kind_int})), 8)'
tsize_log = f'max(c_sizeof(logical(true, kind={kind_log})), 8)'

assert transformation._key == 'some_key'
assert transformation._key in kernel_item.trafo_data
exp_stack_size = f'{tsize_real}*klon + {tsize_real}*klev*klon + 2*{tsize_int}*klon + {tsize_log}*klev'
assert kernel_item.trafo_data[transformation._key]['stack_size'] == exp_stack_size
Expand Down
7 changes: 1 addition & 6 deletions transformations/transformations/pool_allocator.py
Original file line number Diff line number Diff line change
Expand Up @@ -93,8 +93,6 @@ class TemporariesPoolAllocatorTransformation(Transformation):
check_bounds : bool, optional
Insert bounds-checks in the kernel to make sure the allocated stack size is not
exceeded (default: `True`)
key : str, optional
Overwrite the key that is used to store analysis results in ``trafo_data``.
"""

_key = 'TemporariesPoolAllocatorTransformation'
Expand All @@ -108,7 +106,7 @@ def __init__(
self, block_dim, stack_ptr_name='L', stack_end_name='U', stack_size_name='ISTSZ',
stack_storage_name='ZSTACK', stack_argument_name='YDSTACK', stack_local_var_name='YLSTACK',
local_ptr_var_name_pattern='IP_{name}', stack_int_type_kind=IntLiteral(8), directive=None,
check_bounds=True, key=None
check_bounds=True,
):
self.block_dim = block_dim
self.stack_ptr_name = stack_ptr_name
Expand All @@ -126,9 +124,6 @@ def __init__(
raise ValueError(f'"stack_ptr_name": "{self.stack_ptr_name}" and '
f'"stack_end_name": "{self.stack_end_name}" must be different!')

if key:
self._key = key

def transform_subroutine(self, routine, **kwargs):

role = kwargs['role']
Expand Down

0 comments on commit aecb669

Please sign in to comment.