ML::Metal::ComputeEncoder
Compute encoder for setting up kernel dispatch
Constructors
Instance methods
dispatch(grid_size : Tuple(Int32, Int32, Int32), threadgroup_size : Tuple(Int32, Int32, Int32)) : self
Dispatch with explicit grid/threadgroup sizes (total threads)
dispatch_2d(width : Int32, height : Int32, threadgroup_size : Tuple(Int32, Int32) = {16, 16}) : self
Dispatch 2D workload (e.g., images)
dispatch_3d(width : Int32, height : Int32, depth : Int32, threadgroup_size : Tuple(Int32, Int32, Int32) = {8, 8, 8}) : self
Dispatch 3D workload
dispatch_threadgroups(threadgroup_count : Tuple(Int32, Int32, Int32), threadgroup_size : Tuple(Int32, Int32, Int32)) : self
Dispatch with threadgroup count (not total threads)
dispatch_threadgroups_indirect(indirect_buffer : ML::MetalBuffer, offset : Int64, threadgroup_size : Tuple(Int32, Int32, Int32)) : self
Indirect dispatch — threadgroup counts come from GPU buffer
set_buffer(buffer : MetalBuffer, index : Int32, access : BufferAccess = BufferAccess::Read, offset : Int64 = 0, length : Int64 = -1, partition : Int32 = -1) : self
Bind Metal buffer at index (access/length/partition accepted for GraphEncoder API compat)
Bind raw bytes (for small constants)
set_pipeline(pipeline : ComputePipeline) : self
SourceSet threadgroup memory (for kernels using threadgroup storage)
Set float3 (as StaticArray(Float32, 3))
Set float4 (as StaticArray(Float32, 4))