ML::Metal::GraphEncoder
GraphEncoder — drop-in replacement for ComputeEncoder that builds a ComputeGraph. Same API (set_pipeline, set_buffer, set_value, dispatch_*, memory_barrier). memory_barrier is a no-op — the graph computes optimal barriers automatically.
Usage: graph = ComputeGraph.new enc = GraphEncoder.new(graph)
... same calls as ComputeEncoder ...
graph.compile! graph.encode(cmd)
Constructors
new(graph : ML::Metal::ComputeGraph)
SourceInstance methods
dispatch_threadgroups_indirect(buf : MetalBuffer, offset : Int64, size : Tuple(Int32, Int32, Int32)) : self
Sourceend_encoding
Sourceset_buffer(buf : MetalBuffer, index : Int32, access : BufferAccess = BufferAccess::Read, offset : Int64 = 0, length : Int64 = -1, partition : Int32 = -1) : self
Buffer binding with access mode (default: :read) length: -1 = entire buffer. partition: ≥0 = Block Integrity key (different partitions don't conflict)
set_pipeline(p : ComputePipeline) : self
Source