Skip to content

Commit

Permalink
Add builtin_exp
Browse files Browse the repository at this point in the history
  • Loading branch information
vgvassilev authored and mcbarton committed Oct 25, 2024
1 parent ff74e0c commit be5679c
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 @@ -147,6 +147,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>
inline __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 be5679c

Please sign in to comment.