mirror of
https://github.com/smyalygames/FiniteVolumeGPU_HIP.git
synced 2025-05-18 14:34:12 +02:00
add hip_check() routine
This commit is contained in:
parent
b312923ce6
commit
163eb02a0b
@ -34,6 +34,20 @@ class SHMEMSimulator(Simulator.BaseSimulator):
|
|||||||
Class which handles communication and synchronization between simulators in different
|
Class which handles communication and synchronization between simulators in different
|
||||||
contexts (presumably on different GPUs)
|
contexts (presumably on different GPUs)
|
||||||
"""
|
"""
|
||||||
|
def hip_check(call_result):
|
||||||
|
err = call_result[0]
|
||||||
|
result = call_result[1:]
|
||||||
|
if len(result) == 1:
|
||||||
|
result = result[0]
|
||||||
|
if isinstance(err, hip.hipError_t) and err != hip.hipError_t.hipSuccess:
|
||||||
|
raise RuntimeError(str(err))
|
||||||
|
elif (
|
||||||
|
isinstance(err, hiprtc.hiprtcResult)
|
||||||
|
and err != hiprtc.hiprtcResult.HIPRTC_SUCCESS
|
||||||
|
):
|
||||||
|
raise RuntimeError(str(err))
|
||||||
|
return result
|
||||||
|
|
||||||
def __init__(self, sims, grid):
|
def __init__(self, sims, grid):
|
||||||
self.logger = logging.getLogger(__name__)
|
self.logger = logging.getLogger(__name__)
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user