std1.0.0-beta-7 SafeC docs

std :: ml::gpu_mps

Function std::mps_matmul_f32_chained

#include <std/ml/gpu_mps.h> source · definition

int mps_matmul_f32_chained(
    struct MpsBuf bufA,
    const &float b,
    &float out,
    unsigned long M,
    unsigned long K,
    unsigned long N,
)

Same computation as mps_matmul_f32/mps_relu_f32, but the primary input ('bufA') is a device buffer — typically MpsBuf::batch_last_output()'s return from a previous batched op in the same still-open batch — instead of a CPU float array, so no CPU<->GPU round trip happens for that input at all. Only usable while a batch is active (mps_batch_is_active()); the secondary input 'b' (matmul's second operand) is still an ordinary CPU float array here — see mps_matmul_f32_persistent below for the case where BOTH operands are already device buffers (e.g. a weight matrix uploaded once with MpsBuf::upload instead of fresh every call).