From cf87548f09607927d49defa5c1bbb3e4fc877286 Mon Sep 17 00:00:00 2001 From: Stan Seibert Date: Thu, 4 Aug 2011 11:52:31 -0400 Subject: Don't draw a random time delta in the daq kernel unless it is necessary. --- src/daq.cu | 7 ++++--- 1 file 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); } } -- cgit