Files
Vito Gamberini f69754ad63 SYCL: Initial language implementation
Add experimental support for SYCL under an experimental gate. The
IntelLLVM and Adaptivecpp compilers are recognized, as well as upstream
Clang with libsycl support.

Fixes: #27219, #27905
2026-10-07 11:43:31 -04:00

18 lines
353 B
C++

#include <sycl/sycl.hpp>
template <typename Kernel>
int run_kernel()
{
sycl::queue queue;
int* value = sycl::malloc_shared<int>(1, queue);
if (!value) {
return 1;
}
*value = 0;
queue.single_task<Kernel>([=] { *value = 42; });
queue.wait_and_throw();
int result = *value;
sycl::free(value, queue);
return result == 42 ? 0 : 1;
}