//! This file has been automatically generated by `objc2`'s `header-translator`.
//! DO NOT EDIT
use core::ffi::*;
use core::ptr::NonNull;
use objc2::__framework_prelude::*;

use crate::*;

extern_protocol!(
    /// Encodes commands for dispatching machine learning networks on Apple silicon.
    ///
    /// See also [Apple's documentation](https://developer.apple.com/documentation/metal/mtl4machinelearningcommandencoder?language=objc)
    #[cfg(feature = "MTL4CommandEncoder")]
    pub unsafe trait MTL4MachineLearningCommandEncoder: MTL4CommandEncoder {
        #[cfg(all(feature = "MTL4MachineLearningPipeline", feature = "MTLAllocation"))]
        /// 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.
        #[unsafe(method(setPipelineState:))]
        #[unsafe(method_family = none)]
        fn setPipelineState(
            &self,
            pipeline_state: &ProtocolObject<dyn MTL4MachineLearningPipelineState>,
        );

        #[cfg(feature = "MTL4ArgumentTable")]
        /// 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.
        #[unsafe(method(setArgumentTable:))]
        #[unsafe(method_family = none)]
        fn setArgumentTable(&self, argument_table: &ProtocolObject<dyn MTL4ArgumentTable>);

        #[cfg(all(feature = "MTLAllocation", feature = "MTLHeap"))]
        /// 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.
        #[unsafe(method(dispatchNetworkWithIntermediatesHeap:))]
        #[unsafe(method_family = none)]
        fn dispatchNetworkWithIntermediatesHeap(&self, heap: &ProtocolObject<dyn MTLHeap>);
    }
);
