#include #include #include "strata/prefill/gemm.hpp" #include #include #include #include #include struct Q8 { sycl::half d; int8_t qs[32]; }; static_assert(sizeof(Q8)==34); uint16_t bf(float x) { uint32_t b; std::memcpy(&b,&x,4); return uint16_t(b>>16); } uint16_t half_bits(float x) { sycl::half h=x; uint16_t b;std::memcpy(&b,&h,2);return b; } int main() { auto& q=dpct::get_in_order_queue(); constexpr int T=3,N=3,K=32,L=40,YSTRIDE=5; auto* xb=sycl::malloc_shared(T*L,q);auto* xh=sycl::malloc_shared(T*L,q); auto* w=sycl::malloc_shared(N*K,q);auto* qw=sycl::malloc_shared(N,q); auto* y=sycl::malloc_shared(T*YSTRIDE,q);auto* scratch=sycl::malloc_device(N*K,q); int checks=0; for(int pad: {0,1}) for(int beta: {0,1}) { int stride=pad?L:K; for(int i=0;i1e-4f){std::fprintf(stderr,"%s stride=%d beta=%d mismatch\n",name,stride,beta);std::exit(1);} }checks++;}; { strata::prefill::Gemm g;std::string err;if(!g.init_external(&q,scratch,N*K,nullptr,0,err))return 2; for(int i=0;i(xb),static_cast(xh),static_cast(w),static_cast(qw),static_cast(y),static_cast(scratch)})sycl::free(p,q); std::printf("GEMM stride checks: %d passed (contiguous/padded, beta0/1, full/sliced native)\n",checks);return 0; }