diff --git a/extra/hip_wrapper.py b/extra/hip_wrapper.py index cc0ccd5230..9084e69818 100644 --- a/extra/hip_wrapper.py +++ b/extra/hip_wrapper.py @@ -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 = []