Skip to content

Commit

Permalink
Runtime: fix Debug execution space crashing after introduction of exe…
Browse files Browse the repository at this point in the history
…cution space instances (#249)
  • Loading branch information
NaderAlAwar authored Jan 18, 2024
1 parent d1e40ee commit 93d933b
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 1 addition & 3 deletions pykokkos/core/runtime.py
Original file line number Diff line number Diff line change
Expand Up @@ -122,9 +122,7 @@ def run_workunit(
:returns: the result of the operation (None for parallel_for)
"""

execution_space: ExecutionSpace = policy.space.space

if self.is_debug(execution_space):
if self.is_debug(policy.space):
if operation is None:
raise RuntimeError("ERROR: operation cannot be None for Debug")
return run_workunit_debug(policy, workunit, operation, initial_value, **kwargs)
Expand Down
4 changes: 3 additions & 1 deletion pykokkos/interface/execution_policy.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,9 @@ def __init__(self, *args):
if isinstance(space, ExecutionSpace):
if space is ExecutionSpace.Default:
space = km.get_default_space()
space = km.get_execution_space_instance(space)

if space is not ExecutionSpace.Debug:
space = km.get_execution_space_instance(space)

elif not isinstance(space, ExecutionSpaceInstance):
raise TypeError(f"Invalid space argument {space}")
Expand Down

0 comments on commit 93d933b

Please sign in to comment.