You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
int b; // expected-warning {{gradient uses a global variable 'b'; rerunning the gradient requires 'b' to be reset}}
8
+
9
+
voidc(float) {
10
+
// expected-warning@+2 {{attempted differentiation of function 'a' without definition and no suitable overload was found in namespace 'custom_derivatives'}}
11
+
// expected-note@+1 {{numerical differentiation is not viable for 'a'; considering 'a' as 0}}
12
+
a(b);
13
+
}
14
+
15
+
doublef0(double x) {
16
+
int index = 10 % 3;
17
+
constchar* func = __func__;
18
+
void* ptr = __null;
19
+
20
+
// expected-warning@+2 {{attempted differentiation of function 'printf' without definition and no suitable overload was found in namespace 'custom_derivatives'}}
21
+
// expected-note@+1 {{numerical differentiation is not viable for 'printf'; considering 'printf' as 0}}
22
+
printf("%f", x);
23
+
24
+
return x * x;
25
+
}
26
+
27
+
auto df = clad::gradient(f0);
28
+
auto dg = clad::gradient(c);
29
+
30
+
int b_fwd;
31
+
32
+
voidc_fwd(float) {
33
+
// expected-warning@+2 {{attempted differentiation of function 'a' without definition and no suitable overload was found in namespace 'custom_derivatives'}}
34
+
// expected-note@+1 {{numerical differentiation is not viable for 'a'; considering 'a' as 0}}
35
+
a(b_fwd);
36
+
}
37
+
38
+
doublef0_fwd(double x) {
39
+
int index = 10 % 3;
40
+
constchar* func = __func__;
41
+
void* ptr = __null;
42
+
43
+
// expected-warning@+2 {{attempted differentiation of function 'printf' without definition and no suitable overload was found in namespace 'custom_derivatives'}}
44
+
// expected-note@+1 {{numerical differentiation is not viable for 'printf'; considering 'printf' as 0}}
0 commit comments