From b2afdb1c92c820233344cc97a33b54a23a5ae9b4 Mon Sep 17 00:00:00 2001 From: Atell Krasnopolski Date: Thu, 15 Aug 2024 21:51:37 +0200 Subject: [PATCH] Add support for `Kokkos::fence` in the fwd mode Although this function doesn't need to be differentiated and is correctly used by Clad automatically, this custom pushforward prevents Clad from throwing a warning during that. --- include/clad/Differentiator/KokkosBuiltins.h | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/include/clad/Differentiator/KokkosBuiltins.h b/include/clad/Differentiator/KokkosBuiltins.h index af676091f..ad2da7ad7 100644 --- a/include/clad/Differentiator/KokkosBuiltins.h +++ b/include/clad/Differentiator/KokkosBuiltins.h @@ -67,6 +67,12 @@ inline void resize_pushforward(const I& arg, View& v, const size_t n0, ::Kokkos::resize(arg, d_v, n0, n1, n2, n3, n4, n5, n6, n7); } +/// Fence +template +void fence_pushforward(const S& s, const S& /*d_s*/) { + ::Kokkos::fence(s); +} + /// Parallel for template // range policy void parallel_for_pushforward(