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

Dmitry Rogozhkin via llvm-commits llvm-commits at lists.llvm.org
Tue Jan 20 10:58:12 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):
----------------
dvrogozh wrote:

The problem with reserving for the future is that this potentially might never be implemented. I think it might be better to always limit the scope of the PRs to those features which are actually being added in this PR and defer everything else to next PRs. I.e. PRs must be self-sufficient and changes justified by the actual need in this PR or the currently merged code.

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


More information about the llvm-commits mailing list