Skip to content

Commit e1d1f9e

Browse files
committed
Fix handling of buffer with int handle
1 parent 0784b39 commit e1d1f9e

1 file changed

Lines changed: 7 additions & 1 deletion

File tree

cuda_core/cuda/core/experimental/_kernel_arg_handler.pyx

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -212,7 +212,13 @@ cdef class ParamHolder:
212212
for i, arg in enumerate(kernel_args):
213213
if isinstance(arg, Buffer):
214214
# we need the address of where the actual buffer address is stored
215-
self.data_addresses[i] = <void*><intptr_t>(arg.handle.getPtr())
215+
if isinstance(arg.handle, int):
216+
# see note below on handling int arguments
217+
prepare_arg[intptr_t](self.data, self.data_addresses, arg.handle, i)
218+
continue
219+
else:
220+
# it's a CUdeviceptr:
221+
self.data_addresses[i] = <void*><intptr_t>(arg.handle.getPtr())
216222
continue
217223
elif isinstance(arg, int):
218224
# Here's the dilemma: We want to have a fast path to pass in Python

0 commit comments

Comments
 (0)