- Type:
correctness
- Severity:
medium
- Component:
CMake CUDA backend
- Location:
Tools/CMake/AMReXParallelBackends.cmake:199
Problem
The CUDA backend accumulates compiler flags in _cuda_flags and later applies
that list to every amrex_${D}d target. The CUDA 11.2+ branch intended to make
device-variable misuse a hard error appends to _cuda_flag instead:
if (CMAKE_CUDA_COMPILER_VERSION VERSION_GREATER_EQUAL 11.2)
list(APPEND _cuda_flag --display-error-number "SHELL:--diag-error 20092")
endif ()
The target application step uses _cuda_flags, so these diagnostics are never
actually enabled.
Impact
- CUDA 11.2+ builds silently miss the extra diagnostic enforcement that this
branch is meant to provide.
- Misuse that should be diagnosed as an error can pass through this configuration
path without the intended nvcc flags.
Suggested patch
--- a/Tools/CMake/AMReXParallelBackends.cmake
+++ b/Tools/CMake/AMReXParallelBackends.cmake
@@
- if (CMAKE_CUDA_COMPILER_VERSION VERSION_GREATER_EQUAL 11.2)
- list(APPEND _cuda_flag --display-error-number "SHELL:--diag-error 20092")
+ if (CMAKE_CUDA_COMPILER_VERSION VERSION_GREATER_EQUAL 11.2)
+ list(APPEND _cuda_flags --display-error-number "SHELL:--diag-error 20092")
endif ()
Prepared by Codex
correctnessmediumCMake CUDA backendTools/CMake/AMReXParallelBackends.cmake:199Problem
The CUDA backend accumulates compiler flags in
_cuda_flagsand later appliesthat list to every
amrex_${D}dtarget. The CUDA 11.2+ branch intended to makedevice-variable misuse a hard error appends to
_cuda_flaginstead:The target application step uses
_cuda_flags, so these diagnostics are neveractually enabled.
Impact
branch is meant to provide.
path without the intended nvcc flags.
Suggested patch
Prepared by Codex