[llvm] [SYCL] Add sycl::device initial implementation (PR #176972)
Kseniya Tikhomirova via llvm-commits
llvm-commits at lists.llvm.org
Fri Jan 23 05:25:38 PST 2026
================
@@ -11,18 +11,57 @@
#include <detail/offload/offload_utils.hpp>
#include <array>
-#include <unordered_map>
_LIBSYCL_BEGIN_NAMESPACE_SYCL
namespace detail {
+// Platforms for this backend
+range_view<const ol_platform_handle_t> OffloadTopology::getPlatforms() const {
+ return {MPlatforms.data(), MPlatforms.size()};
+}
+
+// Devices for a specific platform (platform_id is index into Platforms)
+range_view<ol_device_handle_t>
+OffloadTopology::getDevices(size_t PlatformId) const {
+ if (PlatformId >= MDeviceRange.size()) {
+ assert(false && "Platform index exceeds number of platforms.");
+ return {nullptr, 0};
+ }
----------------
KseniyaTikhomirova wrote:
I removed assert then. It matches my original opinion.
https://github.com/llvm/llvm-project/pull/176972/commits/b3acc5d94543ee93d5de42343c99a5faf533e825
https://github.com/llvm/llvm-project/pull/176972
More information about the llvm-commits
mailing list