std1.0.0-beta-7 SafeC docs

std :: ml::gpu_mps

Function std::mps_available

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

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.