Skip to content

Commit f46aa47

Browse files
committed
CMake: Update warning suppressions to match FLAMEGPU2 for CUDA 12+13
1 parent cba67ef commit f46aa47

1 file changed

Lines changed: 17 additions & 3 deletions

File tree

cmake/warnings.cmake

Lines changed: 17 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -106,10 +106,24 @@ if(NOT COMMAND flamegpu_visualiser_suppress_some_compiler_warnings)
106106
# CUDA 11.6 deprecates __device__ cudaDeviceSynchronize, but does not provide an alternative.
107107
# This is used in cub/thrust, and windows still emits this warning from the third party library
108108
if(CMAKE_CUDA_COMPILER_VERSION VERSION_GREATER_EQUAL 11.6.0)
109-
target_compile_definitions(${SSCW_TARGET} PRIVATE "$<$<COMPILE_LANGUAGE:C,CXX,CUDA>:__CDPRT_SUPPRESS_SYNC_DEPRECATION_WARNING>")
109+
target_compile_definitions(${SSCW_TARGET} PRIVATE "__CDPRT_SUPPRESS_SYNC_DEPRECATION_WARNING")
110+
endif()
111+
# CUDA 13.0 curand_poisson.h under windows generates error '#20199-D: unrecognized #pragma in device code'. This was fixed in CUDA 13.0 Update 1, but nvcc reports the same version so the suppression is applied to < 13.1
112+
if(CMAKE_CUDA_COMPILER_VERSION VERSION_GREATER_EQUAL 13.0.0 AND CMAKE_CUDA_COMPILER_VERSION VERSION_LESS 13.1)
113+
target_compile_options(${SSCW_TARGET} PRIVATE "$<$<COMPILE_LANGUAGE:CUDA>:SHELL:-Xcudafe --diag_suppress=20199>")
114+
endif()
115+
elseif(CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
116+
# GCC specific warning suppressions
117+
# GCC 10.1 AARCH specific ps ABI warnings in C++17 mode. See https://github.com/FLAMEGPU/FLAMEGPU2/issues/1176
118+
if(CMAKE_SYSTEM_PROCESSOR STREQUAL "aarch64" AND CMAKE_CUDA_COMPILER_VERSION VERSION_GREATER_EQUAL 10.1.0)
119+
target_compile_options(${SSCW_TARGET} PRIVATE "$<$<COMPILE_LANGUAGE:CUDA>:SHELL:-Xcompiler -Wno-psabi>")
120+
target_compile_options(${SSCW_TARGET} PRIVATE "$<$<COMPILE_LANGUAGE:C,CXX>:-Wno-psabi>")
121+
endif()
122+
# (some) GCC 12 in c++20 issues Wrestrict warnings for assigning a single character to a std::string, which is a false-positive.
123+
if(CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL 12.0.0 AND CMAKE_CXX_COMPILER_VERSION VERSION_LESS 13.0.0)
124+
target_compile_options(${SSCW_TARGET} PRIVATE "$<$<COMPILE_LANGUAGE:CUDA>:SHELL:-Xcompiler -Wno-restrict>")
125+
target_compile_options(${SSCW_TARGET} PRIVATE "$<$<COMPILE_LANGUAGE:C,CXX>:-Wno-restrict>")
110126
endif()
111-
else()
112-
# Linux specific warning suppressions
113127
endif()
114128
# Generic OS/host compiler warning suppressions
115129
# Ensure NVCC outputs warning numbers

0 commit comments

Comments
 (0)