Skip to content

Commit

Permalink
Add support for basic Kokkos operations in the rvs mode
Browse files Browse the repository at this point in the history
  • Loading branch information
gojakuch committed Oct 6, 2024
1 parent 8ed2707 commit f127e92
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions include/clad/Differentiator/KokkosBuiltins.h
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,24 @@ constructor_pushforward(
Kokkos::View<DataType, ViewParams...>(
"_diff_" + name, idx0, idx1, idx2, idx3, idx4, idx5, idx6, idx7)};
}
template <class DataType, class... ViewParams>
clad::ValueAndAdjoint<::Kokkos::View<DataType, ViewParams...>,
::Kokkos::View<DataType, ViewParams...>>
constructor_reverse_forw(
clad::ConstructorReverseForwTag<::Kokkos::View<DataType, ViewParams...>>,
const ::std::string& name, const size_t& idx0, const size_t& idx1,
const size_t& idx2, const size_t& idx3, const size_t& idx4,
const size_t& idx5, const size_t& idx6, const size_t& idx7,
const ::std::string& /*d_name*/, const size_t& /*d_idx0*/,
const size_t& /*d_idx1*/, const size_t& /*d_idx2*/,
const size_t& /*d_idx3*/, const size_t& /*d_idx4*/,
const size_t& /*d_idx5*/, const size_t& /*d_idx6*/,
const size_t& /*d_idx7*/) {
return {::Kokkos::View<DataType, ViewParams...>(name, idx0, idx1, idx2, idx3,
idx4, idx5, idx6, idx7),
::Kokkos::View<DataType, ViewParams...>(
"_diff_" + name, idx0, idx1, idx2, idx3, idx4, idx5, idx6, idx7)};
}

/// View indexing
template <typename View, typename Idx>
Expand Down

0 comments on commit f127e92

Please sign in to comment.