Skip to content

Commit ea339eb

Browse files
Added ExecutionPlacementError
1 parent a1791e2 commit ea339eb

File tree

2 files changed

+14
-1
lines changed

2 files changed

+14
-1
lines changed

dpctl/utils/__init__.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
"""
2020

2121
from ._compute_follows_data import (
22+
ExecutionPlacementError,
2223
get_coerced_usm_type,
2324
get_execution_queue,
2425
validate_usm_type,
@@ -30,4 +31,5 @@
3031
"get_coerced_usm_type",
3132
"validate_usm_type",
3233
"onetrace_enabled",
34+
"ExecutionPlacementError",
3335
]

dpctl/utils/_compute_follows_data.pyx

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,18 @@ import dpctl
2828

2929
from .._sycl_queue cimport SyclQueue
3030

31-
__all__ = ["get_execution_queue", "get_coerced_usm_type"]
31+
__all__ = ["get_execution_queue", "get_coerced_usm_type", "ExecutionPlacementError"]
32+
33+
34+
class ExecutionPlacementError(Exception):
35+
"""Exception raised when execution placement target can be determined
36+
from input arrays.
37+
38+
Make sure that input arrays are associated with the same SyclQueue,
39+
or migrate data to the same SyclQueue using usm_ndarray.to_device
40+
method.
41+
"""
42+
pass
3243

3344

3445
cdef bint queue_equiv(SyclQueue q1, SyclQueue q2):

0 commit comments

Comments
 (0)