From 069882f3e42c372a6c0ffcf2750422a81bc4575d Mon Sep 17 00:00:00 2001 From: Arne Morten Kvarving Date: Fri, 12 Nov 2021 10:29:26 +0100 Subject: [PATCH] fixed: no device handling in test_cusparseSolver the exception is not thrown while setting up the bridge as in opencl. rather the exception is thrown in the solve_system call. --- tests/test_cusparseSolver.cpp | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/tests/test_cusparseSolver.cpp b/tests/test_cusparseSolver.cpp index 78291bdf0..8608cd566 100644 --- a/tests/test_cusparseSolver.cpp +++ b/tests/test_cusparseSolver.cpp @@ -85,14 +85,18 @@ testCusparseSolver(const boost::property_tree::ptree& prm, const std::string& ma std::unique_ptr > bridge; try { bridge = std::make_unique >(gpu_mode, fpga_bitstream, linear_solver_verbosity, maxit, tolerance, platformID, deviceID, opencl_ilu_reorder); + + bridge->solve_system(&matrix, rhs, *wellContribs, result); + bridge->get_result(x); + + return x; } catch (const std::logic_error& error) { BOOST_WARN_MESSAGE(true, error.what()); - throw DeviceInitException(error.what()); + if (strstr(error.what(), "Could not get device") != nullptr) + throw DeviceInitException(error.what()); + else + throw error; } - bridge->solve_system(&matrix, rhs, *wellContribs, result); - bridge->get_result(x); - - return x; } namespace pt = boost::property_tree;