diff options
Diffstat (limited to 'gpu.py')
-rw-r--r-- | gpu.py | 15 |
1 files changed, 8 insertions, 7 deletions
@@ -7,11 +7,12 @@ import pycuda.driver as cuda from pycuda import gpuarray from copy import copy from itertools import izip -from tools import timeit +from chroma.tools import timeit +from os.path import dirname -import src -from geometry import standard_wavelengths -from color import map_to_color +import chroma.src +from chroma.geometry import standard_wavelengths +from chroma.color import map_to_color import sys import event @@ -97,15 +98,15 @@ class GPU(object): self.context.set_cache_config(cuda.func_cache.PREFER_L1) - cuda_options = ['-I' + src.dir, '--use_fast_math', '--ptxas-options=-v'] + cuda_options = ['-I' + dirname(chroma.src.__file__), '--use_fast_math', '--ptxas-options=-v'] - self.module = SourceModule(src.kernel, options=cuda_options, no_extern_c=True) + self.module = SourceModule(chroma.src.kernel, options=cuda_options, no_extern_c=True) self.geo_funcs = CUDAFuncs(self.module, ['set_wavelength_range', 'set_material', 'set_surface', 'set_global_mesh_variables', 'color_solids']) self.prop_funcs = CUDAFuncs(self.module, ['init_rng', 'propagate', 'swap']) self.nthread_per_block = 64 self.max_blocks = 1024 - self.daq_module = SourceModule(src.daq, options=cuda_options, no_extern_c=True) + self.daq_module = SourceModule(chroma.src.daq, options=cuda_options, no_extern_c=True) self.daq_funcs = CUDAFuncs(self.daq_module, ['reset_earliest_time_int', 'run_daq', 'convert_sortable_int_to_float']) |