/* wtab_sycl.cpp -- the weight-table patch kernel under the SYCL backend: one work-item a write. See * wtab.h; wtab.hip is the AMD twin. Built by icpx into librad_sycl.so; in the engine's own build * (core/CMakeLists.txt globs this directory) it compiles to nothing. */ #if defined(SYCL_LANGUAGE_VERSION) #include #include "rad_sycl.h" #include "wtab.h" extern "C" __attribute__((visibility("default"))) int rad_wtab_patch_launch(const rad::WtabPatch* p, void* stream) { if (!p || p->n == 0) return 0; sycl::queue* q = rad_sycl_queue((RadStream)stream); if (!q) return -1; const rad::WtabPatch w = *p; try { q->parallel_for(sycl::nd_range<1>{64, 64}, [=](sycl::nd_item<1> it) { const uint32_t i = (uint32_t)it.get_local_id(0); if (i < w.n) *w.dst[i] = w.val[i]; }); } catch (const sycl::exception&) { return -1; } return 0; } #endif /* SYCL_LANGUAGE_VERSION */