Merge pull request #3321 from blattms/fix-cuda-only-compilation

Fixes compilation with CUDA but without OpenCL.
This commit is contained in:
Markus Blatt 2021-05-31 08:53:54 +02:00 committed by GitHub
commit 1ea70da7e6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 9 additions and 9 deletions

View File

@ -55,7 +55,8 @@ template <class BridgeMatrix, class BridgeVector, int block_size>
BdaBridge<BridgeMatrix, BridgeVector, block_size>::BdaBridge(std::string accelerator_mode_,
[[maybe_unused]] std::string fpga_bitstream,
int linear_solver_verbosity, int maxit,
double tolerance, unsigned int platformID,
double tolerance,
[[maybe_unused]] unsigned int platformID,
unsigned int deviceID,
[[maybe_unused]] std::string opencl_ilu_reorder)
: accelerator_mode(accelerator_mode_)
@ -264,7 +265,7 @@ void BdaBridge<BridgeMatrix, BridgeVector, block_size>::get_result(BridgeVector
}
template <class BridgeMatrix, class BridgeVector, int block_size>
void BdaBridge<BridgeMatrix, BridgeVector, block_size>::initWellContributions(WellContributions& wellContribs) {
void BdaBridge<BridgeMatrix, BridgeVector, block_size>::initWellContributions([[maybe_unused]] WellContributions& wellContribs) {
if(accelerator_mode.compare("opencl") == 0){
#if HAVE_OPENCL
const auto openclBackend = static_cast<const bda::openclSolverBackend<block_size>*>(backend.get());

View File

@ -77,7 +77,8 @@ void WellContributions::setOpenCLEnv(cl::Context *context_, cl::CommandQueue *qu
this->queue = queue_;
}
void WellContributions::setKernel(stdwell_apply_kernel_type *kernel_, stdwell_apply_no_reorder_kernel_type *kernel_no_reorder_){
void WellContributions::setKernel(bda::stdwell_apply_kernel_type *kernel_,
bda::stdwell_apply_no_reorder_kernel_type *kernel_no_reorder_){
this->kernel = kernel_;
this->kernel_no_reorder = kernel_no_reorder_;
}

View File

@ -40,9 +40,6 @@
namespace Opm
{
using bda::stdwell_apply_kernel_type;
using bda::stdwell_apply_no_reorder_kernel_type;
/// This class serves to eliminate the need to include the WellContributions into the matrix (with --matrix-add-well-contributions=true) for the cusparseSolver
/// If the --matrix-add-well-contributions commandline parameter is true, this class should not be used
/// So far, StandardWell and MultisegmentWell are supported
@ -97,8 +94,8 @@ private:
#if HAVE_OPENCL
cl::Context *context;
cl::CommandQueue *queue;
stdwell_apply_kernel_type *kernel;
stdwell_apply_no_reorder_kernel_type *kernel_no_reorder;
bda::stdwell_apply_kernel_type *kernel;
bda::stdwell_apply_no_reorder_kernel_type *kernel_no_reorder;
std::vector<cl::Event> events;
std::unique_ptr<cl::Buffer> d_Cnnzs_ocl, d_Dnnzs_ocl, d_Bnnzs_ocl;
@ -150,7 +147,8 @@ public:
#endif
#if HAVE_OPENCL
void setKernel(stdwell_apply_kernel_type *kernel_, stdwell_apply_no_reorder_kernel_type *kernel_no_reorder_);
void setKernel(bda::stdwell_apply_kernel_type *kernel_,
bda::stdwell_apply_no_reorder_kernel_type *kernel_no_reorder_);
void setOpenCLEnv(cl::Context *context_, cl::CommandQueue *queue_);
/// Since the rows of the matrix are reordered, the columnindices of the matrixdata is incorrect