Skip to content

Commit dfa9f81

Browse files
committed
add ADTypes
1 parent ca908db commit dfa9f81

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

test/AD_performance_regression.jl

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import Optimization
1+
import Optimization, ADTypes
22
using ReverseDiff, Enzyme, BenchmarkTools, Test
33

44
lookup_pg = Dict(5 => 11, 4 => 13, 2 => 15, 3 => 17, 1 => 19)
@@ -26,7 +26,7 @@ opf_objective = let lookup_pg = lookup_pg, ref_gen_idxs = ref_gen_idxs,
2626
end
2727

2828
optprob = Optimization.OptimizationFunction(opf_objective,
29-
AutoReverseDiff(; compile = true))
29+
ADTypes.AutoReverseDiff(; compile = true))
3030

3131
test_u0 = [
3232
0.6292298794022337,
@@ -134,21 +134,21 @@ res = zero(test_u0)
134134

135135
_f = Optimization.instantiate_function(optprob,
136136
test_u0,
137-
AutoReverseDiff(; compile = false),
137+
ADTypes.AutoReverseDiff(; compile = false),
138138
nothing; g = true)
139139
_f.f(test_u0, nothing)
140140
@test @ballocated($(_f.grad)($res, $test_u0)) > 0
141141

142142
_f2 = Optimization.instantiate_function(optprob,
143143
test_u0,
144-
AutoReverseDiff(; compile = true),
144+
ADTypes.AutoReverseDiff(; compile = true),
145145
nothing; g = true)
146146
_f2.f(test_u0, nothing)
147147
@test @ballocated($(_f2.grad)($res, $test_u0)) > 0
148148

149149
_f3 = Optimization.instantiate_function(optprob,
150150
test_u0,
151-
AutoEnzyme(),
151+
ADTypes.AutoEnzyme(),
152152
nothing; g = true)
153153
_f3.f(test_u0, nothing)
154154
@test @ballocated($(_f3.grad)($res, $test_u0)) == 0

0 commit comments

Comments
 (0)