[llvm] [SYCL] Add sycl::device initial implementation (PR #176972)

Kseniya Tikhomirova via llvm-commits llvm-commits at lists.llvm.org
Wed Jan 21 05:21:06 PST 2026


================
@@ -0,0 +1,55 @@
+//===----------------------------------------------------------------------===//
+//
+// 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 <detail/device_impl.hpp>
+#include <detail/platform_impl.hpp>
+
+_LIBSYCL_BEGIN_NAMESPACE_SYCL
+
+namespace detail {
+
+bool DeviceImpl::has(aspect Aspect) const {
+  switch (Aspect) {
+  case (aspect::cpu):
+    return isCPU();
+  case (aspect::gpu):
+    return isGPU();
+  case (aspect::accelerator):
+    return isAccelerator();
+  case (aspect::custom):
----------------
KseniyaTikhomirova wrote:

I agree, and I added here values for aspects that I can handle right now. These aspects have the same hardcoded values in intel/llvm. Other aspects that is not covered here will return false always (== not enabled, not implemented, unsupported). 
Regarding "might never be implemented": I am tracking features & APIs that I left behind for initial stage (see index.rst). Also when I will be focused on per class features/APIs (Phase1+) I plan to work with conformance tests that:
1) require all descriptions and APIs to be defined
2) checks RT behavior
so after index.rst - SYCL conformance will be the next line of protection against reserved but not implemented stuff.

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


More information about the llvm-commits mailing list