[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:05 PST 2025


================
@@ -15,17 +15,108 @@
 #ifndef _LIBSYCL___IMPL_PLATFORM_HPP
 #define _LIBSYCL___IMPL_PLATFORM_HPP
 
+#include <sycl/__impl/backend.hpp>
 #include <sycl/__impl/detail/config.hpp>
+#include <sycl/__impl/detail/obj_utils.hpp>
+#include <sycl/__impl/info/platform.hpp>
+
+#include <memory>
+#include <vector>
 
 _LIBSYCL_BEGIN_NAMESPACE_SYCL
 
+namespace detail {
+class platform_impl;
+} // namespace detail
+
+// SYCL 2020 4.6.2. Platform class
 class _LIBSYCL_EXPORT platform {
 public:
-  /// Constructs a SYCL platform which contains the default device.
-  platform();
+  /// Constructs a platform object that is a copy of the platform which contains
+  /// the device returned by default_selector_v.
+  // platform();
+
+  platform(const platform &rhs) = default;
+
+  platform(platform &&rhs) = default;
+
+  platform &operator=(const platform &rhs) = default;
+
+  platform &operator=(platform &&rhs) = default;
+
+  bool operator==(const platform &rhs) const { return &impl == &rhs.impl; }
+
+  bool operator!=(const platform &rhs) const { return !(*this == rhs); }
+
+  /// Constructs a platform object that is a copy of the platform which contains
----------------
dvrogozh wrote:

This and below seems something commented for the future. Maybe just drop all that and add in the PR which will really get use them? I personally believe that each PR should be self contained and avoid adding anything out if its scope. This greatly improves cherry-pickability of commits in a long run which is critical for maintenance.

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


More information about the llvm-commits mailing list