From f127e920a9bd365869e4461160b1936226737d7e Mon Sep 17 00:00:00 2001 From: Atell Krasnopolski Date: Thu, 29 Aug 2024 18:48:40 +0200 Subject: [PATCH] Add support for basic Kokkos operations in the rvs mode --- include/clad/Differentiator/KokkosBuiltins.h | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/include/clad/Differentiator/KokkosBuiltins.h b/include/clad/Differentiator/KokkosBuiltins.h index 1a6253027..c205cf9c1 100644 --- a/include/clad/Differentiator/KokkosBuiltins.h +++ b/include/clad/Differentiator/KokkosBuiltins.h @@ -30,6 +30,24 @@ constructor_pushforward( Kokkos::View( "_diff_" + name, idx0, idx1, idx2, idx3, idx4, idx5, idx6, idx7)}; } +template +clad::ValueAndAdjoint<::Kokkos::View, + ::Kokkos::View> +constructor_reverse_forw( + clad::ConstructorReverseForwTag<::Kokkos::View>, + 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(name, idx0, idx1, idx2, idx3, + idx4, idx5, idx6, idx7), + ::Kokkos::View( + "_diff_" + name, idx0, idx1, idx2, idx3, idx4, idx5, idx6, idx7)}; +} /// View indexing template