Skip to content
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 of cuda kernels as pullback functions #1114

Merged
merged 11 commits into from
Oct 29, 2024

Conversation

kchristin22
Copy link
Collaborator

No description provided.

@kchristin22 kchristin22 self-assigned this Oct 12, 2024
Copy link

codecov bot commented Oct 12, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 94.42%. Comparing base (72f0edd) to head (5f8b54b).
Report is 2 commits behind head on master.

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #1114      +/-   ##
==========================================
+ Coverage   94.39%   94.42%   +0.02%     
==========================================
  Files          50       50              
  Lines        8713     8729      +16     
==========================================
+ Hits         8225     8242      +17     
+ Misses        488      487       -1     
Files with missing lines Coverage Δ
include/clad/Differentiator/DerivativeBuilder.h 100.00% <ø> (ø)
include/clad/Differentiator/ReverseModeVisitor.h 97.32% <ø> (ø)
include/clad/Differentiator/VisitorBase.h 100.00% <ø> (ø)
lib/Differentiator/CladUtils.cpp 94.40% <100.00%> (+0.05%) ⬆️
lib/Differentiator/DerivativeBuilder.cpp 100.00% <100.00%> (ø)
lib/Differentiator/ReverseModeVisitor.cpp 95.63% <100.00%> (+0.04%) ⬆️
lib/Differentiator/VisitorBase.cpp 97.27% <100.00%> (ø)

... and 2 files with indirect coverage changes

Files with missing lines Coverage Δ
include/clad/Differentiator/DerivativeBuilder.h 100.00% <ø> (ø)
include/clad/Differentiator/ReverseModeVisitor.h 97.32% <ø> (ø)
include/clad/Differentiator/VisitorBase.h 100.00% <ø> (ø)
lib/Differentiator/CladUtils.cpp 94.40% <100.00%> (+0.05%) ⬆️
lib/Differentiator/DerivativeBuilder.cpp 100.00% <100.00%> (ø)
lib/Differentiator/ReverseModeVisitor.cpp 95.63% <100.00%> (+0.04%) ⬆️
lib/Differentiator/VisitorBase.cpp 97.27% <100.00%> (ø)

... and 2 files with indirect coverage changes

Copy link
Contributor

@github-actions github-actions bot left a 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

include/clad/Differentiator/DiffPlanner.h Outdated Show resolved Hide resolved
include/clad/Differentiator/ReverseModeVisitor.h Outdated Show resolved Hide resolved
include/clad/Differentiator/ReverseModeVisitor.h Outdated Show resolved Hide resolved
lib/Differentiator/ErrorEstimator.cpp Outdated Show resolved Hide resolved
lib/Differentiator/MultiplexExternalRMVSource.cpp Outdated Show resolved Hide resolved
lib/Differentiator/ReverseModeVisitor.cpp Outdated Show resolved Hide resolved
lib/Differentiator/ReverseModeVisitor.cpp Outdated Show resolved Hide resolved
lib/Differentiator/ReverseModeVisitor.cpp Outdated Show resolved Hide resolved
lib/Differentiator/ReverseModeVisitor.cpp Outdated Show resolved Hide resolved
Copy link
Contributor

@github-actions github-actions bot left a 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

include/clad/Differentiator/DiffPlanner.h Outdated Show resolved Hide resolved
include/clad/Differentiator/ReverseModeVisitor.h Outdated Show resolved Hide resolved
lib/Differentiator/ReverseModeVisitor.cpp Outdated Show resolved Hide resolved
lib/Differentiator/ReverseModeVisitor.cpp Outdated Show resolved Hide resolved
@vgvassilev vgvassilev force-pushed the cuda-pullback-host-functions branch from 22399c4 to ed7194c Compare October 15, 2024 19:28
Copy link
Contributor

@github-actions github-actions bot left a 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

lib/Differentiator/ReverseModeVisitor.cpp Outdated Show resolved Hide resolved
lib/Differentiator/ReverseModeVisitor.cpp Outdated Show resolved Hide resolved
include/clad/Differentiator/ExternalRMVSource.h Outdated Show resolved Hide resolved
include/clad/Differentiator/DerivativeBuilder.h Outdated Show resolved Hide resolved
lib/Differentiator/ReverseModeVisitor.cpp Outdated Show resolved Hide resolved
lib/Differentiator/ReverseModeVisitor.cpp Outdated Show resolved Hide resolved
lib/Differentiator/ReverseModeVisitor.cpp Outdated Show resolved Hide resolved
lib/Differentiator/ReverseModeVisitor.cpp Outdated Show resolved Hide resolved
@kchristin22 kchristin22 force-pushed the cuda-pullback-host-functions branch 2 times, most recently from 96ad6a1 to e5fa81d Compare October 18, 2024 16:59
@kchristin22 kchristin22 requested a review from parth-07 October 18, 2024 17:02
Copy link
Contributor

@github-actions github-actions bot left a 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

lib/Differentiator/ReverseModeVisitor.cpp Outdated Show resolved Hide resolved
test/CUDA/GradientKernels.cu Outdated Show resolved Hide resolved
test/CUDA/GradientKernels.cu Show resolved Hide resolved
test/CUDA/GradientKernels.cu Outdated Show resolved Hide resolved
Copy link
Contributor

clang-tidy review says "All clean, LGTM! 👍"

1 similar comment
Copy link
Contributor

clang-tidy review says "All clean, LGTM! 👍"

include/clad/Differentiator/BuiltinDerivatives.h Outdated Show resolved Hide resolved
lib/Differentiator/ReverseModeVisitor.cpp Outdated Show resolved Hide resolved
test/CUDA/GradientKernels.cu Outdated Show resolved Hide resolved
test/CUDA/GradientKernels.cu Outdated Show resolved Hide resolved
test/CUDA/GradientKernels.cu Show resolved Hide resolved
Copy link
Contributor

@github-actions github-actions bot left a 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

lib/Differentiator/VisitorBase.cpp Outdated Show resolved Hide resolved
lib/Differentiator/VisitorBase.cpp Outdated Show resolved Hide resolved
Copy link
Contributor

@github-actions github-actions bot left a 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

lib/Differentiator/ReverseModeVisitor.cpp Outdated Show resolved Hide resolved
@kchristin22 kchristin22 requested a review from parth-07 October 22, 2024 22:51
Copy link
Contributor

clang-tidy review says "All clean, LGTM! 👍"

@kchristin22 kchristin22 force-pushed the cuda-pullback-host-functions branch from 51ae88f to 7ec28c7 Compare October 23, 2024 12:27
Copy link
Contributor

clang-tidy review says "All clean, LGTM! 👍"

@vgvassilev vgvassilev force-pushed the cuda-pullback-host-functions branch from 7ec28c7 to 6a3f79a Compare October 27, 2024 12:08
Copy link
Contributor

@github-actions github-actions bot left a 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

@@ -1940,7 +1952,8 @@ Expr* getArraySizeExpr(const ArrayType* AT, ASTContext& context,
OverloadedDerivedFn =
m_Builder.BuildCallToCustomDerivativeOrNumericalDiff(
customPushforward, pushforwardCallArgs, getCurrentScope(),
const_cast<DeclContext*>(FD->getDeclContext()));
const_cast<DeclContext*>(FD->getDeclContext()), true, true,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

warning: do not use const_cast [cppcoreguidelines-pro-type-const-cast]

              const_cast<DeclContext*>(FD->getDeclContext()), true, true,
              ^

lib/Differentiator/ReverseModeVisitor.cpp Outdated Show resolved Hide resolved
@kchristin22 kchristin22 force-pushed the cuda-pullback-host-functions branch from 4959e67 to 5f8b54b Compare October 28, 2024 10:20
Copy link
Contributor

@github-actions github-actions bot left a 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

@@ -1940,7 +1952,9 @@ Expr* getArraySizeExpr(const ArrayType* AT, ASTContext& context,
OverloadedDerivedFn =
m_Builder.BuildCallToCustomDerivativeOrNumericalDiff(
customPushforward, pushforwardCallArgs, getCurrentScope(),
const_cast<DeclContext*>(FD->getDeclContext()));
const_cast<DeclContext*>(FD->getDeclContext()),
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

warning: do not use const_cast [cppcoreguidelines-pro-type-const-cast]

              const_cast<DeclContext*>(FD->getDeclContext()),
              ^

@@ -2041,7 +2055,9 @@
OverloadedDerivedFn =
m_Builder.BuildCallToCustomDerivativeOrNumericalDiff(
customPullback, pullbackCallArgs, getCurrentScope(),
const_cast<DeclContext*>(FD->getDeclContext()));
const_cast<DeclContext*>(FD->getDeclContext()),
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

warning: do not use const_cast [cppcoreguidelines-pro-type-const-cast]

              const_cast<DeclContext*>(FD->getDeclContext()),
              ^

Copy link
Collaborator

@parth-07 parth-07 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good.

@vgvassilev vgvassilev merged commit b8de117 into vgvassilev:master Oct 29, 2024
90 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants