From: Daniel Arndt Date: Thu, 1 Aug 2024 19:49:53 +0000 (-0400) Subject: Merge pull request #17417 from tjhei/kokkos-in-tril-warnings X-Git-Tag: v9.6.0-rc2~4^2~1 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=2850f4d0f6847fa6d12349862207b63ea68407bb;p=dealii.git Merge pull request #17417 from tjhei/kokkos-in-tril-warnings Kokkos: disable CUDA warnings when using Kokkos from Trilinos --- diff --git a/cmake/modules/FindDEAL_II_KOKKOS.cmake b/cmake/modules/FindDEAL_II_KOKKOS.cmake index dac87f9bc9..40ac11261a 100644 --- a/cmake/modules/FindDEAL_II_KOKKOS.cmake +++ b/cmake/modules/FindDEAL_II_KOKKOS.cmake @@ -39,39 +39,41 @@ else() set(KOKKOS_FOUND ${Kokkos_FOUND}) - if(Kokkos_FOUND) + set(_target Kokkos::kokkos) + process_feature(KOKKOS + TARGETS REQUIRED _target + ) +endif() + + +if(Kokkos_FOUND) + if(Kokkos_ENABLE_CUDA) # We need to disable SIMD vectorization for CUDA device code. # Otherwise, nvcc compilers from version 9 on will emit an error message like: # "[...] contains a vector, which is not supported in device code". We # would like to set the variable in check_01_cpu_feature but at that point # we don't know if CUDA support is enabled in Kokkos - if(Kokkos_ENABLE_CUDA) - set(DEAL_II_VECTORIZATION_WIDTH_IN_BITS 0) - # Require lambda support and expt-relaxed-constexpr for Cuda - # so that we can use std::array and other interfaces with - # __host__ constexpr functions in device code - KOKKOS_CHECK(OPTIONS CUDA_LAMBDA CUDA_CONSTEXPR) + set(DEAL_II_VECTORIZATION_WIDTH_IN_BITS 0) - # Disable a bunch of annoying warnings generated by boost, template code, - # and in other random places: - # - # integer conversion resulted in a change of sign: - enable_if_supported(DEAL_II_CXX_FLAGS "-Xcudafe --diag_suppress=68") - # variable "i" was set but never used: - enable_if_supported(DEAL_II_CXX_FLAGS "-Xcudafe --diag_suppress=550") - # loop is not reachable: - enable_if_supported(DEAL_II_CXX_FLAGS "-Xcudafe --diag_suppress=128") - # warning #186-D: pointless comparison of unsigned integer with zero - enable_if_supported(DEAL_II_CXX_FLAGS "-Xcudafe --diag_suppress=186") - # warning #177-D: variable "n_max_face_orientations" was declared but never referenced - enable_if_supported(DEAL_II_CXX_FLAGS "-Xcudafe --diag_suppress=177") - # warning #284-D: NULL reference is not allowed - enable_if_supported(DEAL_II_CXX_FLAGS "-Xcudafe --diag_suppress=284") - endif() - endif() + # Require lambda support and expt-relaxed-constexpr for Cuda + # so that we can use std::array and other interfaces with + # __host__ constexpr functions in device code + KOKKOS_CHECK(OPTIONS CUDA_LAMBDA CUDA_CONSTEXPR) - set(_target Kokkos::kokkos) - process_feature(KOKKOS - TARGETS REQUIRED _target - ) + # Disable a bunch of annoying warnings generated by boost, template code, + # and in other random places: + # + # integer conversion resulted in a change of sign: + enable_if_supported(DEAL_II_CXX_FLAGS "-Xcudafe --diag_suppress=68") + # variable "i" was set but never used: + enable_if_supported(DEAL_II_CXX_FLAGS "-Xcudafe --diag_suppress=550") + # loop is not reachable: + enable_if_supported(DEAL_II_CXX_FLAGS "-Xcudafe --diag_suppress=128") + # warning #186-D: pointless comparison of unsigned integer with zero + enable_if_supported(DEAL_II_CXX_FLAGS "-Xcudafe --diag_suppress=186") + # warning #177-D: variable "n_max_face_orientations" was declared but never referenced + enable_if_supported(DEAL_II_CXX_FLAGS "-Xcudafe --diag_suppress=177") + # warning #284-D: NULL reference is not allowed + enable_if_supported(DEAL_II_CXX_FLAGS "-Xcudafe --diag_suppress=284") + endif() endif()