Merge pull request #4883 from jychang48/jychang48-edits

Removed OpenCL dependencies for rocsparse backend & error exception handling
This commit is contained in:
Markus Blatt
2023-10-06 20:50:22 +02:00
committed by GitHub
4 changed files with 43 additions and 44 deletions

View File

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

View File

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