-
Notifications
You must be signed in to change notification settings - Fork 14
/
nlpmodelstest.jl
36 lines (34 loc) · 1.54 KB
/
nlpmodelstest.jl
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
35
36
@testset "Checking NLPModelsTest (NLP) tests with $backend" for backend in
keys(ADNLPModels.predefined_backend)
@testset "Checking NLPModelsTest tests on problem $problem" for problem in
NLPModelsTest.nlp_problems
nlp_from_T = eval(Meta.parse(lowercase(problem) * "_autodiff"))
nlp_ad = nlp_from_T(; backend = backend)
nlp_man = eval(Meta.parse(problem))()
show(IOBuffer(), nlp_ad)
nlps = [nlp_ad, nlp_man]
@testset "Check Consistency" begin
consistent_nlps(nlps, exclude = [], linear_api = true, reimplemented = ["jtprod"])
end
@testset "Check dimensions" begin
check_nlp_dimensions(nlp_ad, exclude = [], linear_api = true)
end
@testset "Check multiple precision" begin
multiple_precision_nlp(nlp_from_T, exclude = [], linear_api = true)
end
@testset "Check multiple precision GPU" begin
if CUDA.functional()
CUDA.allowscalar() do
# sparse Jacobian/Hessian doesn't work here
multiple_precision_nlp_array(T -> nlp_from_T(T; jacobian_backend = ADNLPModels.ForwardDiffADJacobian, hessian_backend = ADNLPModels.ForwardDiffADHessian), CuArray, exclude = [jth_hprod, hprod, jprod], linear_api = true)
end
end
end
@testset "Check view subarray" begin
view_subarray_nlp(nlp_ad, exclude = [])
end
@testset "Check coordinate memory" begin
coord_memory_nlp(nlp_ad, exclude = [], linear_api = true)
end
end
end