diff options
author | Anthony LaTorre <telatorre@gmail.com> | 2011-05-23 19:33:02 -0400 |
---|---|---|
committer | Anthony LaTorre <telatorre@gmail.com> | 2011-05-23 19:33:02 -0400 |
commit | 36391a29dfb02a24e97b3ef9a3727201af415985 (patch) | |
tree | e1113c6aa310ba5f49c985b4fef0858b0d0f00d9 /gputhread.py | |
parent | 37b1d85c9f61190f223ee0cc6893c75c6c5f88cb (diff) | |
download | chroma-36391a29dfb02a24e97b3ef9a3727201af415985.tar.gz chroma-36391a29dfb02a24e97b3ef9a3727201af415985.tar.bz2 chroma-36391a29dfb02a24e97b3ef9a3727201af415985.zip |
lbne model now imports python modules directly
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), \ |