Skip to content

Commit

Permalink
runtime.py: Fixed standalone workunit check
Browse files Browse the repository at this point in the history
  • Loading branch information
HannanNaeem committed Dec 18, 2023
1 parent 0bbb8d7 commit 73cb3d8
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions pykokkos/core/runtime.py
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,12 @@ def run_workunit(
this_tree = parser.get_entity(this_metadata.name).AST

# check if this is the first run of this workunit
if not isinstance(this_tree, ast.FunctionDef):
# Workunit must be a function on its own (not in a functor)
is_standalone_workunit = False
entity_AST.append(this_tree)
continue

if str(this_workunit) in self.workunit_params:
this_tree.args = copy.deepcopy(self.workunit_params[str(this_workunit)])
else:
Expand All @@ -155,10 +161,6 @@ def run_workunit(

entity_AST.append(this_tree)

# Workunit must be a function on its own (not in a functor)
if not isinstance(entity_AST[0], ast.FunctionDef):
is_standalone_workunit = False

workunit_tree_tup = list(zip(workunit, entity_AST))

if not list_passed: # revert to singular tuple if not list originally
Expand Down

0 comments on commit 73cb3d8

Please sign in to comment.