From 7f4f925385359357a95dc3b9522fab01ac6efc21 Mon Sep 17 00:00:00 2001 From: David Hou Date: Fri, 27 Oct 2023 14:38:07 -0700 Subject: [PATCH] fix hip del on compile fail (#2163) * fix hip del on compile fail * the test doesn't actually work --- tinygrad/runtime/ops_hip.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tinygrad/runtime/ops_hip.py b/tinygrad/runtime/ops_hip.py index 574420fe7a..2b3cc832f8 100644 --- a/tinygrad/runtime/ops_hip.py +++ b/tinygrad/runtime/ops_hip.py @@ -80,13 +80,13 @@ class RawHIPBuffer(RawBufferCopyInOut, RawBufferTransfer): class HIPProgram: def __init__(self, name:str, prg:str, binary=False): + self.modules, self.prgs = [], [] prg = prg if binary else self.compile(prg, name) if DEBUG >= 6: asm = early_exec((["/opt/rocm/llvm/bin/llvm-objdump", '-d', '-'], prg)) print('\n'.join([x for x in asm.decode('utf-8').split("\n") if 's_code_end' not in x])) - self.modules, self.prgs = [], [] for i in range(HIP.device_count): hip.hipSetDevice(i) self.modules.append(hip.hipModuleLoadData(prg))