mirror of
https://github.com/smyalygames/FiniteVolumeGPU_HIP.git
synced 2025-05-18 14:34:12 +02:00
add hip_check
This commit is contained in:
parent
bf04b4bd1b
commit
999ea7bb57
@ -52,6 +52,21 @@ class KP07_dimsplit(Simulator.BaseSimulator):
|
|||||||
dt: Size of each timestep (90 s)
|
dt: Size of each timestep (90 s)
|
||||||
g: Gravitational accelleration (9.81 m/s^2)
|
g: Gravitational accelleration (9.81 m/s^2)
|
||||||
"""
|
"""
|
||||||
|
|
||||||
|
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,
|
def __init__(self,
|
||||||
context,
|
context,
|
||||||
h0, hu0, hv0,
|
h0, hu0, hv0,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user