[llvm-branch-commits] [llvm] [libsycl] add single_task (PR #188797)

Mariya Podchishchaeva via llvm-branch-commits llvm-branch-commits at lists.llvm.org
Mon Mar 30 07:01:26 PDT 2026


================
@@ -0,0 +1,18 @@
+// REQUIRES: any-device
+// RUN: %clangxx -fsycl  %s -o %t.out
+// RUN: %t.out
+
+#include <sycl/sycl.hpp>
+
+class Test;
+
+int main() {
+  sycl::queue q;
+  int *p = sycl::malloc_shared<int>(1, q);
+  *p = 0;
+  q.single_task<Test>([=]() { *p = 42; });
----------------
Fznamznon wrote:

I wonder if can exercise more types of arguments, like scalar types and trivially copyable structs just to make sure everything is right? For example we can capture 42 as an int and make sure it is fine on the host. We can also use structs either as additional byval capture or a type of usm data. Maybe it would be also great to launch several different kernels in the same application so we know the work with kernel names is correct.

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


More information about the llvm-branch-commits mailing list