Module
gpu::metal::emulated
cheatah-gpu v0.5.1-alpha — Biome Standard 0.6.3-alpha
Classes
DispatchShape— The full shape of one dispatch, as a 3-D-aware stand-in kernel receives it.Extent— A three-axis extent, mirroringMTL::Size— width × height × depth, unused axes 1.
Functions
fn
register_kernel · 2 overloads
void register_kernel(const char *name, void(*fn)(void **buffers, unsigned buffer_count, unsigned long grid_width))#void register_kernel(const char *name, void(*fn)(void **buffers, unsigned buffer_count, const DispatchShape &shape))#Register a software stand-in for a compiled MSL compute kernel, keyed by its function name.
Parameters
name | the kernel/function name a pipeline is built for (matches newFunctionWithName). |
fn | called per dispatch as fn(buffers, buffer_count, grid_width): |
Complexity
O(1) registration.
Host allocation
none (stores the function pointer).
Unit test
MetalCompute.AddArraysSystem test
systests/metal/test_compute.purrThe number of emulator objects still alive — 0 means nothing leaked.
Meaningful when built with -DCHEATAH_GPU_METAL_LEAKCHECK=1 (otherwise always 0); compiled out for production so there is no tracking overhead. This ALERTS on leaks; it does not enforce RAII.
Returns
count of live emulated Metal objects.
Complexity
O(1).
Host allocation
none.
Unit test
MetalCompute.LeakCleanSystem test
systests/metal/test_compute.purr