Skip to content

Commit

Permalink
Fix stream parameters in asynchronous methods.
Browse files Browse the repository at this point in the history
Within gpuarray.set_async, the stream keyword
argument in the call to gpuarray.set was
always set to None.

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

This keyword argument is now always set to value
supplied in the arguments to gpuarray.set_async.

  return self.set(ary, async=True, stream=stream)

Within _memcpy_discontig, Memcpy2D.__call__
was being called for asynchronous cases as follows:

  copy(stream=stream)

However, this does not match the C++ function
definition. Instead, they are now called as follows:

  copy(stream)
  • Loading branch information
sjperkins committed Aug 7, 2015
1 parent dae67bf commit 5d5e5a2
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 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 self.set(ary, async=True, stream=None)
return self.set(ary, async=True, stream=stream)

def get(self, ary=None, pagelocked=False, async=False, stream=None):
if ary is None:
Expand Down Expand Up @@ -1191,7 +1191,7 @@ def _memcpy_discontig(dst, src, async=False, stream=None):

if len(shape) == 2:
if async:
copy(stream=stream)
copy(stream)
else:
copy(aligned=True)

Expand All @@ -1206,7 +1206,7 @@ def _memcpy_discontig(dst, src, async=False, stream=None):

copy.depth = shape[2]
if async:
copy(stream=stream)
copy(stream)
else:
copy()

Expand Down

0 comments on commit 5d5e5a2

Please sign in to comment.