[llvm] [libsycl] Add constructors for context (PR #214538)

Kseniya Tikhomirova via llvm-commits llvm-commits at lists.llvm.org
Thu Aug 27 07:00:22 PDT 2026


================
@@ -0,0 +1,62 @@
+// REQUIRES: any-device
+// RUN: %clangxx -fsycl %s -o %t.out
+// RUN: %t.out
+
+#include <iostream>
+
+#include <sycl/sycl.hpp>
+
+using namespace sycl;
+
+void return_fail() {
+  std::cout << "Failed" << std::endl;
+  exit(1);
+}
+
+void dummyAsyncHandler(sycl::exception_list) {}
+
+void check(const context &ctx) {
+  auto devices = ctx.get_devices();
+  if (devices.empty()) {
----------------
KseniyaTikhomirova wrote:

is it a possible case? I think you will receive an exception with any context ctor if there is no available or suitable devices. Please check.

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


More information about the llvm-commits mailing list