We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 530b565 commit d7d617fCopy full SHA for d7d617f
tests/codegen/autodiff/inline.rs
@@ -0,0 +1,20 @@
1
+//@ compile-flags: -Zautodiff=Enable -Zautodiff=NoPostopt -C opt-level=3 -Clto=fat
2
+//@ no-prefer-dynamic
3
+//@ needs-enzyme
4
+
5
+#![feature(autodiff)]
6
7
+use std::autodiff::autodiff;
8
9
+#[autodiff(d_square, Reverse, Duplicated, Active)]
10
+fn square(x: &f64) -> f64 {
11
+ x * x
12
+}
13
+// CHECK: ; Function Attrs: alwaysinline noinline
14
+// CHECK-NEXT: declare double @__enzyme_autodiff_ZN6inline8d_square17h021c74e92c259cdeE(...) local_unnamed_addr #8
15
+fn main() {
16
+ let x = std::hint::black_box(3.0);
17
+ let mut dx1 = std::hint::black_box(1.0);
18
+ let _ = d_square(&x, &mut dx1, 1.0);
19
+ assert_eq!(dx1, 6.0);
20
0 commit comments