Skip to content

Commit

Permalink
Remove fix -50 in coord memory nlp allocation tests
Browse files Browse the repository at this point in the history
  • Loading branch information
tmigot committed Sep 28, 2024
1 parent a250100 commit 08aa587
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions src/nlp/coord-memory.jl
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ function coord_memory_nlp(nlp::AbstractNLPModel; linear_api = false, exclude = [
V = zeros(nlp.meta.nnzh)
hess_coord!(nlp, x, V)
al2 = @allocated hess_coord!(nlp, x, V)
@test al2 < al1 - 50
@test al2 < al1
end

if m > 0
Expand All @@ -29,15 +29,15 @@ function coord_memory_nlp(nlp::AbstractNLPModel; linear_api = false, exclude = [
al1 = @allocated vals = hess_coord(nlp, x, y)
hess_coord!(nlp, x, y, V)
al2 = @allocated hess_coord!(nlp, x, y, V)
@test al2 < al1 - 50
@test al2 < al1
end

if jth_hess_coord exclude
vals = jth_hess_coord(nlp, x, m)
al1 = @allocated vals = jth_hess_coord(nlp, x, m)
jth_hess_coord!(nlp, x, m, V)
al2 = @allocated jth_hess_coord!(nlp, x, m, V)
@test al2 < al1 - 50
@test al2 < al1
end

if jac_coord exclude
Expand All @@ -46,22 +46,22 @@ function coord_memory_nlp(nlp::AbstractNLPModel; linear_api = false, exclude = [
V = zeros(nlp.meta.nnzj)
jac_coord!(nlp, x, vals)
al2 = @allocated jac_coord!(nlp, x, vals)
@test al2 < al1 - 50
@test al2 < al1
if linear_api && nlp.meta.nlin > 0
vals = jac_lin_coord(nlp, x)
al1 = @allocated vals = jac_lin_coord(nlp, x)
V = zeros(nlp.meta.lin_nnzj)
jac_lin_coord!(nlp, x, vals)
al2 = @allocated jac_lin_coord!(nlp, x, vals)
@test al2 < al1 - 50
@test al2 < al1
end
if linear_api && nlp.meta.nnln > 0
vals = jac_nln_coord(nlp, x)
al1 = @allocated vals = jac_nln_coord(nlp, x)
V = zeros(nlp.meta.nln_nnzj)
jac_nln_coord!(nlp, x, vals)
al2 = @allocated jac_nln_coord!(nlp, x, vals)
@test al2 < al1 - 50
@test al2 < al1
end
end
end
Expand Down

0 comments on commit 08aa587

Please sign in to comment.