Skip to content

Commit

Permalink
Cuda: fix long double suppression (kokkos#7465)
Browse files Browse the repository at this point in the history
* 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
  • Loading branch information
masterleinad authored Oct 19, 2024
1 parent f6ecb2b commit bf8416c
Show file tree
Hide file tree
Showing 5 changed files with 28 additions and 13 deletions.
10 changes: 9 additions & 1 deletion .gitlab/hpsf-gitlab-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
6 changes: 3 additions & 3 deletions .jenkins
Original file line number Diff line number Diff line change
Expand Up @@ -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 \
Expand Down Expand Up @@ -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 \
Expand Down Expand Up @@ -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 \
Expand Down
8 changes: 6 additions & 2 deletions core/unit_test/TestComplex.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,11 @@
//
//@HEADER

#include <Kokkos_Core.hpp>
#include <sstream>
#include <Kokkos_Macros.hpp>

// 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
Expand All @@ -30,6 +31,9 @@
#endif
#endif

#include <Kokkos_Core.hpp>
#include <sstream>

namespace {
template <typename... Ts>
KOKKOS_FUNCTION constexpr void maybe_unused(Ts &&...) noexcept {}
Expand Down
2 changes: 1 addition & 1 deletion core/unit_test/TestGraph.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
15 changes: 9 additions & 6 deletions core/unit_test/TestNumericTraits.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,11 @@
//
//@HEADER

#include <gtest/gtest.h>

#include <Kokkos_Core.hpp>
#include <type_traits>
#include <limits>
#include "Kokkos_NumericTraits.hpp"
#include <Kokkos_Macros.hpp>

// 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
Expand All @@ -34,6 +31,12 @@
#endif
#endif

#include <gtest/gtest.h>

#include <Kokkos_Core.hpp>
#include <type_traits>
#include <limits>

struct extrema {
#define DEFINE_EXTREMA(T, m, M) \
KOKKOS_FUNCTION static T min(T) { return m; } \
Expand Down

0 comments on commit bf8416c

Please sign in to comment.