Skip to content

Commit

Permalink
Merge pull request #80 from untom/fix_gpuarray.set
Browse files Browse the repository at this point in the history
Fix gpuarray.set
  • Loading branch information
inducer committed Jul 29, 2015
2 parents d80405e + 51599aa commit 79294e4
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions pycuda/gpuarray.py
Expand Up @@ -236,7 +236,7 @@ def set(self, ary, async=False, stream=None):
_memcpy_discontig(self, ary, async=async, stream=stream)

def set_async(self, ary, stream=None):
return set(ary, async=True, stream=None)
return self.set(ary, async=True, stream=None)

def get(self, ary=None, pagelocked=False, async=False, stream=None):
if ary is None:
Expand Down Expand Up @@ -1087,7 +1087,7 @@ def _compact_strides(a):

def _memcpy_discontig(dst, src, async=False, stream=None):
"""Copy the contents of src into dst.
The two arrays should have the same dtype, shape, and order, but
not necessarily the same strides. There may be up to _two_
axes along which either `src` or `dst` is not contiguous.
Expand Down Expand Up @@ -1161,7 +1161,7 @@ def _memcpy_discontig(dst, src, async=False, stream=None):
else:
src = _as_strided(src, shape=(src.size,), strides=(src.dtype.itemsize,))
if async:
drv.memcpy_htod(dst.gpudata, src, stream=stream)
drv.memcpy_htod_async(dst.gpudata, src, stream=stream)
else:
drv.memcpy_htod(dst.gpudata, src)
return
Expand All @@ -1188,7 +1188,7 @@ def _memcpy_discontig(dst, src, async=False, stream=None):
copy.src_pitch = src_strides[1]
copy.dst_pitch = dst_strides[1]
copy.height = shape[1]

if len(shape) == 2:
if async:
copy(stream=stream)
Expand Down

0 comments on commit 79294e4

Please sign in to comment.