diff options
| author | Stan Seibert <stan@mtrr.org> | 2011-10-05 17:37:26 -0400 |
|---|---|---|
| committer | Stan Seibert <stan@mtrr.org> | 2011-10-05 17:37:26 -0400 |
| commit | e4ea02720991b5e923e0b7b1045709aff0d6b0c0 (patch) | |
| tree | 461db2be1fdb4e3b543837c2f3832e0e50f7f7ca /chroma/gpu | |
| parent | c309d251232c45bb497da4859eb8cf1b2ab47417 (diff) | |
| download | chroma-e4ea02720991b5e923e0b7b1045709aff0d6b0c0.tar.gz chroma-e4ea02720991b5e923e0b7b1045709aff0d6b0c0.tar.bz2 chroma-e4ea02720991b5e923e0b7b1045709aff0d6b0c0.zip | |
Epic port of Chroma from units of meters/seconds/MeV to
millimeters/nanoseconds/MeV in order to match GEANT4, and also avoid
huge discrepancies in magnitude caused by values like 10e-9 sec.
Along the way, cleaned up a few things:
* Switch the PI and SPEED_OF_LIGHT constants from double to single
precision. This avoid some unnecessary double precision calculations
in the GPU code.
* Fixed a silly problem in the definition of the spherical spiral. Now
the demo detector looks totally awesome. Also wrapped it in a
black surface. Demo detector now has 10055 PMTs.
* Updated the test_ray_intersection data file to reflect the new units.
* Fix a missing import in chroma.gpu.tools
Diffstat (limited to 'chroma/gpu')
| -rw-r--r-- | chroma/gpu/daq.py | 2 | ||||
| -rw-r--r-- | chroma/gpu/tools.py | 1 |
2 files changed, 2 insertions, 1 deletions
diff --git a/chroma/gpu/daq.py b/chroma/gpu/daq.py index 82958dc..6ec1a79 100644 --- a/chroma/gpu/daq.py +++ b/chroma/gpu/daq.py @@ -20,7 +20,7 @@ class GPUChannels(object): return event.Channels(t<1e8, t, q, self.flags.get()) class GPUDaq(object): - def __init__(self, gpu_geometry, max_pmt_id, pmt_rms=1.2e-9): + def __init__(self, gpu_geometry, max_pmt_id, pmt_rms=1.2): self.earliest_time_gpu = ga.empty(max_pmt_id+1, dtype=np.float32) self.earliest_time_int_gpu = ga.empty(max_pmt_id+1, dtype=np.uint32) self.channel_history_gpu = ga.zeros_like(self.earliest_time_int_gpu) diff --git a/chroma/gpu/tools.py b/chroma/gpu/tools.py index a11a561..38d67a1 100644 --- a/chroma/gpu/tools.py +++ b/chroma/gpu/tools.py @@ -2,6 +2,7 @@ import numpy as np import pycuda.tools from pycuda import characterize import pycuda.driver as cuda +import pycuda.compiler from pycuda import gpuarray as ga from chroma.cuda import srcdir |
