From 4d2b07432c07ac6e06e49ba6b6b28c23e48029cf Mon Sep 17 00:00:00 2001 From: Arne Morten Kvarving Date: Thu, 23 Jan 2025 10:45:32 +0100 Subject: [PATCH] fixed: rethrow exceptions using bare throw instead of making copies --- opm/simulators/linalg/gpubridge/opencl/ChowPatelIlu.cpp | 2 +- .../linalg/gpubridge/opencl/openclSolverBackend.cpp | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/opm/simulators/linalg/gpubridge/opencl/ChowPatelIlu.cpp b/opm/simulators/linalg/gpubridge/opencl/ChowPatelIlu.cpp index 87f11b646..67a39cb58 100644 --- a/opm/simulators/linalg/gpubridge/opencl/ChowPatelIlu.cpp +++ b/opm/simulators/linalg/gpubridge/opencl/ChowPatelIlu.cpp @@ -978,7 +978,7 @@ void ChowPatelIlu::gpu_decomposition( OPM_THROW(std::logic_error, oss.str()); } catch (const std::logic_error& error) { // rethrow exception by OPM_THROW in the try{} - throw error; + throw; } } diff --git a/opm/simulators/linalg/gpubridge/opencl/openclSolverBackend.cpp b/opm/simulators/linalg/gpubridge/opencl/openclSolverBackend.cpp index e3599b65c..8a16a815f 100644 --- a/opm/simulators/linalg/gpubridge/opencl/openclSolverBackend.cpp +++ b/opm/simulators/linalg/gpubridge/opencl/openclSolverBackend.cpp @@ -219,7 +219,7 @@ openclSolverBackend(int verbosity_, OPM_THROW(std::logic_error, oss.str()); } catch (const std::logic_error& error) { // rethrow exception by OPM_THROW in the try{}, without this, a segfault occurs - throw error; + throw; } } @@ -479,7 +479,7 @@ initialize(std::shared_ptr> matrix, OPM_THROW(std::logic_error, oss.str()); } catch (const std::logic_error& error) { // rethrow exception by OPM_THROW in the try{}, without this, a segfault occurs - throw error; + throw; } initialized = true; @@ -649,7 +649,7 @@ solve_system(WellContributions& wellContribs, GpuResult& res) OPM_THROW(std::logic_error, oss.str()); } catch (const std::logic_error& error) { // rethrow exception by OPM_THROW in the try{}, without this, a segfault occurs - throw error; + throw; } if (verbosity > 2) {