std :: ml::gpu_mps
Function std::mps_available
int mps_available()True if a Metal device is available on this machine at all (checks MTLCreateSystemDefaultDevice() != nil) — lets callers fall back to the CPU Tensor ops (tensor.h) when there's no GPU, without needing to attempt an mps_* call first just to find out.