Skip to content

Change global tag variables to local variables. - #467

Open
seyonglee wants to merge 1 commit into
kokkos:stablefrom
seyonglee:change-global-tag-to-local
Open

Change global tag variables to local variables.#467
seyonglee wants to merge 1 commit into
kokkos:stablefrom
seyonglee:change-global-tag-to-local

Conversation

@seyonglee

Copy link
Copy Markdown
Contributor

This PR changes global tag variables accessed in Kokkos subview-related functions to local variables, so that NVHPC OpenACC compiler (nvc++ version higher than 24.5) can compile a Kokkos program where a subview is created in a device kernel.
This PR contains the same changes as mdspan code changes in Kokkos PR 9486 (kokkos/kokkos#9486)

@nmm0

nmm0 commented Sep 2, 2026

Copy link
Copy Markdown
Contributor

Do you know why this is causing problems? Is it an nvc++ compiler bug?

@seyonglee

Copy link
Copy Markdown
Contributor Author

Do you know why this is causing problems? Is it an nvc++ compiler bug?

If a subview is created in a device kernel (e.g., in a Kokkos parallel_for()), several global tag symbols are accessed, which cannot be correctly captured by nvc++ compiler if version > 24.5.

@nmm0

nmm0 commented Sep 2, 2026

Copy link
Copy Markdown
Contributor

Fascinating, even if they are constexpr? Well either way I think this is fine

@dalg24 dalg24 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Just noting that mdspan_non_standard would now become unused.

cc @mhoemmen @weinbe2

@mhoemmen

mhoemmen commented Sep 4, 2026

Copy link
Copy Markdown
Contributor

Thanks for the fix! : - )

@seyonglee wrote:

... so that NVHPC OpenACC compiler (nvc++ version higher than 24.5) can compile a Kokkos program where a subview is created in a device kernel.

Does this mean "is able to build without errors" or "is able to build and pass tests"?

@seyonglee

Copy link
Copy Markdown
Contributor Author

Thanks for the fix! : - )

@seyonglee wrote:

... so that NVHPC OpenACC compiler (nvc++ version higher than 24.5) can compile a Kokkos program where a subview is created in a device kernel.

Does this mean "is able to build without errors" or "is able to build and pass tests"?

With this update, the following two Kokkos unit tests, which create subview in a device kernel, can be built without errors and pass tests:

core/unit_test/range_policy/TestRangePolicyExecutionTypes.hpp
core/unit_test/TestSubView_c13.hpp

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.

4 participants