summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorStan Seibert <stan@mtrr.org>2011-08-04 11:52:31 -0400
committerStan Seibert <stan@mtrr.org>2011-08-04 11:52:31 -0400
commitcf87548f09607927d49defa5c1bbb3e4fc877286 (patch)
tree6cbcba952e5f1e48afcda30e938ab4aeeba2cbc4 /src
parent125de2738868d30c537d84b471cfb5e8274fe6d8 (diff)
downloadchroma-cf87548f09607927d49defa5c1bbb3e4fc877286.tar.gz
chroma-cf87548f09607927d49defa5c1bbb3e4fc877286.tar.bz2
chroma-cf87548f09607927d49defa5c1bbb3e4fc877286.zip
Don't draw a random time delta in the daq kernel unless it is necessary.
Diffstat (limited to 'src')
-rw-r--r--src/daq.cu7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/daq.cu b/src/daq.cu
index 07e2d5e..2b5f9b4 100644
--- a/src/daq.cu
+++ b/src/daq.cu
@@ -48,12 +48,13 @@ __global__ void run_daq(curandState *s, unsigned int detection_state,
{
int solid_id = solid_map[triangle_id];
int history = photon_histories[id];
- float time = photon_times[id] + curand_normal(&rng) * time_rms;
- unsigned int time_int = float_to_sortable_int(time);
if (solid_id < nsolids && (history & detection_state))
{
- atomicMin(earliest_time_int + solid_id, time_int);
+ float time = photon_times[id] + curand_normal(&rng) * time_rms;
+ unsigned int time_int = float_to_sortable_int(time);
+
+ atomicMin(earliest_time_int + solid_id, time_int);
}
}