/* xe2_couple.cpp -- the linear-MTP coupling ops (`--draft-coupling on`) on the card. * * `mtp_couple_propose` and `mtp_couple_verify` (docs/OPS.md) through the spechub plugin's own row * helpers (plugin/spechub/spechub.h over abi/rad_spechub.h) and argument readers, one work-item a * row: the rows are a step's sampled positions (at most the draft window), and the sampler's * candidate plane holds ~top_k live entries, so the serial walks are short. The arithmetic is the * host reference's, in its order, in FP64 (libxe2 builds with -ffp-contract=off). */ #include "xe2_common.h" #include "xe2_ops.h" #include "../plugin/spechub/spechub.cpp" namespace xe2 { int mtp_couple_propose(const RadArgs* a, RadStream st) { RadMtpCoupleProposeCall c{}; if (int rc = rad_mtp_couple_propose_args(a, &c); rc != RAD_OK) return rc; if (c.M <= 0) return RAD_OK; sycl::queue* q = queue_of(st); if (!q) return RAD_E_DEVICE; return submit([&] { q->parallel_for(sycl::range<1>{(size_t)c.M}, [=](sycl::id<1> i) { rad_mtp_couple_propose_row(c, (int64_t)i[0]); }); }); } int mtp_couple_verify(const RadArgs* a, RadStream st) { RadMtpCoupleVerifyCall c{}; if (int rc = rad_mtp_couple_verify_args(a, &c); rc != RAD_OK) return rc; if (c.M <= 0) return RAD_OK; sycl::queue* q = queue_of(st); if (!q) return RAD_E_DEVICE; return submit([&] { q->parallel_for(sycl::range<1>{(size_t)c.M}, [=](sycl::id<1> i) { rad_mtp_couple_verify_row(c, (int64_t)i[0]); }); }); } } // namespace xe2