Skip to content

Commit

Permalink
Add builtin_exp
Browse files Browse the repository at this point in the history
  • Loading branch information
vgvassilev committed Aug 4, 2024
1 parent b06b239 commit 9e40539
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions include/clad/Differentiator/BuiltinDerivatives.h
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,11 @@ CUDA_HOST_DEVICE inline void __builtin_powf_pullback(float x, float exponent,
*d_exponent += t.pushforward * d_y;
}

CUDA_HOST_DEVICE ValueAndPushforward<double, double>
__builtin_exp_pushforward(double x, double d_x) {
return {__builtin_exp(x), __builtin_exp(x) * d_x};
}

// FIXME: Add the rest of the __builtin_ routines for log, sqrt, abs, etc.

namespace std {
Expand Down

0 comments on commit 9e40539

Please sign in to comment.