From d9df4fd6bbacb67e9b6d37f4be5298e0ba216c9e Mon Sep 17 00:00:00 2001 From: Damien L-G Date: Tue, 7 Mar 2023 09:59:21 -0500 Subject: [PATCH] Drop obsolete workaround checking whether KOKKOS_IF_ON_{HOST,DEVICE} macros are defined This is always true from Kokkos release 3.6 and current develop does not even build any more against Kokkos 3.7 --- ...hed_Eigendecomposition_Serial_Internal.hpp | 32 ------------------- sparse/impl/KokkosSparse_spmv_struct_impl.hpp | 22 ++----------- 2 files changed, 2 insertions(+), 52 deletions(-) diff --git a/batched/dense/impl/KokkosBatched_Eigendecomposition_Serial_Internal.hpp b/batched/dense/impl/KokkosBatched_Eigendecomposition_Serial_Internal.hpp index c1bc0439c5..f89b76e162 100644 --- a/batched/dense/impl/KokkosBatched_Eigendecomposition_Serial_Internal.hpp +++ b/batched/dense/impl/KokkosBatched_Eigendecomposition_Serial_Internal.hpp @@ -388,42 +388,10 @@ struct SerialEigendecompositionInternal { const int ers, RealType* ei, const int eis, RealType* UL, const int uls0, const int uls1, RealType* UR, const int urs0, const int urs1, RealType* w, const int wlen) { -#if defined(KOKKOS_IF_ON_HOST) KOKKOS_IF_ON_HOST((host_invoke(m, A, as0, as1, er, ers, ei, eis, UL, uls0, uls1, UR, urs0, urs1, w, wlen);)) KOKKOS_IF_ON_DEVICE((device_invoke(m, A, as0, as1, er, ers, ei, eis, UL, uls0, uls1, UR, urs0, urs1, w, wlen);)) -#elif defined(KOKKOS_ACTIVE_EXECUTION_MEMORY_SPACE_HOST) // FIXME remove when - // requiring minimum - // version of - // Kokkos 3.6 - // if (as0 == 1 || as1 == 1) { - /// column major or row major and it runs on host - /// potentially it can run tpls internally - // NOTE BMK: If LAPACK not enabled, this will static_assert. - // If neither stride is unit, will runtime assert. - // Otherwise will succeed using LAPACK. - host_invoke(m, A, as0, as1, er, ers, ei, eis, UL, uls0, uls1, UR, urs0, - urs1, w, wlen); - /* - } else { - /// arbitrary strides should be handled by native implementation - device_invoke(m, - A, as0, as1, - er, ers, - ei, eis, - UL, uls0, uls1, - UR, urs0, urs1, - w, wlen); - throw std::runtime_error("Serial eigendecomposition without unit stride - implemented yet."); - } - */ -#else - /// device code runs - device_invoke(m, A, as0, as1, er, ers, ei, eis, UL, uls0, uls1, UR, urs0, - urs1, w, wlen); -#endif return 0; } }; diff --git a/sparse/impl/KokkosSparse_spmv_struct_impl.hpp b/sparse/impl/KokkosSparse_spmv_struct_impl.hpp index 2831cb8861..ac3da5e45f 100644 --- a/sparse/impl/KokkosSparse_spmv_struct_impl.hpp +++ b/sparse/impl/KokkosSparse_spmv_struct_impl.hpp @@ -521,7 +521,7 @@ struct SPMV_Struct_Functor { const size_type rowOffset = m_A.graph.row_map(rowIdx); y_value_type sum(0.0); -#if defined(KOKKOS_IF_ON_HOST) + // clang-format off KOKKOS_IF_ON_HOST(( for (ordinal_type idx = 0; idx < 27; ++idx) { @@ -540,25 +540,7 @@ struct SPMV_Struct_Functor { }, sum); )) - // clang-format on -#elif defined(KOKKOS_ACTIVE_EXECUTION_MEMORY_SPACE_HOST) // FIXME remove when - // requiring minimum - // version of - // Kokkos 3.6 - for (ordinal_type idx = 0; idx < 27; ++idx) { - sum += - m_A.values(rowOffset + idx) * m_x(rowIdx + columnOffsets(idx)); - } -#else - Kokkos::parallel_reduce( - Kokkos::ThreadVectorRange(dev, 27), - [&](const ordinal_type& idx, y_value_type& lclSum) { - lclSum += (conjugate ? ATV::conj(m_A.values(rowOffset + idx)) - : m_A.values(rowOffset + idx)) * - m_x(rowIdx + columnOffsets(idx)); - }, - sum); -#endif + // clang-format on Kokkos::single(Kokkos::PerThread(dev), [&]() { m_y(rowIdx) = beta * m_y(rowIdx) + alpha * sum;