objc2_metal/generated/
MTL4MachineLearningCommandEncoder.rs

1//! This file has been automatically generated by `objc2`'s `header-translator`.
2//! DO NOT EDIT
3use core::ffi::*;
4use core::ptr::NonNull;
5use objc2::__framework_prelude::*;
6
7use crate::*;
8
9extern_protocol!(
10    /// Encodes commands for dispatching machine learning networks on Apple silicon.
11    ///
12    /// See also [Apple's documentation](https://developer.apple.com/documentation/metal/mtl4machinelearningcommandencoder?language=objc)
13    #[cfg(feature = "MTL4CommandEncoder")]
14    pub unsafe trait MTL4MachineLearningCommandEncoder: MTL4CommandEncoder {
15        #[cfg(all(feature = "MTL4MachineLearningPipeline", feature = "MTLAllocation"))]
16        /// Configures the encoder with a machine learning pipeline state instance.
17        ///
18        /// The pipeline state instance affects all subsequent Machine Learning commands.
19        ///
20        /// - Parameters:
21        /// - pipelineState: A Machine Learning pipeline state instance.
22        #[unsafe(method(setPipelineState:))]
23        #[unsafe(method_family = none)]
24        fn setPipelineState(
25            &self,
26            pipeline_state: &ProtocolObject<dyn MTL4MachineLearningPipelineState>,
27        );
28
29        #[cfg(feature = "MTL4ArgumentTable")]
30        /// Sets an argument table for the command encoder's machine learning shader stage.
31        ///
32        /// The argument table provides inputs to all subsequent Machine Learning dispatches.
33        /// - Parameters:
34        /// - argumentTable: An argument table to set on the command encoder's Machine Learning stage.
35        #[unsafe(method(setArgumentTable:))]
36        #[unsafe(method_family = none)]
37        fn setArgumentTable(&self, argument_table: &ProtocolObject<dyn MTL4ArgumentTable>);
38
39        #[cfg(all(feature = "MTLAllocation", feature = "MTLHeap"))]
40        /// Dispatches a machine learning network using the current pipeline state and argument table.
41        ///
42        /// This method takes a parameter consisting of a `MTLHeap` that Metal can use to allocate intermediate tensors.
43        /// You can query the minimum size Metal requires for this heap by calling
44        /// ``MTL4MachineLearningPipelineState/intermediatesHeapSize``.
45        ///
46        /// - Parameters:
47        /// - heap: a heap that Metal can use to allocate intermediate tensors.
48        #[unsafe(method(dispatchNetworkWithIntermediatesHeap:))]
49        #[unsafe(method_family = none)]
50        fn dispatchNetworkWithIntermediatesHeap(&self, heap: &ProtocolObject<dyn MTLHeap>);
51    }
52);