Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix out-of-sync Kokkos items #1288

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 11 additions & 11 deletions src/batched/KokkosBatched_Util.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -300,7 +300,7 @@ struct Mode {
};
};

#if !defined(KOKKOS_IF_HOST)
#if !defined(KOKKOS_IF_ON_HOST)

template <class>
struct algo_level3_blocked_mb_impl;
Expand Down Expand Up @@ -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;
}
Expand Down Expand Up @@ -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;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -94,8 +94,8 @@ struct SerialEigendecompositionInternal {
//
// DO THIS INSTEAD
//
// KOKKOS_IF_HOST((<host code>))
// KOKKOS_IF_DEVICE((<device code>))
// KOKKOS_IF_ON_HOST((<host code>))
// KOKKOS_IF_ON_DEVICE((<device code>))
//
////////////////////////////////////////////////////////////////////////////
// #if (defined(KOKKOSKERNELS_ENABLE_TPL_MKL) && (__INTEL_MKL__ >= 2018)) &&
Expand Down Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -77,8 +77,8 @@ struct TeamVectorEigendecompositionInternal {
//
// DO THIS INSTEAD
//
// KOKKOS_IF_HOST((<host code>))
// KOKKOS_IF_DEVICE((<device code>))
// KOKKOS_IF_ON_HOST((<host code>))
// KOKKOS_IF_ON_DEVICE((<device code>))
//
#if defined(KOKKOS_ACTIVE_EXECUTION_MEMORY_SPACE_HOST)
if (as0 == 1 || as1 == 1) {
Expand Down
6 changes: 3 additions & 3 deletions src/sparse/impl/KokkosSparse_spmv_struct_impl.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down