-
Notifications
You must be signed in to change notification settings - Fork 20
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add support for view inputs #269
Conversation
Codecov Report
@@ Coverage Diff @@
## main #269 +/- ##
=======================================
Coverage 84.61% 84.61%
=======================================
Files 5 5
Lines 598 598
=======================================
Hits 506 506
Misses 92 92
Continue to review full report at Codecov.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Many thanks for this. Just a few rather unsubstantial comments for now.
Co-authored-by: Dominique <[email protected]>
Co-authored-by: Dominique <[email protected]>
Co-authored-by: Dominique <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the PR, very good stuff!
thank you! |
thanks for the merge! |
Hey JSO devs, we've been using CUTEst.jl for benchmarking our solver MadNLP.jl, and we recently found that JSO's current julia interface does not efficiently handle view inputs. Please consider merging this PR.
This PR adds better support for view inputs for CUTEst.jl's julia interface.
The current CUTEst.jl julia interface converts any
AbstractVector
input toVector{Float64}
to make it compatible with subsequent ccalls, and this process accompanies memory allocations. But when the AbstractVector is a stride-one array (which typically comes from a view of aVector
over aUnitRange
), this can be avoided by directly passing it to C functions.I have added the definition for
StrideOneVector{T}
, and replaced the type specifications in the functions from::Vector{Float64}
to::StrideOneVector{Float64}
. This change allows directly using stride-one vectors as inputs to the C functions instead of allocating more memory. I have also added a test forStrideOneVector{T}
intest_core.jl
.