From a0e9d5bb36853530ec273fa3a24288b9992a5c81 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Miko=C5=82aj=20Zuzek?= Date: Tue, 25 Jan 2022 12:05:09 +0100 Subject: [PATCH] Fix out-of-sync Kokkos items --- src/batched/KokkosBatched_Util.hpp | 22 +++++++++---------- ...hed_Eigendecomposition_Serial_Internal.hpp | 14 ++++++------ ...Eigendecomposition_TeamVector_Internal.hpp | 4 ++-- .../impl/KokkosSparse_spmv_struct_impl.hpp | 6 ++--- 4 files changed, 23 insertions(+), 23 deletions(-) diff --git a/src/batched/KokkosBatched_Util.hpp b/src/batched/KokkosBatched_Util.hpp index 656416c784..21c6a1bd48 100644 --- a/src/batched/KokkosBatched_Util.hpp +++ b/src/batched/KokkosBatched_Util.hpp @@ -300,7 +300,7 @@ struct Mode { }; }; -#if !defined(KOKKOS_IF_HOST) +#if !defined(KOKKOS_IF_ON_HOST) template struct algo_level3_blocked_mb_impl; @@ -367,14 +367,14 @@ struct Algo { // - team policy (smaller) or range policy (bigger) // - space (gpu vs host) // - blocksize input (blk <= 4 mb = 2, otherwise mb = 4), etc. -#if defined(KOKKOS_IF_HOST) - static constexpr KOKKKOS_FUNCTION int mb() { - KOKKOS_IF_HOST((return 4;)) - KOKKOS_IF_DEVICE((return 2;)) +#if defined(KOKKOS_IF_ON_HOST) + static constexpr KOKKOS_INLINE_FUNCTION int mb() { + KOKKOS_IF_ON_HOST((return 4;)) + KOKKOS_IF_ON_DEVICE((return 2;)) } #else // FIXME remove when requiring minimum version of Kokkos 3.6 - static constexpr KOKKOS_FUNCTION int mb() { + static constexpr KOKKOS_INLINE_FUNCTION int mb() { return algo_level3_blocked_mb_impl< Kokkos::Impl::ActiveExecutionMemorySpace>::value; } @@ -417,14 +417,14 @@ struct Algo { // - team policy (smaller) or range policy (bigger) // - space (cuda vs host) // - blocksize input (blk <= 4 mb = 2, otherwise mb = 4), etc. -#if defined(KOKKOS_IF_HOST) - static constexpr KOKKKOS_FUNCTION int mb() { - KOKKOS_IF_HOST((return 4;)) - KOKKOS_IF_DEVICE((return 1;)) +#if defined(KOKKOS_IF_ON_HOST) + static constexpr KOKKOS_INLINE_FUNCTION int mb() { + KOKKOS_IF_ON_HOST((return 4;)) + KOKKOS_IF_ON_DEVICE((return 1;)) } #else // FIXME remove when requiring minimum version of Kokkos 3.6 - static constexpr KOKKOS_FUNCTION int mb() { + static constexpr KOKKOS_INLINE_FUNCTION int mb() { return algo_level2_blocked_mb_impl< Kokkos::Impl::ActiveExecutionMemorySpace>::value; } diff --git a/src/batched/dense/impl/KokkosBatched_Eigendecomposition_Serial_Internal.hpp b/src/batched/dense/impl/KokkosBatched_Eigendecomposition_Serial_Internal.hpp index 41dbe5d9fd..c56fd6ba87 100644 --- a/src/batched/dense/impl/KokkosBatched_Eigendecomposition_Serial_Internal.hpp +++ b/src/batched/dense/impl/KokkosBatched_Eigendecomposition_Serial_Internal.hpp @@ -94,8 +94,8 @@ struct SerialEigendecompositionInternal { // // DO THIS INSTEAD // - // KOKKOS_IF_HOST(()) - // KOKKOS_IF_DEVICE(()) + // KOKKOS_IF_ON_HOST(()) + // KOKKOS_IF_ON_DEVICE(()) // //////////////////////////////////////////////////////////////////////////// // #if (defined(KOKKOSKERNELS_ENABLE_TPL_MKL) && (__INTEL_MKL__ >= 2018)) && @@ -373,11 +373,11 @@ 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_HOST) - KOKKOS_IF_HOST((host_invoke(m, A, as0, as1, er, ers, ei, eis, UL, uls0, - uls1, UR, urs0, urs1, w, wlen);)) - KOKKOS_IF_DEVICE((device_invoke(m, A, as0, as1, er, ers, ei, eis, UL, uls0, - uls1, UR, urs0, urs1, w, 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 diff --git a/src/batched/dense/impl/KokkosBatched_Eigendecomposition_TeamVector_Internal.hpp b/src/batched/dense/impl/KokkosBatched_Eigendecomposition_TeamVector_Internal.hpp index f3be2ff3d8..ca46c3e9e7 100644 --- a/src/batched/dense/impl/KokkosBatched_Eigendecomposition_TeamVector_Internal.hpp +++ b/src/batched/dense/impl/KokkosBatched_Eigendecomposition_TeamVector_Internal.hpp @@ -77,8 +77,8 @@ struct TeamVectorEigendecompositionInternal { // // DO THIS INSTEAD // - // KOKKOS_IF_HOST(()) - // KOKKOS_IF_DEVICE(()) + // KOKKOS_IF_ON_HOST(()) + // KOKKOS_IF_ON_DEVICE(()) // #if defined(KOKKOS_ACTIVE_EXECUTION_MEMORY_SPACE_HOST) if (as0 == 1 || as1 == 1) { diff --git a/src/sparse/impl/KokkosSparse_spmv_struct_impl.hpp b/src/sparse/impl/KokkosSparse_spmv_struct_impl.hpp index fbfd28ef0e..4d8eaf9d68 100644 --- a/src/sparse/impl/KokkosSparse_spmv_struct_impl.hpp +++ b/src/sparse/impl/KokkosSparse_spmv_struct_impl.hpp @@ -548,16 +548,16 @@ struct SPMV_Struct_Functor { const size_type rowOffset = m_A.graph.row_map(rowIdx); y_value_type sum(0.0); -#if defined(KOKKOS_IF_HOST) +#if defined(KOKKOS_IF_ON_HOST) // clang-format off - KOKKOS_IF_HOST(( + KOKKOS_IF_ON_HOST(( for (ordinal_type idx = 0; idx < 27; ++idx) { sum += m_A.values(rowOffset + idx) * m_x(rowIdx + columnOffsets(idx)); } )) - KOKKOS_IF_DEVICE(( + KOKKOS_IF_ON_DEVICE(( Kokkos::parallel_reduce( Kokkos::ThreadVectorRange(dev, 27), [&](const ordinal_type& idx, y_value_type& lclSum) {