module

ML::Metal::Dispatch

High-level dispatch helper

Instance methods

dispatch(pipeline : ComputePipeline, &block : ComputeEncoder -> Nil) : Nil

Backwards-compatible alias

Source
execute(pipeline : ComputePipeline, &block : ComputeEncoder -> Nil) : Nil

Execute a kernel synchronously

Source
execute_async(pipeline : ComputePipeline, &block : ComputeEncoder -> Nil) : CommandBuffer

Execute kernel asynchronously

Source
execute_blit

Execute blit (memory) operations synchronously

Source
execute_blit_async

Execute blit operations asynchronously

Source
execute_sequence

Execute multiple kernels in sequence (single command buffer)

Source
optimal_threadgroup_1d(count : Int32, pipeline : ComputePipeline | Nil = nil) : Int32

Optimal threadgroup size for 1D workloads

Source
optimal_threadgroup_2d(width : Int32, height : Int32, pipeline : ComputePipeline | Nil = nil) : Tuple(Int32, Int32)

Optimal threadgroup size for 2D workloads (images, tiles)

Source