Skip to content

Commit

Permalink
PR cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
awnawab committed Jun 11, 2024
1 parent be5a4f9 commit 410e3c5
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 11 deletions.
4 changes: 0 additions & 4 deletions loki/transformations/hoist_variables.py
Original file line number Diff line number Diff line change
Expand Up @@ -153,10 +153,6 @@ def transform_subroutine(self, routine, **kwargs):
if not isinstance(child, ProcedureItem):
continue

# skip successors that might have been inlined
if not call_map.get(child.local_name, None):
continue

arg_map = dict(call_map[child.local_name].arg_iter())
hoist_variables = []
for var in child.trafo_data[self._key]["hoist_variables"]:
Expand Down
12 changes: 6 additions & 6 deletions loki/transformations/inline.py
Original file line number Diff line number Diff line change
Expand Up @@ -607,14 +607,14 @@ def inline_marked_subroutines(routine, allowed_aliases=None, adjust_imports=True
import_map[impt] = impt.clone(symbols=new_symbols) if new_symbols else None

# Remove explicit interfaces of inlined routines
for intf in FindNodes(Interface).visit(routine.ir):
for intf in routine.interfaces:
if not intf.spec:
_body = []
for s in intf.symbols:
if s.name not in callees or s.name in not_inlined:
_body += [s.type.dtype.procedure,]
_body = tuple(
s.type.dtype.procedure for s in intf.symbols
if s.name not in callees or s.name in not_inlined
)
if _body:
import_map[intf] = intf.clone(body=as_tuple(_body))
import_map[intf] = intf.clone(body=_body)
else:
import_map[intf] = None

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1214,7 +1214,7 @@ def test_single_column_coalesced_hoist_nested_inline_openacc(frontend, horizonta
scc_hoist.apply(inner_kernel, role='kernel', item=inner_kernel_item)
scc_hoist.apply(
outer_kernel, role='kernel', item=outer_kernel_item,
targets=['compute_q'], successors=(inner_kernel_item,)
targets=['compute_q'], successors=()
)
scc_hoist.apply(
driver, role='driver', item=driver_item,
Expand Down

0 comments on commit 410e3c5

Please sign in to comment.