Fix failing stencil test on cuda - #545
Draft
greole wants to merge 7 commits into
Draft
Conversation
greole
force-pushed
the
fix/failingStencilTestCuda
branch
from
June 15, 2026 12:58
4bd1c5a to
6c23686
Compare
Contributor
There was a problem hiding this comment.
Pull request overview
This PR addresses CUDA-specific test failures by making View element access device-callable, hardening the build against a known nvcc miscompile mode, and avoiding problematic host-side copies/dispatch of nvcc extended lambdas when running scans on the Serial backend.
Changes:
- Mark
NeoN::View::operator[]asKOKKOS_INLINE_FUNCTIONand document the CUDA relaxed-constexpr dependency. - Rework
parallelScanto (a) avoid kernel copies through the executor dispatch chain and (b) emulate scan behavior with a plain host loop onSerialExecutor. - Add CUDA compile diagnostics promotion (nvcc 20013/20015) and ensure
Kokkos_ENABLE_CUDA_CONSTEXPRis enabled for CUDA builds.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| include/NeoN/core/view.hpp | Makes View element access callable in device kernels; documents reliance on relaxed constexpr. |
| include/NeoN/core/parallelAlgorithms.hpp | Avoids problematic kernel copying for scans and adds a SerialExecutor host-loop scan path. |
| CMakeLists.txt | Promotes nvcc constexpr-from-device diagnostics (20013/20015) to hard errors to prevent silent miscompiles. |
| cmake/AutoEnableDevice.cmake | Ensures Kokkos_ENABLE_CUDA_CONSTEXPR is set when CUDA is enabled (but see review comment). |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
greole
force-pushed
the
fix/failingStencilTestCuda
branch
from
June 15, 2026 16:50
6c23686 to
37da7bc
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR addresses CUDA-specific test failures by making View element access device-callable, hardening the build against a known nvcc miscompile mode, and avoiding problematic host-side copies/dispatch of nvcc extended lambdas when running scans on the Serial backend.
Changes:
Mark NeoN::View::operator[] as KOKKOS_INLINE_FUNCTION and document the CUDA relaxed-constexpr dependency.
Rework parallelScan to (a) avoid kernel copies through the executor dispatch chain and (b) emulate scan behavior with a plain host loop on SerialExecutor.
Add CUDA compile diagnostics promotion (nvcc 20013/20015) and ensure Kokkos_ENABLE_CUDA_CONSTEXPR is enabled for CUDA builds.