提交 6fcc93a9 authored 作者: Frederic Bastien's avatar Frederic Bastien

Allow kernel to have signature type of int32, ...

上级 e761a11b
...@@ -270,12 +270,13 @@ class Kernel(object): ...@@ -270,12 +270,13 @@ class Kernel(object):
def get_ctype(dtype): def get_ctype(dtype):
if dtype is gpuarray.GpuArray: if dtype is gpuarray.GpuArray:
return "gpudata *" return "gpudata *"
elif isinstance(dtype, np.dtype):
return 'npy_' + dtype.name
elif dtype == gpuarray.SIZE: elif dtype == gpuarray.SIZE:
return "size_t" return "size_t"
elif dtype == gpuarray.SSIZE: elif dtype == gpuarray.SSIZE:
return "ssize_t" return "ssize_t"
else: else:
if not isinstance(dtype, np.dtype):
dtype = np.dtype(dtype) dtype = np.dtype(dtype)
return 'npy_' + dtype.name return 'npy_' + dtype.name
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论