Skip to content

Commit

Permalink
Enable gpu for bound-constrained problems (#208)
Browse files Browse the repository at this point in the history
* Remove constrained type in ForwardDiffADHvprod
* Allow more generic type in constructor
  • Loading branch information
tmigot authored Dec 22, 2023
1 parent d4c48d2 commit f1c03b1
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions src/forward.jl
Original file line number Diff line number Diff line change
Expand Up @@ -182,8 +182,8 @@ struct ForwardDiffADHvprod{Tag, GT, S, T, F, Tagf} <: ADBackend
lz::Vector{ForwardDiff.Dual{Tag, T, 1}}
glz::Vector{ForwardDiff.Dual{Tag, T, 1}}
sol::S
longv::S
Hvp::S
longv
Hvp
∇φ!::GT
z::Vector{ForwardDiff.Dual{Tagf, T, 1}}
gz::Vector{ForwardDiff.Dual{Tagf, T, 1}}
Expand Down
2 changes: 1 addition & 1 deletion src/nlp.jl
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ ADNLPModel(
adbackend::ADModelBackend,
f,
c,
) where {T, S} = ADNLPModel(meta, counters, adbackend, f, Int[], Int[], T[], c)
) where {T, S} = ADNLPModel(meta, counters, adbackend, f, Int[], Int[], similar(meta.x0, 0), c)

ADNLPModels.show_header(io::IO, nlp::ADNLPModel) =
println(io, "ADNLPModel - Model with automatic differentiation backend $(nlp.adbackend)")
Expand Down
2 changes: 1 addition & 1 deletion src/nls.jl
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ ADNLSModel(
adbackend::ADModelBackend,
F,
c,
) where {T, S} = ADNLSModel(meta, nls_meta, counters, adbackend, F, Int[], Int[], T[], c)
) where {T, S} = ADNLSModel(meta, nls_meta, counters, adbackend, F, Int[], Int[], similar(meta.x0, 0), c)

ADNLPModels.show_header(io::IO, nls::ADNLSModel) = println(
io,
Expand Down

0 comments on commit f1c03b1

Please sign in to comment.