MTL4MachineLearningCommandEncoder

Trait MTL4MachineLearningCommandEncoder 

Source
pub unsafe trait MTL4MachineLearningCommandEncoder: MTL4CommandEncoder {
    // Provided methods
    fn setPipelineState(
        &self,
        pipeline_state: &ProtocolObject<dyn MTL4MachineLearningPipelineState>,
    )
       where Self: Sized + Message { ... }
    fn setArgumentTable(
        &self,
        argument_table: &ProtocolObject<dyn MTL4ArgumentTable>,
    )
       where Self: Sized + Message { ... }
    fn dispatchNetworkWithIntermediatesHeap(
        &self,
        heap: &ProtocolObject<dyn MTLHeap>,
    )
       where Self: Sized + Message { ... }
}
Available on crate features MTL4CommandEncoder and MTL4MachineLearningCommandEncoder only.
Expand description

Encodes commands for dispatching machine learning networks on Apple silicon.

See also Apple’s documentation

Provided Methods§

Source

fn setPipelineState( &self, pipeline_state: &ProtocolObject<dyn MTL4MachineLearningPipelineState>, )
where Self: Sized + Message,

Available on crate features MTL4MachineLearningPipeline and MTLAllocation only.

Configures the encoder with a machine learning pipeline state instance.

The pipeline state instance affects all subsequent Machine Learning commands.

  • Parameters:
  • pipelineState: A Machine Learning pipeline state instance.
Source

fn setArgumentTable( &self, argument_table: &ProtocolObject<dyn MTL4ArgumentTable>, )
where Self: Sized + Message,

Available on crate feature MTL4ArgumentTable only.

Sets an argument table for the command encoder’s machine learning shader stage.

The argument table provides inputs to all subsequent Machine Learning dispatches.

  • Parameters:
  • argumentTable: An argument table to set on the command encoder’s Machine Learning stage.
Source

fn dispatchNetworkWithIntermediatesHeap( &self, heap: &ProtocolObject<dyn MTLHeap>, )
where Self: Sized + Message,

Available on crate features MTLAllocation and MTLHeap only.

Dispatches a machine learning network using the current pipeline state and argument table.

This method takes a parameter consisting of a MTLHeap that Metal can use to allocate intermediate tensors. You can query the minimum size Metal requires for this heap by calling MTL4MachineLearningPipelineState/intermediatesHeapSize.

  • Parameters:
  • heap: a heap that Metal can use to allocate intermediate tensors.

Trait Implementations§

Source§

impl ProtocolType for dyn MTL4MachineLearningCommandEncoder

Source§

const NAME: &'static str = "MTL4MachineLearningCommandEncoder"

The name of the Objective-C protocol that this type represents. Read more
Source§

fn protocol() -> Option<&'static AnyProtocol>

Get a reference to the Objective-C protocol object that this type represents. Read more
Source§

impl<T> ImplementedBy<T> for dyn MTL4MachineLearningCommandEncoder

Implementations on Foreign Types§

Source§

impl<T> MTL4MachineLearningCommandEncoder for ProtocolObject<T>

Implementors§