diff options
Diffstat (limited to 'gputhread.py')
-rw-r--r-- | gputhread.py | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/gputhread.py b/gputhread.py index fe05e4f..26520c4 100644 --- a/gputhread.py +++ b/gputhread.py @@ -2,8 +2,8 @@ import numpy as np import pycuda.driver as cuda from pycuda.compiler import SourceModule import threading -import layout -from Queue import Empty +import Queue +import src class Job(object): def __init__(self, origins, directions): @@ -28,16 +28,15 @@ class GPUThread(threading.Thread): def run(self): device = cuda.Device(self.device_id) context = device.make_context() - source = open(layout.source + '/kernel.cu').read() - module = SourceModule(source, options=['-I' + layout.source], \ - no_extern_c=True, cache_dir=False) + module = SourceModule(src.kernel, options=['-I' + src.dir], + no_extern_c=True, cache_dir=False) propagate = module.get_function('propagate') texrefs = self.geometry.load(module) while not self.stopped(): try: job = self.jobs.get(timeout=2) - except Empty: + except Queue.Empty: continue origins_gpu, directions_gpu = cuda.to_device(job.origins), \ |