From 9e40539ce8e0913e2388a6f3c0046b9edb3f3706 Mon Sep 17 00:00:00 2001 From: Vassil Vassilev Date: Sun, 4 Aug 2024 07:59:56 +0000 Subject: [PATCH] Add builtin_exp --- include/clad/Differentiator/BuiltinDerivatives.h | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/include/clad/Differentiator/BuiltinDerivatives.h b/include/clad/Differentiator/BuiltinDerivatives.h index 92b9094ea..3a971a874 100644 --- a/include/clad/Differentiator/BuiltinDerivatives.h +++ b/include/clad/Differentiator/BuiltinDerivatives.h @@ -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 +__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 {