std :: ml::gpu_mps
Function std::mps_matmul_f32_persistent
int mps_matmul_f32_persistent(
struct MpsBuf bufA,
struct MpsBuf bufB,
&float out,
unsigned long M,
unsigned long K,
unsigned long N,
)out[M,N] = bufA[M,K] . bufB[K,N] -- like mps_matmul_f32_chained, but 'bufB' is ALSO a pre-existing device buffer instead of a plain CPU array to upload fresh. For a matmul run repeatedly against the same weight matrix (e.g. an inference loop doing the same forward pass hundreds of times), mps_matmul_f32_chained would re-upload (memcpy) that weight matrix from CPU on every single call even though it never changes — this skips that entirely for both operands.