Skip to content

Commit

Permalink
Fixed errors from CI testing
Browse files Browse the repository at this point in the history
  • Loading branch information
ldh4 committed Apr 9, 2024
1 parent cd00bd8 commit 05b6edf
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 23 deletions.
21 changes: 9 additions & 12 deletions core/src/Cuda/Kokkos_Cuda_Team.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -533,11 +533,10 @@ parallel_reduce(const Impl::TeamThreadRangeBoundariesStruct<
functor_analysis_type::has_join_member_function &&
functor_analysis_type::has_init_member_function;

using ReducerSelector =
typename Kokkos::Impl::if_c<is_reducer_closure, Closure,
Sum<ValueType>>::type;

KOKKOS_IF_ON_DEVICE((
using ReducerSelector =
typename Kokkos::Impl::if_c<is_reducer_closure, Closure,
Sum<ValueType>>::type;
auto run_closure =
[&](ValueType& value) {
for (iType i = loop_boundaries.start + threadIdx.y;
Expand Down Expand Up @@ -614,11 +613,10 @@ parallel_reduce(const Impl::TeamVectorRangeBoundariesStruct<
functor_analysis_type::has_join_member_function &&
functor_analysis_type::has_init_member_function;

using ReducerSelector =
typename Kokkos::Impl::if_c<is_reducer_closure, Closure,
Sum<ValueType>>::type;

KOKKOS_IF_ON_DEVICE((
using ReducerSelector =
typename Kokkos::Impl::if_c<is_reducer_closure, Closure,
Sum<ValueType>>::type;
auto run_closure =
[&](ValueType& value) {
for (iType i = loop_boundaries.start + threadIdx.y * blockDim.x +
Expand Down Expand Up @@ -735,11 +733,10 @@ parallel_reduce(Impl::ThreadVectorRangeBoundariesStruct<
functor_analysis_type::has_join_member_function &&
functor_analysis_type::has_init_member_function;

using ReducerSelector =
typename Kokkos::Impl::if_c<is_reducer_closure, Closure,
Sum<ValueType>>::type;

KOKKOS_IF_ON_DEVICE((
using ReducerSelector =
typename Kokkos::Impl::if_c<is_reducer_closure, Closure,
Sum<ValueType>>::type;
auto run_closure =
[&](ValueType& value) {
for (iType i = loop_boundaries.start + threadIdx.x;
Expand Down
22 changes: 12 additions & 10 deletions core/src/HIP/Kokkos_HIP_Team.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -178,17 +178,19 @@ class HIPTeamMember {
template <typename ReducerType, typename ValueType>
KOKKOS_INLINE_FUNCTION void team_reduce(ReducerType const& reducer,
ValueType& value) const noexcept {
KOKOS_IF_ON_DEVICE((
typename Kokkos::Impl::FunctorAnalysis<
FunctorPatternInterface::REDUCE, TeamPolicy<HIP>, ReducerType,
typename ReducerType::value_type>::Reducer wrapped_reducer(reducer);
hip_intra_block_shuffle_reduction(value, wrapped_reducer, blockDim.y);

if constexpr (is_reducer_v<ReducerType>) {
reducer.reference() = value;
}))
#ifdef __HIP_DEVICE_COMPILE__
typename Kokkos::Impl::FunctorAnalysis<
FunctorPatternInterface::REDUCE, TeamPolicy<HIP>, ReducerType,
ValueType>::Reducer wrapped_reducer(reducer);
hip_intra_block_shuffle_reduction(value, wrapped_reducer, blockDim.y);

KOKKOS_IF_ON_HOST(((void)reducer; (void)value;))
if constexpr (is_reducer_v<ReducerType>) {
reducer.reference() = value;
}
#else
(void)reducer;
(void)value;
#endif
}

//--------------------------------------------------------------------------
Expand Down
2 changes: 1 addition & 1 deletion core/src/SYCL/Kokkos_SYCL_Team.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ class SYCLTeamMember {
template <typename ReducerType, typename ValueType>
KOKKOS_INLINE_FUNCTION void team_reduce(ReducerType const& reducer,
ValueType& value) const noexcept {
using value_type = typename ValueType;
using value_type = ValueType;

auto sg = m_item.get_sub_group();
const auto sub_group_range = sg.get_local_range()[0];
Expand Down

0 comments on commit 05b6edf

Please sign in to comment.