[llvm] [libsycl] Add lit configuration files and basic test (PR #177407)
Kseniya Tikhomirova via llvm-commits
llvm-commits at lists.llvm.org
Tue Feb 10 04:52:23 PST 2026
================
@@ -0,0 +1,122 @@
+// REQUIRES: any-device
+// RUN: %clangxx %sycl_options %s -o %t.out
+// RUN: %t.out
+//
+// Tests platform::get_devices for each device type.
+
+#include <sycl.hpp>
+
+#include <algorithm>
+#include <iostream>
+
+std::string BackendToString(sycl::backend Backend) {
+ switch (Backend) {
+ case sycl::backend::opencl:
+ return "opencl";
+ case sycl::backend::level_zero:
+ return "level_zero";
+ case sycl::backend::cuda:
+ return "cuda";
+ case sycl::backend::hip:
+ return "hip";
+ default:
+ return "unknown";
+ }
+}
+
+std::string DeviceTypeToString(sycl::info::device_type DevType) {
+ switch (DevType) {
+ case sycl::info::device_type::all:
+ return "device_type::all";
+ case sycl::info::device_type::cpu:
+ return "device_type::cpu";
+ case sycl::info::device_type::gpu:
+ return "device_type::gpu";
+ case sycl::info::device_type::accelerator:
+ return "device_type::accelerator";
+ case sycl::info::device_type::custom:
+ return "device_type::custom";
+ case sycl::info::device_type::automatic:
+ return "device_type::automatic";
+ case sycl::info::device_type::host:
+ return "device_type::host";
+ default:
+ return "UNKNOWN";
----------------
KseniyaTikhomirova wrote:
https://github.com/llvm/llvm-project/pull/177407/commits/17361e09b9b7d072e080a07f16f8c29e00f5d06d
https://github.com/llvm/llvm-project/pull/177407
More information about the llvm-commits
mailing list