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

Kseniya Tikhomirova via llvm-commits llvm-commits at lists.llvm.org
Wed Nov 19 05:45:40 PST 2025


================
@@ -0,0 +1,64 @@
+//===----------------------------------------------------------------------===//
+//
+// 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 helper functions for tranformation between implementation
+/// and SYCL's interface objects.
+///
+//===----------------------------------------------------------------------===//
+
+#ifndef _LIBSYCL___IMPL_DETAIL_OBJ_BASE_HPP
+#define _LIBSYCL___IMPL_DETAIL_OBJ_BASE_HPP
+
+#include <sycl/__impl/detail/config.hpp>
+
+#include <cassert>
+#include <type_traits>
+#include <utility>
+
+_LIBSYCL_BEGIN_NAMESPACE_SYCL
+
+namespace detail {
+
+template <class Impl, class SyclObject> class ObjBase {
+public:
+  using ImplType = Impl;
+  using Base = ObjBase<Impl, SyclObject>;
+
+protected:
+  ImplType &impl;
+
+  explicit ObjBase(ImplType &pImpl) : impl(pImpl) {}
+  ObjBase() = default;
+
+  static SyclObject createSyclProxy(ImplType &impl) { return SyclObject(impl); }
+
+  template <class Obj>
+  friend const typename Obj::ImplType &getSyclObjImpl(const Obj &Object);
+
+  template <class Obj>
+  friend Obj createSyclObjFromImpl(
+      std::add_lvalue_reference_t<typename Obj::ImplType> ImplObj);
+};
----------------
KseniyaTikhomirova wrote:

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

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


More information about the llvm-commits mailing list