Skip to content

amrex::callNoinline: Call given function without inline #4606

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

Open
wants to merge 3 commits into
base: development
Choose a base branch
from

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.
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.

1 participant