mirror of https://github.com/commaai/tinygrad.git
faster program start in llvm (#3897)
This commit is contained in:
parent
46a3501cec
commit
4e18dd78d3
|
@ -27,6 +27,7 @@ class LLVMProgram:
|
|||
self.fxn = device.engine.get_function_address(name)
|
||||
|
||||
def __call__(self, *bufs, vals:Tuple[int, ...]=(), wait=False):
|
||||
if not hasattr(self, 'cfunc'):
|
||||
self.cfunc = ctypes.CFUNCTYPE(ctypes.c_int, *([ctypes.c_void_p]*len(bufs)), *([ctypes.c_int32]*len(vals)))(self.fxn)
|
||||
return cpu_time_execution(lambda: self.cfunc(*bufs, *vals), enable=wait)
|
||||
|
||||
|
|
Loading…
Reference in New Issue