Merge pull request #5255 from BigDataAccelerate/fix_dep_rocm_ocl

Bug fix: remove dependencies for rocm & cuda on opencl to run block Jacobi ILU
This commit is contained in:
Arne Morten Kvarving 2024-04-05 12:02:30 +02:00 committed by GitHub
commit fdab87d336
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
4 changed files with 12 additions and 12 deletions

View File

@ -89,12 +89,12 @@ struct EdgeWeightsMethod {
using type = UndefinedProperty;
};
#if HAVE_OPENCL || HAVE_ROCSPARSE
#if HAVE_OPENCL || HAVE_ROCSPARSE || HAVE_CUDA
template<class TypeTag, class MyTypeTag>
struct NumJacobiBlocks {
using type = UndefinedProperty;
};
#endif // HAVE_OPENCL || HAVE_ROCSPARSE
#endif
template<class TypeTag, class MyTypeTag>
struct OwnerCellsFirst {
@ -156,12 +156,12 @@ struct EdgeWeightsMethod<TypeTag, TTag::FlowBaseVanguard> {
static constexpr int value = 1;
};
#if HAVE_OPENCL || HAVE_ROCSPARSE
#if HAVE_OPENCL || HAVE_ROCSPARSE || HAVE_CUDA
template<class TypeTag>
struct NumJacobiBlocks<TypeTag, TTag::FlowBaseVanguard> {
static constexpr int value = 0;
};
#endif // HAVE_OPENCL || HAVE_ROCSPARSE
#endif
template<class TypeTag>
struct OwnerCellsFirst<TypeTag, TTag::FlowBaseVanguard> {
@ -256,7 +256,7 @@ public:
EWOMS_REGISTER_PARAM(TypeTag, int, EdgeWeightsMethod,
"Choose edge-weighing strategy: 0=uniform, 1=trans, 2=log(trans).");
#if HAVE_OPENCL || HAVE_ROCSPARSE
#if HAVE_OPENCL || HAVE_ROCSPARSE || HAVE_CUDA
EWOMS_REGISTER_PARAM(TypeTag, int, NumJacobiBlocks,
"Number of blocks to be created for the Block-Jacobi preconditioner.");
#endif
@ -302,7 +302,7 @@ public:
fileName_ = EWOMS_GET_PARAM(TypeTag, std::string, EclDeckFileName);
edgeWeightsMethod_ = Dune::EdgeWeightMethod(EWOMS_GET_PARAM(TypeTag, int, EdgeWeightsMethod));
#if HAVE_OPENCL || HAVE_ROCSPARSE
#if HAVE_OPENCL || HAVE_ROCSPARSE || HAVE_CUDA
numJacobiBlocks_ = EWOMS_GET_PARAM(TypeTag, int, NumJacobiBlocks);
#endif

View File

@ -199,7 +199,7 @@ public:
*/
int numJacobiBlocks() const
{
#if HAVE_OPENCL || HAVE_ROCSPARSE
#if HAVE_OPENCL || HAVE_ROCSPARSE || HAVE_CUDA
return numJacobiBlocks_;
#else
return 0;
@ -285,9 +285,9 @@ protected:
std::string fileName_;
Dune::EdgeWeightMethod edgeWeightsMethod_;
#if HAVE_OPENCL || HAVE_ROCSPARSE
#if HAVE_OPENCL || HAVE_ROCSPARSE || HAVE_CUDA
int numJacobiBlocks_{0};
#endif // HAVE_OPENCL || HAVE_ROCSPARSE
#endif
bool ownersFirst_;
#if HAVE_MPI

View File

@ -207,14 +207,14 @@ doLoadBalance_(const Dune::EdgeWeightMethod edgeWeightsMethod,
// first cell of a well (e.g. for pressure). Hence this is now
// skipped. Rank 0 had everything even before.
#if HAVE_OPENCL
#if HAVE_OPENCL || HAVE_ROCSPARSE || HAVE_CUDA
if (partitionJacobiBlocks) {
this->cell_part_ = this->grid_->
zoltanPartitionWithoutScatter(&wells, faceTrans.data(),
numJacobiBlocks,
zoltanImbalanceTol);
}
#endif // HAVE_OPENCL
#endif
}
}

View File

@ -195,7 +195,7 @@ public:
ParentType::prepare(M,b);
}
#if HAVE_OPENCL
#if HAVE_OPENCL || HAVE_ROCSPARSE || HAVE_CUDA
// update matrix entries for solvers.
if (firstcall && bdaBridge_) {
// model will not change the matrix object. Hence simply store a pointer