summaryrefslogtreecommitdiff
path: root/sim.py
diff options
context:
space:
mode:
authorAnthony LaTorre <tlatorre9@gmail.com>2011-09-06 17:18:14 -0400
committerAnthony LaTorre <tlatorre9@gmail.com>2011-09-06 17:18:14 -0400
commit86cb5f26029b3357727b88fee3fa7dd799a8d6c8 (patch)
treefc915556ef813cf4ad59edeb7b59fee0e3244c34 /sim.py
parent3d3140071713e523516793258e3c904ca162d7b7 (diff)
downloadchroma-86cb5f26029b3357727b88fee3fa7dd799a8d6c8.tar.gz
chroma-86cb5f26029b3357727b88fee3fa7dd799a8d6c8.tar.bz2
chroma-86cb5f26029b3357727b88fee3fa7dd799a8d6c8.zip
geometry on the GPU is now a struct created in the GPUGeometry class. coding style for cuda code is now compliant with python PEP 7 -- Style Guide for C Code.
Diffstat (limited to 'sim.py')
-rwxr-xr-xsim.py15
1 files changed, 8 insertions, 7 deletions
diff --git a/sim.py b/sim.py
index 931858f..53f7f9a 100755
--- a/sim.py
+++ b/sim.py
@@ -48,10 +48,7 @@ class Simulation(object):
detector.build(bits=bvh_bits, use_cache=use_cache)
self.gpu = gpu.GPU(cuda_device)
-
- # geometry is loaded onto gpu by default
- self.gpu_geometry = gpu.GPUGeometry(self.gpu, detector)
-
+ self.gpu_geometry = gpu.GPUGeometry(detector)
self.gpu_daq = gpu.GPUDaq(self.gpu_geometry, max(self.detector.pmtids))
self.gpu_pdf = gpu.GPUPDF()
@@ -77,7 +74,7 @@ class Simulation(object):
for ev in iterable:
gpu_photons = gpu.GPUPhotons(ev.photons_beg)
- gpu.propagate(self.gpu, gpu_photons, self.rng_states, nthreads_per_block=self.nthreads_per_block, max_blocks=self.max_blocks, max_steps=max_steps)
+ gpu_photons.propagate(self.gpu_geometry, self.rng_states, nthreads_per_block=self.nthreads_per_block, max_blocks=self.max_blocks, max_steps=max_steps)
ev.nphotons = len(ev.photons_beg.pos)
@@ -114,7 +111,9 @@ class Simulation(object):
for ev in iterable:
gpu_photons = gpu.GPUPhotons(ev.photons_beg)
- gpu.propagate(self.gpu, gpu_photons, self.rng_states, nthreads_per_block=self.nthreads_per_block, max_blocks=self.max_blocks)
+ gpu_photons.propagate(self.gpu_geometry, self.rng_states,
+ nthreads_per_block=self.nthreads_per_block,
+ max_blocks=self.max_blocks)
gpu_channels = self.gpu_daq.acquire(gpu_photons, self.rng_states, nthreads_per_block=self.nthreads_per_block, max_blocks=self.max_blocks)
self.gpu_pdf.add_hits_to_pdf(gpu_channels)
@@ -143,7 +142,9 @@ class Simulation(object):
for ev in iterable:
gpu_photons = gpu.GPUPhotons(ev.photons_beg)
- gpu.propagate(self.gpu, gpu_photons, self.rng_states, nthreads_per_block=self.nthreads_per_block, max_blocks=self.max_blocks)
+ gpu_photons.propagate(self.gpu_geometry, self.rng_states,
+ nthreads_per_block=self.nthreads_per_block,
+ max_blocks=self.max_blocks)
gpu_channels = self.gpu_daq.acquire(gpu_photons, self.rng_states, nthreads_per_block=self.nthreads_per_block, max_blocks=self.max_blocks)
self.gpu_pdf.accumulate_pdf_eval(gpu_channels)