-
Notifications
You must be signed in to change notification settings - Fork 32
Expand file tree
/
Copy pathtest.jl
More file actions
34 lines (27 loc) · 906 Bytes
/
test.jl
File metadata and controls
34 lines (27 loc) · 906 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
using Pkg
Pkg.add("GTPSA")
using DifferentiationInterface, DifferentiationInterfaceTest
using GTPSA: GTPSA
using Test
using ExplicitImports
check_no_implicit_imports(DifferentiationInterface)
LOGGING = get(ENV, "CI", "false") == "false"
for backend in [AutoGTPSA()]
@test check_available(backend)
@test check_inplace(backend)
end
# Test no Descriptor (use context)
test_differentiation(
AutoGTPSA(),
default_scenarios(; include_constantified=true);
type_stability=safetypestab(:full),
logging=LOGGING,
);
# Test with Descriptor:
d1 = GTPSA.Descriptor(20, 2) # 20 variables to 2nd order
test_differentiation(AutoGTPSA(d1); type_stability=safetypestab(:full), logging=LOGGING);
# Test with Descriptor using varying orders
vos = 2 * ones(Int, 20)
vos[1] = 3
d2 = GTPSA.Descriptor(vos, 3)
test_differentiation(AutoGTPSA(d2); type_stability=safetypestab(:full), logging=LOGGING);