[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 04:28:11 PST 2025
================
@@ -0,0 +1,65 @@
+//===----------------------------------------------------------------------===//
+//
+// 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
+//
+//===----------------------------------------------------------------------===//
+
+#include <sycl/__impl/detail/config.hpp>
+#include <sycl/__impl/detail/obj_base.hpp>
+
+#include <detail/global_objects.hpp>
+#include <detail/platform_impl.hpp>
+
+_LIBSYCL_BEGIN_NAMESPACE_SYCL
+
+namespace detail {
+
+platform_impl *
+platform_impl::getOrMakePlatformImpl(ol_platform_handle_t Platform,
+ size_t PlatformIndex) {
+ const std::lock_guard<std::mutex> Guard(getPlatformMapMutex());
----------------
KseniyaTikhomirova wrote:
I'd like to revise my answer here. There is a case when container with platform_impl can be changed after init. This case is interop usage. I know that we have some complications with it at least because of context absence in liboffload. Although it is something that should be done eventually and I don't want to do design that doesn't suit that usage.
https://github.com/llvm/llvm-project/pull/166927
More information about the llvm-commits
mailing list