Skip to content

Commit b8c2032

Browse files
authored
add new chemistry testcase (#34)
1 parent 98c47b9 commit b8c2032

File tree

1 file changed

+23
-0
lines changed

1 file changed

+23
-0
lines changed

samples/tests/reverse/mod.rs

+23
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,29 @@ samples::test! {
2020
// ANCHOR_END: square
2121
}
2222

23+
samples::test! {
24+
chemistry;
25+
// ANCHOR: chemistry
26+
use std::autodiff::autodiff;
27+
#[autodiff(dchem, Reverse, Duplicated, Const, Const, Const)]
28+
fn chemistry(
29+
arg1: &mut [f64],
30+
arg2: [i32; 4],
31+
arg3: &mut [i32],
32+
arg4: i32,
33+
){}
34+
35+
fn main() {
36+
let mut arg1 = [0.0, 0.0, 0.0, 0.0];
37+
let mut darg1 = [0.0, 0.0, 0.0, 0.0];
38+
let arg2 = [0, 1, 2, 3];
39+
let mut arg3 = [0, 1, 2, 3];
40+
let arg4 = 4;
41+
dchem(&mut arg1, &mut darg1, arg2, &mut arg3, arg4);
42+
}
43+
// ANCHOR_END: chemistry
44+
}
45+
2346
samples::test! {
2447
active_only;
2548
// ANCHOR: active_only

0 commit comments

Comments
 (0)