[llvm] [SYCL] Add platform enumeration and info query using liboffload (PR #166927)
Dmitry Rogozhkin via llvm-commits
llvm-commits at lists.llvm.org
Fri Dec 12 08:35:02 PST 2025
================
@@ -0,0 +1,49 @@
+//===----------------------------------------------------------------------===//
+//
+// 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, "Libsycl requires C++17 or later.");
----------------
dvrogozh wrote:
I think this assert might be better moved up and be the very first check right before defining `__SYCL2020_DEPRECATED`. It does not seem quite right to first introduce macro definitions using C++ features (`[[deprecated]]`) and then define which standard to require.
https://github.com/llvm/llvm-project/pull/166927
More information about the llvm-commits
mailing list