Skip to content

Conversation

WeiqunZhang
Copy link
Member

@WeiqunZhang WeiqunZhang commented Aug 13, 2025

This works on lambdas, functors, normal functions. But it does not work on overloaded functions like std::sin. If needed, one could however wrap functions like std::sin inside a lambda function. It also does not work with normal
functions for SYCL and one would have to wrap it inside a lambda.

Here is the motivation behind this PR. In this impactx PR (BLAST-ImpactX/impactx#964), a GPU kernel uses 8 amrex::Parser's. The CUDA CI fails if more than one job is used in build. Apparently the kernel is too big because all those parser functions are inlined. This PR provides a way to reduce the size by forcing noinline.

This works on lambdas, functors, normal functions. But it does not work on
overloaded functions like std::sin. If needed, one could however wrap
functions like std::sin inside a lambda function.

Here is the motivation behind this PR. In this impactx PR
(BLAST-ImpactX/impactx#964), a GPU kernel uses 8
amrex::Parser's. The CUDA CI fails if more than one job is used in
build. Apparently the kernel is too big because all those parser functions
are inlined. This PR provides a way to reduce the size by forcing noinline.
Copy link
Member

@ax3l ax3l left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you!

@ax3l ax3l merged commit ae20296 into AMReX-Codes:development Aug 28, 2025
75 checks passed
@ax3l ax3l self-assigned this Aug 28, 2025
@WeiqunZhang WeiqunZhang deleted the call_noinline branch August 28, 2025 22:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants