Fix warnings with Intel 2021.4
authorRoland Schulz <roland.schulz@intel.com>
Tue, 19 Oct 2021 22:38:22 +0000 (22:38 +0000)
committerMark Abraham <mark.j.abraham@gmail.com>
Tue, 19 Oct 2021 22:38:22 +0000 (22:38 +0000)
cmake/gmxCFlags.cmake
cmake/gmxManageSYCL.cmake
cmake/gmxTestCompilerProblems.cmake
src/external/thread_mpi/src/scatter.cpp
src/gromacs/gpu_utils/gmxsycl.h

index 597d425f04bd410f8b2b56272582733df62ac0ab..dbc379619091467b2c872326664ca829ad135088 100644 (file)
@@ -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.
index 79da7359be7b91e02725ec09fee694a82f49d442..2a9205a35f79cfa0b7afa7506aafd63295cbe817 100644 (file)
@@ -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)
index 59848df2f1f43035d9900a2bc17f8cdd07bac33c..c382cc85bbf57d59fe9ee3c69b7e35b8dcccb7c6 100644 (file)
@@ -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(
index 03117a34b977c75529c8fb0216b105ba791e65bf..0c1a60762f8d0a49ad7e1603f321fc617016019e 100644 (file)
@@ -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
index 2b07b927a7649288778546911ef69f5fb26ca5f3..3d790d49450dba7b8147796ba70f1a5052e27553 100644 (file)
@@ -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