From 36391a29dfb02a24e97b3ef9a3727201af415985 Mon Sep 17 00:00:00 2001 From: Anthony LaTorre Date: Mon, 23 May 2011 19:33:02 -0400 Subject: lbne model now imports python modules directly --- gputhread.py | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) (limited to 'gputhread.py') 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), \ -- cgit