From bf8416c8037df2c62c8fe356250e66196f6ecffe Mon Sep 17 00:00:00 2001 From: Daniel Arndt Date: Fri, 18 Oct 2024 22:22:24 -0400 Subject: [PATCH] Cuda: fix long double suppression (#7465) * Cuda: fix long double suppression * Enable warnings and warnings as errrors in GitLab CI for GH200 * Also drop -Xcudafe --diag_suppress=3159 * Prefer Werror=all-warnings * Fix uninitializated warning in TestGraph * Add more comments for suppression * Remove redundant inclusion of Kokkos_NumericTraits.hpp --- .gitlab/hpsf-gitlab-ci.yml | 10 +++++++++- .jenkins | 6 +++--- core/unit_test/TestComplex.hpp | 8 ++++++-- core/unit_test/TestGraph.hpp | 2 +- core/unit_test/TestNumericTraits.hpp | 15 +++++++++------ 5 files changed, 28 insertions(+), 13 deletions(-) diff --git a/.gitlab/hpsf-gitlab-ci.yml b/.gitlab/hpsf-gitlab-ci.yml index 6ff23cd9b6b..d578c601398 100644 --- a/.gitlab/hpsf-gitlab-ci.yml +++ b/.gitlab/hpsf-gitlab-ci.yml @@ -3,7 +3,15 @@ NVIDIA-GH200: tags: [nvidia-gh200] image: masterleinad/kokkos-nvcc:12.6.1 script: - - cmake -B build -DKokkos_ENABLE_CUDA=ON -DKokkos_ARCH_HOPPER90=ON -DKokkos_ENABLE_IMPL_CUDA_UNIFIED_MEMORY=ON -DKokkos_ENABLE_TESTS=ON + - cmake + -B build + -DCMAKE_CXX_COMPILER=`pwd`/bin/nvcc_wrapper + -DCMAKE_CXX_FLAGS="-Werror=all-warnings -Werror" + -DKokkos_ARCH_HOPPER90=ON + -DKokkos_ENABLE_CUDA=ON + -DKokkos_ENABLE_COMPILER_WARNINGS=ON + -DKokkos_ENABLE_IMPL_CUDA_UNIFIED_MEMORY=ON + -DKokkos_ENABLE_TESTS=ON - cmake --build build -j48 - cd build - ctest -V diff --git a/.jenkins b/.jenkins index cc5a14a6446..4345a3bb6d8 100644 --- a/.jenkins +++ b/.jenkins @@ -146,7 +146,7 @@ pipeline { -DCMAKE_BUILD_TYPE=Release \ -DCMAKE_CXX_COMPILER_LAUNCHER=ccache \ -DCMAKE_CXX_COMPILER=$WORKSPACE/bin/nvcc_wrapper \ - -DCMAKE_CXX_FLAGS="-Werror --Werror=all-warnings -Xcudafe --diag_suppress=3159 -Xcudafe --diag_suppress=940" \ + -DCMAKE_CXX_FLAGS="-Werror --Werror=all-warnings -Xcudafe --diag_suppress=940" \ -DCMAKE_EXE_LINKER_FLAGS="-Xnvlink -suppress-stack-size-warning" \ -DCMAKE_CXX_STANDARD=17 \ -DKokkos_INSTALL_TESTING=ON \ @@ -454,7 +454,7 @@ pipeline { -DCMAKE_BUILD_TYPE=Debug \ -DCMAKE_CXX_COMPILER_LAUNCHER=ccache \ -DCMAKE_CXX_COMPILER=$WORKSPACE/bin/nvcc_wrapper \ - -DCMAKE_CXX_FLAGS="-Werror -Werror all-warnings -Xcudafe --diag_suppress=20208" \ + -DCMAKE_CXX_FLAGS="-Werror -Werror=all-warnings" \ -DCMAKE_CXX_STANDARD=17 \ -DKokkos_ARCH_NATIVE=ON \ -DKokkos_ENABLE_COMPILER_WARNINGS=ON \ @@ -495,7 +495,7 @@ pipeline { sh '''rm -rf build && mkdir -p build && cd build && \ ../gnu_generate_makefile.bash \ --with-options=compiler_warnings \ - --cxxflags="-Werror -Werror all-warnings -Xcudafe --diag_suppress=20208" \ + --cxxflags="-Werror -Werror=all-warnings" \ --cxxstandard=c++17 \ --with-cuda \ --with-cuda-options=enable_lambda \ diff --git a/core/unit_test/TestComplex.hpp b/core/unit_test/TestComplex.hpp index 43d454d7041..185df52a50b 100644 --- a/core/unit_test/TestComplex.hpp +++ b/core/unit_test/TestComplex.hpp @@ -14,10 +14,11 @@ // //@HEADER -#include -#include +#include // Suppress "'long double' is treated as 'double' in device code" +// The suppression needs to happen before Kokkos_Complex.hpp is included to be +// effective #ifdef KOKKOS_COMPILER_NVCC #ifdef __NVCC_DIAG_PRAGMA_SUPPORT__ #pragma nv_diagnostic push @@ -30,6 +31,9 @@ #endif #endif +#include +#include + namespace { template KOKKOS_FUNCTION constexpr void maybe_unused(Ts &&...) noexcept {} diff --git a/core/unit_test/TestGraph.hpp b/core/unit_test/TestGraph.hpp index e860817c2d9..0792794c95f 100644 --- a/core/unit_test/TestGraph.hpp +++ b/core/unit_test/TestGraph.hpp @@ -507,7 +507,7 @@ TEST_F(TEST_CATEGORY_FIXTURE(graph), force_global_launch) { ASSERT_TRUE(contains(ex, data, functor_t::count)); ASSERT_TRUE(validate_event_set( - [&]() { graph.~optional(); }, + [&]() { graph.reset(); }, [&](DeallocateDataEvent dealloc) { if (dealloc.name == alloc_label && dealloc.ptr == ptr && dealloc.size == ptr_size) diff --git a/core/unit_test/TestNumericTraits.hpp b/core/unit_test/TestNumericTraits.hpp index 9ff5cbfae5c..2cdc6515f63 100644 --- a/core/unit_test/TestNumericTraits.hpp +++ b/core/unit_test/TestNumericTraits.hpp @@ -14,14 +14,11 @@ // //@HEADER -#include - -#include -#include -#include -#include "Kokkos_NumericTraits.hpp" +#include // Suppress "'long double' is treated as 'double' in device code" +// The suppression needs to happen before Kokkos_NumericTraits.hpp is included +// to be effective #ifdef KOKKOS_COMPILER_NVCC #ifdef __NVCC_DIAG_PRAGMA_SUPPORT__ #pragma nv_diagnostic push @@ -34,6 +31,12 @@ #endif #endif +#include + +#include +#include +#include + struct extrema { #define DEFINE_EXTREMA(T, m, M) \ KOKKOS_FUNCTION static T min(T) { return m; } \