fix hip del on compile fail (#2163)

* fix hip del on compile fail

* the test doesn't actually work
This commit is contained in:
David Hou 2023-10-27 14:38:07 -07:00 committed by GitHub
parent 8cf0bb9351
commit 7f4f925385
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 1 deletions

View File

@ -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))