[llvm] [SYCL] Add platform enumeration and info query using liboffload (PR #166927)

Kseniya Tikhomirova via llvm-commits llvm-commits at lists.llvm.org
Thu Dec 11 06:05:52 PST 2025


================
@@ -0,0 +1,52 @@
+//===----------------------------------------------------------------------===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===----------------------------------------------------------------------===//
+///
+/// \file
+/// This file contains macro definitions used in SYCL implementation.
+///
+//===----------------------------------------------------------------------===//
+
+#ifndef _LIBSYCL___IMPL_DETAIL_MACRO_DEFINITIONS_HPP
+#define _LIBSYCL___IMPL_DETAIL_MACRO_DEFINITIONS_HPP
+
+#ifndef __SYCL2020_DEPRECATED
+#  if SYCL_LANGUAGE_VERSION == 202012L &&                                      \
+      !defined(SYCL2020_DISABLE_DEPRECATION_WARNINGS)
+#    define __SYCL2020_DEPRECATED(message) [[deprecated(message)]]
+#  else
+#    define __SYCL2020_DEPRECATED(message)
+#  endif
+#endif // __SYCL2020_DEPRECATED
+
+static_assert(__cplusplus >= 201703L,
+              "SYCL RT does not support C++ version earlier than C++17.");
+
+#if defined(_WIN32) && !defined(_DLL) && !defined(__SYCL_DEVICE_ONLY__)
+// SYCL library is designed such a way that STL objects cross DLL boundary,
+// which is guaranteed to work properly only when the application uses the same
+// C++ runtime that SYCL library uses.
+// The appplications using sycl.dll must be linked with dynamic/release C++ MSVC
+// runtime, i.e. be compiled with /MD switch. Similarly, the applications using
+// sycld.dll must be linked with dynamic/debug C++ runtime and be compiled with
+// /MDd switch.
+// Compiler automatically adds /MD or /MDd when -fsycl switch is used.
+// The options /MD and /MDd that make the code to use dynamic runtime also
+// define the _DLL macro.
----------------
KseniyaTikhomirova wrote:

I believe it is not a part of upstream yet, but eventually should be. I need to sync with Michael about driver upstreaming status since we can enable include & linking for libsycl with "-fsycl" option. same goes for this code.
https://github.com/intel/llvm/blob/sycl/clang/lib/Driver/ToolChains/Clang.cpp#L5093 

https://github.com/llvm/llvm-project/pull/166927


More information about the llvm-commits mailing list