From eccc941d8752d1a7578ade6603cf1030311696f1 Mon Sep 17 00:00:00 2001 From: Roland Schulz Date: Tue, 19 Oct 2021 22:38:22 +0000 Subject: [PATCH] Fix warnings with Intel 2021.4 --- cmake/gmxCFlags.cmake | 4 ---- cmake/gmxManageSYCL.cmake | 2 +- cmake/gmxTestCompilerProblems.cmake | 6 ++++++ src/external/thread_mpi/src/scatter.cpp | 6 +++--- src/gromacs/gpu_utils/gmxsycl.h | 5 +++++ 5 files changed, 15 insertions(+), 8 deletions(-) diff --git a/cmake/gmxCFlags.cmake b/cmake/gmxCFlags.cmake index 597d425f04..dbc3796190 100644 --- a/cmake/gmxCFlags.cmake +++ b/cmake/gmxCFlags.cmake @@ -378,10 +378,6 @@ macro (gmx_c_flags) endif() GMX_TEST_CXXFLAG(CXXFLAGS_WARN_NO_RESERVED_IDENTIFIER "-Wno-reserved-identifier" GMXC_CXXFLAGS) # LLVM BUG #50644 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) - endif() # Some versions of Intel ICPX compiler (at least 2021.1.1 to 2021.3.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. diff --git a/cmake/gmxManageSYCL.cmake b/cmake/gmxManageSYCL.cmake index 79da7359be..2a9205a35f 100644 --- a/cmake/gmxManageSYCL.cmake +++ b/cmake/gmxManageSYCL.cmake @@ -277,7 +277,7 @@ else() sycl::queue q(sycl::default_selector{}); return 0; } - " "CXX" DISABLE_SYCL_CXX_FLAGS SYCL_CXX_FLAGS "-fsycl -fsycl-device-code-split=per_kernel") + " "CXX" DISABLE_SYCL_CXX_FLAGS SYCL_CXX_FLAGS "-fsycl -fsycl-device-code-split=per_kernel -Wno-deprecated-declarations") if(NOT CHECK_SYCL_CXX_FLAGS_QUIETLY) if(SYCL_CXX_FLAGS_RESULT) diff --git a/cmake/gmxTestCompilerProblems.cmake b/cmake/gmxTestCompilerProblems.cmake index 59848df2f1..c382cc85bb 100644 --- a/cmake/gmxTestCompilerProblems.cmake +++ b/cmake/gmxTestCompilerProblems.cmake @@ -75,6 +75,12 @@ macro(gmx_test_compiler_problems) if (CMAKE_CXX_COMPILER_ID MATCHES "Intel" AND NOT CMAKE_CXX_COMPILER_ID MATCHES "IntelLLVM") message(WARNING "The Intel classic compiler is no longer supported. It may pass the tests, but is not tested by the GROMACS developers. Use the clang-based compiler from oneAPI, or gcc") endif() + # Intel LLVM 2021.2 defaults to no-finite-math which isn't OK for GROMACS and its dependencies (muParser and GTest). + # This is why we set the flags globally via CMAKE_CXX_FLAGS + if(GMX_INTEL_LLVM AND GMX_INTEL_LLVM_VERSION GREATER_EQUAL 2021020) + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fno-finite-math-only") + endif() + if("${CMAKE_CXX_COMPILER_ID}" STREQUAL "XL") check_cxx_source_compiles( diff --git a/src/external/thread_mpi/src/scatter.cpp b/src/external/thread_mpi/src/scatter.cpp index 03117a34b9..0c1a60762f 100644 --- a/src/external/thread_mpi/src/scatter.cpp +++ b/src/external/thread_mpi/src/scatter.cpp @@ -56,7 +56,7 @@ #include "impl.h" #include "collective.h" - +#include "unused.h" int tMPI_Scatter(const void* sendbuf, int sendcount, tMPI_Datatype sendtype, @@ -90,7 +90,7 @@ int tMPI_Scatter(const void* sendbuf, int sendcount, tMPI_Datatype sendtype, { int i; size_t sendsize = sendtype->size*sendcount; - size_t total_send_size = 0; + tmpi_unused size_t total_send_size = 0; #ifdef USE_COLLECTIVE_COPY_BUFFER tmpi_bool using_cb; #endif @@ -227,7 +227,7 @@ int tMPI_Scatterv(const void* sendbuf, int *sendcounts, int *displs, if (myrank == root) { int i; - size_t total_send_size = 0; + tmpi_unused size_t total_send_size = 0; #ifdef USE_COLLECTIVE_COPY_BUFFER tmpi_bool using_cb; #endif diff --git a/src/gromacs/gpu_utils/gmxsycl.h b/src/gromacs/gpu_utils/gmxsycl.h index 2b07b927a7..3d790d4945 100644 --- a/src/gromacs/gpu_utils/gmxsycl.h +++ b/src/gromacs/gpu_utils/gmxsycl.h @@ -106,7 +106,12 @@ namespace detail #if GMX_SYCL_DPCPP // Confirmed to work for 2021.1-beta10 (20201005) to 2021.3.0 (20210619). // Deprecated in favor of sycl::ext::oneapi on 20210717 in https://github.com/intel/llvm/commit/d703f578. +// Removed on 20210927 with https://github.com/intel/llvm/pull/4488 +# if __clang_major__ >= 14 +namespace origin = sycl::ext::oneapi; +# else namespace origin = cl::sycl::ONEAPI; +# endif #elif GMX_SYCL_HIPSYCL namespace origin = cl::sycl; #else -- 2.22.0