summaryrefslogtreecommitdiff
path: root/chroma/gpu/tools.py
diff options
context:
space:
mode:
authorStan Seibert <stan@mtrr.org>2012-01-02 12:53:33 -0500
committertlatorre <tlatorre@uchicago.edu>2021-05-09 08:42:38 -0700
commit90d51c5f897ed7f6230e9280a865b096a19a11b6 (patch)
treee38fa99eede71cc8b4db4168bdc6d565022944d0 /chroma/gpu/tools.py
parent433f94b262df12a7bf6b49dbac7bbe73db9b8aa6 (diff)
downloadchroma-90d51c5f897ed7f6230e9280a865b096a19a11b6.tar.gz
chroma-90d51c5f897ed7f6230e9280a865b096a19a11b6.tar.bz2
chroma-90d51c5f897ed7f6230e9280a865b096a19a11b6.zip
Improve identification of CUDA vector types in struct builder
Diffstat (limited to 'chroma/gpu/tools.py')
-rw-r--r--chroma/gpu/tools.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/chroma/gpu/tools.py b/chroma/gpu/tools.py
index 98df7ce..707a45d 100644
--- a/chroma/gpu/tools.py
+++ b/chroma/gpu/tools.py
@@ -160,7 +160,7 @@ def make_gpu_struct(size, members):
cuda.memcpy_htod(int(struct)+i, np.intp(int(member)))
i += 8
- elif np.isscalar(member) or hasattr(member, 'dtype') and member.dtype in vec_dtypes:
+ elif np.isscalar(member) or (hasattr(member, 'dtype') and member.dtype in vec_dtypes and member.shape == ()):
cuda.memcpy_htod(int(struct)+i, member)
i += member.nbytes
else: