summaryrefslogtreecommitdiff
path: root/benchmark.py
diff options
context:
space:
mode:
Diffstat (limited to 'benchmark.py')
-rwxr-xr-xbenchmark.py12
1 files changed, 6 insertions, 6 deletions
diff --git a/benchmark.py b/benchmark.py
index 9f90c7b..5a344bf 100755
--- a/benchmark.py
+++ b/benchmark.py
@@ -152,23 +152,23 @@ if __name__ == '__main__':
from chroma import detectors
import gc
- lbne = detectors.build_lbne_200kton()
+ lbne = detectors.lbne()
lbne.build(bits=11)
- gpu_instance = gpu.GPU()
+ context = gpu.create_cuda_context()
gpu_geometry = gpu.GPUGeometry(lbne)
- gpu_instance.print_mem_info()
print '%s ray intersections/sec.' % \
tools.ufloat_to_str(intersect(gpu_geometry))
+ # run garbage collection since there is a reference loop
+ # in the GPUArray class.
gc.collect()
- gpu_instance.print_mem_info()
print '%s photons loaded/sec.' % tools.ufloat_to_str(load_photons())
gc.collect()
- gpu_instance.print_mem_info()
print '%s photons propagated/sec.' % \
tools.ufloat_to_str(propagate(gpu_geometry))
gc.collect()
- gpu_instance.print_mem_info()
print '%s 100 MeV events histogrammed/s' % \
tools.ufloat_to_str(pdf(gpu_geometry, max(lbne.pmtids)))
+
+ context.pop()