Add SYCL-related information to the mdrun version header
authorAndrey Alekseenko <al42and@gmail.com>
Mon, 7 Jun 2021 11:22:11 +0000 (11:22 +0000)
committerPaul Bauer <paul.bauer.q@gmail.com>
Mon, 7 Jun 2021 11:22:11 +0000 (11:22 +0000)
src/buildinfo.h.cmakein
src/gromacs/utility/baseversion.cpp
src/gromacs/utility/binaryinformation.cpp

index ba5f3658b67f8352f588e1a463d504499e4754a6..0783fe5ddfb7cb2f9e3004362e9eb04fc319ec87 100644 (file)
@@ -2,7 +2,7 @@
  * This file is part of the GROMACS molecular simulation package.
  *
  * Copyright (c) 2012,2013,2014,2015,2017 by the GROMACS development team.
- * Copyright (c) 2018,2019,2020, by the GROMACS development team, led by
+ * Copyright (c) 2018,2019,2020,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.
 
 /** OpenCL version */
 #define OPENCL_VERSION_STRING "@OpenCL_VERSION_STRING@"
+
+/** SYCL DPCPP flags */
+#define SYCL_DPCPP_COMPILER_FLAGS "@SYCL_CXX_FLAGS@"
+
+/** 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@"
index e862b805dc15d5decb11e5a7ccf4ce721d8fc820..90cddcb7b0b81d753914c8b6ed4a841f785acbd3 100644 (file)
@@ -80,6 +80,11 @@ void gmx_is_single_precision() {}
 
 const char* getGpuImplementationString()
 {
+    // Some flavors of clang complain about unreachable returns.
+#ifdef __clang__
+#    pragma clang diagnostic push
+#    pragma clang diagnostic ignored "-Wunreachable-code-return"
+#endif
     if (GMX_GPU)
     {
         if (GMX_GPU_CUDA)
@@ -92,7 +97,18 @@ const char* getGpuImplementationString()
         }
         else if (GMX_GPU_SYCL)
         {
-            return "SYCL";
+            if (GMX_SYCL_DPCPP)
+            {
+                return "SYCL (DPCPP)";
+            }
+            else if (GMX_SYCL_HIPSYCL)
+            {
+                return "SYCL (hipSYCL)";
+            }
+            else
+            {
+                return "SYCL (unknown)";
+            }
         }
         else
         {
@@ -104,4 +120,7 @@ const char* getGpuImplementationString()
     {
         return "disabled";
     }
+#ifdef __clang__
+#    pragma clang diagnostic pop
+#endif
 }
index 839f4796dbe6e5673fbf45b29465cfe4e9deb3e7..935a6d553add1c3cf2119ae6dfd08ac59cdc1368 100644 (file)
@@ -359,6 +359,14 @@ void gmx_print_version_info(gmx::TextWriter* writer)
     writer->writeLine("CUDA driver:        " + gmx::getCudaDriverVersionString());
     writer->writeLine("CUDA runtime:       " + gmx::getCudaRuntimeVersionString());
 #endif
+#if GMX_SYCL_DPCPP
+    writer->writeLine(formatString("SYCL DPCPP flags:   %s", SYCL_DPCPP_COMPILER_FLAGS));
+#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));
+#endif
 }
 
 //! \endcond