mirror of
https://github.com/OPM/opm-simulators.git
synced 2025-02-25 18:55:30 -06:00
update name of opm cuilu0 to match gpuistl
This commit is contained in:
parent
03795d5b23
commit
0bab02f809
@ -237,7 +237,7 @@ if (HAVE_CUDA)
|
||||
ADD_CUDA_OR_HIP_FILE(MAIN_SOURCE_FILES opm/simulators/linalg detail/vector_operations.cu)
|
||||
ADD_CUDA_OR_HIP_FILE(MAIN_SOURCE_FILES opm/simulators/linalg GpuSparseMatrix.cpp)
|
||||
ADD_CUDA_OR_HIP_FILE(MAIN_SOURCE_FILES opm/simulators/linalg GpuDILU.cpp)
|
||||
ADD_CUDA_OR_HIP_FILE(MAIN_SOURCE_FILES opm/simulators/linalg OpmCuILU0.cpp)
|
||||
ADD_CUDA_OR_HIP_FILE(MAIN_SOURCE_FILES opm/simulators/linalg OpmGpuILU0.cpp)
|
||||
ADD_CUDA_OR_HIP_FILE(MAIN_SOURCE_FILES opm/simulators/linalg GpuJac.cpp)
|
||||
ADD_CUDA_OR_HIP_FILE(MAIN_SOURCE_FILES opm/simulators/linalg GpuSeqILU0.cpp)
|
||||
ADD_CUDA_OR_HIP_FILE(MAIN_SOURCE_FILES opm/simulators/linalg set_device.cpp)
|
||||
@ -257,7 +257,7 @@ if (HAVE_CUDA)
|
||||
ADD_CUDA_OR_HIP_FILE(PUBLIC_HEADER_FILES opm/simulators/linalg detail/preconditionerKernels/ILU0Kernels.hpp)
|
||||
ADD_CUDA_OR_HIP_FILE(PUBLIC_HEADER_FILES opm/simulators/linalg detail/preconditionerKernels/JacKernels.hpp)
|
||||
ADD_CUDA_OR_HIP_FILE(PUBLIC_HEADER_FILES opm/simulators/linalg GpuDILU.hpp)
|
||||
ADD_CUDA_OR_HIP_FILE(PUBLIC_HEADER_FILES opm/simulators/linalg OpmCuILU0.hpp)
|
||||
ADD_CUDA_OR_HIP_FILE(PUBLIC_HEADER_FILES opm/simulators/linalg OpmGpuILU0.hpp)
|
||||
ADD_CUDA_OR_HIP_FILE(PUBLIC_HEADER_FILES opm/simulators/linalg GpuJac.hpp)
|
||||
ADD_CUDA_OR_HIP_FILE(PUBLIC_HEADER_FILES opm/simulators/linalg GpuVector.hpp)
|
||||
ADD_CUDA_OR_HIP_FILE(PUBLIC_HEADER_FILES opm/simulators/linalg GpuView.hpp)
|
||||
|
@ -24,7 +24,7 @@
|
||||
#if USE_HIP
|
||||
#include <opm/simulators/linalg/gpuistl_hip/GpuBlockPreconditioner.hpp>
|
||||
#include <opm/simulators/linalg/gpuistl_hip/GpuDILU.hpp>
|
||||
#include <opm/simulators/linalg/gpuistl_hip/OpmCuILU0.hpp>
|
||||
#include <opm/simulators/linalg/gpuistl_hip/OpmGpuILU0.hpp>
|
||||
#include <opm/simulators/linalg/gpuistl_hip/GpuJac.hpp>
|
||||
#include <opm/simulators/linalg/gpuistl_hip/GpuSeqILU0.hpp>
|
||||
#include <opm/simulators/linalg/gpuistl_hip/PreconditionerAdapter.hpp>
|
||||
@ -33,7 +33,7 @@
|
||||
#else
|
||||
#include <opm/simulators/linalg/gpuistl/GpuBlockPreconditioner.hpp>
|
||||
#include <opm/simulators/linalg/gpuistl/GpuDILU.hpp>
|
||||
#include <opm/simulators/linalg/gpuistl/OpmCuILU0.hpp>
|
||||
#include <opm/simulators/linalg/gpuistl/OpmGpuILU0.hpp>
|
||||
#include <opm/simulators/linalg/gpuistl/GpuJac.hpp>
|
||||
#include <opm/simulators/linalg/gpuistl/GpuSeqILU0.hpp>
|
||||
#include <opm/simulators/linalg/gpuistl/PreconditionerAdapter.hpp>
|
||||
|
@ -358,14 +358,14 @@ struct StandardPreconditioners {
|
||||
return wrapped;
|
||||
});
|
||||
|
||||
F::addCreator("OPMCUILU0", [](const O& op, [[maybe_unused]] const P& prm, const std::function<V()>&, std::size_t, const C& comm) {
|
||||
F::addCreator("OPMGPUILU0", [](const O& op, [[maybe_unused]] const P& prm, const std::function<V()>&, std::size_t, const C& comm) {
|
||||
const bool split_matrix = prm.get<bool>("split_matrix", true);
|
||||
const bool tune_gpu_kernels = prm.get<bool>("tune_gpu_kernels", true);
|
||||
using field_type = typename V::field_type;
|
||||
using OpmCuILU0 = typename gpuistl::OpmCuILU0<M, gpuistl::GpuVector<field_type>, gpuistl::GpuVector<field_type>>;
|
||||
auto cuilu0 = std::make_shared<OpmCuILU0>(op.getmat(), split_matrix, tune_gpu_kernels);
|
||||
using OpmGpuILU0 = typename gpuistl::OpmGpuILU0<M, gpuistl::GpuVector<field_type>, gpuistl::GpuVector<field_type>>;
|
||||
auto gpuilu0 = std::make_shared<OpmGpuILU0>(op.getmat(), split_matrix, tune_gpu_kernels);
|
||||
|
||||
auto adapted = std::make_shared<gpuistl::PreconditionerAdapter<V, V, OpmCuILU0>>(cuilu0);
|
||||
auto adapted = std::make_shared<gpuistl::PreconditionerAdapter<V, V, OpmGpuILU0>>(gpuilu0);
|
||||
auto wrapped = std::make_shared<gpuistl::GpuBlockPreconditioner<V, V, Comm>>(adapted, comm);
|
||||
return wrapped;
|
||||
});
|
||||
@ -616,13 +616,13 @@ struct StandardPreconditioners<Operator, Dune::Amg::SequentialInformation> {
|
||||
std::make_shared<GPUJac>(op.getmat(), w));
|
||||
});
|
||||
|
||||
F::addCreator("OPMCUILU0", [](const O& op, [[maybe_unused]] const P& prm, const std::function<V()>&, std::size_t) {
|
||||
F::addCreator("OPMGPUILU0", [](const O& op, [[maybe_unused]] const P& prm, const std::function<V()>&, std::size_t) {
|
||||
const bool split_matrix = prm.get<bool>("split_matrix", true);
|
||||
const bool tune_gpu_kernels = prm.get<bool>("tune_gpu_kernels", true);
|
||||
using field_type = typename V::field_type;
|
||||
using CUILU0 = typename gpuistl::OpmCuILU0<M, gpuistl::GpuVector<field_type>, gpuistl::GpuVector<field_type>>;
|
||||
using GPUILU0 = typename gpuistl::OpmGpuILU0<M, gpuistl::GpuVector<field_type>, gpuistl::GpuVector<field_type>>;
|
||||
|
||||
return std::make_shared<gpuistl::PreconditionerAdapter<V, V, CUILU0>>(std::make_shared<CUILU0>(op.getmat(), split_matrix, tune_gpu_kernels));
|
||||
return std::make_shared<gpuistl::PreconditionerAdapter<V, V, GPUILU0>>(std::make_shared<GPUILU0>(op.getmat(), split_matrix, tune_gpu_kernels));
|
||||
});
|
||||
|
||||
F::addCreator("GPUDILU", [](const O& op, [[maybe_unused]] const P& prm, const std::function<V()>&, std::size_t) {
|
||||
|
@ -28,7 +28,7 @@
|
||||
#include <opm/simulators/linalg/GraphColoring.hpp>
|
||||
#include <opm/simulators/linalg/gpuistl/GpuSparseMatrix.hpp>
|
||||
#include <opm/simulators/linalg/gpuistl/GpuVector.hpp>
|
||||
#include <opm/simulators/linalg/gpuistl/OpmCuILU0.hpp>
|
||||
#include <opm/simulators/linalg/gpuistl/OpmGpuILU0.hpp>
|
||||
#include <opm/simulators/linalg/gpuistl/detail/autotuner.hpp>
|
||||
#include <opm/simulators/linalg/gpuistl/detail/coloringAndReorderingUtils.hpp>
|
||||
#include <opm/simulators/linalg/gpuistl/detail/gpusparse_matrix_operations.hpp>
|
||||
@ -41,7 +41,7 @@ namespace Opm::gpuistl
|
||||
{
|
||||
|
||||
template <class M, class X, class Y, int l>
|
||||
OpmCuILU0<M, X, Y, l>::OpmCuILU0(const M& A, bool splitMatrix, bool tuneKernels)
|
||||
OpmGpuILU0<M, X, Y, l>::OpmGpuILU0(const M& A, bool splitMatrix, bool tuneKernels)
|
||||
: m_cpuMatrix(A)
|
||||
, m_levelSets(Opm::getMatrixRowColoring(m_cpuMatrix, Opm::ColoringType::LOWER))
|
||||
, m_reorderedToNatural(detail::createReorderedToNatural(m_levelSets))
|
||||
@ -89,13 +89,13 @@ OpmCuILU0<M, X, Y, l>::OpmCuILU0(const M& A, bool splitMatrix, bool tuneKernels)
|
||||
|
||||
template <class M, class X, class Y, int l>
|
||||
void
|
||||
OpmCuILU0<M, X, Y, l>::pre([[maybe_unused]] X& x, [[maybe_unused]] Y& b)
|
||||
OpmGpuILU0<M, X, Y, l>::pre([[maybe_unused]] X& x, [[maybe_unused]] Y& b)
|
||||
{
|
||||
}
|
||||
|
||||
template <class M, class X, class Y, int l>
|
||||
void
|
||||
OpmCuILU0<M, X, Y, l>::apply(X& v, const Y& d)
|
||||
OpmGpuILU0<M, X, Y, l>::apply(X& v, const Y& d)
|
||||
{
|
||||
OPM_TIMEBLOCK(prec_apply);
|
||||
{
|
||||
@ -105,7 +105,7 @@ OpmCuILU0<M, X, Y, l>::apply(X& v, const Y& d)
|
||||
|
||||
template <class M, class X, class Y, int l>
|
||||
void
|
||||
OpmCuILU0<M, X, Y, l>::apply(X& v, const Y& d, int lowerSolveThreadBlockSize, int upperSolveThreadBlockSize)
|
||||
OpmGpuILU0<M, X, Y, l>::apply(X& v, const Y& d, int lowerSolveThreadBlockSize, int upperSolveThreadBlockSize)
|
||||
{
|
||||
int levelStartIdx = 0;
|
||||
for (int level = 0; level < m_levelSets.size(); ++level) {
|
||||
@ -165,20 +165,20 @@ OpmCuILU0<M, X, Y, l>::apply(X& v, const Y& d, int lowerSolveThreadBlockSize, in
|
||||
|
||||
template <class M, class X, class Y, int l>
|
||||
void
|
||||
OpmCuILU0<M, X, Y, l>::post([[maybe_unused]] X& x)
|
||||
OpmGpuILU0<M, X, Y, l>::post([[maybe_unused]] X& x)
|
||||
{
|
||||
}
|
||||
|
||||
template <class M, class X, class Y, int l>
|
||||
Dune::SolverCategory::Category
|
||||
OpmCuILU0<M, X, Y, l>::category() const
|
||||
OpmGpuILU0<M, X, Y, l>::category() const
|
||||
{
|
||||
return Dune::SolverCategory::sequential;
|
||||
}
|
||||
|
||||
template <class M, class X, class Y, int l>
|
||||
void
|
||||
OpmCuILU0<M, X, Y, l>::update()
|
||||
OpmGpuILU0<M, X, Y, l>::update()
|
||||
{
|
||||
OPM_TIMEBLOCK(prec_update);
|
||||
{
|
||||
@ -188,7 +188,7 @@ OpmCuILU0<M, X, Y, l>::update()
|
||||
|
||||
template <class M, class X, class Y, int l>
|
||||
void
|
||||
OpmCuILU0<M, X, Y, l>::update(int moveThreadBlockSize, int factorizationThreadBlockSize)
|
||||
OpmGpuILU0<M, X, Y, l>::update(int moveThreadBlockSize, int factorizationThreadBlockSize)
|
||||
{
|
||||
OPM_TIMEBLOCK(prec_update);
|
||||
{
|
||||
@ -198,7 +198,7 @@ OpmCuILU0<M, X, Y, l>::update(int moveThreadBlockSize, int factorizationThreadBl
|
||||
}
|
||||
template <class M, class X, class Y, int l>
|
||||
void
|
||||
OpmCuILU0<M, X, Y, l>::LUFactorizeAndMoveData(int moveThreadBlockSize, int factorizationThreadBlockSize)
|
||||
OpmGpuILU0<M, X, Y, l>::LUFactorizeAndMoveData(int moveThreadBlockSize, int factorizationThreadBlockSize)
|
||||
{
|
||||
if (m_splitMatrix) {
|
||||
detail::copyMatDataToReorderedSplit<field_type, blocksize_>(
|
||||
@ -257,7 +257,7 @@ OpmCuILU0<M, X, Y, l>::LUFactorizeAndMoveData(int moveThreadBlockSize, int facto
|
||||
|
||||
template <class M, class X, class Y, int l>
|
||||
void
|
||||
OpmCuILU0<M, X, Y, l>::tuneThreadBlockSizes()
|
||||
OpmGpuILU0<M, X, Y, l>::tuneThreadBlockSizes()
|
||||
{
|
||||
// tune the thread-block size of the update function
|
||||
auto tuneMoveThreadBlockSizeInUpdate
|
||||
@ -291,10 +291,10 @@ OpmCuILU0<M, X, Y, l>::tuneThreadBlockSizes()
|
||||
|
||||
} // namespace Opm::gpuistl
|
||||
#define INSTANTIATE_CUDILU_DUNE(realtype, blockdim) \
|
||||
template class ::Opm::gpuistl::OpmCuILU0<Dune::BCRSMatrix<Dune::FieldMatrix<realtype, blockdim, blockdim>>, \
|
||||
template class ::Opm::gpuistl::OpmGpuILU0<Dune::BCRSMatrix<Dune::FieldMatrix<realtype, blockdim, blockdim>>, \
|
||||
::Opm::gpuistl::GpuVector<realtype>, \
|
||||
::Opm::gpuistl::GpuVector<realtype>>; \
|
||||
template class ::Opm::gpuistl::OpmCuILU0<Dune::BCRSMatrix<Opm::MatrixBlock<realtype, blockdim, blockdim>>, \
|
||||
template class ::Opm::gpuistl::OpmGpuILU0<Dune::BCRSMatrix<Opm::MatrixBlock<realtype, blockdim, blockdim>>, \
|
||||
::Opm::gpuistl::GpuVector<realtype>, \
|
||||
::Opm::gpuistl::GpuVector<realtype>>
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
Copyright 2022-2023 SINTEF AS
|
||||
Copyright 2024 SINTEF AS
|
||||
|
||||
This file is part of the Open Porous Media project (OPM).
|
||||
|
||||
@ -16,8 +16,8 @@
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with OPM. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
#ifndef OPM_CUILU0_OPM_Impl_HPP
|
||||
#define OPM_CUILU0_OPM_Impl_HPP
|
||||
#ifndef OPM_GPUILU0_OPM_Impl_HPP
|
||||
#define OPM_GPUILU0_OPM_Impl_HPP
|
||||
|
||||
#include <memory>
|
||||
#include <opm/grid/utility/SparseTable.hpp>
|
||||
@ -42,7 +42,7 @@ namespace Opm::gpuistl
|
||||
//! \note We assume X and Y are both GpuVector<real_type>, but we leave them as template
|
||||
//! arguments in case of future additions.
|
||||
template <class M, class X, class Y, int l = 1>
|
||||
class OpmCuILU0 : public Dune::PreconditionerWithUpdate<X, Y>
|
||||
class OpmGpuILU0 : public Dune::PreconditionerWithUpdate<X, Y>
|
||||
{
|
||||
public:
|
||||
//! \brief The matrix type the preconditioner is for.
|
||||
@ -62,7 +62,7 @@ public:
|
||||
//! \param A The matrix to operate on.
|
||||
//! \param w The relaxation factor.
|
||||
//!
|
||||
explicit OpmCuILU0(const M& A, bool splitMatrix, bool tuneKernels);
|
||||
explicit OpmGpuILU0(const M& A, bool splitMatrix, bool tuneKernels);
|
||||
|
||||
//! \brief Prepare the preconditioner.
|
||||
//! \note Does nothing at the time being.
|
Loading…
Reference in New Issue
Block a user