8000 Rework `p_global` to use `global_data` instead of memory pools by FreyJo · Pull Request #1313 · acados/acados · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

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
merged 32 commits into from
Oct 25, 2024

Conversation

FreyJo
Copy link
Member
@FreyJo FreyJo commented Oct 24, 2024

Previously, as of #1241, p_global was only supported for MX, since the memory pool workflow is limited to this.
The p_global_precompute_fun now computes the same stuff but has one output vector called global_data (a concatenation of all the expressions previously computed by the function).
This global_data has been added to ocp_nlp_in and is added as a last input to all other external CasADi functions by the GenerateContext.

Detailed changes below:

OCP NLP Dimensions:

  • Added np_global and n_global_data fields to ocp_nlp_dims and initialized them in ocp_nlp_dims_assign_self.
  • Introduced ocp_nlp_dims_set_global function to set global fields in ocp_nlp_dims
  • Updated ocp_nlp_in_calculate_size_self and ocp_nlp_in_assign_self to handle global data.

External Function Generic Enhancements:

  • Added with_global_data field to external_function_opts and corresponding default setter function.

External Function CasADi Enhancements:

  • Added set_global_data_pointer function to external_function_external_param_casadi and updated related functions to handle global data.

Bug Fixes and Code Clean-Up:

  • Fixed incorrect error messages and improved error handling in external_function_casadi_wrapper and external_function_param_casadi_wrapper.
  • Refactored parameter handling in external_function_param_casadi_set_param and external_function_param_casadi_set_param_sparse.

Copy link
Contributor
@sandmaennchen sandmaennchen left a 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 FreyJo merged commit 0adcbb7 into acados:master Oct 25, 2024
13 checks passed
@FreyJo FreyJo deleted the ext_fun_stuff branch October 25, 2024 09:16
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
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants
0