mirror of
https://github.com/tinygrad/tinygrad.git
synced 2026-04-29 03:00:14 -04:00
Print more meaningfull hip error messages (#1530)
This commit is contained in:
@@ -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 = []
|
||||
|
||||
Reference in New Issue
Block a user