Skip to content

Commit 4c00203

Browse files
ndellingwoodeeprude
authored andcommitted
muelu: update ArithTraits namespace for KOKKOS_VERSION > 40799
Compatibility update corresponding to kokkos/kokkos-kernels#2771 Signed-off-by: Nathan Ellingwood <ndellin@sandia.gov>
1 parent 479d8a8 commit 4c00203

33 files changed

+539
-3
lines changed

packages/muelu/adapters/tpetra/MueLu_TpetraOperatorAsRowMatrix.hpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,11 @@ class TpetraOperatorAsRowMatrix : public Tpetra::RowMatrix<Scalar, LocalOrdinal,
2828
using row_matrix_type = Tpetra::RowMatrix<Scalar, LocalOrdinal, GlobalOrdinal, Node>;
2929

3030
using impl_scalar_type = typename row_matrix_type::impl_scalar_type;
31+
#if KOKKOS_VERSION > 40799
32+
using mag_type = typename KokkosKernels::ArithTraits<impl_scalar_type>::mag_type;
33+
#else
3134
using mag_type = typename Kokkos::ArithTraits<impl_scalar_type>::mag_type;
35+
#endif
3236

3337
using local_inds_device_view_type =
3438
typename row_matrix_type::local_inds_device_view_type;

packages/muelu/example/basic/Stratimikos.cpp

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -306,9 +306,17 @@ int main_(Teuchos::CommandLineProcessor &clp, Xpetra::UnderlyingLib lib, int arg
306306
// We fill the arrays describing the local part of the matrix.
307307
// This step can obviously be skipped if the user has pre-assembled arrays.
308308

309+
#if KOKKOS_VERSION > 40799
310+
using ATS = KokkosKernels::ArithTraits<Scalar>;
311+
#else
309312
using ATS = Kokkos::ArithTraits<Scalar>;
313+
#endif
310314
using impl_SC = typename ATS::val_type;
315+
#if KOKKOS_VERSION > 40799
316+
using impl_ATS = KokkosKernels::ArithTraits<impl_SC>;
317+
#else
311318
using impl_ATS = Kokkos::ArithTraits<impl_SC>;
319+
#endif
312320

313321
LocalOrdinal offset = (comm->getRank() == 0) ? 2 : 3;
314322
GlobalOrdinal numGlobalRows = tpetra_rowmap->getGlobalNumElements();

packages/muelu/research/caglusa/Tpetra_HierarchicalOperator_decl.hpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,11 @@ class HierarchicalOperator : public Tpetra::OperatorWithDiagonal<Scalar, LocalOr
7373
using row_matrix_type = RowMatrix<Scalar, LocalOrdinal, GlobalOrdinal, Node>;
7474

7575
using impl_scalar_type = typename row_matrix_type::impl_scalar_type;
76+
#if KOKKOS_VERSION > 40799
77+
using mag_type = typename KokkosKernels::ArithTraits<impl_scalar_type>::mag_type;
78+
#else
7679
using mag_type = typename Kokkos::ArithTraits<impl_scalar_type>::mag_type;
80+
#endif
7781

7882
using local_inds_device_view_type =
7983
typename row_matrix_type::local_inds_device_view_type;

packages/muelu/research/caglusa/Tpetra_HierarchicalOperator_def.hpp

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,9 +28,17 @@ removeSmallEntries(Teuchos::RCP<Tpetra::CrsMatrix<Scalar, LocalOrdinal, GlobalOr
2828
using col_idx_type = typename crs_matrix::local_graph_device_type::entries_type::non_const_type;
2929
using vals_type = typename crs_matrix::local_matrix_device_type::values_type;
3030

31+
#if KOKKOS_VERSION > 40799
32+
using ATS = KokkosKernels::ArithTraits<Scalar>;
33+
#else
3134
using ATS = Kokkos::ArithTraits<Scalar>;
35+
#endif
3236
using impl_SC = typename ATS::val_type;
37+
#if KOKKOS_VERSION > 40799
38+
using impl_ATS = KokkosKernels::ArithTraits<impl_SC>;
39+
#else
3340
using impl_ATS = Kokkos::ArithTraits<impl_SC>;
41+
#endif
3442

3543
auto lclA = A->getLocalMatrixDevice();
3644

packages/muelu/research/caglusa/Tpetra_OperatorWithDiagonal.hpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,11 @@ class OperatorWithDiagonal : public Tpetra::RowMatrix<Scalar, LocalOrdinal, Glob
3030
using row_matrix_type = RowMatrix<Scalar, LocalOrdinal, GlobalOrdinal, Node>;
3131

3232
using impl_scalar_type = typename row_matrix_type::impl_scalar_type;
33+
#if KOKKOS_VERSION > 40799
34+
using mag_type = typename KokkosKernels::ArithTraits<impl_scalar_type>::mag_type;
35+
#else
3336
using mag_type = typename Kokkos::ArithTraits<impl_scalar_type>::mag_type;
37+
#endif
3438

3539
using local_inds_device_view_type =
3640
typename row_matrix_type::local_inds_device_view_type;

packages/muelu/src/Graph/MatrixTransformation/MueLu_BoundaryDetection.hpp

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,11 @@
1313
#include <cstddef>
1414
#include <type_traits>
1515
#include "Kokkos_Core.hpp"
16+
#if KOKKOS_VERSION > 40799
17+
#include "KokkosKernels_ArithTraits.hpp"
18+
#else
1619
#include "Kokkos_ArithTraits.hpp"
20+
#endif
1721
#include "MueLu_LWGraph_kokkos.hpp"
1822
#include "MueLu_Utilities.hpp"
1923
#include "Teuchos_RCP.hpp"
@@ -37,7 +41,11 @@ class PointDirichletFunctor {
3741
using local_ordinal_type = typename local_matrix_type::ordinal_type;
3842
using memory_space = typename local_matrix_type::memory_space;
3943

44+
#if KOKKOS_VERSION > 40799
45+
using ATS = KokkosKernels::ArithTraits<scalar_type>;
46+
#else
4047
using ATS = Kokkos::ArithTraits<scalar_type>;
48+
#endif
4149
using magnitudeType = typename ATS::magnitudeType;
4250
using boundary_nodes_view = Kokkos::View<bool*, memory_space>;
4351

@@ -87,7 +95,11 @@ class VectorDirichletFunctor {
8795
using local_ordinal_type = typename local_matrix_type::ordinal_type;
8896
using memory_space = typename local_matrix_type::memory_space;
8997

98+
#if KOKKOS_VERSION > 40799
99+
using ATS = KokkosKernels::ArithTraits<scalar_type>;
100+
#else
90101
using ATS = Kokkos::ArithTraits<scalar_type>;
102+
#endif
91103
using magnitudeType = typename ATS::magnitudeType;
92104
using boundary_nodes_view = Kokkos::View<bool*, memory_space>;
93105

@@ -152,9 +164,17 @@ class RowSumFunctor {
152164
using local_ordinal_type = typename local_matrix_type::ordinal_type;
153165
using memory_space = typename local_matrix_type::memory_space;
154166

167+
#if KOKKOS_VERSION > 40799
168+
using ATS = KokkosKernels::ArithTraits<scalar_type>;
169+
#else
155170
using ATS = Kokkos::ArithTraits<scalar_type>;
171+
#endif
156172
using magnitudeType = typename ATS::magnitudeType;
173+
#if KOKKOS_VERSION > 40799
174+
using magATS = KokkosKernels::ArithTraits<magnitudeType>;
175+
#else
157176
using magATS = Kokkos::ArithTraits<magnitudeType>;
177+
#endif
158178
using boundary_nodes_view = Kokkos::View<bool*, memory_space>;
159179

160180
local_matrix_type A;

packages/muelu/src/Graph/MatrixTransformation/MueLu_ClassicalDropping.hpp

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,11 @@
1212

1313
#include "MueLu_DroppingCommon.hpp"
1414
#include "Kokkos_Core.hpp"
15+
#if KOKKOS_VERSION > 40799
16+
#include "KokkosKernels_ArithTraits.hpp"
17+
#else
1518
#include "Kokkos_ArithTraits.hpp"
19+
#endif
1620
#include "Xpetra_Matrix.hpp"
1721
#include "MueLu_Utilities.hpp"
1822

@@ -55,9 +59,17 @@ class DropFunctor {
5559

5660
using results_view = Kokkos::View<DecisionType*, memory_space>;
5761

62+
#if KOKKOS_VERSION > 40799
63+
using ATS = KokkosKernels::ArithTraits<scalar_type>;
64+
#else
5865
using ATS = Kokkos::ArithTraits<scalar_type>;
66+
#endif
5967
using magnitudeType = typename ATS::magnitudeType;
68+
#if KOKKOS_VERSION > 40799
69+
using mATS = KokkosKernels::ArithTraits<magnitudeType>;
70+
#else
6071
using mATS = Kokkos::ArithTraits<magnitudeType>;
72+
#endif
6173
using boundary_nodes_view = Kokkos::View<const bool*, memory_space>;
6274

6375
private:

packages/muelu/src/Graph/MatrixTransformation/MueLu_CoalesceDropFactory_def.hpp

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -556,9 +556,17 @@ void CoalesceDropFactory<Scalar, LocalOrdinal, GlobalOrdinal, Node>::Build(Level
556556
using ExecSpace = typename Node::execution_space;
557557
using TeamPol = Kokkos::TeamPolicy<ExecSpace>;
558558
using TeamMem = typename TeamPol::member_type;
559+
#if KOKKOS_VERSION > 40799
560+
using ATS = KokkosKernels::ArithTraits<Scalar>;
561+
#else
559562
using ATS = Kokkos::ArithTraits<Scalar>;
563+
#endif
560564
using impl_scalar_type = typename ATS::val_type;
565+
#if KOKKOS_VERSION > 40799
566+
using implATS = KokkosKernels::ArithTraits<impl_scalar_type>;
567+
#else
561568
using implATS = Kokkos::ArithTraits<impl_scalar_type>;
569+
#endif
562570

563571
// move from host to device
564572
auto ghostedDiagValsView = Kokkos::subview(ghostedDiag->getLocalViewDevice(Xpetra::Access::ReadOnly), Kokkos::ALL(), 0);

packages/muelu/src/Graph/MatrixTransformation/MueLu_CutDrop.hpp

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,11 @@
1111
#define MUELU_CUTDROP_HPP
1212

1313
#include "Kokkos_Core.hpp"
14+
#if KOKKOS_VERSION > 40799
15+
#include "KokkosKernels_ArithTraits.hpp"
16+
#else
1417
#include "Kokkos_ArithTraits.hpp"
18+
#endif
1519
#include "MueLu_DroppingCommon.hpp"
1620
#include "MueLu_Utilities.hpp"
1721
#include "Xpetra_Matrix.hpp"
@@ -45,7 +49,11 @@ class UnscaledComparison {
4549
results_view results;
4650

4751
private:
52+
#if KOKKOS_VERSION > 40799
53+
using ATS = KokkosKernels::ArithTraits<scalar_type>;
54+
#else
4855
using ATS = Kokkos::ArithTraits<scalar_type>;
56+
#endif
4957
using magnitudeType = typename ATS::magnitudeType;
5058

5159
public:
@@ -61,7 +69,11 @@ class UnscaledComparison {
6169
using memory_space = typename local_matrix_type2::memory_space;
6270
using results_view = Kokkos::View<DecisionType*, memory_space>;
6371

72+
#if KOKKOS_VERSION > 40799
73+
using ATS = KokkosKernels::ArithTraits<scalar_type>;
74+
#else
6475
using ATS = Kokkos::ArithTraits<scalar_type>;
76+
#endif
6577
using magnitudeType = typename ATS::magnitudeType;
6678

6779
const local_matrix_type2 A;
@@ -129,7 +141,11 @@ class ScaledComparison {
129141
results_view results;
130142

131143
private:
144+
#if KOKKOS_VERSION > 40799
145+
using ATS = KokkosKernels::ArithTraits<scalar_type>;
146+
#else
132147
using ATS = Kokkos::ArithTraits<scalar_type>;
148+
#endif
133149
using magnitudeType = typename ATS::magnitudeType;
134150

135151
Teuchos::RCP<diag_vec_type> diagVec;
@@ -158,9 +174,17 @@ class ScaledComparison {
158174
using memory_space = typename local_matrix_type2::memory_space;
159175
using results_view = Kokkos::View<DecisionType*, memory_space>;
160176

177+
#if KOKKOS_VERSION > 40799
178+
using ATS = KokkosKernels::ArithTraits<scalar_type>;
179+
#else
161180
using ATS = Kokkos::ArithTraits<scalar_type>;
181+
#endif
162182
using magnitudeType = typename ATS::magnitudeType;
183+
#if KOKKOS_VERSION > 40799
184+
using mATS = KokkosKernels::ArithTraits<magnitudeType>;
185+
#else
163186
using mATS = Kokkos::ArithTraits<magnitudeType>;
187+
#endif
164188

165189
const local_matrix_type2 A;
166190
const diag_view_type2 diag;
@@ -257,7 +281,11 @@ class UnscaledDistanceLaplacianComparison {
257281
results_view results;
258282

259283
private:
284+
#if KOKKOS_VERSION > 40799
285+
using ATS = KokkosKernels::ArithTraits<scalar_type>;
286+
#else
260287
using ATS = Kokkos::ArithTraits<scalar_type>;
288+
#endif
261289
using magnitudeType = typename ATS::magnitudeType;
262290

263291
Teuchos::RCP<diag_vec_type> diagVec;
@@ -283,7 +311,11 @@ class UnscaledDistanceLaplacianComparison {
283311
using memory_space = typename local_matrix_type2::memory_space;
284312
using results_view = Kokkos::View<DecisionType*, memory_space>;
285313

314+
#if KOKKOS_VERSION > 40799
315+
using ATS = KokkosKernels::ArithTraits<scalar_type>;
316+
#else
286317
using ATS = Kokkos::ArithTraits<scalar_type>;
318+
#endif
287319
using magnitudeType = typename ATS::magnitudeType;
288320

289321
const local_matrix_type2 A;
@@ -367,7 +399,11 @@ class ScaledDistanceLaplacianComparison {
367399
results_view results;
368400

369401
private:
402+
#if KOKKOS_VERSION > 40799
403+
using ATS = KokkosKernels::ArithTraits<scalar_type>;
404+
#else
370405
using ATS = Kokkos::ArithTraits<scalar_type>;
406+
#endif
371407
using magnitudeType = typename ATS::magnitudeType;
372408

373409
Teuchos::RCP<diag_vec_type> diagVec;
@@ -399,9 +435,17 @@ class ScaledDistanceLaplacianComparison {
399435
using memory_space = typename local_matrix_type2::memory_space;
400436
using results_view = Kokkos::View<DecisionType*, memory_space>;
401437

438+
#if KOKKOS_VERSION > 40799
439+
using ATS = KokkosKernels::ArithTraits<scalar_type>;
440+
#else
402441
using ATS = Kokkos::ArithTraits<scalar_type>;
442+
#endif
403443
using magnitudeType = typename ATS::magnitudeType;
444+
#if KOKKOS_VERSION > 40799
445+
using mATS = KokkosKernels::ArithTraits<magnitudeType>;
446+
#else
404447
using mATS = Kokkos::ArithTraits<magnitudeType>;
448+
#endif
405449

406450
const local_matrix_type2 A;
407451
const diag_view_type2 diag;
@@ -512,7 +556,11 @@ class CutDropFunctor {
512556
using memory_space = typename local_matrix_type::memory_space;
513557
using results_view = Kokkos::View<DecisionType*, memory_space>;
514558

559+
#if KOKKOS_VERSION > 40799
560+
using ATS = KokkosKernels::ArithTraits<scalar_type>;
561+
#else
515562
using ATS = Kokkos::ArithTraits<scalar_type>;
563+
#endif
516564
using magnitudeType = typename ATS::magnitudeType;
517565
using boundary_nodes_view = Kokkos::View<const bool*, memory_space>;
518566

0 commit comments

Comments
 (0)