std1.0.0-beta-7 SafeC docs

std :: ml::gpu_mps

Function std::mps_batch_register_finalize

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

generic<T> void mps_batch_register_finalize(fn void(?&T) finalizeFn, ?&T ctx)

Register a callback to run once, in registration order, after mps_batch_end()'s single wait and raw GPU->CPU readback of every batched op's output buffer. Exists for callers that need to do their own CPU-side post-processing on a batched op's result (e.g. float32->float64 conversion) — that processing has to wait for the same sync point the raw readback does, so it can't just run immediately after the mps_*_f32 call returns the way it does outside a batch.