mirror of
https://github.com/OPM/opm-simulators.git
synced 2026-10-25 15:10:09 -05:00
mixed: prepare for excplicit checking for avx2 support
This commit is contained in:
1 parent
3b622342b9
commit
28eedc379d
4 files changed
+25
-5
No files matched your search
@@ -750,6 +750,11 @@ endif()
|
||||
|
||||
add_custom_target(extra_test ${CMAKE_CTEST_COMMAND} -C ExtraTests)
|
||||
|
||||
# must activate avx2 flags for mixed precision.
|
||||
if(HAVE_AVX2_EXTENSION)
|
||||
set_property(SOURCE ${AVX2_SOURCE_FILES} PROPERTY COMPILE_FLAGS ${AVX2_FLAGS})
|
||||
endif()
|
||||
|
||||
# must link libraries after target 'opmsimulators' has been defined
|
||||
|
||||
if(CUDA_FOUND)
|
||||
|
||||
@@ -166,9 +166,6 @@ list (APPEND MAIN_SOURCE_FILES
|
||||
opm/simulators/linalg/FlexibleSolver5.cpp
|
||||
opm/simulators/linalg/FlexibleSolver6.cpp
|
||||
opm/simulators/linalg/FlowLinearSolverParameters.cpp
|
||||
opm/simulators/linalg/mixed/bsr.c
|
||||
opm/simulators/linalg/mixed/prec.c
|
||||
opm/simulators/linalg/mixed/bslv.c
|
||||
opm/simulators/linalg/ISTLSolver.cpp
|
||||
opm/simulators/linalg/MILU.cpp
|
||||
opm/simulators/linalg/ParallelIstlInformation.cpp
|
||||
@@ -265,6 +262,15 @@ list (APPEND MAIN_SOURCE_FILES
|
||||
opm/simulators/wells/WGState.cpp
|
||||
)
|
||||
|
||||
if (HAVE_AVX2_EXTENSION)
|
||||
set (AVX2_SOURCE_FILES
|
||||
opm/simulators/linalg/mixed/bsr.c
|
||||
opm/simulators/linalg/mixed/prec.c
|
||||
opm/simulators/linalg/mixed/bslv.c)
|
||||
list (APPEND MAIN_SOURCE_FILES
|
||||
${AVX2_SOURCE_FILES})
|
||||
endif()
|
||||
|
||||
if (HAVE_ECL_INPUT)
|
||||
list (APPEND MAIN_SOURCE_FILES
|
||||
opm/simulators/utils/satfunc/GasPhaseConsistencyChecks.cpp
|
||||
|
||||
@@ -6,6 +6,7 @@ set (opm-simulators_CONFIG_VAR
|
||||
HAVE_MPI
|
||||
HAVE_PETSC
|
||||
COMPILE_GPU_BRIDGE
|
||||
HAVE_AVX2_EXTENSION
|
||||
HAVE_CUDA
|
||||
HAVE_OPENCL
|
||||
HAVE_OPENCL_HPP
|
||||
@@ -37,6 +38,10 @@ if(CMAKE_VERSION VERSION_GREATER_EQUAL 3.30.0)
|
||||
set(_Boost_CONFIG_MODE CONFIG)
|
||||
endif()
|
||||
|
||||
# Enable when available
|
||||
#include(CheckAVX2)
|
||||
#check_for_avx2()
|
||||
|
||||
# dependencies
|
||||
set (opm-simulators_DEPS
|
||||
# Compile with C99 support if available
|
||||
|
||||
@@ -32,7 +32,9 @@
|
||||
#include <opm/simulators/linalg/PreconditionerFactoryGPUIncludeWrapper.hpp>
|
||||
#include <opm/simulators/linalg/is_gpu_operator.hpp>
|
||||
|
||||
#if HAVE_AVX2_EXTENSION
|
||||
#include <opm/simulators/linalg/mixed/wrapper.hpp>
|
||||
#endif
|
||||
|
||||
#include <dune/common/fmatrix.hh>
|
||||
#include <dune/istl/bcrsmatrix.hh>
|
||||
@@ -183,8 +185,9 @@ namespace Dune
|
||||
tol, // desired residual reduction factor
|
||||
maxiter, // maximum number of iterations
|
||||
verbosity);
|
||||
} else if (solver_type == "mixed-bicgstab") {
|
||||
if constexpr (!Opm::is_gpu_operator_v<Operator>) {
|
||||
#if HAVE_AVX2_EXTENSION
|
||||
} else if (solver_type == "mixed-bicgstab") {
|
||||
if constexpr (!Opm::is_gpu_operator_v<Operator>) {
|
||||
const std::string prec_type = prm.get<std::string>("preconditioner.type", "error");
|
||||
bool use_mixed_dilu= (prec_type=="mixed-dilu");
|
||||
using MatrixType = decltype(linearoperator_for_solver_->getmat());
|
||||
@@ -197,6 +200,7 @@ namespace Dune
|
||||
} else {
|
||||
OPM_THROW(std::invalid_argument, "mixed-bicgstab solver not supported for GPU operators.");
|
||||
}
|
||||
#endif
|
||||
} else if (solver_type == "loopsolver") {
|
||||
linsolver_ = std::make_shared<Dune::LoopSolver<VectorType>>(*linearoperator_for_solver_,
|
||||
*scalarproduct_,
|
||||
|
||||
Reference in new issue
Block a user