summaryrefslogtreecommitdiff
path: root/src/daq.cu
diff options
context:
space:
mode:
authorStan Seibert <stan@mtrr.org>2011-08-08 20:16:33 -0400
committerStan Seibert <stan@mtrr.org>2011-08-08 20:16:33 -0400
commitedd78c209c88a652691cc5602b37d79085fee795 (patch)
treedfd12bb15893dbbea5d5c907d12c9d01f6fee9a0 /src/daq.cu
parent2e80fdc7e7dbb84da0f37bb159e08ed618fe15f5 (diff)
downloadchroma-edd78c209c88a652691cc5602b37d79085fee795.tar.gz
chroma-edd78c209c88a652691cc5602b37d79085fee795.tar.bz2
chroma-edd78c209c88a652691cc5602b37d79085fee795.zip
propagate() takes an array of photon offsets and a range of
offsets to load. Now events with more photons than RNG states can be propagated through multiple kernel calls. Also lays the groundwork for consolidating photons between steps to reduce the amount of propagation work required.
Diffstat (limited to 'src/daq.cu')
-rw-r--r--src/daq.cu9
1 files changed, 5 insertions, 4 deletions
diff --git a/src/daq.cu b/src/daq.cu
index 2b5f9b4..7c5e6a5 100644
--- a/src/daq.cu
+++ b/src/daq.cu
@@ -30,6 +30,7 @@ __global__ void reset_earliest_time_int(float maxtime, int ntime_ints, unsigned
__global__ void run_daq(curandState *s, unsigned int detection_state,
float time_rms,
+ int first_photon,
int nphotons, float *photon_times,
unsigned int *photon_histories,
int *last_hit_triangles, int *solid_map,
@@ -41,17 +42,17 @@ __global__ void run_daq(curandState *s, unsigned int detection_state,
if (id < nphotons)
{
curandState rng = s[id];
-
- int triangle_id = last_hit_triangles[id];
+ int photon_id = id + first_photon;
+ int triangle_id = last_hit_triangles[photon_id];
if (triangle_id > -1)
{
int solid_id = solid_map[triangle_id];
- int history = photon_histories[id];
+ int history = photon_histories[photon_id];
if (solid_id < nsolids && (history & detection_state))
{
- float time = photon_times[id] + curand_normal(&rng) * time_rms;
+ float time = photon_times[photon_id] + curand_normal(&rng) * time_rms;
unsigned int time_int = float_to_sortable_int(time);
atomicMin(earliest_time_int + solid_id, time_int);