-
Notifications
You must be signed in to change notification settings - Fork 280
Rework p_global
to use global_data
instead of memory pools
#1313
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
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
…ion_opts_set_to_default
sandmaennchen
approved these changes
Oct 24, 2024
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.
looks great! 😍 amazing journey 🚀
FreyJo
added a commit
that referenced
this pull request
Nov 4, 2024
Should have happened in #1313 already
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Previously, as of #1241,
p_global
was only supported forMX
, since the memory pool workflow is limited to this.The
p_global_precompute_fun
now computes the same stuff but has one output vector calledglobal_data
(a concatenation of all the expressions previously computed by the function).This
global_data
has been added toocp_nlp_in
and is added as a last input to all other external CasADi functions by theGenerateContext
.Detailed changes below:
OCP NLP Dimensions:
np_global
andn_global_data
fields toocp_nlp_dims
and initialized them inocp_nlp_dims_assign_self
.ocp_nlp_dims_set_global
function to set global fields inocp_nlp_dims
ocp_nlp_in_calculate_size_self
andocp_nlp_in_assign_self
to handle global data.External Function Generic Enhancements:
with_global_data
field toexternal_function_opts
and corresponding default setter function.External Function CasADi Enhancements:
set_global_data_pointer
function toexternal_function_external_param_casadi
and updated related functions to handle global data.Bug Fixes and Code Clean-Up:
external_function_casadi_wrapper
andexternal_function_param_casadi_wrapper
.external_function_param_casadi_set_param
andexternal_function_param_casadi_set_param_sparse
.