diff --git a/GPUSimulators/LxF.py b/GPUSimulators/LxF.py index 3b989d3..7751b30 100644 --- a/GPUSimulators/LxF.py +++ b/GPUSimulators/LxF.py @@ -49,6 +49,21 @@ class LxF (Simulator.BaseSimulator): dt: Size of each timestep (90 s) 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, context, h0, hu0, hv0,