Skip to content

Commit a298989

Browse files
ndellingwoodeeprude
authored andcommitted
panzer: 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 acbb1dc commit a298989

File tree

6 files changed

+36
-0
lines changed

6 files changed

+36
-0
lines changed

packages/panzer/disc-fe/src/Panzer_Interpolation.cpp

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

36+
#if KOKKOS_VERSION > 40799
37+
using ATS = KokkosKernels::ArithTraits<Scalar>;
38+
#else
3639
using ATS = Kokkos::ArithTraits<Scalar>;
40+
#endif
3741
using impl_SC = typename ATS::val_type;
42+
#if KOKKOS_VERSION > 40799
43+
using impl_ATS = KokkosKernels::ArithTraits<impl_SC>;
44+
#else
3845
using impl_ATS = Kokkos::ArithTraits<impl_SC>;
46+
#endif
3947

4048
auto lclA = A->getLocalMatrixDevice();
4149

@@ -159,7 +167,11 @@ Teuchos::RCP<Thyra::LinearOpBase<double> > buildInterpolation(const Teuchos::RCP
159167
using Scalar = double;
160168

161169
using STS = Teuchos::ScalarTraits<Scalar>;
170+
#if KOKKOS_VERSION > 40799
171+
using KAT = KokkosKernels::ArithTraits<Scalar>;
172+
#else
162173
using KAT = Kokkos::ArithTraits<Scalar>;
174+
#endif
163175
using OT = Teuchos::OrdinalTraits<GlobalOrdinal>;
164176

165177
using DeviceSpace = PHX::Device;

packages/panzer/mini-em/src/closures/MiniEM_DarcyAnalyticForcing_impl.hpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,11 @@
1717
#include "Panzer_GatherBasisCoordinates.hpp"
1818

1919
#include "Panzer_Traits.hpp"
20+
#if KOKKOS_VERSION > 40799
21+
#include "KokkosKernels_ArithTraits.hpp"
22+
#else
2023
#include "Kokkos_ArithTraits.hpp"
24+
#endif
2125
#include "Kokkos_MathematicalConstants.hpp"
2226
#include "Kokkos_MathematicalFunctions.hpp"
2327

packages/panzer/mini-em/src/closures/MiniEM_DarcyAnalyticSolution_impl.hpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,11 @@
1717
#include "Panzer_GatherBasisCoordinates.hpp"
1818

1919
#include "Panzer_Traits.hpp"
20+
#if KOKKOS_VERSION > 40799
21+
#include "KokkosKernels_ArithTraits.hpp"
22+
#else
2023
#include "Kokkos_ArithTraits.hpp"
24+
#endif
2125
#include "Kokkos_MathematicalConstants.hpp"
2226
#include "Kokkos_MathematicalFunctions.hpp"
2327

packages/panzer/mini-em/src/closures/MiniEM_MaxwellAnalyticForcing_impl.hpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,11 @@
1717
#include "Panzer_GatherBasisCoordinates.hpp"
1818

1919
#include "Panzer_Traits.hpp"
20+
#if KOKKOS_VERSION > 40799
21+
#include "KokkosKernels_ArithTraits.hpp"
22+
#else
2023
#include "Kokkos_ArithTraits.hpp"
24+
#endif
2125
#include "Kokkos_MathematicalConstants.hpp"
2226
#include "Kokkos_MathematicalFunctions.hpp"
2327

packages/panzer/mini-em/src/closures/MiniEM_MaxwellAnalyticSolution_impl.hpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,11 @@
1717
#include "Panzer_GatherBasisCoordinates.hpp"
1818

1919
#include "Panzer_Traits.hpp"
20+
#if KOKKOS_VERSION > 40799
21+
#include "KokkosKernels_ArithTraits.hpp"
22+
#else
2023
#include "Kokkos_ArithTraits.hpp"
24+
#endif
2125
#include "Kokkos_MathematicalConstants.hpp"
2226
#include "Kokkos_MathematicalFunctions.hpp"
2327

packages/panzer/mini-em/src/closures/MiniEM_RandomForcing_impl.hpp

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,11 @@
2121
#include "Panzer_Traits.hpp"
2222
#include "Kokkos_Random.hpp"
2323
#include "MiniEM_Sacado_Kokkos_Random.hpp"
24+
#if KOKKOS_VERSION > 40799
25+
#include "KokkosKernels_ArithTraits.hpp"
26+
#else
2427
#include "Kokkos_ArithTraits.hpp"
28+
#endif
2529

2630

2731
namespace mini_em {
@@ -74,7 +78,11 @@ void RandomForcing<EvalT,Traits>::evaluateFields(typename Traits::EvalData works
7478

7579
// double time = workset.time;
7680

81+
#if KOKKOS_VERSION > 40799
82+
using IST = typename KokkosKernels::ArithTraits<ScalarT>::val_type;
83+
#else
7784
using IST = typename Kokkos::ArithTraits<ScalarT>::val_type;
85+
#endif
7886

7987
const IST max = static_cast<IST>(rangeMin_);
8088
const IST min = static_cast<IST>(rangeMax_);

0 commit comments

Comments
 (0)