better cacheline test

This commit is contained in:
George Hotz
2023-03-30 06:08:54 +04:00
parent 76db1af6fc
commit b05c2828f7
2 changed files with 35 additions and 9 deletions

View File

@@ -40,10 +40,10 @@ class CLBuffer(RawBufferCopyInOut):
cl.enqueue_copy(CL.cl_queue, x, self._buf, is_blocking=True)
class CLProgram:
def __init__(self, name:str, prg:str, binary=False, argdtypes=None):
def __init__(self, name:str, prg:str, binary=False, argdtypes=None, options=None):
self.name, self.argdtypes, self.clprogram = name, argdtypes, cl.Program(CL.cl_ctx, CL.cl_ctx.devices, [prg]) if binary else cl.Program(CL.cl_ctx, prg) # type: ignore
try:
self._clprg = self.clprogram.build()
self._clprg = self.clprogram.build(options=options)
except cl.RuntimeError as e:
if DEBUG >= 3: print("FAILED TO BUILD", prg)
raise e