def __init__(self): with open('sha1c.cl', 'r') as f: self.cl_program = f.read() self.ctx = cl.create_context_from_type(cl.device_type.GPU) self.queue = cl.CommandQueue(self.ctx) self.prg = cl.Program(self.ctx, self.cl_program) try: self.prg = self.prg.build() except: print "Error" print self.prg.get_build_info(self.ctx.get_info(cl.context_info.DEVICES)[0], cl.program_build_info.LOG) self.init()
def __init__(self): with open('sha1.cl', 'r') as f: self.cl_program = f.read() self.ctx = cl.create_context_from_type(cl.device_type.GPU) self.queue = cl.CommandQueue(self.ctx) self.prg = cl.Program(self.ctx, self.cl_program) try: self.prg = self.prg.build() except: print "Error" print self.prg.get_build_info(self.ctx.get_info(cl.context_info.DEVICES)[0], cl.program_build_info.LOG) self.H0 = 0x67452301L self.H1 = 0xEFCDAB89L self.H2 = 0x98BADCFEL self.H3 = 0x10325476L self.H4 = 0xC3D2E1F0L self.init()
import scipy from scipy.weave import inline from scipy.weave import converters #from handythread import * from scipy import signal #from EdgeDetection import * from EyeFeatureFinder import * from stopwatch import * from VanillaBackend import * from WovenBackend import * from OpenCLBackend import * opencl_available = True try: import pyopencl as cl cl_ctx = cl.create_context_from_type(cl.device_type.ALL) cl_queue = cl.CommandQueue(ctx) except Exception, e: opencl_available = False class FastRadialFeatureFinder(EyeFeatureFinder): def __init__(self): self.backend = WovenBackend() #self.backend = OpenCLBackend() self.target_kpixels = 80.0 #8.0 self.max_target_kpixels = 50.0 self.min_target_kpixels = 1.0 self.parameters_updated = 1
import scipy from scipy.weave import inline from scipy.weave import converters #from handythread import * from scipy import signal #from EdgeDetection import * from EyeFeatureFinder import * from stopwatch import * from VanillaBackend import * from WovenBackend import * from OpenCLBackend import * opencl_available = True try: import pyopencl as cl cl_ctx = cl.create_context_from_type(cl.device_type.ALL) cl_queue = cl.CommandQueue(ctx) except Exception, e: opencl_available = False class FastRadialFeatureFinder (EyeFeatureFinder): def __init__(self): self.backend = WovenBackend() #self.backend = OpenCLBackend() self.target_kpixels = 80.0 #8.0 self.max_target_kpixels = 50.0 self.min_target_kpixels = 1.0