Thanks for using Compiler Explorer
C
C++
LLVM IR
Julia
MLIR
CUDA C++
CMake
c++ source #1
Output
Compile to binary object
Link to binary
Execute the code
Intel asm syntax
Demangle identifiers
Filters
Unused labels
Library functions
Directives
Comments
Horizontal whitespace
Debug intrinsics
Compiler
clang 11 (0b62188)
clang 12 (0b62188)
clang 13 (0b62188)
clang 14 (0b62188)
clang 15 (0b62188)
clang 16 (0b62188)
clang 17 (0b62188)
clang 18 (0b62188)
clang10-enzyme-main
clang9-enzyme-main
Options
Source code
#include <stdio.h> extern double __enzyme_autodiff(void*, double); double square(double x) { return x * x; } double dsquare(double x) { // This returns the derivative of square or 2 * x return __enzyme_autodiff((void*)square, x); } int main() { for(double i=1; i<5; i++) printf("square(%f)=%f, dsquare(%f)=%f", i, square(i), i, dsquare(i)); }
Become a Patron
Sponsor on GitHub
Donate via PayPal
Source on GitHub
Mailing list
Installed libraries
Wiki
Report an issue
How it works
Contact the author
CE on Mastodon
About the author
Statistics
Changelog
Version tree