Skip to content

Commit

Permalink
Per review prefer always_false<Arg>::value to is_void_v<Arg>
Browse files Browse the repository at this point in the history
  • Loading branch information
dalg24 committed Dec 14, 2023
1 parent 33db304 commit e4a7cfc
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 8 deletions.
3 changes: 2 additions & 1 deletion core/src/OpenACC/Kokkos_OpenACC_ParallelReduce_MDRange.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,8 @@ template <class Functor, class Reducer, class Policy,
struct OpenACCParallelReduceMDRangeHelper {
OpenACCParallelReduceMDRangeHelper(Functor const&, Reducer const&,
Policy const&) {
static_assert(std::is_void_v<Functor>, "not implemented");
static_assert(Kokkos::Impl::always_false<Functor>::value,
"not implemented");
}
};
} // namespace Kokkos::Experimental::Impl
Expand Down
3 changes: 2 additions & 1 deletion core/src/OpenACC/Kokkos_OpenACC_ParallelReduce_Range.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,8 @@ template <class Functor, class Reducer, class Policy,
bool = std::is_arithmetic_v<typename Reducer::value_type>>
struct OpenACCParallelReduceHelper {
OpenACCParallelReduceHelper(Functor const&, Reducer const&, Policy const&) {
static_assert(std::is_void_v<Functor>, "not implemented");
static_assert(Kokkos::Impl::always_false<Functor>::value,
"not implemented");
}
};

Expand Down
9 changes: 6 additions & 3 deletions core/src/OpenACC/Kokkos_OpenACC_ParallelReduce_Team.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,8 @@ template <class Functor, class Reducer, class Policy,
struct OpenACCParallelReduceTeamHelper {
OpenACCParallelReduceTeamHelper(Functor const&, Reducer const&,
Policy const&) {
static_assert(std::is_void_v<Functor>, "not implemented");
static_assert(Kokkos::Impl::always_false<Functor>::value,
"not implemented");
}
};

Expand Down Expand Up @@ -128,7 +129,8 @@ KOKKOS_INLINE_FUNCTION void parallel_reduce(
const Impl::TeamThreadRangeBoundariesStruct<iType, Impl::OpenACCTeamMember>&
loop_boundaries,
const Lambda& lambda, const JoinType& join, ValueType& init_result) {
static_assert(std::is_void_v<Lambda>, "custom reduction is not implemented");
static_assert(Kokkos::Impl::always_false<Lambda>::value,
"custom reduction is not implemented");
}

// Hierarchical Parallelism -> Thread vector level implementation
Expand All @@ -138,7 +140,8 @@ KOKKOS_INLINE_FUNCTION void parallel_reduce(
const Impl::ThreadVectorRangeBoundariesStruct<
iType, Impl::OpenACCTeamMember>& loop_boundaries,
const Lambda& lambda, const JoinType& join, ValueType& init_result) {
static_assert(std::is_void_v<Lambda>, "custom reduction is not implemented");
static_assert(Kokkos::Impl::always_false<Lambda>::value,
"custom reduction is not implemented");
}

} // namespace Kokkos
Expand Down
6 changes: 3 additions & 3 deletions core/src/OpenACC/Kokkos_OpenACC_Team.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ class OpenACCTeamMember {
// FIXME_OPENACC: team_broadcast() is not implemented.
template <class ValueType>
KOKKOS_FUNCTION void team_broadcast(ValueType& value, int thread_id) const {
static_assert(std::is_void_v<ValueType>,
static_assert(Kokkos::Impl::always_false<ValueType>::value,
"Kokkos Error: team_broadcast() is not implemented for the "
"OpenACC backend");
return ValueType();
Expand All @@ -99,7 +99,7 @@ class OpenACCTeamMember {
template <class ValueType, class JoinOp>
KOKKOS_FUNCTION ValueType team_reduce(const ValueType& value,
const JoinOp& op_in) const {
static_assert(std::is_void_v<ValueType>,
static_assert(Kokkos::Impl::always_false<ValueType>::value,
"Kokkos Error: team_reduce() is not implemented for the "
"OpenACC backend");
return ValueType();
Expand All @@ -110,7 +110,7 @@ class OpenACCTeamMember {
KOKKOS_FUNCTION ArgType team_scan(const ArgType& /*value*/,
ArgType* const /*global_accum*/) const {
static_assert(
std::is_void_v<ArgType>,
Kokkos::Impl::always_false<ArgType>::value,
"Kokkos Error: team_scan() is not implemented for the OpenACC backend");
return ArgType();
}
Expand Down

0 comments on commit e4a7cfc

Please sign in to comment.