summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStan Seibert <stan@mtrr.org>2013-02-01 12:00:22 -0500
committertlatorre <tlatorre@uchicago.edu>2021-05-09 08:42:39 -0700
commit390ac46b0514cf617f990e959f78de6653c6d509 (patch)
tree3e2ca12e0a916ddf2573629acbeb2a69bf8c7a59
parent6494951a96f7e6e9889a97bd926d15a3cdd7b4b9 (diff)
downloadchroma-390ac46b0514cf617f990e959f78de6653c6d509.tar.gz
chroma-390ac46b0514cf617f990e959f78de6653c6d509.tar.bz2
chroma-390ac46b0514cf617f990e959f78de6653c6d509.zip
Assign to a GPU array slice with a numpy array of length 1 to silence
a warning from PyCUDA about setting array with different stride.
-rw-r--r--chroma/gpu/photon.py4
1 files changed, 3 insertions, 1 deletions
diff --git a/chroma/gpu/photon.py b/chroma/gpu/photon.py
index fbb064b..5d06fc4 100644
--- a/chroma/gpu/photon.py
+++ b/chroma/gpu/photon.py
@@ -137,7 +137,9 @@ class GPUPhotons(object):
temp = input_queue_gpu
input_queue_gpu = output_queue_gpu
output_queue_gpu = temp
- output_queue_gpu[:1].set(np.uint32(1))
+ # Assign with a numpy array of length 1 to silence
+ # warning from PyCUDA about setting array with different strides/storage orders.
+ output_queue_gpu[:1].set(np.ones(shape=1, dtype=np.uint32))
nphotons = input_queue_gpu[:1].get()[0] - 1
if ga.max(self.flags).get() & (1 << 31):