-
Notifications
You must be signed in to change notification settings - Fork 32
Open
Labels
enhancementNew feature or requestNew feature or request
Milestone
Description
dpex ufunc kernels cannot be called from other dpex device functions.
Example:
@dppy.func
def a_device_function(a):
return a + 1
@vectorize(nopython=True)
def ufunc_kernel(x, y):
return a_device_function(x) + y
def test_ufunc():
N = 10
dtype = np.float64
A = np.arange(N, dtype=dtype)
B = np.arange(N, dtype=dtype) * 10
context = get_context()
with dpctl.device_context(context):
C = ufunc_kernel(A, B)
print(C)
Output:
numba.core.errors.TypingError: Failed in nopython mode pipeline (step: nopython frontend)
Untyped global name 'a_device_function': cannot determine Numba type of <class 'numba_dppy.compiler.DPPYFunctionTemplate'>
File "numba_dppy/examples/vectorize_func.py", line 14:
def ufunc_kernel(x, y):
return a_device_function(x) + y
^
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or request