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 6, 2024
1 parent fd9e092 commit e9450fe
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 inline 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 e9450fe

Please sign in to comment.