HypreErrorHandling: move out of gpuistl

put in new folder/namespace linalg/hypreinterface
This commit is contained in:
Arne Morten Kvarving committed 2026-05-18 09:28:11 +02:00
1 parent 7b2ad981bb
commit 79be046813
8 files changed
+11 -11

No files matched your search

+1 -1
View File
@@ -396,7 +396,6 @@ if(CUDA_FOUND OR hip_FOUND)
ADD_CUDA_OR_HIP_FILE(PUBLIC_HEADER_FILES opm/simulators/linalg AmgxInterface.hpp)
ADD_CUDA_OR_HIP_FILE(PUBLIC_HEADER_FILES opm/simulators/linalg HypreInterface.hpp)
ADD_CUDA_OR_HIP_FILE(PUBLIC_HEADER_FILES opm/simulators/linalg hypreinterface/HypreCpuTransfers.hpp)
ADD_CUDA_OR_HIP_FILE(PUBLIC_HEADER_FILES opm/simulators/linalg hypreinterface/HypreErrorHandling.hpp)
ADD_CUDA_OR_HIP_FILE(PUBLIC_HEADER_FILES opm/simulators/linalg hypreinterface/HypreGpuTransfers.hpp)
ADD_CUDA_OR_HIP_FILE(PUBLIC_HEADER_FILES opm/simulators/linalg hypreinterface/HypreSetup.hpp)
ADD_CUDA_OR_HIP_FILE(PUBLIC_HEADER_FILES opm/simulators/linalg PinnedMemoryHolder.hpp)
@@ -1421,6 +1420,7 @@ if(HYPRE_FOUND)
list(APPEND PUBLIC_HEADER_FILES
opm/simulators/linalg/HyprePreconditioner.hpp
opm/simulators/linalg/hypreinterface/HypreDataStructures.hpp
opm/simulators/linalg/hypreinterface/HypreErrorHandling.hpp
opm/simulators/linalg/hypreinterface/HypreUtils.hpp
)
endif()
@@ -22,7 +22,7 @@
#include <opm/simulators/linalg/gpuistl/hypreinterface/HypreCpuTransfers.hpp>
#include <opm/simulators/linalg/hypreinterface/HypreDataStructures.hpp>
#include <opm/simulators/linalg/gpuistl/hypreinterface/HypreErrorHandling.hpp>
#include <opm/simulators/linalg/hypreinterface/HypreErrorHandling.hpp>
#include <opm/simulators/linalg/gpuistl/hypreinterface/HypreGpuTransfers.hpp>
#include <opm/simulators/linalg/gpuistl/hypreinterface/HypreSetup.hpp>
#include <opm/simulators/linalg/hypreinterface/HypreUtils.hpp>
@@ -21,7 +21,7 @@
#define OPM_HYPRE_CPU_TRANSFERS_HPP
#include <opm/simulators/linalg/hypreinterface/HypreDataStructures.hpp>
#include <opm/simulators/linalg/gpuistl/hypreinterface/HypreErrorHandling.hpp>
#include <opm/simulators/linalg/hypreinterface/HypreErrorHandling.hpp>
#include <HYPRE.h>
#include <_hypre_utilities.h>
@@ -21,7 +21,7 @@
#define OPM_HYPRE_GPU_TRANSFERS_HPP
#include <opm/simulators/linalg/hypreinterface/HypreDataStructures.hpp>
#include <opm/simulators/linalg/gpuistl/hypreinterface/HypreErrorHandling.hpp>
#include <opm/simulators/linalg/hypreinterface/HypreErrorHandling.hpp>
#if HAVE_CUDA
#if USE_HIP
@@ -23,7 +23,7 @@
#include <opm/simulators/linalg/PropertyTree.hpp>
#include <opm/simulators/linalg/gpuistl/detail/gpu_type_detection.hpp>
#include <opm/simulators/linalg/hypreinterface/HypreDataStructures.hpp>
#include <opm/simulators/linalg/gpuistl/hypreinterface/HypreErrorHandling.hpp>
#include <opm/simulators/linalg/hypreinterface/HypreErrorHandling.hpp>
#include <dune/istl/owneroverlapcopy.hh>
#include <dune/istl/paamg/graph.hh>
@@ -27,7 +27,7 @@
#include <stdexcept>
#include <string>
namespace Opm::gpuistl
namespace Opm::linalg::HypreInterface
{
/**
@@ -93,7 +93,7 @@ hypreSafeCall(
* OPM_HYPRE_SAFE_CALL(HYPRE_BoomerAMGCreate(&solver));
* @endcode
*/
#define OPM_HYPRE_SAFE_CALL(expr) ::Opm::gpuistl::hypreSafeCall((expr), #expr, __FILE__, __func__, __LINE__)
#define OPM_HYPRE_SAFE_CALL(expr) ::Opm::linalg::HypreInterface::hypreSafeCall((expr), #expr, __FILE__, __func__, __LINE__)
/**
* @brief Short form macro for Hypre function calls (for backward compatibility)
@@ -102,6 +102,6 @@ hypreSafeCall(
#define HYPRE_SAFE_CALL(expr) OPM_HYPRE_SAFE_CALL(expr)
#endif
} // namespace Opm::gpuistl
} // namespace Opm::linalg::HypreInterface
#endif // OPM_HYPRE_ERROR_HANDLING_HPP
@@ -26,7 +26,7 @@
#undef MM_MAX_LINE_LENGTH
#endif
#include <opm/simulators/linalg/gpuistl/hypreinterface/HypreErrorHandling.hpp>
#include <opm/simulators/linalg/hypreinterface/HypreErrorHandling.hpp>
#include <HYPRE.h>
#include <_hypre_utilities.h>
+2 -2
View File
@@ -547,8 +547,8 @@ inline void testErrorHandling(bool use_gpu_backend)
// Test that errors are properly thrown
Dune::Amg::SequentialInformation comm;
BOOST_CHECK_THROW(HypreInterface::createMatrix(-1, 0, comm), Opm::gpuistl::HypreError);
BOOST_CHECK_THROW(HypreInterface::createVector(-1, 0, comm), Opm::gpuistl::HypreError);
BOOST_CHECK_THROW(HypreInterface::createMatrix(-1, 0, comm), Opm::linalg::HypreInterface::HypreError);
BOOST_CHECK_THROW(HypreInterface::createVector(-1, 0, comm), Opm::linalg::HypreInterface::HypreError);
// Test null pointer handling (should not throw)
HypreInterface::destroySolver(nullptr);