def setUp(self): devtype = ocl.device_from_context(self.ctx).type if (devtype == "CPU"): self.use_cpu = True else: self.use_cpu = False kernel = ("matching_gpu.cl" if not(self.use_cpu) else "matching_cpu.cl") kernel_src = os.linesep.join((get_opencl_code(os.path.join("sift", i)) for i in ("sift", kernel))) self.program = pyopencl.Program(self.ctx, kernel_src).build() # .build('-D WORKGROUP_SIZE=%s' % wg_size) self.wg = (1, 128)
def setUp(self): devtype = ocl.device_from_context(self.ctx).type if (devtype == "CPU"): self.use_cpu = True else: self.use_cpu = False kernel = ("matching_gpu.cl" if not (self.use_cpu) else "matching_cpu.cl") kernel_src = get_opencl_code(os.path.join("sift", kernel)) self.program = pyopencl.Program( self.ctx, kernel_src).build() # .build('-D WORKGROUP_SIZE=%s' % wg_size) self.wg = (1, 128)