Fix compilation with oneAPI 2021.2 and earlier
authorAndrey Alekseenko <al42and@gmail.com>
Sat, 18 Sep 2021 21:30:45 +0000 (00:30 +0300)
committerAndrey Alekseenko <al42and@gmail.com>
Tue, 21 Sep 2021 13:07:43 +0000 (13:07 +0000)
We were using some PP defines introduced only in 2021.3. And, since they
are not standard, now we play it safe and don't use them if they are not
defined.

Bug introduced in MR !1888 (2861057f).

src/gromacs/utility/sycl_version_information.cpp

index b3a15412446e36da25e6fd8b0c59d139973a8da4..fdb01bf724b8d6d728a32257176ba5d887cbc8e2 100644 (file)
@@ -51,11 +51,15 @@ namespace gmx
 std::string getSyclCompilerVersion()
 {
 #if GMX_SYCL_DPCPP
+#    ifdef __LIBSYCL_MAJOR_VERSION
     return formatString("%d (libsycl %d.%d.%d)",
                         __SYCL_COMPILER_VERSION,
                         __LIBSYCL_MAJOR_VERSION,
                         __LIBSYCL_MINOR_VERSION,
                         __LIBSYCL_PATCH_VERSION);
+#    else
+    return formatString("%d", __SYCL_COMPILER_VERSION);
+#    endif
 #elif GMX_SYCL_HIPSYCL
     return hipsycl::sycl::detail::version_string();
 #else