diff --git a/CMakeLists.txt b/CMakeLists.txt index 7cab53aa45e..704352a553f 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -121,9 +121,13 @@ endif() # For now, PGI/NVHPC nvc++ compiler doesn't seem to support # `#pragma omp declare reduction` -if (${CMAKE_CXX_COMPILER_ID} MATCHES "PGI|NVHPC") +# +# The math with optimization level -O2 doesn't follow IEEE standard, so we +# enable that back as well. +if (CMAKE_CXX_COMPILER_ID MATCHES "PGI|NVHPC") message(STATUS "OpenMP: Switching to OFF because PGI/NVHPC nvc++ compiler lacks important features.") set(GINKGO_BUILD_OMP OFF) + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Kieee") endif() set(GINKGO_CIRCULAR_DEPS_FLAGS "-Wl,--no-undefined") diff --git a/include/ginkgo/core/base/std_extensions.hpp b/include/ginkgo/core/base/std_extensions.hpp index 460460178e5..c2b585c87dc 100644 --- a/include/ginkgo/core/base/std_extensions.hpp +++ b/include/ginkgo/core/base/std_extensions.hpp @@ -70,7 +70,7 @@ template using void_t = typename detail::make_void::type; -// Disable deprecation warnings when using standard > 2014 +// Disable deprecation warnings when using standard > C++14 inline bool uncaught_exception() noexcept { #if __cplusplus > 201402L return std::uncaught_exceptions() > 0;