changed: refactor BDA well contributions

split in API specific classes for Cuda/OpenCL

this to
1) it's cleaner
2) it avoids pulling in openCL code in cuda classes which leads
to clashes between nvidia headers and opencl.hpp

there is still too much API specific things in interface between the
bda components to work through a virtual interface so we still have to cast
to the relevant implementation in various places.
This commit is contained in:
Arne Morten Kvarving
2021-11-11 14:45:12 +01:00
parent 352d31a1e9
commit e25caba8ed
13 changed files with 388 additions and 279 deletions

View File

@@ -81,7 +81,7 @@ testCusparseSolver(const boost::property_tree::ptree& prm, const std::string& ma
Dune::InverseOperatorResult result;
Vector x(rhs.size());
Opm::WellContributions wellContribs("cusparse", false);
auto wellContribs = Opm::WellContributions::create("cusparse", false);
std::unique_ptr<Opm::BdaBridge<Matrix, Vector, bz> > bridge;
try {
bridge = std::make_unique<Opm::BdaBridge<Matrix, Vector, bz> >(gpu_mode, fpga_bitstream, linear_solver_verbosity, maxit, tolerance, platformID, deviceID, opencl_ilu_reorder);
@@ -89,7 +89,7 @@ testCusparseSolver(const boost::property_tree::ptree& prm, const std::string& ma
BOOST_WARN_MESSAGE(true, error.what());
throw DeviceInitException(error.what());
}
bridge->solve_system(&matrix, rhs, wellContribs, result);
bridge->solve_system(&matrix, rhs, *wellContribs, result);
bridge->get_result(x);
return x;