Skip to content

Commit

Permalink
Merge Pull Request trilinos#13582 from pzehner/Trilinos/refactor/remo…
Browse files Browse the repository at this point in the history
…ve-dyn-rank-view-fill

Automatically Merged using Trilinos Pull Request AutoTester
PR Title: b'Remove the use of `Kokkos::Impl::DynRankViewFill` in Sacado'
PR Author: pzehner
  • Loading branch information
trilinos-autotester authored Nov 8, 2024
2 parents 4e6e2ca + c54fe80 commit 9eb6cbc
Showing 1 changed file with 20 additions and 6 deletions.
26 changes: 20 additions & 6 deletions packages/sacado/src/Kokkos_DynRankView_Fad.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -988,9 +988,16 @@ void deep_copy(
typename ViewTraits<DT,DP...>::non_const_value_type >::value
, "Can only deep copy into non-const type" );

Kokkos::fence();
Kokkos::Impl::DynRankViewFill< DynRankView<DT,DP...> >( view , value );
Kokkos::fence();
switch(view.rank()) {
case 0: deep_copy(Impl::as_view_of_rank_n<0>(view), value); break;
case 1: deep_copy(Impl::as_view_of_rank_n<1>(view), value); break;
case 2: deep_copy(Impl::as_view_of_rank_n<2>(view), value); break;
case 3: deep_copy(Impl::as_view_of_rank_n<3>(view), value); break;
case 4: deep_copy(Impl::as_view_of_rank_n<4>(view), value); break;
case 5: deep_copy(Impl::as_view_of_rank_n<5>(view), value); break;
case 6: deep_copy(Impl::as_view_of_rank_n<6>(view), value); break;
case 7: deep_copy(Impl::as_view_of_rank_n<7>(view), value); break;
}
}

// Overload of deep_copy for Fad views intializing to a constant Fad
Expand All @@ -1010,9 +1017,16 @@ void deep_copy(
typename ViewTraits<DT,DP...>::non_const_value_type >::value
, "Can only deep copy into non-const type" );

Kokkos::fence();
Kokkos::Impl::DynRankViewFill< DynRankView<DT,DP...> >( view , value );
Kokkos::fence();
switch(view.rank()) {
case 0: deep_copy(Impl::as_view_of_rank_n<0>(view), value); break;
case 1: deep_copy(Impl::as_view_of_rank_n<1>(view), value); break;
case 2: deep_copy(Impl::as_view_of_rank_n<2>(view), value); break;
case 3: deep_copy(Impl::as_view_of_rank_n<3>(view), value); break;
case 4: deep_copy(Impl::as_view_of_rank_n<4>(view), value); break;
case 5: deep_copy(Impl::as_view_of_rank_n<5>(view), value); break;
case 6: deep_copy(Impl::as_view_of_rank_n<6>(view), value); break;
case 7: deep_copy(Impl::as_view_of_rank_n<7>(view), value); break;
}
}

template< class DstType , class SrcType >
Expand Down

0 comments on commit 9eb6cbc

Please sign in to comment.