Print more meaningfull hip error messages (#1530)

This commit is contained in:
Szymon Ożóg
2023-08-12 16:16:20 +02:00
committed by GitHub
parent 29d5801387
commit 330fb7b1a3

View File

@@ -14,7 +14,16 @@ except:
def hipCheckStatus(status):
if status != 0:
raise RuntimeError('HIP error %s' % status)
raise RuntimeError('HIP error %s: %s' % (status, hipGetErrorString(status)))
_libhip.hipGetErrorString.restype = ctypes.c_char_p
_libhip.hipGetErrorString.argtypes = [ctypes.c_int]
def hipGetErrorString(status):
return _libhip.hipGetErrorString(status).decode('utf-8')
_libhip.hipDeviceSynchronize.restype = int
_libhip.hipDeviceSynchronize.argtypes = []