MCPcopy Index your code
hub / github.com/tinygrad/tinygrad / __init__

Method __init__

tinygrad/runtime/ops_hip.py:27–31  ·  view source on GitHub ↗
(self, dev:HIPDevice, name:str, lib:bytes, **kwargs)

Source from the content-addressed store, hash-verified

25
26class HIPProgram:
27 def __init__(self, dev:HIPDevice, name:str, lib:bytes, **kwargs):
28 self.dev, self.name, self.lib = dev, name, lib
29 check(hip.hipSetDevice(self.dev.device_id))
30 self.module = init_c_var(hip.hipModule_t, lambda x: check(hip.hipModuleLoadData(ctypes.byref(x), lib)))
31 self.prg = init_c_var(hip.hipFunction_t, lambda x: check(hip.hipModuleGetFunction(ctypes.byref(x), self.module, name.encode("utf-8"))))
32
33 @suppress_finalizing
34 def __del__(self):

Callers

nothing calls this directly

Calls 3

init_c_varFunction · 0.90
checkFunction · 0.70
encodeMethod · 0.45

Tested by

no test coverage detected