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 20, 2024
1 parent 50d2baf commit 38b97c0
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 38b97c0

Please sign in to comment.