Commit e451ad18 authored by Pierre Paleo's avatar Pierre Paleo

Robustify CudaKernel integer types

parent a630a0aa
......@@ -161,6 +161,12 @@ class CudaKernel(object):
def call(self, *args, **kwargs):
block, grid = self.get_block_grid(*args, **kwargs)
# pycuda crashes when any element of block/grid is not a python int (ex. numpy.int64).
# A weird behavior once observed is "data.shape" returning (np.int64, int, int) (!).
# Ensure that everything is a python integer.
block = tuple(int(x) for x in block)
grid = tuple(int(x) for x in grid)
#
args = self.follow_gpu_arr(args)
if self.prepared:
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment