-
Notifications
You must be signed in to change notification settings - Fork 122
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add support for Kokkos::fence
in the fwd mode
#1048
Conversation
b2afdb1
to
38b97c0
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
clang-tidy made some suggestions
@@ -6,6 +6,7 @@ | |||
#define CLAD_DIFFERENTIATOR_KOKKOSBUILTINS_H | |||
|
|||
#include <Kokkos_Core.hpp> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
warning: 'Kokkos_Core.hpp' file not found [clang-diagnostic-error]
#include <Kokkos_Core.hpp>
^
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should probably install Kokkos as part of our clang-tidy CI dependencies...
return; | ||
/// Fence | ||
template <typename S> void fence_pushforward(const S& s, const S& /*d_s*/) { | ||
::Kokkos::fence(s); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
warning: variable 's' is not initialized [cppcoreguidelines-init-variables]
::Kokkos::fence(s); | |
::Kokkos::fence(s = 0); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That seems broken, probably because my previous comment on kokkos and our CI.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yeah, I saw this, I don't think it's a valid suggestion either :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Note, this is fine for forward mode but for the reverse mode we probably want d_s
for the argument of the fence call to be able to identify the fences from the forward passes vs the fences of the reverse passes.
@gojakuch, could you rebase this PR? @kliegeois, can you take a look? |
3b0acb4
to
6473e60
Compare
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.
6473e60
to
d00360e
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Lgtm! Thank you @gojakuch and @kliegeois!
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.
P.S. this PR has been developed on top of #1022 and should be merged after that. I just don't want to slow down the review of #1022 any longer by adding new commits to it.