From 05607cc9adbe461546f35da8dd23d0aa3b7170b5 Mon Sep 17 00:00:00 2001 From: Andrey Alekseenko Date: Sat, 29 May 2021 01:51:33 +0300 Subject: [PATCH] Disable false-positive warnings for ICPX 2021.2.0 Not happening in open-source intel/llvm compiler. While originally it was enough to disable them at include stage, in 2021.2 the warning is issued in the kernel itself, so we had to expand its usage beyond gmxsycl.h. --- cmake/gmxCFlags.cmake | 13 ++++++++++--- src/gromacs/gpu_utils/gmxsycl.h | 23 ----------------------- 2 files changed, 10 insertions(+), 26 deletions(-) diff --git a/cmake/gmxCFlags.cmake b/cmake/gmxCFlags.cmake index 831dbcac40..64e963d85b 100644 --- a/cmake/gmxCFlags.cmake +++ b/cmake/gmxCFlags.cmake @@ -362,9 +362,16 @@ macro (gmx_c_flags) GMX_TEST_CXXFLAG(CXXFLAGS_PRAGMA "-Wno-unknown-pragmas" GMXC_CXXFLAGS) endif() GMX_TEST_CXXFLAG(CXXFLAGS_WARN_NO_MISSING_FIELD_INITIALIZERS "-Wno-missing-field-initializers" GMXC_CXXFLAGS) - # Intel LLVM 2021.2 defaults to no-finite-math which isn't OK for GROMACS - if(GMX_INTEL_LLVM AND GMX_INTEL_LLVM_VERSION GREATER_EQUAL 2021020) - GMX_TEST_CXXFLAG(CXXFLAGS_FINITE_MATH "-fno-finite-math-only" GMXC_CXXFLAGS) + # Intel LLVM 2021.2 defaults to no-finite-math which isn't OK for GROMACS + if(GMX_INTEL_LLVM AND GMX_INTEL_LLVM_VERSION GREATER_EQUAL 2021020) + GMX_TEST_CXXFLAG(CXXFLAGS_FINITE_MATH "-fno-finite-math-only" GMXC_CXXFLAGS) + endif() + # Some versions of Intel ICPX compiler (at least 2021.1.1 to 2021.2.0) fail to unroll a loop + # in sycl::accessor::__init, and emit -Wpass-failed=transform-warning. This is a useful + # warning, but mostly noise right now. Probably related to using shared memory accessors. + # Note: not a typo: ICPX 2021.1.1 has GMX_INTEL_LLVM_VERSION 202110; 2021.2.0 has 20210200. + if(GMX_INTEL_LLVM AND GMX_INTEL_LLVM_VERSION GREATER_EQUAL 202110) + GMX_TEST_CXXFLAG(CXXFLAGS_NO_UNROLL_WARNING "-Wno-pass-failed" GMXC_CXXFLAGS) endif() endif() diff --git a/src/gromacs/gpu_utils/gmxsycl.h b/src/gromacs/gpu_utils/gmxsycl.h index 77891f937d..897b5493d2 100644 --- a/src/gromacs/gpu_utils/gmxsycl.h +++ b/src/gromacs/gpu_utils/gmxsycl.h @@ -54,23 +54,6 @@ #include "config.h" -/* Some versions of Intel ICPX compiler (at least 2021.1.1 and 2021.1.2) fail to unroll a loop - * in sycl::accessor::__init, and emit -Wpass-failed=transform-warning. This is a useful - * warning, but mostly noise right now. Probably related to using shared memory accessors. - * The unroll directive was introduced in https://github.com/intel/llvm/pull/2449. */ -#if GMX_SYCL_DPCPP -# include -# define DISABLE_UNROLL_WARNINGS \ - ((__SYCL_COMPILER_VERSION >= 20201113) && (__SYCL_COMPILER_VERSION <= 20201214)) -#else -# define DISABLE_UNROLL_WARNINGS 0 -#endif - -#if DISABLE_UNROLL_WARNINGS -# pragma clang diagnostic push -# pragma clang diagnostic ignored "-Wpass-failed" -#endif - // For hipSYCL, we need to activate floating-point atomics #if GMX_SYCL_HIPSYCL # define HIPSYCL_EXT_FP_ATOMICS @@ -106,16 +89,10 @@ # include #endif -#if DISABLE_UNROLL_WARNINGS -# pragma clang diagnostic pop -#endif - #if GMX_SYCL_HIPSYCL # pragma clang diagnostic pop #endif -#undef DISABLE_UNROLL_WARNINGS - /* Exposing Intel-specific extensions in a manner compatible with SYCL2020 provisional spec. * Despite ICPX (up to 2021.1.2 at the least) having SYCL_LANGUAGE_VERSION=202001, * some parts of the spec are still in custom sycl::ONEAPI namespace (sycl::intel in beta versions), -- 2.22.0