Skip to content

Commit

Permalink
Fix for custom-dtype arguments vs Py3
Browse files Browse the repository at this point in the history
  • Loading branch information
inducer committed May 27, 2014
1 parent df49c03 commit 570d664
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion pycuda/driver.py
Expand Up @@ -9,6 +9,13 @@
raise

import numpy as np
import sys


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


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

0 comments on commit 570d664

Please sign in to comment.