From d6f134b477968b8a375612351098735c5f6d53eb Mon Sep 17 00:00:00 2001 From: Stan Seibert Date: Tue, 9 Aug 2011 20:10:32 -0400 Subject: The --use-fast-math gives the simulation another 25% speed boost. --- gpu.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'gpu.py') diff --git a/gpu.py b/gpu.py index 0f56ee4..ed8ca12 100644 --- a/gpu.py +++ b/gpu.py @@ -72,13 +72,15 @@ class GPU(object): device = cuda.Device(device_id) self.context = device.make_context() print 'device %s' % self.context.get_device().name() - self.module = SourceModule(src.kernel, options=['-I' + src.dir], no_extern_c=True) + cuda_options = ['-I' + src.dir, '--use_fast_math'] + + self.module = SourceModule(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']) self.nthread_per_block = 64 self.max_blocks = 1024 - self.daq_module = SourceModule(src.daq, options=['-I' + src.dir], no_extern_c=True) + self.daq_module = SourceModule(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']) -- cgit