Skip to content

Commit e13d97d

Browse files
committed
Avoid cupy dependency
1 parent 3b0e3b9 commit e13d97d

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

kernel_tuner/backends/compiler.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -358,7 +358,7 @@ def memcpy_dtoh(self, dest, src):
358358
:param src: An Argument for some memory allocation
359359
:type src: Argument
360360
"""
361-
if isinstance(dest, np.ndarray) and isinstance(src.numpy, cp.ndarray):
361+
if isinstance(dest, np.ndarray) and is_cupy_array(src.numpy):
362362
# Implicit conversion to a NumPy array is not allowed.
363363
value = src.numpy.get()
364364
else:
@@ -375,7 +375,7 @@ def memcpy_htod(self, dest, src):
375375
:param src: A numpy array containing the source data
376376
:type src: np.ndarray
377377
"""
378-
if isinstance(dest.numpy, np.ndarray) and isinstance(src, cp.ndarray):
378+
if isinstance(dest.numpy, np.ndarray) and is_cupy_array(src):
379379
# Implicit conversion to a NumPy array is not allowed.
380380
value = src.get()
381381
else:

0 commit comments

Comments
 (0)