From 3201dea2e419f31c121646020ae29595ca25d53d Mon Sep 17 00:00:00 2001 From: kliegeois Date: Thu, 4 Nov 2021 08:33:32 -0600 Subject: [PATCH] Update of the GMRES PR --- .../dense/impl/KokkosBatched_Dot_Internal.hpp | 12 +-- .../sparse/KokkosBatched_CrsMatrix.hpp | 12 ++- .../impl/KokkosBatched_CG_TeamVector_Impl.hpp | 12 +-- .../impl/KokkosBatched_CG_Team_Impl.hpp | 12 +-- .../KokkosBatched_GMRES_TeamVector_Impl.hpp | 87 +++++++++--------- .../impl/KokkosBatched_GMRES_Team_Impl.hpp | 89 ++++++++++--------- test_common/KokkosKernels_TestUtils.hpp | 26 ++++++ .../batched/dense/Test_Batched_SerialAxpy.hpp | 21 ++--- .../batched/dense/Test_Batched_SerialGemm.hpp | 14 +-- .../batched/dense/Test_Batched_SerialGemv.hpp | 14 +-- .../dense/Test_Batched_SerialInverseLU.hpp | 42 ++------- .../batched/dense/Test_Batched_SerialLU.hpp | 14 +-- .../dense/Test_Batched_SerialMatUtil.hpp | 12 +-- .../dense/Test_Batched_SerialSolveLU.hpp | 42 ++------- .../batched/dense/Test_Batched_SerialTrmm.hpp | 14 +-- .../batched/dense/Test_Batched_SerialTrsm.hpp | 14 +-- .../batched/dense/Test_Batched_SerialTrsv.hpp | 14 +-- .../dense/Test_Batched_SerialTrtri.hpp | 14 +-- .../batched/dense/Test_Batched_TeamAxpy.hpp | 21 ++--- .../batched/dense/Test_Batched_TeamGemm.hpp | 14 +-- .../batched/dense/Test_Batched_TeamGemv.hpp | 14 +-- .../dense/Test_Batched_TeamInverseLU.hpp | 42 ++------- .../batched/dense/Test_Batched_TeamLU.hpp | 14 +-- .../dense/Test_Batched_TeamMatUtil.hpp | 12 +-- .../dense/Test_Batched_TeamSolveLU.hpp | 42 ++------- .../batched/dense/Test_Batched_TeamTrsm.hpp | 14 +-- .../batched/dense/Test_Batched_TeamTrsv.hpp | 14 +-- .../dense/Test_Batched_TeamVectorAxpy.hpp | 21 ++--- .../dense/Test_Batched_TeamVectorGemm.hpp | 14 +-- .../dense/Test_Batched_TeamVectorQR.hpp | 14 +-- ...atched_TeamVectorQR_WithColumnPivoting.hpp | 14 +-- .../dense/Test_Batched_TeamVectorSolveUTV.hpp | 14 +-- .../Test_Batched_TeamVectorSolveUTV2.hpp | 14 +-- .../dense/Test_Batched_TeamVectorUTV.hpp | 14 +-- .../sparse/Test_Batched_SerialSpmv.hpp | 14 +-- .../sparse/Test_Batched_SparseUtils.hpp | 8 +- .../batched/sparse/Test_Batched_TeamCG.hpp | 22 +---- .../batched/sparse/Test_Batched_TeamGMRES.hpp | 32 ++----- .../batched/sparse/Test_Batched_TeamSpmv.hpp | 14 +-- .../sparse/Test_Batched_TeamVectorCG.hpp | 22 +---- .../sparse/Test_Batched_TeamVectorGMRES.hpp | 32 ++----- .../sparse/Test_Batched_TeamVectorSpmv.hpp | 14 +-- 42 files changed, 252 insertions(+), 663 deletions(-) diff --git a/src/batched/dense/impl/KokkosBatched_Dot_Internal.hpp b/src/batched/dense/impl/KokkosBatched_Dot_Internal.hpp index 642a3fed6c..2f8662d00f 100644 --- a/src/batched/dense/impl/KokkosBatched_Dot_Internal.hpp +++ b/src/batched/dense/impl/KokkosBatched_Dot_Internal.hpp @@ -34,11 +34,13 @@ struct SerialDotInternal { // j \in [0,n), i \in [0,m) // C(j) = conj(A(:,j))*B(:,j) template - KOKKOS_FORCEINLINE_FUNCTION static int invoke( - const int m, const int n, const ValueType *__restrict__ A, const int as0, - const int as1, const ValueType *__restrict__ B, const int bs0, - const int bs1, - /* */ MagnitudeType *__restrict__ C, const int cs) { + KOKKOS_INLINE_FUNCTION static int invoke(const int m, const int n, + const ValueType *__restrict__ A, + const int as0, const int as1, + const ValueType *__restrict__ B, + const int bs0, const int bs1, + /* */ MagnitudeType *__restrict__ C, + const int cs) { for (int j = 0; j < n; ++j) invoke(m, A + j * as1, as0, B + j * bs1, bs0, C + j * cs); return 0; diff --git a/src/batched/sparse/KokkosBatched_CrsMatrix.hpp b/src/batched/sparse/KokkosBatched_CrsMatrix.hpp index f4bda1aa9e..5448c4684c 100644 --- a/src/batched/sparse/KokkosBatched_CrsMatrix.hpp +++ b/src/batched/sparse/KokkosBatched_CrsMatrix.hpp @@ -64,6 +64,8 @@ class CrsMatrix { IntViewType row_ptr; IntViewType colIndices; int n_operators; + int n_rows; + int n_colums; public: KOKKOS_INLINE_FUNCTION @@ -71,11 +73,15 @@ class CrsMatrix { const IntViewType &_colIndices) : values(_values), row_ptr(_row_ptr), colIndices(_colIndices) { n_operators = _values.extent(0); + n_rows = _row_ptr.extent(0) - 1; + n_colums = n_rows; } + KOKKOS_INLINE_FUNCTION ~CrsMatrix() {} - /// \brief apply + /// \brief apply version that uses constant coefficients alpha and beta + /// /// y_l <- alpha * A_l * x_l + beta * y_l for all l = 1, ..., N /// where: /// * N is the number of matrices, @@ -115,7 +121,7 @@ class CrsMatrix { member, alpha, values, row_ptr, colIndices, X, beta, Y); } - /// \brief apply + /// \brief apply version that uses variable coefficient alpha and no beta /// y_l <- alpha_l * A_l * x_l for all l = 1, ..., N /// where: /// * N is the number of matrices, @@ -147,7 +153,7 @@ class CrsMatrix { Y); } - /// \brief apply + /// \brief apply version that uses variable coefficients alpha and beta /// y_l <- alpha_l * A_l * x_l + beta_l * y_l for all l = 1, ..., N /// where: /// * N is the number of matrices, diff --git a/src/batched/sparse/impl/KokkosBatched_CG_TeamVector_Impl.hpp b/src/batched/sparse/impl/KokkosBatched_CG_TeamVector_Impl.hpp index b1356ec8f9..960780b54d 100644 --- a/src/batched/sparse/impl/KokkosBatched_CG_TeamVector_Impl.hpp +++ b/src/batched/sparse/impl/KokkosBatched_CG_TeamVector_Impl.hpp @@ -70,9 +70,6 @@ struct TeamVectorCG { typedef int OrdinalType; typedef typename Kokkos::Details::ArithTraits< typename VectorViewType::non_const_value_type>::mag_type MagnitudeType; - typedef Kokkos::View - NormViewType; const size_t maximum_iteration = handle->get_max_iteration(); const MagnitudeType tolerance = handle->get_tolerance(); @@ -104,9 +101,6 @@ struct TeamVectorCG { // Deep copy of b into r_0: TeamVectorCopy::invoke(member, _B, R); - Kokkos::parallel_for(Kokkos::TeamVectorRange(member, 0, numMatrices), - [&](const OrdinalType& i) { mask(i) = 1.; }); - // r_0 := b - A x_0 member.team_barrier(); A.template apply::invoke(member, R, R, sqr_norm_0); member.team_barrier(); + Kokkos::parallel_for(Kokkos::TeamVectorRange(member, 0, numMatrices), + [&](const OrdinalType& i) { + mask(i) = + sqr_norm_0(i) > tolerance * tolerance ? 1. : 0; + }); + TeamVectorCopy1D::invoke(member, sqr_norm_0, sqr_norm_j); int status = 1; diff --git a/src/batched/sparse/impl/KokkosBatched_CG_Team_Impl.hpp b/src/batched/sparse/impl/KokkosBatched_CG_Team_Impl.hpp index 6a416507f7..4444562750 100644 --- a/src/batched/sparse/impl/KokkosBatched_CG_Team_Impl.hpp +++ b/src/batched/sparse/impl/KokkosBatched_CG_Team_Impl.hpp @@ -69,9 +69,6 @@ struct TeamCG { typedef int OrdinalType; typedef typename Kokkos::Details::ArithTraits< typename VectorViewType::non_const_value_type>::mag_type MagnitudeType; - typedef Kokkos::View - NormViewType; size_t maximum_iteration = handle->get_max_iteration(); const MagnitudeType tolerance = handle->get_tolerance(); @@ -103,9 +100,6 @@ struct TeamCG { // Deep copy of b into r_0: TeamCopy::invoke(member, _B, R); - Kokkos::parallel_for(Kokkos::TeamThreadRange(member, 0, numMatrices), - [&](const OrdinalType& i) { mask(i) = 1.; }); - // r_0 := b - A x_0 member.team_barrier(); A.template apply::invoke(member, R, R, sqr_norm_0); member.team_barrier(); + Kokkos::parallel_for(Kokkos::TeamThreadRange(member, 0, numMatrices), + [&](const OrdinalType& i) { + mask(i) = + sqr_norm_0(i) > tolerance * tolerance ? 1. : 0; + }); + TeamCopy1D::invoke(member, sqr_norm_0, sqr_norm_j); int status = 1; diff --git a/src/batched/sparse/impl/KokkosBatched_GMRES_TeamVector_Impl.hpp b/src/batched/sparse/impl/KokkosBatched_GMRES_TeamVector_Impl.hpp index 625952982c..f9d84ffd77 100644 --- a/src/batched/sparse/impl/KokkosBatched_GMRES_TeamVector_Impl.hpp +++ b/src/batched/sparse/impl/KokkosBatched_GMRES_TeamVector_Impl.hpp @@ -73,12 +73,6 @@ struct TeamVectorGMRES { typedef typename Kokkos::Details::ArithTraits< typename VectorViewType::non_const_value_type>::mag_type MagnitudeType; typedef Kokkos::Details::ArithTraits ATM; - typedef Kokkos::View - NormViewType; - - size_t maximum_iteration = handle->get_max_iteration(); - const MagnitudeType tolerance = handle->get_tolerance(); using ScratchPadNormViewType = Kokkos::View< MagnitudeType*, @@ -96,6 +90,12 @@ struct TeamVectorGMRES { const OrdinalType numMatrices = _X.extent(0); const OrdinalType numRows = _X.extent(1); + size_t maximum_iteration = handle->get_max_iteration() < numRows + ? handle->get_max_iteration() + : numRows; + const MagnitudeType tolerance = handle->get_tolerance(); + const MagnitudeType max_tolerance = 0.; + ScratchPadMultiVectorViewType V(member.team_scratch(1), numMatrices, maximum_iteration + 1, numRows); ScratchPadMultiVectorViewType H(member.team_scratch(1), numMatrices, @@ -134,8 +134,8 @@ struct TeamVectorGMRES { Kokkos::parallel_for(Kokkos::TeamVectorRange(member, 0, numMatrices), [&](const OrdinalType& i) { beta(i) = ATM::sqrt(beta(i)); - G(i, 0) = beta(i); - tmp(i) = 1. / beta(i); + G(i, 0) = beta(i) > max_tolerance ? beta(i) : 0.; + tmp(i) = beta(i) > max_tolerance ? 1. / beta(i) : 0.; }); Kokkos::parallel_for( @@ -174,14 +174,14 @@ struct TeamVectorGMRES { } TeamVectorDot::invoke(member, W, W, tmp); + member.team_barrier(); Kokkos::parallel_for( Kokkos::TeamVectorRange(member, 0, numMatrices), - [&](const OrdinalType& i) { tmp(i) = ATM::sqrt(tmp(i)); }); + [&](const OrdinalType& i) { + H(i, j + 1, j) = ATM::sqrt(tmp(i)); + tmp(i) = H(i, j + 1, j) > max_tolerance ? 1. / H(i, j + 1, j) : 0.; + }); member.team_barrier(); - TeamVectorCopy1D::invoke(member, tmp, - Kokkos::subview(H, Kokkos::ALL, j + 1, j)); - Kokkos::parallel_for(Kokkos::TeamVectorRange(member, 0, numMatrices), - [&](const OrdinalType& i) { tmp(i) = 1. / tmp(i); }); Kokkos::parallel_for( Kokkos::TeamVectorRange(member, 0, numMatrices * numRows), [&](const OrdinalType& iTemp) { @@ -197,38 +197,39 @@ struct TeamVectorGMRES { // Apply the previous Givens rotations: auto H_j = Kokkos::subview(H, l, Kokkos::ALL, j); - for (size_t i = 0; i < j; ++i) { + if (mask(l) == 1.) { + for (size_t i = 0; i < j; ++i) { + auto tmp1 = + Givens(l, i, 0) * H_j(i) + Givens(l, i, 1) * H_j(i + 1); + auto tmp2 = + -Givens(l, i, 1) * H_j(i) + Givens(l, i, 0) * H_j(i + 1); + H_j(i) = tmp1; + H_j(i + 1) = tmp2; + } + + // Compute the new Givens rotation: + Kokkos::pair + G_new; + typename VectorViewType::non_const_value_type alpha; + SerialGivensInternal::invoke(H_j(j), H_j(j + 1), &G_new, &alpha); + + Givens(l, j, 0) = G_new.first; + Givens(l, j, 1) = G_new.second; + + // Apply the new Givens rotation: auto tmp1 = - Givens(l, i, 0) * H_j(i) + Givens(l, i, 1) * H_j(i + 1); + Givens(l, j, 0) * H_j(j) + Givens(l, j, 1) * H_j(j + 1); auto tmp2 = - -Givens(l, i, 1) * H_j(i) + Givens(l, i, 0) * H_j(i + 1); - H_j(i) = tmp1; - H_j(i + 1) = tmp2; - } - - // Compute the new Givens rotation: - Kokkos::pair - G_new; - typename VectorViewType::non_const_value_type alpha; - SerialGivensInternal::invoke(H_j(j), H_j(j + 1), &G_new, &alpha); - - Givens(l, j, 0) = G_new.first; - Givens(l, j, 1) = G_new.second; - - // Apply the new Givens rotation: - auto tmp1 = Givens(l, j, 0) * H_j(j) + Givens(l, j, 1) * H_j(j + 1); - auto tmp2 = - -Givens(l, j, 1) * H_j(j) + Givens(l, j, 0) * H_j(j + 1); - H_j(j) = tmp1; - H_j(j + 1) = tmp2; - - G(l, j + 1) = -Givens(l, j, 1) * G(l, j); - G(l, j) *= Givens(l, j, 0); - - if (mask(l) == 0.) { - H_j(j) = 1.; - G(l, j) = 0.; + -Givens(l, j, 1) * H_j(j) + Givens(l, j, 0) * H_j(j + 1); + H_j(j) = tmp1; + H_j(j + 1) = tmp2; + + G(l, j + 1) = -Givens(l, j, 1) * G(l, j); + G(l, j) *= Givens(l, j, 0); + } else { + H_j(j) = 1.; + G(l, j + 1) = 0.; } if (mask(l) == 1. && std::abs(G(l, j + 1)) / beta(l) < tolerance) { diff --git a/src/batched/sparse/impl/KokkosBatched_GMRES_Team_Impl.hpp b/src/batched/sparse/impl/KokkosBatched_GMRES_Team_Impl.hpp index a6dcf36e1e..2d862ab708 100644 --- a/src/batched/sparse/impl/KokkosBatched_GMRES_Team_Impl.hpp +++ b/src/batched/sparse/impl/KokkosBatched_GMRES_Team_Impl.hpp @@ -72,12 +72,6 @@ struct TeamGMRES { typedef typename Kokkos::Details::ArithTraits< typename VectorViewType::non_const_value_type>::mag_type MagnitudeType; typedef Kokkos::Details::ArithTraits ATM; - typedef Kokkos::View - NormViewType; - - size_t maximum_iteration = handle->get_max_iteration(); - const MagnitudeType tolerance = handle->get_tolerance(); using ScratchPadNormViewType = Kokkos::View< MagnitudeType*, @@ -95,6 +89,12 @@ struct TeamGMRES { const OrdinalType numMatrices = _X.extent(0); const OrdinalType numRows = _X.extent(1); + size_t maximum_iteration = handle->get_max_iteration() < numRows + ? handle->get_max_iteration() + : numRows; + const MagnitudeType tolerance = handle->get_tolerance(); + const MagnitudeType max_tolerance = 0.; + ScratchPadMultiVectorViewType V(member.team_scratch(1), numMatrices, maximum_iteration + 1, numRows); ScratchPadMultiVectorViewType H(member.team_scratch(1), numMatrices, @@ -133,8 +133,8 @@ struct TeamGMRES { Kokkos::parallel_for(Kokkos::TeamThreadRange(member, 0, numMatrices), [&](const OrdinalType& i) { beta(i) = ATM::sqrt(beta(i)); - G(i, 0) = beta(i); - tmp(i) = 1. / beta(i); + G(i, 0) = beta(i) > max_tolerance ? beta(i) : 0.; + tmp(i) = beta(i) > max_tolerance ? 1. / beta(i) : 0.; }); Kokkos::parallel_for( @@ -161,6 +161,7 @@ struct TeamGMRES { for (size_t i = 0; i < j + 1; ++i) { auto V_i = Kokkos::subview(V, Kokkos::ALL, i, Kokkos::ALL); TeamDot::invoke(member, W, V_i, tmp); + member.team_barrier(); TeamCopy1D::invoke(member, tmp, Kokkos::subview(H, Kokkos::ALL, i, j)); Kokkos::parallel_for( @@ -171,13 +172,14 @@ struct TeamGMRES { } TeamDot::invoke(member, W, W, tmp); + member.team_barrier(); Kokkos::parallel_for( Kokkos::TeamThreadRange(member, 0, numMatrices), - [&](const OrdinalType& i) { tmp(i) = ATM::sqrt(tmp(i)); }); - TeamCopy1D::invoke(member, tmp, - Kokkos::subview(H, Kokkos::ALL, j + 1, j)); - Kokkos::parallel_for(Kokkos::TeamThreadRange(member, 0, numMatrices), - [&](const OrdinalType& i) { tmp(i) = 1. / tmp(i); }); + [&](const OrdinalType& i) { + H(i, j + 1, j) = ATM::sqrt(tmp(i)); + tmp(i) = H(i, j + 1, j) > max_tolerance ? 1. / H(i, j + 1, j) : 0.; + }); + member.team_barrier(); Kokkos::parallel_for( Kokkos::TeamThreadRange(member, 0, numMatrices * numRows), [&](const OrdinalType& iTemp) { @@ -193,38 +195,39 @@ struct TeamGMRES { // Apply the previous Givens rotations: auto H_j = Kokkos::subview(H, l, Kokkos::ALL, j); - for (size_t i = 0; i < j; ++i) { + if (mask(l) == 1.) { + for (size_t i = 0; i < j; ++i) { + auto tmp1 = + Givens(l, i, 0) * H_j(i) + Givens(l, i, 1) * H_j(i + 1); + auto tmp2 = + -Givens(l, i, 1) * H_j(i) + Givens(l, i, 0) * H_j(i + 1); + H_j(i) = tmp1; + H_j(i + 1) = tmp2; + } + + // Compute the new Givens rotation: + Kokkos::pair + G_new; + typename VectorViewType::non_const_value_type alpha; + SerialGivensInternal::invoke(H_j(j), H_j(j + 1), &G_new, &alpha); + + Givens(l, j, 0) = G_new.first; + Givens(l, j, 1) = G_new.second; + + // Apply the new Givens rotation: auto tmp1 = - Givens(l, i, 0) * H_j(i) + Givens(l, i, 1) * H_j(i + 1); + Givens(l, j, 0) * H_j(j) + Givens(l, j, 1) * H_j(j + 1); auto tmp2 = - -Givens(l, i, 1) * H_j(i) + Givens(l, i, 0) * H_j(i + 1); - H_j(i) = tmp1; - H_j(i + 1) = tmp2; - } - - // Compute the new Givens rotation: - Kokkos::pair - G_new; - typename VectorViewType::non_const_value_type alpha; - SerialGivensInternal::invoke(H_j(j), H_j(j + 1), &G_new, &alpha); - - Givens(l, j, 0) = G_new.first; - Givens(l, j, 1) = G_new.second; - - // Apply the new Givens rotation: - auto tmp1 = Givens(l, j, 0) * H_j(j) + Givens(l, j, 1) * H_j(j + 1); - auto tmp2 = - -Givens(l, j, 1) * H_j(j) + Givens(l, j, 0) * H_j(j + 1); - H_j(j) = tmp1; - H_j(j + 1) = tmp2; - - G(l, j + 1) = -Givens(l, j, 1) * G(l, j); - G(l, j) *= Givens(l, j, 0); - - if (mask(l) == 0.) { - H_j(j) = 1.; - G(l, j) = 0.; + -Givens(l, j, 1) * H_j(j) + Givens(l, j, 0) * H_j(j + 1); + H_j(j) = tmp1; + H_j(j + 1) = tmp2; + + G(l, j + 1) = -Givens(l, j, 1) * G(l, j); + G(l, j) *= Givens(l, j, 0); + } else { + H_j(j) = 1.; + G(l, j + 1) = 0.; } if (mask(l) == 1. && std::abs(G(l, j + 1)) / beta(l) < tolerance) { diff --git a/test_common/KokkosKernels_TestUtils.hpp b/test_common/KokkosKernels_TestUtils.hpp index d472e2cee9..9cfb945b84 100644 --- a/test_common/KokkosKernels_TestUtils.hpp +++ b/test_common/KokkosKernels_TestUtils.hpp @@ -433,5 +433,31 @@ struct SharedParamTag { using transB = TB; using batchLayout = BL; }; + +/// \brief value_type_name returns a string with the value type name +template +KOKKOS_INLINE_FUNCTION std::string value_type_name() { + return "::UnknowValueType"; +} + +template <> +KOKKOS_INLINE_FUNCTION std::string value_type_name() { + return "::Float"; +} + +template <> +KOKKOS_INLINE_FUNCTION std::string value_type_name() { + return "::Double"; +} + +template <> +KOKKOS_INLINE_FUNCTION std::string value_type_name>() { + return "::ComplexFloat"; +} + +template <> +KOKKOS_INLINE_FUNCTION std::string value_type_name>() { + return "::ComplexDouble"; +} } // namespace Test #endif diff --git a/unit_test/batched/dense/Test_Batched_SerialAxpy.hpp b/unit_test/batched/dense/Test_Batched_SerialAxpy.hpp index 94f41aca97..a0f4a206ee 100644 --- a/unit_test/batched/dense/Test_Batched_SerialAxpy.hpp +++ b/unit_test/batched/dense/Test_Batched_SerialAxpy.hpp @@ -36,18 +36,8 @@ struct Functor_TestBatchedSerialAxpy { inline void run() { typedef typename ViewType::value_type value_type; std::string name_region("KokkosBatched::Test::SerialAxpy"); - std::string name_value_type = - (std::is_same::value - ? "::Float" - : std::is_same::value - ? "::Double" - : std::is_same >::value - ? "::ComplexFloat" - : std::is_same >::value - ? "::ComplexDouble" - : "::UnknownValueType"); - std::string name = name_region + name_value_type; + const std::string name_value_type = Test::value_type_name(); + std::string name = name_region + name_value_type; Kokkos::Profiling::pushRegion(name.c_str()); Kokkos::RangePolicy policy(0, _X.extent(0)); Kokkos::parallel_for(name.c_str(), policy, *this); @@ -58,6 +48,7 @@ struct Functor_TestBatchedSerialAxpy { template void impl_test_batched_axpy(const int N, const int BlkSize) { typedef typename ViewType::value_type value_type; + typedef typename ViewType::const_value_type const_value_type; typedef Kokkos::Details::ArithTraits ats; ViewType X0("x0", N, BlkSize), X1("x1", N, BlkSize), Y0("y0", N, BlkSize), @@ -67,9 +58,9 @@ void impl_test_batched_axpy(const int N, const int BlkSize) { Kokkos::Random_XorShift64_Pool random( 13718); - Kokkos::fill_random(X0, random, value_type(1.0)); - Kokkos::fill_random(Y0, random, value_type(1.0)); - Kokkos::fill_random(alpha, random, value_type(1.0)); + Kokkos::fill_random(X0, random, const_value_type(1.0)); + Kokkos::fill_random(Y0, random, const_value_type(1.0)); + Kokkos::fill_random(alpha, random, const_value_type(1.0)); Kokkos::fence(); diff --git a/unit_test/batched/dense/Test_Batched_SerialGemm.hpp b/unit_test/batched/dense/Test_Batched_SerialGemm.hpp index 37e171d227..6a8be3fc54 100644 --- a/unit_test/batched/dense/Test_Batched_SerialGemm.hpp +++ b/unit_test/batched/dense/Test_Batched_SerialGemm.hpp @@ -48,18 +48,8 @@ struct Functor_TestBatchedSerialGemm { inline void run() { typedef typename ViewType::value_type value_type; std::string name_region("KokkosBatched::Test::SerialGemm"); - std::string name_value_type = - (std::is_same::value - ? "::Float" - : std::is_same::value - ? "::Double" - : std::is_same >::value - ? "::ComplexFloat" - : std::is_same >::value - ? "::ComplexDouble" - : "::UnknownValueType"); - std::string name = name_region + name_value_type; + const std::string name_value_type = Test::value_type_name(); + std::string name = name_region + name_value_type; Kokkos::Profiling::pushRegion(name.c_str()); Kokkos::RangePolicy policy(0, _c.extent(0)); Kokkos::parallel_for(name.c_str(), policy, *this); diff --git a/unit_test/batched/dense/Test_Batched_SerialGemv.hpp b/unit_test/batched/dense/Test_Batched_SerialGemv.hpp index c9257f3618..eb1d8f285c 100644 --- a/unit_test/batched/dense/Test_Batched_SerialGemv.hpp +++ b/unit_test/batched/dense/Test_Batched_SerialGemv.hpp @@ -47,18 +47,8 @@ struct Functor_TestBatchedSerialGemv { inline void run() { typedef typename ViewType::value_type value_type; std::string name_region("KokkosBatched::Test::SerialGemv"); - std::string name_value_type = - (std::is_same::value - ? "::Float" - : std::is_same::value - ? "::Double" - : std::is_same >::value - ? "::ComplexFloat" - : std::is_same >::value - ? "::ComplexDouble" - : "::UnknownValueType"); - std::string name = name_region + name_value_type; + const std::string name_value_type = Test::value_type_name(); + std::string name = name_region + name_value_type; Kokkos::Profiling::pushRegion(name.c_str()); Kokkos::RangePolicy policy(0, _c.extent(0)); Kokkos::parallel_for(name.c_str(), policy, *this); diff --git a/unit_test/batched/dense/Test_Batched_SerialInverseLU.hpp b/unit_test/batched/dense/Test_Batched_SerialInverseLU.hpp index 2442e22dea..fd7d0478fc 100644 --- a/unit_test/batched/dense/Test_Batched_SerialInverseLU.hpp +++ b/unit_test/batched/dense/Test_Batched_SerialInverseLU.hpp @@ -54,18 +54,8 @@ struct Functor_BatchedSerialGemm { inline void run() { typedef typename ViewType::value_type value_type; std::string name_region("KokkosBatched::Test::SerialInverseLU"); - std::string name_value_type = - (std::is_same::value - ? "::Float" - : std::is_same::value - ? "::Double" - : std::is_same >::value - ? "::ComplexFloat" - : std::is_same >::value - ? "::ComplexDouble" - : "::UnknownValueType"); - std::string name = name_region + name_value_type; + const std::string name_value_type = Test::value_type_name(); + std::string name = name_region + name_value_type; Kokkos::Profiling::pushRegion(name.c_str()); Kokkos::RangePolicy policy(0, _c.extent(0)); Kokkos::parallel_for((name + "::GemmFunctor").c_str(), policy, *this); @@ -92,18 +82,8 @@ struct Functor_BatchedSerialLU { inline void run() { typedef typename ViewType::value_type value_type; std::string name_region("KokkosBatched::Test::SerialInverseLU"); - std::string name_value_type = - (std::is_same::value - ? "::Float" - : std::is_same::value - ? "::Double" - : std::is_same >::value - ? "::ComplexFloat" - : std::is_same >::value - ? "::ComplexDouble" - : "::UnknownValueType"); - std::string name = name_region + name_value_type; + const std::string name_value_type = Test::value_type_name(); + std::string name = name_region + name_value_type; Kokkos::Profiling::pushRegion(name.c_str()); Kokkos::RangePolicy policy(0, _a.extent(0)); Kokkos::parallel_for((name + "::LUFunctor").c_str(), policy, *this); @@ -132,18 +112,8 @@ struct Functor_TestBatchedSerialInverseLU { inline void run() { typedef typename AViewType::value_type value_type; std::string name_region("KokkosBatched::Test::SerialInverseLU"); - std::string name_value_type = - (std::is_same::value - ? "::Float" - : std::is_same::value - ? "::Double" - : std::is_same >::value - ? "::ComplexFloat" - : std::is_same >::value - ? "::ComplexDouble" - : "::UnknownValueType"); - std::string name = name_region + name_value_type; + const std::string name_value_type = Test::value_type_name(); + std::string name = name_region + name_value_type; Kokkos::Profiling::pushRegion(name.c_str()); Kokkos::RangePolicy policy(0, _a.extent(0)); Kokkos::parallel_for((name + "::InverseLUFunctor").c_str(), policy, *this); diff --git a/unit_test/batched/dense/Test_Batched_SerialLU.hpp b/unit_test/batched/dense/Test_Batched_SerialLU.hpp index b42bb2943a..9bb92340a2 100644 --- a/unit_test/batched/dense/Test_Batched_SerialLU.hpp +++ b/unit_test/batched/dense/Test_Batched_SerialLU.hpp @@ -34,18 +34,8 @@ struct Functor_TestBatchedSerialLU { inline void run() { typedef typename ViewType::value_type value_type; std::string name_region("KokkosBatched::Test::SerialLU"); - std::string name_value_type = - (std::is_same::value - ? "::Float" - : std::is_same::value - ? "::Double" - : std::is_same >::value - ? "::ComplexFloat" - : std::is_same >::value - ? "::ComplexDouble" - : "::UnknownValueType"); - std::string name = name_region + name_value_type; + const std::string name_value_type = Test::value_type_name(); + std::string name = name_region + name_value_type; Kokkos::Profiling::pushRegion(name.c_str()); Kokkos::RangePolicy policy(0, _a.extent(0)); Kokkos::parallel_for(name.c_str(), policy, *this); diff --git a/unit_test/batched/dense/Test_Batched_SerialMatUtil.hpp b/unit_test/batched/dense/Test_Batched_SerialMatUtil.hpp index 79c9d9b2f7..f9a58f5442 100644 --- a/unit_test/batched/dense/Test_Batched_SerialMatUtil.hpp +++ b/unit_test/batched/dense/Test_Batched_SerialMatUtil.hpp @@ -62,17 +62,7 @@ struct Functor_TestBatchedSerialMatUtil { inline int run() { typedef typename ViewType::value_type value_type; std::string name_region("KokkosBatched::Test::SerialMatUtil"); - std::string name_value_type = - (std::is_same::value - ? "::Float" - : std::is_same::value - ? "::Double" - : std::is_same >::value - ? "::ComplexFloat" - : std::is_same >::value - ? "::ComplexDouble" - : "::UnknownValueType"); + const std::string name_value_type = Test::value_type_name(); std::string name_work_tag = (std::is_same::value ? "::KokkosBatched" diff --git a/unit_test/batched/dense/Test_Batched_SerialSolveLU.hpp b/unit_test/batched/dense/Test_Batched_SerialSolveLU.hpp index 64362d9140..b6d8e1aecf 100644 --- a/unit_test/batched/dense/Test_Batched_SerialSolveLU.hpp +++ b/unit_test/batched/dense/Test_Batched_SerialSolveLU.hpp @@ -54,18 +54,8 @@ struct Functor_BatchedSerialGemm { inline void run() { typedef typename ViewType::value_type value_type; std::string name_region("KokkosBatched::Test::SerialSolveLU"); - std::string name_value_type = - (std::is_same::value - ? "::Float" - : std::is_same::value - ? "::Double" - : std::is_same >::value - ? "::ComplexFloat" - : std::is_same >::value - ? "::ComplexDouble" - : "::UnknownValueType"); - std::string name = name_region + name_value_type; + const std::string name_value_type = Test::value_type_name(); + std::string name = name_region + name_value_type; Kokkos::Profiling::pushRegion(name.c_str()); Kokkos::RangePolicy policy(0, _c.extent(0)); Kokkos::parallel_for((name + "::GemmFunctor").c_str(), policy, *this); @@ -92,18 +82,8 @@ struct Functor_BatchedSerialLU { inline void run() { typedef typename ViewType::value_type value_type; std::string name_region("KokkosBatched::Test::SerialSolveLU"); - std::string name_value_type = - (std::is_same::value - ? "::Float" - : std::is_same::value - ? "::Double" - : std::is_same >::value - ? "::ComplexFloat" - : std::is_same >::value - ? "::ComplexDouble" - : "::UnknownValueType"); - std::string name = name_region + name_value_type; + const std::string name_value_type = Test::value_type_name(); + std::string name = name_region + name_value_type; Kokkos::Profiling::pushRegion(name.c_str()); Kokkos::RangePolicy policy(0, _a.extent(0)); Kokkos::parallel_for((name + "::LUFunctor").c_str(), policy, *this); @@ -132,18 +112,8 @@ struct Functor_TestBatchedSerialSolveLU { inline void run() { typedef typename ViewType::value_type value_type; std::string name_region("KokkosBatched::Test::SerialSolveLU"); - std::string name_value_type = - (std::is_same::value - ? "::Float" - : std::is_same::value - ? "::Double" - : std::is_same >::value - ? "::ComplexFloat" - : std::is_same >::value - ? "::ComplexDouble" - : "::UnknownValueType"); - std::string name = name_region + name_value_type; + const std::string name_value_type = Test::value_type_name(); + std::string name = name_region + name_value_type; Kokkos::Profiling::pushRegion(name.c_str()); Kokkos::RangePolicy policy(0, _a.extent(0)); Kokkos::parallel_for((name + "::SolveLUFunctor").c_str(), policy, *this); diff --git a/unit_test/batched/dense/Test_Batched_SerialTrmm.hpp b/unit_test/batched/dense/Test_Batched_SerialTrmm.hpp index 227a255707..8df653b48f 100644 --- a/unit_test/batched/dense/Test_Batched_SerialTrmm.hpp +++ b/unit_test/batched/dense/Test_Batched_SerialTrmm.hpp @@ -118,18 +118,8 @@ struct Functor_TestBatchedSerialTrmm { inline void run() { typedef typename ViewType::value_type value_type; std::string name_region("KokkosBatched::Test::SerialTrmm"); - std::string name_value_type = - (std::is_same::value - ? "::Float" - : std::is_same::value - ? "::Double" - : std::is_same >::value - ? "::ComplexFloat" - : std::is_same >::value - ? "::ComplexDouble" - : "::UnknownValueType"); - std::string name = name_region + name_value_type; + const std::string name_value_type = Test::value_type_name(); + std::string name = name_region + name_value_type; Kokkos::Profiling::pushRegion(name.c_str()); Kokkos::RangePolicy policy(0, _a.extent(0)); Kokkos::parallel_for(name.c_str(), policy, *this); diff --git a/unit_test/batched/dense/Test_Batched_SerialTrsm.hpp b/unit_test/batched/dense/Test_Batched_SerialTrsm.hpp index cbf36c503d..81a0456623 100644 --- a/unit_test/batched/dense/Test_Batched_SerialTrsm.hpp +++ b/unit_test/batched/dense/Test_Batched_SerialTrsm.hpp @@ -47,18 +47,8 @@ struct Functor_TestBatchedSerialTrsm { inline void run() { typedef typename ViewType::value_type value_type; std::string name_region("KokkosBatched::Test::SerialTrsm"); - std::string name_value_type = - (std::is_same::value - ? "::Float" - : std::is_same::value - ? "::Double" - : std::is_same >::value - ? "::ComplexFloat" - : std::is_same >::value - ? "::ComplexDouble" - : "::UnknownValueType"); - std::string name = name_region + name_value_type; + const std::string name_value_type = Test::value_type_name(); + std::string name = name_region + name_value_type; Kokkos::Profiling::pushRegion(name.c_str()); Kokkos::RangePolicy policy(0, _b.extent(0)); Kokkos::parallel_for(name.c_str(), policy, *this); diff --git a/unit_test/batched/dense/Test_Batched_SerialTrsv.hpp b/unit_test/batched/dense/Test_Batched_SerialTrsv.hpp index f9bcaeb84a..995f33178d 100644 --- a/unit_test/batched/dense/Test_Batched_SerialTrsv.hpp +++ b/unit_test/batched/dense/Test_Batched_SerialTrsv.hpp @@ -46,18 +46,8 @@ struct Functor_TestBatchedSerialTrsv { inline void run() { typedef typename ViewType::value_type value_type; std::string name_region("KokkosBatched::Test::SerialTrsv"); - std::string name_value_type = - (std::is_same::value - ? "::Float" - : std::is_same::value - ? "::Double" - : std::is_same >::value - ? "::ComplexFloat" - : std::is_same >::value - ? "::ComplexDouble" - : "::UnknownValueType"); - std::string name = name_region + name_value_type; + const std::string name_value_type = Test::value_type_name(); + std::string name = name_region + name_value_type; Kokkos::Profiling::pushRegion(name.c_str()); Kokkos::RangePolicy policy(0, _b.extent(0)); Kokkos::parallel_for(name.c_str(), policy, *this); diff --git a/unit_test/batched/dense/Test_Batched_SerialTrtri.hpp b/unit_test/batched/dense/Test_Batched_SerialTrtri.hpp index 75cb1fe2c8..2af8420be3 100644 --- a/unit_test/batched/dense/Test_Batched_SerialTrtri.hpp +++ b/unit_test/batched/dense/Test_Batched_SerialTrtri.hpp @@ -112,18 +112,8 @@ struct Functor_TestBatchedSerialTrtri { inline void run() { typedef typename ViewType::value_type value_type; std::string name_region("KokkosBatched::Test::SerialTrtri"); - std::string name_value_type = - (std::is_same::value - ? "::Float" - : std::is_same::value - ? "::Double" - : std::is_same >::value - ? "::ComplexFloat" - : std::is_same >::value - ? "::ComplexDouble" - : "::UnknownValueType"); - std::string name = name_region + name_value_type; + const std::string name_value_type = Test::value_type_name(); + std::string name = name_region + name_value_type; Kokkos::Profiling::pushRegion(name.c_str()); Kokkos::RangePolicy policy(0, _a.extent(0)); Kokkos::parallel_for("Functor_TestBatchedSerialTrtri", policy, *this); diff --git a/unit_test/batched/dense/Test_Batched_TeamAxpy.hpp b/unit_test/batched/dense/Test_Batched_TeamAxpy.hpp index b5ec0539ee..2f6fc905c5 100644 --- a/unit_test/batched/dense/Test_Batched_TeamAxpy.hpp +++ b/unit_test/batched/dense/Test_Batched_TeamAxpy.hpp @@ -47,18 +47,8 @@ struct Functor_TestBatchedTeamAxpy { inline void run() { typedef typename ViewType::value_type value_type; std::string name_region("KokkosBatched::Test::TeamAxpy"); - std::string name_value_type = - (std::is_same::value - ? "::Float" - : std::is_same::value - ? "::Double" - : std::is_same >::value - ? "::ComplexFloat" - : std::is_same >::value - ? "::ComplexDouble" - : "::UnknownValueType"); - std::string name = name_region + name_value_type; + const std::string name_value_type = Test::value_type_name(); + std::string name = name_region + name_value_type; Kokkos::Profiling::pushRegion(name.c_str()); Kokkos::TeamPolicy policy(_X.extent(0) / _N_team, Kokkos::AUTO(), Kokkos::AUTO()); @@ -70,6 +60,7 @@ struct Functor_TestBatchedTeamAxpy { template void impl_test_batched_axpy(const int N, const int BlkSize, const int N_team) { typedef typename ViewType::value_type value_type; + typedef typename ViewType::const_value_type const_value_type; typedef Kokkos::Details::ArithTraits ats; ViewType X0("x0", N, BlkSize), X1("x1", N, BlkSize), Y0("y0", N, BlkSize), @@ -79,9 +70,9 @@ void impl_test_batched_axpy(const int N, const int BlkSize, const int N_team) { Kokkos::Random_XorShift64_Pool random( 13718); - Kokkos::fill_random(X0, random, value_type(1.0)); - Kokkos::fill_random(Y0, random, value_type(1.0)); - Kokkos::fill_random(alpha, random, value_type(1.0)); + Kokkos::fill_random(X0, random, const_value_type(1.0)); + Kokkos::fill_random(Y0, random, const_value_type(1.0)); + Kokkos::fill_random(alpha, random, const_value_type(1.0)); Kokkos::fence(); diff --git a/unit_test/batched/dense/Test_Batched_TeamGemm.hpp b/unit_test/batched/dense/Test_Batched_TeamGemm.hpp index 6c5356dc7a..00fb2f4d49 100644 --- a/unit_test/batched/dense/Test_Batched_TeamGemm.hpp +++ b/unit_test/batched/dense/Test_Batched_TeamGemm.hpp @@ -54,18 +54,8 @@ struct Functor_TestBatchedTeamGemm { inline void run() { typedef typename ViewType::value_type value_type; std::string name_region("KokkosBatched::Test::TeamGemm"); - std::string name_value_type = - (std::is_same::value - ? "::Float" - : std::is_same::value - ? "::Double" - : std::is_same >::value - ? "::ComplexFloat" - : std::is_same >::value - ? "::ComplexDouble" - : "::UnknownValueType"); - std::string name = name_region + name_value_type; + const std::string name_value_type = Test::value_type_name(); + std::string name = name_region + name_value_type; Kokkos::Profiling::pushRegion(name.c_str()); const int league_size = _c.extent(0); Kokkos::TeamPolicy policy(league_size, diff --git a/unit_test/batched/dense/Test_Batched_TeamGemv.hpp b/unit_test/batched/dense/Test_Batched_TeamGemv.hpp index 138c591ecc..9f19180a3f 100644 --- a/unit_test/batched/dense/Test_Batched_TeamGemv.hpp +++ b/unit_test/batched/dense/Test_Batched_TeamGemv.hpp @@ -52,18 +52,8 @@ struct Functor_TestBatchedTeamGemv { inline void run() { typedef typename ViewType::value_type value_type; std::string name_region("KokkosBatched::Test::SerialGemm"); - std::string name_value_type = - (std::is_same::value - ? "::Float" - : std::is_same::value - ? "::Double" - : std::is_same >::value - ? "::ComplexFloat" - : std::is_same >::value - ? "::ComplexDouble" - : "::UnknownValueType"); - std::string name = name_region + name_value_type; + const std::string name_value_type = Test::value_type_name(); + std::string name = name_region + name_value_type; Kokkos::Profiling::pushRegion(name.c_str()); const int league_size = _c.extent(0); Kokkos::TeamPolicy policy(league_size, diff --git a/unit_test/batched/dense/Test_Batched_TeamInverseLU.hpp b/unit_test/batched/dense/Test_Batched_TeamInverseLU.hpp index 5226775c1b..4db8a69155 100644 --- a/unit_test/batched/dense/Test_Batched_TeamInverseLU.hpp +++ b/unit_test/batched/dense/Test_Batched_TeamInverseLU.hpp @@ -62,18 +62,8 @@ struct Functor_BatchedTeamGemm { inline void run() { typedef typename ViewType::value_type value_type; std::string name_region("KokkosBatched::Test::TeamInverseLU"); - std::string name_value_type = - (std::is_same::value - ? "::Float" - : std::is_same::value - ? "::Double" - : std::is_same >::value - ? "::ComplexFloat" - : std::is_same >::value - ? "::ComplexDouble" - : "::UnknownValueType"); - std::string name = name_region + name_value_type; + const std::string name_value_type = Test::value_type_name(); + std::string name = name_region + name_value_type; Kokkos::Profiling::pushRegion(name.c_str()); const int league_size = _c.extent(0); @@ -107,18 +97,8 @@ struct Functor_BatchedTeamLU { inline void run() { typedef typename ViewType::value_type value_type; std::string name_region("KokkosBatched::Test::TeamInverseLU"); - std::string name_value_type = - (std::is_same::value - ? "::Float" - : std::is_same::value - ? "::Double" - : std::is_same >::value - ? "::ComplexFloat" - : std::is_same >::value - ? "::ComplexDouble" - : "::UnknownValueType"); - std::string name = name_region + name_value_type; + const std::string name_value_type = Test::value_type_name(); + std::string name = name_region + name_value_type; Kokkos::Profiling::pushRegion(name.c_str()); const int league_size = _a.extent(0); @@ -151,18 +131,8 @@ struct Functor_TestBatchedTeamInverseLU { inline void run() { typedef typename AViewType::value_type value_type; std::string name_region("KokkosBatched::Test::TeamInverseLU"); - std::string name_value_type = - (std::is_same::value - ? "::Float" - : std::is_same::value - ? "::Double" - : std::is_same >::value - ? "::ComplexFloat" - : std::is_same >::value - ? "::ComplexDouble" - : "::UnknownValueType"); - std::string name = name_region + name_value_type; + const std::string name_value_type = Test::value_type_name(); + std::string name = name_region + name_value_type; Kokkos::Profiling::pushRegion(name.c_str()); const int league_size = _a.extent(0); diff --git a/unit_test/batched/dense/Test_Batched_TeamLU.hpp b/unit_test/batched/dense/Test_Batched_TeamLU.hpp index d49472f064..ec9ab01a7d 100644 --- a/unit_test/batched/dense/Test_Batched_TeamLU.hpp +++ b/unit_test/batched/dense/Test_Batched_TeamLU.hpp @@ -40,18 +40,8 @@ struct Functor_TestBatchedTeamLU { inline void run() { typedef typename ViewType::value_type value_type; std::string name_region("KokkosBatched::Test::TeamLU"); - std::string name_value_type = - (std::is_same::value - ? "::Float" - : std::is_same::value - ? "::Double" - : std::is_same >::value - ? "::ComplexFloat" - : std::is_same >::value - ? "::ComplexDouble" - : "::UnknownValueType"); - std::string name = name_region + name_value_type; + const std::string name_value_type = Test::value_type_name(); + std::string name = name_region + name_value_type; Kokkos::Profiling::pushRegion(name.c_str()); const int league_size = _a.extent(0); diff --git a/unit_test/batched/dense/Test_Batched_TeamMatUtil.hpp b/unit_test/batched/dense/Test_Batched_TeamMatUtil.hpp index ff557d5241..16879444f7 100644 --- a/unit_test/batched/dense/Test_Batched_TeamMatUtil.hpp +++ b/unit_test/batched/dense/Test_Batched_TeamMatUtil.hpp @@ -70,17 +70,7 @@ struct Functor_TestBatchedTeamMatUtil { inline int run() { typedef typename ViewType::value_type value_type; std::string name_region("KokkosBatched::Test::SerialMatUtil"); - std::string name_value_type = - (std::is_same::value - ? "::Float" - : std::is_same::value - ? "::Double" - : std::is_same >::value - ? "::ComplexFloat" - : std::is_same >::value - ? "::ComplexDouble" - : "::UnknownValueType"); + const std::string name_value_type = Test::value_type_name(); std::string name_work_tag = (std::is_same::value ? "::KokkosBatched" diff --git a/unit_test/batched/dense/Test_Batched_TeamSolveLU.hpp b/unit_test/batched/dense/Test_Batched_TeamSolveLU.hpp index 6f31773269..201cc025fc 100644 --- a/unit_test/batched/dense/Test_Batched_TeamSolveLU.hpp +++ b/unit_test/batched/dense/Test_Batched_TeamSolveLU.hpp @@ -62,18 +62,8 @@ struct Functor_BatchedTeamGemm { inline void run() { typedef typename ViewType::value_type value_type; std::string name_region("KokkosBatched::Test::TeamSolveLU"); - std::string name_value_type = - (std::is_same::value - ? "::Float" - : std::is_same::value - ? "::Double" - : std::is_same >::value - ? "::ComplexFloat" - : std::is_same >::value - ? "::ComplexDouble" - : "::UnknownValueType"); - std::string name = name_region + name_value_type; + const std::string name_value_type = Test::value_type_name(); + std::string name = name_region + name_value_type; Kokkos::Profiling::pushRegion(name.c_str()); const int league_size = _c.extent(0); Kokkos::TeamPolicy policy(league_size, @@ -104,18 +94,8 @@ struct Functor_BatchedTeamLU { inline void run() { typedef typename ViewType::value_type value_type; std::string name_region("KokkosBatched::Test::TeamSolveLU"); - std::string name_value_type = - (std::is_same::value - ? "::Float" - : std::is_same::value - ? "::Double" - : std::is_same >::value - ? "::ComplexFloat" - : std::is_same >::value - ? "::ComplexDouble" - : "::UnknownValueType"); - std::string name = name_region + name_value_type; + const std::string name_value_type = Test::value_type_name(); + std::string name = name_region + name_value_type; Kokkos::Profiling::pushRegion(name.c_str()); const int league_size = _a.extent(0); Kokkos::TeamPolicy policy(league_size, Kokkos::AUTO); @@ -146,18 +126,8 @@ struct Functor_TestBatchedTeamSolveLU { inline void run() { typedef typename ViewType::value_type value_type; std::string name_region("KokkosBatched::Test::TeamSolveLU"); - std::string name_value_type = - (std::is_same::value - ? "::Float" - : std::is_same::value - ? "::Double" - : std::is_same >::value - ? "::ComplexFloat" - : std::is_same >::value - ? "::ComplexDouble" - : "::UnknownValueType"); - std::string name = name_region + name_value_type; + const std::string name_value_type = Test::value_type_name(); + std::string name = name_region + name_value_type; Kokkos::Profiling::pushRegion(name.c_str()); const int league_size = _a.extent(0); diff --git a/unit_test/batched/dense/Test_Batched_TeamTrsm.hpp b/unit_test/batched/dense/Test_Batched_TeamTrsm.hpp index eba8fa8ef1..da4b70933a 100644 --- a/unit_test/batched/dense/Test_Batched_TeamTrsm.hpp +++ b/unit_test/batched/dense/Test_Batched_TeamTrsm.hpp @@ -54,18 +54,8 @@ struct Functor_TestBatchedTeamTrsm { inline void run() { typedef typename ViewType::value_type value_type; std::string name_region("KokkosBatched::Test::TeamTrsm"); - std::string name_value_type = - (std::is_same::value - ? "::Float" - : std::is_same::value - ? "::Double" - : std::is_same >::value - ? "::ComplexFloat" - : std::is_same >::value - ? "::ComplexDouble" - : "::UnknownValueType"); - std::string name = name_region + name_value_type; + const std::string name_value_type = Test::value_type_name(); + std::string name = name_region + name_value_type; Kokkos::Profiling::pushRegion(name.c_str()); const int league_size = _b.extent(0); diff --git a/unit_test/batched/dense/Test_Batched_TeamTrsv.hpp b/unit_test/batched/dense/Test_Batched_TeamTrsv.hpp index b354529e72..c33c939488 100644 --- a/unit_test/batched/dense/Test_Batched_TeamTrsv.hpp +++ b/unit_test/batched/dense/Test_Batched_TeamTrsv.hpp @@ -52,18 +52,8 @@ struct Functor_TestBatchedTeamTrsv { inline void run() { typedef typename ViewType::value_type value_type; std::string name_region("KokkosBatched::Test::TeamTrsv"); - std::string name_value_type = - (std::is_same::value - ? "::Float" - : std::is_same::value - ? "::Double" - : std::is_same >::value - ? "::ComplexFloat" - : std::is_same >::value - ? "::ComplexDouble" - : "::UnknownValueType"); - std::string name = name_region + name_value_type; + const std::string name_value_type = Test::value_type_name(); + std::string name = name_region + name_value_type; Kokkos::Profiling::pushRegion(name.c_str()); const int league_size = _b.extent(0); diff --git a/unit_test/batched/dense/Test_Batched_TeamVectorAxpy.hpp b/unit_test/batched/dense/Test_Batched_TeamVectorAxpy.hpp index b93cce9c3a..142be0990c 100644 --- a/unit_test/batched/dense/Test_Batched_TeamVectorAxpy.hpp +++ b/unit_test/batched/dense/Test_Batched_TeamVectorAxpy.hpp @@ -48,18 +48,8 @@ struct Functor_TestBatchedTeamVectorAxpy { inline void run() { typedef typename ViewType::value_type value_type; std::string name_region("KokkosBatched::Test::TeamVectorAxpy"); - std::string name_value_type = - (std::is_same::value - ? "::Float" - : std::is_same::value - ? "::Double" - : std::is_same >::value - ? "::ComplexFloat" - : std::is_same >::value - ? "::ComplexDouble" - : "::UnknownValueType"); - std::string name = name_region + name_value_type; + const std::string name_value_type = Test::value_type_name(); + std::string name = name_region + name_value_type; Kokkos::Profiling::pushRegion(name.c_str()); Kokkos::TeamPolicy policy(_X.extent(0) / _N_team, Kokkos::AUTO(), Kokkos::AUTO()); @@ -71,6 +61,7 @@ struct Functor_TestBatchedTeamVectorAxpy { template void impl_test_batched_axpy(const int N, const int BlkSize, const int N_team) { typedef typename ViewType::value_type value_type; + typedef typename ViewType::const_value_type const_value_type; typedef Kokkos::Details::ArithTraits ats; ViewType X0("x0", N, BlkSize), X1("x1", N, BlkSize), Y0("y0", N, BlkSize), @@ -80,9 +71,9 @@ void impl_test_batched_axpy(const int N, const int BlkSize, const int N_team) { Kokkos::Random_XorShift64_Pool random( 13718); - Kokkos::fill_random(X0, random, value_type(1.0)); - Kokkos::fill_random(Y0, random, value_type(1.0)); - Kokkos::fill_random(alpha, random, value_type(1.0)); + Kokkos::fill_random(X0, random, const_value_type(1.0)); + Kokkos::fill_random(Y0, random, const_value_type(1.0)); + Kokkos::fill_random(alpha, random, const_value_type(1.0)); Kokkos::fence(); diff --git a/unit_test/batched/dense/Test_Batched_TeamVectorGemm.hpp b/unit_test/batched/dense/Test_Batched_TeamVectorGemm.hpp index 074a1342fa..d104df2b06 100644 --- a/unit_test/batched/dense/Test_Batched_TeamVectorGemm.hpp +++ b/unit_test/batched/dense/Test_Batched_TeamVectorGemm.hpp @@ -49,18 +49,8 @@ struct Functor_TestBatchedTeamVector { inline void run() { typedef typename ViewType::value_type value_type; std::string name_region("KokkosBatched::Test::TeamVector"); - std::string name_value_type = - (std::is_same::value - ? "::Float" - : std::is_same::value - ? "::Double" - : std::is_same >::value - ? "::ComplexFloat" - : std::is_same >::value - ? "::ComplexDouble" - : "::UnknownValueType"); - std::string name = name_region + name_value_type; + const std::string name_value_type = Test::value_type_name(); + std::string name = name_region + name_value_type; Kokkos::Profiling::pushRegion(name.c_str()); const int league_size = _c.extent(0); Kokkos::TeamPolicy policy(league_size, diff --git a/unit_test/batched/dense/Test_Batched_TeamVectorQR.hpp b/unit_test/batched/dense/Test_Batched_TeamVectorQR.hpp index a687ffad20..4ae4ee4133 100644 --- a/unit_test/batched/dense/Test_Batched_TeamVectorQR.hpp +++ b/unit_test/batched/dense/Test_Batched_TeamVectorQR.hpp @@ -79,18 +79,8 @@ struct Functor_TestBatchedTeamVectorQR { inline void run() { typedef typename MatrixViewType::non_const_value_type value_type; std::string name_region("KokkosBatched::Test::TeamVectorQR"); - std::string name_value_type = - (std::is_same::value - ? "::Float" - : std::is_same::value - ? "::Double" - : std::is_same >::value - ? "::ComplexFloat" - : std::is_same >::value - ? "::ComplexDouble" - : "::UnknownValueType"); - std::string name = name_region + name_value_type; + const std::string name_value_type = Test::value_type_name(); + std::string name = name_region + name_value_type; Kokkos::Profiling::pushRegion(name.c_str()); const int league_size = _a.extent(0); diff --git a/unit_test/batched/dense/Test_Batched_TeamVectorQR_WithColumnPivoting.hpp b/unit_test/batched/dense/Test_Batched_TeamVectorQR_WithColumnPivoting.hpp index 61bf8bf7ec..3ae24bda84 100644 --- a/unit_test/batched/dense/Test_Batched_TeamVectorQR_WithColumnPivoting.hpp +++ b/unit_test/batched/dense/Test_Batched_TeamVectorQR_WithColumnPivoting.hpp @@ -89,18 +89,8 @@ struct Functor_TestBatchedTeamVectorQR_WithColumnPivoting { typedef typename MatrixViewType::non_const_value_type value_type; std::string name_region( "KokkosBatched::Test::TeamVectorQR_WithColumnPivoting"); - std::string name_value_type = - (std::is_same::value - ? "::Float" - : std::is_same::value - ? "::Double" - : std::is_same >::value - ? "::ComplexFloat" - : std::is_same >::value - ? "::ComplexDouble" - : "::UnknownValueType"); - std::string name = name_region + name_value_type; + const std::string name_value_type = Test::value_type_name(); + std::string name = name_region + name_value_type; Kokkos::Profiling::pushRegion(name.c_str()); const int league_size = _a.extent(0); diff --git a/unit_test/batched/dense/Test_Batched_TeamVectorSolveUTV.hpp b/unit_test/batched/dense/Test_Batched_TeamVectorSolveUTV.hpp index 4fe2133982..6610383d12 100644 --- a/unit_test/batched/dense/Test_Batched_TeamVectorSolveUTV.hpp +++ b/unit_test/batched/dense/Test_Batched_TeamVectorSolveUTV.hpp @@ -101,18 +101,8 @@ struct Functor_TestBatchedTeamVectorSolveUTV { inline void run() { typedef typename MatrixViewType::non_const_value_type value_type; std::string name_region("KokkosBatched::Test::TeamVectorSolveUTV"); - std::string name_value_type = - (std::is_same::value - ? "::Float" - : std::is_same::value - ? "::Double" - : std::is_same >::value - ? "::ComplexFloat" - : std::is_same >::value - ? "::ComplexDouble" - : "::UnknownValueType"); - std::string name = name_region + name_value_type; + const std::string name_value_type = Test::value_type_name(); + std::string name = name_region + name_value_type; Kokkos::Profiling::pushRegion(name.c_str()); const int league_size = _a.extent(0); diff --git a/unit_test/batched/dense/Test_Batched_TeamVectorSolveUTV2.hpp b/unit_test/batched/dense/Test_Batched_TeamVectorSolveUTV2.hpp index 81bba6fe76..77bec61c28 100644 --- a/unit_test/batched/dense/Test_Batched_TeamVectorSolveUTV2.hpp +++ b/unit_test/batched/dense/Test_Batched_TeamVectorSolveUTV2.hpp @@ -105,18 +105,8 @@ struct Functor_TestBatchedTeamVectorSolveUTV2 { inline void run() { typedef typename MatrixViewType::non_const_value_type value_type; std::string name_region("KokkosBatched::Test::TeamVectorSolveUTV"); - std::string name_value_type = - (std::is_same::value - ? "::Float" - : std::is_same::value - ? "::Double" - : std::is_same >::value - ? "::ComplexFloat" - : std::is_same >::value - ? "::ComplexDouble" - : "::UnknownValueType"); - std::string name = name_region + name_value_type; + const std::string name_value_type = Test::value_type_name(); + std::string name = name_region + name_value_type; Kokkos::Profiling::pushRegion(name.c_str()); const int league_size = _a.extent(0); diff --git a/unit_test/batched/dense/Test_Batched_TeamVectorUTV.hpp b/unit_test/batched/dense/Test_Batched_TeamVectorUTV.hpp index 54512f87d4..0a49db7dce 100644 --- a/unit_test/batched/dense/Test_Batched_TeamVectorUTV.hpp +++ b/unit_test/batched/dense/Test_Batched_TeamVectorUTV.hpp @@ -135,18 +135,8 @@ struct Functor_TestBatchedTeamVectorUTV { inline void run() { typedef typename MatrixViewType::non_const_value_type value_type; std::string name_region("KokkosBatched::Test::TeamVectorUTV"); - std::string name_value_type = - (std::is_same::value - ? "::Float" - : std::is_same::value - ? "::Double" - : std::is_same >::value - ? "::ComplexFloat" - : std::is_same >::value - ? "::ComplexDouble" - : "::UnknownValueType"); - std::string name = name_region + name_value_type; + const std::string name_value_type = Test::value_type_name(); + std::string name = name_region + name_value_type; Kokkos::Profiling::pushRegion(name.c_str()); const int league_size = _a.extent(0); diff --git a/unit_test/batched/sparse/Test_Batched_SerialSpmv.hpp b/unit_test/batched/sparse/Test_Batched_SerialSpmv.hpp index 0629e292a5..c482f8fdb0 100644 --- a/unit_test/batched/sparse/Test_Batched_SerialSpmv.hpp +++ b/unit_test/batched/sparse/Test_Batched_SerialSpmv.hpp @@ -57,18 +57,8 @@ struct Functor_TestBatchedSerialSpmv { inline void run() { typedef typename ValuesViewType::value_type value_type; std::string name_region("KokkosBatched::Test::SerialSpmv"); - std::string name_value_type = - (std::is_same::value - ? "::Float" - : std::is_same::value - ? "::Double" - : std::is_same >::value - ? "::ComplexFloat" - : std::is_same >::value - ? "::ComplexDouble" - : "::UnknownValueType"); - std::string name = name_region + name_value_type; + const std::string name_value_type = Test::value_type_name(); + std::string name = name_region + name_value_type; Kokkos::Profiling::pushRegion(name.c_str()); Kokkos::RangePolicy policy(0, _D.extent(0)); Kokkos::parallel_for(name.c_str(), policy, *this); diff --git a/unit_test/batched/sparse/Test_Batched_SparseUtils.hpp b/unit_test/batched/sparse/Test_Batched_SparseUtils.hpp index 40bd993a30..919f34aa91 100644 --- a/unit_test/batched/sparse/Test_Batched_SparseUtils.hpp +++ b/unit_test/batched/sparse/Test_Batched_SparseUtils.hpp @@ -12,8 +12,12 @@ void create_tridiagonal_batched_matrices(const int nnz, const int BlkSize, Kokkos::Random_XorShift64_Pool< typename VectorViewType::device_type::execution_space> random(13718); - Kokkos::fill_random(X, random, typename VectorViewType::value_type(1.0)); - Kokkos::fill_random(B, random, typename VectorViewType::value_type(1.0)); + Kokkos::fill_random( + X, random, + Kokkos::reduction_identity::prod()); + Kokkos::fill_random( + B, random, + Kokkos::reduction_identity::prod()); auto D_host = Kokkos::create_mirror_view(D); auto r_host = Kokkos::create_mirror_view(r); diff --git a/unit_test/batched/sparse/Test_Batched_TeamCG.hpp b/unit_test/batched/sparse/Test_Batched_TeamCG.hpp index a6be2b30a2..2177264489 100644 --- a/unit_test/batched/sparse/Test_Batched_TeamCG.hpp +++ b/unit_test/batched/sparse/Test_Batched_TeamCG.hpp @@ -3,17 +3,9 @@ #include "gtest/gtest.h" #include "Kokkos_Core.hpp" #include "Kokkos_Random.hpp" - -//#include "KokkosBatched_Vector.hpp" - #include "KokkosBatched_CG.hpp" - #include "KokkosKernels_TestUtils.hpp" - -#include "KokkosBatched_CG.hpp" - #include "KokkosBatched_CrsMatrix.hpp" - #include "Test_Batched_SparseUtils.hpp" using namespace KokkosBatched; @@ -68,18 +60,8 @@ struct Functor_TestBatchedTeamCG { inline void run() { typedef typename ValuesViewType::value_type value_type; std::string name_region("KokkosBatched::Test::TeamCG"); - std::string name_value_type = - (std::is_same::value - ? "::Float" - : std::is_same::value - ? "::Double" - : std::is_same >::value - ? "::ComplexFloat" - : std::is_same >::value - ? "::ComplexDouble" - : "::UnknownValueType"); - std::string name = name_region + name_value_type; + const std::string name_value_type = Test::value_type_name(); + std::string name = name_region + name_value_type; Kokkos::Profiling::pushRegion(name.c_str()); Kokkos::TeamPolicy policy(_D.extent(0) / _N_team, Kokkos::AUTO(), Kokkos::AUTO()); diff --git a/unit_test/batched/sparse/Test_Batched_TeamGMRES.hpp b/unit_test/batched/sparse/Test_Batched_TeamGMRES.hpp index 544005f01a..11b382c640 100644 --- a/unit_test/batched/sparse/Test_Batched_TeamGMRES.hpp +++ b/unit_test/batched/sparse/Test_Batched_TeamGMRES.hpp @@ -3,17 +3,9 @@ #include "gtest/gtest.h" #include "Kokkos_Core.hpp" #include "Kokkos_Random.hpp" - -//#include "KokkosBatched_Vector.hpp" - #include "KokkosBatched_GMRES.hpp" - #include "KokkosKernels_TestUtils.hpp" - -#include "KokkosBatched_GMRES.hpp" - #include "KokkosBatched_CrsMatrix.hpp" - #include "Test_Batched_SparseUtils.hpp" using namespace KokkosBatched; @@ -68,18 +60,8 @@ struct Functor_TestBatchedTeamGMRES { inline void run() { typedef typename ValuesViewType::value_type value_type; std::string name_region("KokkosBatched::Test::TeamGMRES"); - std::string name_value_type = - (std::is_same::value - ? "::Float" - : std::is_same::value - ? "::Double" - : std::is_same >::value - ? "::ComplexFloat" - : std::is_same >::value - ? "::ComplexDouble" - : "::UnknownValueType"); - std::string name = name_region + name_value_type; + const std::string name_value_type = Test::value_type_name(); + std::string name = name_region + name_value_type; Kokkos::Profiling::pushRegion(name.c_str()); Kokkos::TeamPolicy policy(_D.extent(0) / _N_team, Kokkos::AUTO(), Kokkos::AUTO()); @@ -154,9 +136,8 @@ void impl_test_batched_GMRES(const int N, const int BlkSize, const int N_team) { typename ValuesViewType::HostMirror, typename IntView::HostMirror, typename VectorViewType::HostMirror, typename VectorViewType::HostMirror, 1>(-1, D_host, r_host, c_host, X_host, 1, R_host); - KokkosBatched::SerialDot::template invoke< - typename VectorViewType::HostMirror, typename VectorViewType::HostMirror, - typename NormViewType::HostMirror>(R_host, R_host, sqr_norm_0_host); + KokkosBatched::SerialDot::invoke(R_host, R_host, + sqr_norm_0_host); Functor_TestBatchedTeamGMRES(D, r, c, X, B, N_team) .run(); @@ -171,9 +152,8 @@ void impl_test_batched_GMRES(const int N, const int BlkSize, const int N_team) { typename ValuesViewType::HostMirror, typename IntView::HostMirror, typename VectorViewType::HostMirror, typename VectorViewType::HostMirror, 1>(-1, D_host, r_host, c_host, X_host, 1, R_host); - KokkosBatched::SerialDot::template invoke< - typename VectorViewType::HostMirror, typename VectorViewType::HostMirror, - typename NormViewType::HostMirror>(R_host, R_host, sqr_norm_j_host); + KokkosBatched::SerialDot::invoke(R_host, R_host, + sqr_norm_j_host); const MagnitudeType eps = 1.0e5 * ats::epsilon(); diff --git a/unit_test/batched/sparse/Test_Batched_TeamSpmv.hpp b/unit_test/batched/sparse/Test_Batched_TeamSpmv.hpp index ee7d7f46aa..0b0f96e9b1 100644 --- a/unit_test/batched/sparse/Test_Batched_TeamSpmv.hpp +++ b/unit_test/batched/sparse/Test_Batched_TeamSpmv.hpp @@ -81,18 +81,8 @@ struct Functor_TestBatchedTeamSpmv { inline void run() { typedef typename ValuesViewType::value_type value_type; std::string name_region("KokkosBatched::Test::TeamSpmv"); - std::string name_value_type = - (std::is_same::value - ? "::Float" - : std::is_same::value - ? "::Double" - : std::is_same >::value - ? "::ComplexFloat" - : std::is_same >::value - ? "::ComplexDouble" - : "::UnknownValueType"); - std::string name = name_region + name_value_type; + const std::string name_value_type = Test::value_type_name(); + std::string name = name_region + name_value_type; Kokkos::Profiling::pushRegion(name.c_str()); Kokkos::TeamPolicy policy( _D.extent(0) / _N_team, Kokkos::AUTO(), Kokkos::AUTO()); diff --git a/unit_test/batched/sparse/Test_Batched_TeamVectorCG.hpp b/unit_test/batched/sparse/Test_Batched_TeamVectorCG.hpp index ddf80ed3ab..0f3b0ca693 100644 --- a/unit_test/batched/sparse/Test_Batched_TeamVectorCG.hpp +++ b/unit_test/batched/sparse/Test_Batched_TeamVectorCG.hpp @@ -3,17 +3,9 @@ #include "gtest/gtest.h" #include "Kokkos_Core.hpp" #include "Kokkos_Random.hpp" - -//#include "KokkosBatched_Vector.hpp" - #include "KokkosBatched_CG.hpp" - #include "KokkosKernels_TestUtils.hpp" - -#include "KokkosBatched_CG.hpp" - #include "KokkosBatched_CrsMatrix.hpp" - #include "Test_Batched_SparseUtils.hpp" using namespace KokkosBatched; @@ -68,18 +60,8 @@ struct Functor_TestBatchedTeamVectorCG { inline void run() { typedef typename ValuesViewType::value_type value_type; std::string name_region("KokkosBatched::Test::TeamVectorCG"); - std::string name_value_type = - (std::is_same::value - ? "::Float" - : std::is_same::value - ? "::Double" - : std::is_same >::value - ? "::ComplexFloat" - : std::is_same >::value - ? "::ComplexDouble" - : "::UnknownValueType"); - std::string name = name_region + name_value_type; + const std::string name_value_type = Test::value_type_name(); + std::string name = name_region + name_value_type; Kokkos::Profiling::pushRegion(name.c_str()); Kokkos::TeamPolicy policy(_D.extent(0) / _N_team, Kokkos::AUTO(), Kokkos::AUTO()); diff --git a/unit_test/batched/sparse/Test_Batched_TeamVectorGMRES.hpp b/unit_test/batched/sparse/Test_Batched_TeamVectorGMRES.hpp index 94106278a3..bb6abdc1a9 100644 --- a/unit_test/batched/sparse/Test_Batched_TeamVectorGMRES.hpp +++ b/unit_test/batched/sparse/Test_Batched_TeamVectorGMRES.hpp @@ -3,17 +3,9 @@ #include "gtest/gtest.h" #include "Kokkos_Core.hpp" #include "Kokkos_Random.hpp" - -//#include "KokkosBatched_Vector.hpp" - #include "KokkosBatched_GMRES.hpp" - #include "KokkosKernels_TestUtils.hpp" - -#include "KokkosBatched_GMRES.hpp" - #include "KokkosBatched_CrsMatrix.hpp" - #include "Test_Batched_SparseUtils.hpp" using namespace KokkosBatched; @@ -68,18 +60,8 @@ struct Functor_TestBatchedTeamVectorGMRES { inline void run() { typedef typename ValuesViewType::value_type value_type; std::string name_region("KokkosBatched::Test::TeamVectorGMRES"); - std::string name_value_type = - (std::is_same::value - ? "::Float" - : std::is_same::value - ? "::Double" - : std::is_same >::value - ? "::ComplexFloat" - : std::is_same >::value - ? "::ComplexDouble" - : "::UnknownValueType"); - std::string name = name_region + name_value_type; + const std::string name_value_type = Test::value_type_name(); + std::string name = name_region + name_value_type; Kokkos::Profiling::pushRegion(name.c_str()); Kokkos::TeamPolicy policy(_D.extent(0) / _N_team, Kokkos::AUTO(), Kokkos::AUTO()); @@ -154,9 +136,8 @@ void impl_test_batched_GMRES(const int N, const int BlkSize, const int N_team) { typename ValuesViewType::HostMirror, typename IntView::HostMirror, typename VectorViewType::HostMirror, typename VectorViewType::HostMirror, 1>(-1, D_host, r_host, c_host, X_host, 1, R_host); - KokkosBatched::SerialDot::template invoke< - typename VectorViewType::HostMirror, typename VectorViewType::HostMirror, - typename NormViewType::HostMirror>(R_host, R_host, sqr_norm_0_host); + KokkosBatched::SerialDot::invoke(R_host, R_host, + sqr_norm_0_host); Functor_TestBatchedTeamVectorGMRES(D, r, c, X, B, N_team) .run(); @@ -171,9 +152,8 @@ void impl_test_batched_GMRES(const int N, const int BlkSize, const int N_team) { typename ValuesViewType::HostMirror, typename IntView::HostMirror, typename VectorViewType::HostMirror, typename VectorViewType::HostMirror, 1>(-1, D_host, r_host, c_host, X_host, 1, R_host); - KokkosBatched::SerialDot::template invoke< - typename VectorViewType::HostMirror, typename VectorViewType::HostMirror, - typename NormViewType::HostMirror>(R_host, R_host, sqr_norm_j_host); + KokkosBatched::SerialDot::invoke(R_host, R_host, + sqr_norm_j_host); const MagnitudeType eps = 1.0e5 * ats::epsilon(); diff --git a/unit_test/batched/sparse/Test_Batched_TeamVectorSpmv.hpp b/unit_test/batched/sparse/Test_Batched_TeamVectorSpmv.hpp index 7225f2bd0b..205ad6fa73 100644 --- a/unit_test/batched/sparse/Test_Batched_TeamVectorSpmv.hpp +++ b/unit_test/batched/sparse/Test_Batched_TeamVectorSpmv.hpp @@ -81,18 +81,8 @@ struct Functor_TestBatchedTeamVectorSpmv { inline void run() { typedef typename ValuesViewType::value_type value_type; std::string name_region("KokkosBatched::Test::TeamVectorSpmv"); - std::string name_value_type = - (std::is_same::value - ? "::Float" - : std::is_same::value - ? "::Double" - : std::is_same >::value - ? "::ComplexFloat" - : std::is_same >::value - ? "::ComplexDouble" - : "::UnknownValueType"); - std::string name = name_region + name_value_type; + const std::string name_value_type = Test::value_type_name(); + std::string name = name_region + name_value_type; Kokkos::Profiling::pushRegion(name.c_str()); Kokkos::TeamPolicy policy( _D.extent(0) / _N_team, Kokkos::AUTO(), Kokkos::AUTO());