summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStan Seibert <stan@mtrr.org>2011-08-18 19:28:32 -0400
committerStan Seibert <stan@mtrr.org>2011-08-18 19:28:32 -0400
commit10f8e10b73dbf88f244cb83dbdec5e80d89ee658 (patch)
tree8dcf8f4fc39bf17b2a6228c231c3f097b76d3e33
parenta6e2415f2fa7324e2aec0c09466edf6bb5c3161d (diff)
downloadchroma-10f8e10b73dbf88f244cb83dbdec5e80d89ee658.tar.gz
chroma-10f8e10b73dbf88f244cb83dbdec5e80d89ee658.tar.bz2
chroma-10f8e10b73dbf88f244cb83dbdec5e80d89ee658.zip
Could have run off the end of the array by 1 because the queue counter points to the next available photon slot.
-rw-r--r--gpu.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/gpu.py b/gpu.py
index 372bc7b..4eb2fab 100644
--- a/gpu.py
+++ b/gpu.py
@@ -308,7 +308,7 @@ class GPU(object):
input_queue_gpu = output_queue_gpu
output_queue_gpu = temp
output_queue_gpu[:1].set(np.uint32(1))
- nphotons = input_queue_gpu[:1].get()[0]
+ nphotons = input_queue_gpu[:1].get()[0] - 1
if gpuarray.max(self.histories_gpu).get() & (1 << 31):
print >>sys.stderr, "WARNING: ABORTED PHOTONS IN THIS EVENT"