Thanks for using Compiler Explorer
C
C++
LLVM IR
Julia
MLIR
CUDA C++
Rust
CMake
c++ source #1
Output
Compile to binary object
Link to binary
Execute the code
Intel asm syntax
Demangle identifiers
Verbose demangling
Filters
Unused labels
Library functions
Directives
Comments
Horizontal whitespace
Debug intrinsics
Compiler
clang 15 (3ea5fe2)
clang 16 (3ea5fe2)
clang 17 (3ea5fe2)
clang 18 (3ea5fe2)
clang 20 (3ea5fe2)
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
CE on Bluesky
About the author
Statistics
Changelog
Version tree