Skip to content

Fix failing stencil test on cuda - #545

Draft
greole wants to merge 7 commits into
developfrom
fix/failingStencilTestCuda
Draft

Fix failing stencil test on cuda#545
greole wants to merge 7 commits into
developfrom
fix/failingStencilTestCuda

Conversation

@greole

@greole greole commented Jun 15, 2026

Copy link
Copy Markdown
Contributor

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.

@greole
greole force-pushed the fix/failingStencilTestCuda branch from 4bd1c5a to 6c23686 Compare June 15, 2026 12:58
@greole
greole requested a review from Copilot June 15, 2026 13:11

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

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

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.

Comment thread cmake/AutoEnableDevice.cmake
@greole
greole force-pushed the fix/failingStencilTestCuda branch from 6c23686 to 37da7bc Compare June 15, 2026 16:50
@greole greole changed the title Fix/failing stencil test cuda Fix failing stencil test on cuda Jun 16, 2026
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.

2 participants