Skip to content

Commit

Permalink
Add support for Kokkos::fence in the fwd mode
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
gojakuch committed Aug 21, 2024
1 parent b7f8e5d commit 5c16b0f
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions include/clad/Differentiator/KokkosBuiltins.h
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,11 @@ 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 <typename S> void fence_pushforward(const S& s, const S& /*d_s*/) {
::Kokkos::fence(s);
}

/// Parallel for
template <class... PolicyParams, class FunctorType> // range policy
void parallel_for_pushforward(
Expand Down

0 comments on commit 5c16b0f

Please sign in to comment.