Skip to content

Add an option to disable CUDA constant memory dispatch - #9352

Closed
NamjaeChoi wants to merge 1 commit into
kokkos:developfrom
NamjaeChoi:constant_dispatch
Closed

NamjaeChoi wants to merge 1 commit into
kokkos:developfrom
NamjaeChoi:constant_dispatch

Conversation

@NamjaeChoi

@NamjaeChoi NamjaeChoi commented Jul 14, 2026

Copy link
Copy Markdown
Contributor

This PR adds a compile option Kokkos_ENABLE_IMPL_CUDA_CONSTANT_MEMORY which can be used to optionally disable explicit constant memory dispatches for CUDA. Because of the constant memory buffer definition, it is currently required to set the RDC option consistently across all the downstream packages. If an application that wants to use RDC acquires Kokkos through one of its upstream packages, and if the package has its own Kokkos codes not using RDC, meeting this requirement becomes really painful. Combined with #9346, if a user sets this option to OFF, the user can use Kokkos as a fully self-contained library.

As constant memory dispatch was replaced by __grid_constant__ kernel argument annotation (even though #9133 mentioned that it sometimes doesn't provide equivalent performance), and using constant memory should now be explicitly requested, those who didn't see performance hit and are not interested in explicitly using it may consider disabling it.

Signed-off-by: Namjae Choi <Namjae.Choi@inl.gov>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

SNL-CI-APPROVAL Required for non-SNL contributions to run on SNL CI

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants