Skip to content

Commit

Permalink
Kokkos_CopyViews: update local_deep_copy_contiguous signature
Browse files Browse the repository at this point in the history
Changes signature of routine so the call is valid for case
when the trait specialize == void, allowing for customized
implementations when specialize != void

See trilinos/Trilinos#9917 for request and use case
  • Loading branch information
ndellingwood committed Nov 10, 2021
1 parent 72418c2 commit e075ed0
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions core/src/Kokkos_CopyViews.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -2117,15 +2117,23 @@ void KOKKOS_INLINE_FUNCTION local_deep_copy(
template <class TeamType, class DT, class... DP>
void KOKKOS_INLINE_FUNCTION local_deep_copy_contiguous(
const TeamType& team, const View<DT, DP...>& dst,
typename ViewTraits<DT, DP...>::const_value_type& value) {
typename ViewTraits<DT, DP...>::const_value_type& value,
typename std::enable_if<
std::is_same< typename ViewTraits<DT, DP...>::specialize,
void>::value
>::type* = nullptr) {
Kokkos::parallel_for(Kokkos::TeamThreadRange(team, dst.span()),
[&](const int& i) { dst.data()[i] = value; });
}
//----------------------------------------------------------------------------
template <class DT, class... DP>
void KOKKOS_INLINE_FUNCTION local_deep_copy_contiguous(
const View<DT, DP...>& dst,
typename ViewTraits<DT, DP...>::const_value_type& value) {
typename ViewTraits<DT, DP...>::const_value_type& value,
typename std::enable_if<
std::is_same< typename ViewTraits<DT, DP...>::specialize,
void>::value
>::type* = nullptr) {
for (size_t i = 0; i < dst.span(); ++i) {
dst.data()[i] = value;
}
Expand Down

0 comments on commit e075ed0

Please sign in to comment.