Skip to content

Commit

Permalink
Only set -Wno-unused-but-set-parameter where nvhpc supports it (maybe…
Browse files Browse the repository at this point in the history
… >= 22.9
  • Loading branch information
ptheywood committed Jan 11, 2024
1 parent 3ad813d commit 0d6c52a
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 3 deletions.
5 changes: 5 additions & 0 deletions .github/workflows/NVHPC.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,11 @@ jobs:
hostcxx: nvhpc-22.9
os: ubuntu-22.04
container: nvcr.io/nvidia/nvhpc:22.9-devel-cuda11.7-ubuntu22.04
- cuda: "11.7"
cuda_arch: "35"
hostcxx: nvhpc-22.7
os: ubuntu-22.04
container: nvcr.io/nvidia/nvhpc:22.7-devel-cuda11.7-ubuntu22.04
- cuda: "11.7"
cuda_arch: "35"
hostcxx: nvhpc-22.5
Expand Down
9 changes: 6 additions & 3 deletions cmake/warnings.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -119,9 +119,12 @@ if(NOT COMMAND flamegpu_suppress_some_compiler_warnings)
# nvc++ etc do not appear to have an equivalent to -isystem. Rather than more pragma warning soup, just tone down warnings when using nvc++ as appropriate.
target_compile_options(${SSCW_TARGET} PRIVATE "$<$<COMPILE_LANGUAGE:CUDA>:SHELL:-Xcudafe --diag_suppress=code_is_unreachable>")
target_compile_options(${SSCW_TARGET} PRIVATE "$<$<COMPILE_LANGUAGE:C,CXX>:SHELL:--diag_suppress=code_is_unreachable>")
# older nvhpc as host compiler warns for intentional declared but never referenced parameters
target_compile_options(${SSCW_TARGET} PRIVATE "$<$<COMPILE_LANGUAGE:C,CXX>:SHELL:-Wno-unused-but-set-parameter>")
target_compile_options(${SSCW_TARGET} PRIVATE "$<$<COMPILE_LANGUAGE:CUDA>:SHELL:-Xcompiler -Wno-unused-but-set-parameter>")
# older nvhpc as host compiler warns for intentional declared but never referenced parameters. only supported from 22.7/9
message(FATAL_ERROR "${CMAKE_CXX_COMPILER_VERSION}")
if(CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL "22.7")
target_compile_options(${SSCW_TARGET} PRIVATE "$<$<COMPILE_LANGUAGE:C,CXX>:SHELL:-Wno-unused-but-set-parameter>")
target_compile_options(${SSCW_TARGET} PRIVATE "$<$<COMPILE_LANGUAGE:CUDA>:SHELL:-Xcompiler -Wno-unused-but-set-parameter>")
endif()
else()
# Linux specific warning suppressions
endif()
Expand Down

0 comments on commit 0d6c52a

Please sign in to comment.