Skip to content

Commit

Permalink
Attempt 4 at custom-dtype arguments
Browse files Browse the repository at this point in the history
  • Loading branch information
inducer committed May 27, 2014
1 parent 570d664 commit 9a0ff04
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion pycuda/driver.py
Expand Up @@ -14,8 +14,10 @@

if sys.version_info >= (3,):
_memoryview = memoryview
_my_bytes = bytes
else:
_memoryview = buffer
_my_bytes = str


try:
Expand Down Expand Up @@ -141,7 +143,7 @@ def _build_arg_buf(args):
arg_data.append(arg)
format += "%ds" % arg.nbytes
elif isinstance(arg, np.void):
arg_data.append(str(_memoryview(arg)))
arg_data.append(_my_bytes(_memoryview(arg)))
format += "%ds" % arg.itemsize
else:
try:
Expand Down

0 comments on commit 9a0ff04

Please sign in to comment.