mirror of
https://github.com/OPM/opm-simulators.git
synced 2025-02-25 18:55:30 -06:00
Make sure amgcl can be used without CUDA
This commit is contained in:
parent
b197130b3e
commit
282f611f92
@ -218,10 +218,12 @@ if(amgcl_FOUND)
|
||||
set(HAVE_AMGCL 1)
|
||||
# Linking to target angcl::amgcl drags in OpenMP and -fopenmp as a compile
|
||||
# flag. With that nvcc fails as it does not that flag.
|
||||
# Hence we set AMG_CL_INCLUDE_DIRS.
|
||||
# Hence we set AMGCL_INCLUDE_DIRS.
|
||||
get_property(AMGCL_INCLUDE_DIRS TARGET amgcl::amgcl PROPERTY INTERFACE_INCLUDE_DIRECTORIES)
|
||||
include_directories(${AMGCL_INCLUDE_DIRS})
|
||||
set_source_files_properties(opm/simulators/linalg/bda/amgclSolverBackend.cpp PROPERTIES LANGUAGE CUDA)
|
||||
if(CUDA_FOUND)
|
||||
set_source_files_properties(opm/simulators/linalg/bda/amgclSolverBackend.cpp PROPERTIES LANGUAGE CUDA)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
# read the list of components from this file (in the project directory);
|
||||
|
@ -115,6 +115,9 @@ if(HAVE_FPGA)
|
||||
list (APPEND MAIN_SOURCE_FILES opm/simulators/linalg/bda/WellContributions.cpp)
|
||||
endif()
|
||||
if(HAVE_AMGCL)
|
||||
list (APPEND MAIN_SOURCE_FILES opm/simulators/linalg/bda/BdaBridge.cpp)
|
||||
list (APPEND MAIN_SOURCE_FILES opm/simulators/linalg/bda/WellContributions.cpp)
|
||||
list (APPEND MAIN_SOURCE_FILES opm/simulators/linalg/bda/MultisegmentWellContribution.cpp)
|
||||
list (APPEND MAIN_SOURCE_FILES opm/simulators/linalg/bda/amgclSolverBackend.cpp)
|
||||
endif()
|
||||
if(MPI_FOUND)
|
||||
|
@ -265,9 +265,12 @@ namespace Opm
|
||||
WellContributions wellContribs(accelerator_mode, useWellConn_);
|
||||
bdaBridge->initWellContributions(wellContribs);
|
||||
|
||||
// the WellContributions can only be applied separately with CUDA or OpenCL, not with an FPGA or amgcl
|
||||
#if HAVE_CUDA || HAVE_OPENCL
|
||||
if (!useWellConn_) {
|
||||
simulator_.problem().wellModel().getWellContributions(wellContribs);
|
||||
}
|
||||
#endif
|
||||
|
||||
// Const_cast needed since the CUDA stuff overwrites values for better matrix condition..
|
||||
bdaBridge->solve_system(const_cast<Matrix*>(&getMatrix()), *rhs_, wellContribs, result);
|
||||
|
@ -30,18 +30,19 @@
|
||||
|
||||
#include <amgcl/amg.hpp>
|
||||
#include <amgcl/backend/builtin.hpp>
|
||||
#include <amgcl/backend/cuda.hpp>
|
||||
#include <amgcl/relaxation/cusparse_ilu0.hpp>
|
||||
#include <amgcl/adapter/crs_tuple.hpp>
|
||||
#include <amgcl/make_block_solver.hpp>
|
||||
#include <amgcl/relaxation/as_preconditioner.hpp>
|
||||
#include <amgcl/relaxation/ilu0.hpp>
|
||||
#include <amgcl/solver/bicgstab.hpp>
|
||||
|
||||
#include <amgcl/preconditioner/runtime.hpp>
|
||||
|
||||
#include <amgcl/value_type/static_matrix.hpp>
|
||||
|
||||
#if HAVE_CUDA
|
||||
#include <amgcl/backend/cuda.hpp>
|
||||
#include <amgcl/relaxation/cusparse_ilu0.hpp>
|
||||
#endif
|
||||
|
||||
#define AMGCL_CUDA 0
|
||||
|
||||
namespace bda
|
||||
|
Loading…
Reference in New Issue
Block a user