Skip to content

Commit ffb40f0

Browse files
committed
amesos2: 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 4467ed5 commit ffb40f0

File tree

2 files changed

+12
-0
lines changed

2 files changed

+12
-0
lines changed

packages/amesos2/src/Amesos2_SolverCore_def.hpp

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,11 @@
1919
#ifndef AMESOS2_SOLVERCORE_DEF_HPP
2020
#define AMESOS2_SOLVERCORE_DEF_HPP
2121

22+
#if KOKKOS_VERSION > 40799
23+
#include "KokkosKernels_ArithTraits.hpp"
24+
#else
2225
#include "Kokkos_ArithTraits.hpp"
26+
#endif
2327

2428
#include "Amesos2_MatrixAdapter_def.hpp"
2529
#include "Amesos2_MultiVecAdapter_def.hpp"
@@ -238,7 +242,11 @@ SolverCore<ConcreteSolver,Matrix,Vector>::solve_ir(const Teuchos::Ptr< Vect
238242
const int maxNumIters,
239243
const bool verbose) const
240244
{
245+
#if KOKKOS_VERSION > 40799
246+
using KAT = KokkosKernels::ArithTraits<scalar_type>;
247+
#else
241248
using KAT = Kokkos::ArithTraits<scalar_type>;
249+
#endif
242250
using impl_scalar_type = typename KAT::val_type;
243251
using magni_type = typename KAT::mag_type;
244252
using host_execution_space = Kokkos::DefaultHostExecutionSpace;

packages/amesos2/src/Amesos2_Util.hpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -394,7 +394,11 @@ namespace Amesos2 {
394394
EStorage_Ordering ordering)
395395
{
396396
typedef typename M::global_ordinal_t mat_go_t;
397+
#if KOKKOS_VERSION > 40799
398+
typedef typename KokkosKernels::ArithTraits<typename M::scalar_t>::val_type mat_scalar_t;
399+
#else
397400
typedef typename Kokkos::ArithTraits<typename M::scalar_t>::val_type mat_scalar_t;
401+
#endif
398402
typedef typename Kokkos::View<mat_scalar_t*, Kokkos::HostSpace> KV_TMP;
399403
size_t i, size = nzvals.extent(0);
400404
KV_TMP nzvals_tmp(Kokkos::ViewAllocateWithoutInitializing("nzvals_tmp"), size);

0 commit comments

Comments
 (0)