Add SYCL compiler and MKL versions
authorAndrey Alekseenko <al42and@gmail.com>
Thu, 16 Sep 2021 10:08:04 +0000 (10:08 +0000)
committerSzilárd Páll <pall.szilard@gmail.com>
Thu, 16 Sep 2021 10:08:04 +0000 (10:08 +0000)
src/GetCompilerInfo.cmake
src/buildinfo.h.cmakein
src/config.h.cmakein
src/gromacs/utility/CMakeLists.txt
src/gromacs/utility/binaryinformation.cpp
src/gromacs/utility/sycl_version_information.cpp [new file with mode: 0644]
src/gromacs/utility/sycl_version_information.h [new file with mode: 0644]

index 4720f492d68b2697762a79601e47230d59cee010..b9c29642e280eb07f1b72b929433f701bd9e29b9 100644 (file)
@@ -1,7 +1,7 @@
 #
 # This file is part of the GROMACS molecular simulation package.
 #
-# Copyright (c) 2012,2013,2014,2019, by the GROMACS development team, led by
+# Copyright (c) 2012,2013,2014,2019,2021, by the GROMACS development team, led by
 # Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
 # and including many others, as listed in the AUTHORS file in the
 # top-level source directory and at http://www.gromacs.org.
 #                    some compiler-provided information
 #
 macro(get_compiler_info LANGUAGE BUILD_COMPILER)
-    set(${BUILD_COMPILER} "${CMAKE_${LANGUAGE}_COMPILER} ${CMAKE_${LANGUAGE}_COMPILER_ID} ${CMAKE_${LANGUAGE}_COMPILER_VERSION}")
+    if(GMX_INTEL_LLVM AND NOT CMAKE_CXX_COMPILER_ID MATCHES "IntelLLVM")
+        # Manually set compiler info for Intel LLVM. Can be removed after we require CMake 3.20+.
+        set(${BUILD_COMPILER} "${CMAKE_${LANGUAGE}_COMPILER} IntelLLVM ${GMX_INTEL_LLVM_VERSION}")
+    else()
+        set(${BUILD_COMPILER} "${CMAKE_${LANGUAGE}_COMPILER} ${CMAKE_${LANGUAGE}_COMPILER_ID} ${CMAKE_${LANGUAGE}_COMPILER_VERSION}")
+    endif()
 endmacro()
index 0783fe5ddfb7cb2f9e3004362e9eb04fc319ec87..5d392abc1fd6a4fa41588203eaacc867aa35b6b4 100644 (file)
@@ -97,4 +97,4 @@
 /** SYCL hipSYCL backend list */
 #define SYCL_HIPSYCL_COMPILER_LAUNCHER "@HIPSYCL_SYCLCC_LAUNCHER@"
 #define SYCL_HIPSYCL_COMPILER_FLAGS "@HIPSYCL_SYCLCC_EXTRA_ARGS@"
-#define SYCL_HIPSYCL_PLATFORMS "@HIPSYCL_PLATFORMS_STRING@"
+#define SYCL_HIPSYCL_TARGETS "@HIPSYCL_TARGETS@"
index e9ae7a8d4633e7a1f4c23045eef81c559fe1eb6c..298d9f40b6103e41fe7c7bbbb2b6d31ce668ad8b 100644 (file)
 /* Define if we have fedisableexcept */
 #cmakedefine01 HAVE_FEDISABLEEXCEPT
 
+/* Define if we have MKL available */
+#cmakedefine01 HAVE_LIBMKL
+
 /* Define if we have lmfit support */
 #cmakedefine01 HAVE_LMFIT
 
index 342b7eecebafa3cde366a7cbf861af135f19d61f..fd1a6e7d8b844513c1c519641708c159e8d566ed 100644 (file)
@@ -2,7 +2,8 @@
 # This file is part of the GROMACS molecular simulation package.
 #
 # Copyright (c) 2010,2011,2012,2013,2014 by the GROMACS development team.
-# Copyright (c) 2015,2017,2018,2019,2020, by the GROMACS development team, led by
+# Copyright (c) 2015,2017,2018,2019,2020 by the GROMACS development team.
+# Copyright (c) 2021, by the GROMACS development team, led by
 # Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
 # and including many others, as listed in the AUTHORS file in the
 # top-level source directory and at http://www.gromacs.org.
@@ -39,6 +40,11 @@ file(GLOB UTILITY_SOURCES *.cpp)
 if (GMX_GPU_CUDA)
     gmx_add_libgromacs_sources(cuda_version_information.cu)
 endif()
+if (GMX_GPU_SYCL)
+    _gmx_add_files_to_property(SYCL_SOURCES
+        sycl_version_information.cpp
+    )
+endif()
 set(LIBGROMACS_SOURCES ${LIBGROMACS_SOURCES} ${UTILITY_SOURCES} PARENT_SCOPE)
 
 if(GMX_INSTALL_LEGACY_API)
index 2ca50c01860e6c78d80e17e1d6f879cd87e55cb7..aff7b5dc195d93b30e44ee2fa0cfbc6436cef2ca 100644 (file)
@@ -52,7 +52,7 @@
 #    include <fftw3.h>
 #endif
 
-#ifdef HAVE_LIBMKL
+#if HAVE_LIBMKL
 #    include <mkl.h>
 #endif
 
@@ -86,6 +86,7 @@
 #include "gromacs/utility/textwriter.h"
 
 #include "cuda_version_information.h"
+#include "sycl_version_information.h"
 
 namespace
 {
@@ -372,10 +373,10 @@ void gmx_print_version_info(gmx::TextWriter* writer)
     writer->writeLine(formatString("C++ compiler:       %s", BUILD_CXX_COMPILER));
     writer->writeLine(formatString(
             "C++ compiler flags: %s %s", BUILD_CXXFLAGS, CMAKE_BUILD_CONFIGURATION_CXX_FLAGS));
-#ifdef HAVE_LIBMKL
+#if HAVE_LIBMKL
     /* MKL might be used for LAPACK/BLAS even if FFTs use FFTW, so keep it separate */
     writer->writeLine(formatString(
-            "Linked with Intel MKL version %d.%d.%d.", __INTEL_MKL__, __INTEL_MKL_MINOR__, __INTEL_MKL_UPDATE__));
+            "Intel MKL version:  %d.%d.%d", __INTEL_MKL__, __INTEL_MKL_MINOR__, __INTEL_MKL_UPDATE__));
 #endif
 #if GMX_GPU_OPENCL
     writer->writeLine(formatString("OpenCL include dir: %s", OPENCL_INCLUDE_DIR));
@@ -390,12 +391,14 @@ void gmx_print_version_info(gmx::TextWriter* writer)
     writer->writeLine("CUDA runtime:       " + gmx::getCudaRuntimeVersionString());
 #endif
 #if GMX_SYCL_DPCPP
-    writer->writeLine(formatString("SYCL DPCPP flags:   %s", SYCL_DPCPP_COMPILER_FLAGS));
+    writer->writeLine(formatString("SYCL DPC++ flags:   %s", SYCL_DPCPP_COMPILER_FLAGS));
+    writer->writeLine("SYCL DPC++ version: " + gmx::getSyclCompilerVersion());
 #endif
 #if GMX_SYCL_HIPSYCL
     writer->writeLine(formatString("hipSYCL launcher:   %s", SYCL_HIPSYCL_COMPILER_LAUNCHER));
     writer->writeLine(formatString("hipSYCL flags:      %s", SYCL_HIPSYCL_COMPILER_FLAGS));
-    writer->writeLine(formatString("hipSYCL platforms:  %s", SYCL_HIPSYCL_PLATFORMS));
+    writer->writeLine(formatString("hipSYCL targets:    %s", SYCL_HIPSYCL_TARGETS));
+    writer->writeLine("hipSYCL version:    " + gmx::getSyclCompilerVersion());
 #endif
 }
 
diff --git a/src/gromacs/utility/sycl_version_information.cpp b/src/gromacs/utility/sycl_version_information.cpp
new file mode 100644 (file)
index 0000000..b3a1541
--- /dev/null
@@ -0,0 +1,66 @@
+/*
+ * This file is part of the GROMACS molecular simulation package.
+ *
+ * Copyright (c) 2021, by the GROMACS development team, led by
+ * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
+ * and including many others, as listed in the AUTHORS file in the
+ * top-level source directory and at http://www.gromacs.org.
+ *
+ * GROMACS is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public License
+ * as published by the Free Software Foundation; either version 2.1
+ * of the License, or (at your option) any later version.
+ *
+ * GROMACS is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with GROMACS; if not, see
+ * http://www.gnu.org/licenses, or write to the Free Software Foundation,
+ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA.
+ *
+ * If you want to redistribute modifications to GROMACS, please
+ * consider that scientific software is very special. Version
+ * control is crucial - bugs must be traceable. We will be happy to
+ * consider code for inclusion in the official distribution, but
+ * derived work must not be called official GROMACS. Details are found
+ * in the README & COPYING files - if they are missing, get the
+ * official version at http://www.gromacs.org.
+ *
+ * To help us fund GROMACS development, we humbly ask that you cite
+ * the research papers on the package. Check out http://www.gromacs.org.
+ */
+
+#include "gmxpre.h"
+
+#include "config.h"
+
+#include "sycl_version_information.h"
+
+#if GMX_GPU_SYCL
+#    include "gromacs/gpu_utils/gmxsycl.h"
+#endif
+#include "gromacs/utility/exceptions.h"
+#include "gromacs/utility/stringutil.h"
+
+namespace gmx
+{
+
+std::string getSyclCompilerVersion()
+{
+#if GMX_SYCL_DPCPP
+    return formatString("%d (libsycl %d.%d.%d)",
+                        __SYCL_COMPILER_VERSION,
+                        __LIBSYCL_MAJOR_VERSION,
+                        __LIBSYCL_MINOR_VERSION,
+                        __LIBSYCL_PATCH_VERSION);
+#elif GMX_SYCL_HIPSYCL
+    return hipsycl::sycl::detail::version_string();
+#else
+    GMX_THROW(gmx::InternalError("Not implemented for non-SYCL build"));
+#endif
+}
+
+} // namespace gmx
diff --git a/src/gromacs/utility/sycl_version_information.h b/src/gromacs/utility/sycl_version_information.h
new file mode 100644 (file)
index 0000000..0b075ca
--- /dev/null
@@ -0,0 +1,48 @@
+/*
+ * This file is part of the GROMACS molecular simulation package.
+ *
+ * Copyright (c) 2021, by the GROMACS development team, led by
+ * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
+ * and including many others, as listed in the AUTHORS file in the
+ * top-level source directory and at http://www.gromacs.org.
+ *
+ * GROMACS is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public License
+ * as published by the Free Software Foundation; either version 2.1
+ * of the License, or (at your option) any later version.
+ *
+ * GROMACS is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with GROMACS; if not, see
+ * http://www.gnu.org/licenses, or write to the Free Software Foundation,
+ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA.
+ *
+ * If you want to redistribute modifications to GROMACS, please
+ * consider that scientific software is very special. Version
+ * control is crucial - bugs must be traceable. We will be happy to
+ * consider code for inclusion in the official distribution, but
+ * derived work must not be called official GROMACS. Details are found
+ * in the README & COPYING files - if they are missing, get the
+ * official version at http://www.gromacs.org.
+ *
+ * To help us fund GROMACS development, we humbly ask that you cite
+ * the research papers on the package. Check out http://www.gromacs.org.
+ */
+#ifndef GMX_UTILITY_SYCL_VERSION_INFORMATION_H
+#define GMX_UTILITY_SYCL_VERSION_INFORMATION_H
+
+#include <string>
+
+namespace gmx
+{
+
+//! Returns an internal version strings of the Intel DPC++ and hipSYCL compiler.
+std::string getSyclCompilerVersion();
+
+} // namespace gmx
+
+#endif