/* advance_sycl.cpp -- the advance kernel under the SYCL backend: one work-item per row of the batch * it patches, in stream order on the rank's queue. See advance.h; advance.hip is the AMD twin. * * Built by icpx into librad_sycl.so (sycl/CMakeLists.txt); core/CMakeLists.txt globs this directory * into the engine, built without SYCL, where the file compiles to nothing. There is no chained form: * chained launches are the AQL backend's (rad_dev_chain_enabled is 0 here). */ #if defined(SYCL_LANGUAGE_VERSION) #include #include "advance_impl.h" #include "rad_sycl.h" namespace { constexpr int kThreads = 64; } // namespace extern "C" __attribute__((visibility("default"))) int rad_step_advance_launch(const rad::AdvanceArgs* args, void* stream) { if (!args || args->n_seq <= 0) return 0; sycl::queue* q = rad_sycl_queue((RadStream)stream); if (!q) return -1; const rad::AdvanceArgs a = *args; const size_t blocks = (size_t)((a.n_seq + kThreads - 1) / kThreads); try { q->parallel_for(sycl::nd_range<1>{blocks * kThreads, kThreads}, [=](sycl::nd_item<1> it) { const int i = (int)it.get_global_id(0); if (i < a.n_seq) rad::adv_row(a, i); }); } catch (const sycl::exception&) { return -1; } return 0; } #endif /* SYCL_LANGUAGE_VERSION */