Skip to content

Commit

Permalink
Fewer intp->uintp changes
Browse files Browse the repository at this point in the history
  • Loading branch information
inducer committed Sep 19, 2014
1 parent 13f40bd commit f194beb
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions pycuda/driver.py
Expand Up @@ -147,7 +147,7 @@ def _build_arg_buf(args):
format += "%ds" % arg.itemsize
else:
try:
gpudata = np.intp(arg.gpudata)
gpudata = np.uintp(arg.gpudata)
except AttributeError:
raise TypeError("invalid type on parameter #%d (0-based)" % i)
else:
Expand Down Expand Up @@ -252,7 +252,7 @@ def function_prepare_pre_v4(func, arg_types, block=None,
elif isinstance(arg_type, str):
func.arg_format += arg_type
else:
func.arg_format += np.dtype(np.intp).char
func.arg_format += np.dtype(np.uintp).char

from pycuda._pvt_struct import calcsize
func._param_set_size(calcsize(func.arg_format))
Expand Down Expand Up @@ -432,7 +432,7 @@ def function_prepare(func, arg_types, texrefs=[]):
elif isinstance(arg_type, str):
func.arg_format += arg_type
else:
func.arg_format += np.dtype(np.intp).char
func.arg_format += np.dtype(np.uintp).char

return func

Expand Down
2 changes: 1 addition & 1 deletion test/test_driver.py
Expand Up @@ -76,7 +76,7 @@ def test_simple_kernel_2(self):
# now try with offsets
dest = np.zeros_like(a)
multiply_them(
drv.Out(dest), np.intp(a_gpu)+a.itemsize, b_gpu,
drv.Out(dest), np.uintp(a_gpu)+a.itemsize, b_gpu,
block=(399, 1, 1))

assert la.norm((dest[:-1]-a[1:]*b[:-1])) == 0
Expand Down

0 comments on commit f194beb

Please sign in to comment.