MetalPerformanceShaders Namespace

Highly-optimized image and computer shaders.

Classes

MPSAccelerationStructure
MPSAccelerationStructureGroup
MPSBinaryImageKernel

A image kernel that combines two textures into one texture result.

MPSCnnAdd
MPSCnnAddGradient
MPSCnnArithmetic
MPSCnnArithmeticGradient
MPSCnnArithmeticGradientState
MPSCnnBatchNormalization
MPSCnnBatchNormalizationDataSource
MPSCnnBatchNormalizationDataSource_Extensions
MPSCnnBatchNormalizationGradient
MPSCnnBatchNormalizationGradientNode
MPSCnnBatchNormalizationNode
MPSCnnBatchNormalizationState
MPSCnnBatchNormalizationStatistics
MPSCnnBatchNormalizationStatisticsGradient
MPSCnnBinaryConvolution

A MPSCnnKernel that has binary weights and convolves its input.

MPSCnnBinaryConvolutionNode

A MPSCnnConvolutionNode that represents a binary convolution kernel.

MPSCnnBinaryFullyConnected

A MPSCnnBinaryConvolution that is a fully-connected convolution layer that uses binary weights.

MPSCnnBinaryFullyConnectedNode

A MPSCnnBinaryConvolutionNode that represents a fully-connected convolution layer that uses binary weights.

MPSCnnBinaryKernel

A MPSKernel that has binary weights.

MPSCnnConvolution

A MPSCnnKernel that convolves its inputs, producing a feature map for each of its constituent filters.

MPSCnnConvolutionDataSource

Base class for classes that provide weights and bias terms to convolution filters.

MPSCnnConvolutionDataSource_Extensions

Extension methods to the IMPSCnnConvolutionDataSource interface to support all the methods from the MPSCnnConvolutionDataSource protocol.

MPSCnnConvolutionDescriptor

Describes a convolution kernel.

MPSCnnConvolutionGradient
MPSCnnConvolutionGradientNode
MPSCnnConvolutionGradientState
MPSCnnConvolutionGradientStateNode
MPSCnnConvolutionNode

Subclass of MPSNNFilterNode that is the base class for convolution representation nodes.

MPSCnnConvolutionState
MPSCnnConvolutionStateNode
MPSCnnConvolutionTranspose

A MPSCnnKernel that transposes its input.

MPSCnnConvolutionTransposeNode

A MPSCnnConvolutionNode that represents a transpose kernel.

MPSCnnConvolutionWeightsAndBiasesState
MPSCnnCrossChannelNormalization

A MPSCnnKernel that normalizes across feature channels.

MPSCnnCrossChannelNormalizationGradient
MPSCnnCrossChannelNormalizationGradientNode
MPSCnnCrossChannelNormalizationNode

A MPSCnnNormalizationNode that represents a cross-channel normalization kernel.

MPSCnnDepthWiseConvolutionDescriptor

A MPSCnnConvolutionDescriptor that describes depthwise convolution.

MPSCnnDilatedPoolingMax

A dilated max MPSCnnPooling filter.

MPSCnnDilatedPoolingMaxGradient
MPSCnnDilatedPoolingMaxGradientNode
MPSCnnDilatedPoolingMaxNode

A MPSNNFilterNode that represents a dilated max pooling filter.

MPSCnnDivide
MPSCnnDropout
MPSCnnDropoutGradient
MPSCnnDropoutGradientNode
MPSCnnDropoutGradientState
MPSCnnDropoutNode
MPSCnnFullyConnected

A fully connected layer.

MPSCnnFullyConnectedGradient
MPSCnnFullyConnectedNode

A MPSCnnConvolutionNode that represents a fully connected layer.

MPSCnnGradientKernel
MPSCnnInstanceNormalization
MPSCnnInstanceNormalizationDataSource
MPSCnnInstanceNormalizationDataSource_Extensions
MPSCnnInstanceNormalizationGradient
MPSCnnInstanceNormalizationGradientNode
MPSCnnInstanceNormalizationGradientState
MPSCnnInstanceNormalizationNode
MPSCnnKernel

The base class for layers in a convolutional neural network.

MPSCnnLocalContrastNormalization

A local contrast MPSCnnKernel.

MPSCnnLocalContrastNormalizationGradient
MPSCnnLocalContrastNormalizationGradientNode
MPSCnnLocalContrastNormalizationNode

A MPSCnnNormalizationNode representing a local contrast normalization kernel.

MPSCnnLogSoftMax

The logarithmic softmax loss function.

MPSCnnLogSoftMaxGradient
MPSCnnLogSoftMaxGradientNode
MPSCnnLogSoftMaxNode

A MPSNNFilterNode that represents the logarithmic softmax loss function.

MPSCnnLoss
MPSCnnLossDataDescriptor
MPSCnnLossDescriptor
MPSCnnLossLabels
MPSCnnLossNode
MPSCnnMultiply
MPSCnnMultiplyGradient
MPSCnnNeuron

The base class for activation functions.

MPSCnnNeuronAbsolute

The absolute-value activation function.

MPSCnnNeuronAbsoluteNode

A MPSCnnNeuronNode that represents the absolute-value activation function.

MPSCnnNeuronElu

The exponential linear unit activation function.

MPSCnnNeuronEluNode

A MPSCnnNeuronNode that represents the exponential linear unit activation function.

MPSCnnNeuronExponential
MPSCnnNeuronExponentialNode
MPSCnnNeuronGradient
MPSCnnNeuronGradientNode
MPSCnnNeuronHardSigmoid

The hard sigmoid activation function.

MPSCnnNeuronHardSigmoidNode

A MPSCnnNeuronNode that represents the hard sigmoid activation function.

MPSCnnNeuronLinear

The linear activation function.

MPSCnnNeuronLinearNode

A MPSCnnNeuronNode that represents the linear activation function.

MPSCnnNeuronLogarithm
MPSCnnNeuronLogarithmNode
MPSCnnNeuronNode

The base class for representations of activation functions.

MPSCnnNeuronPower
MPSCnnNeuronPowerNode
MPSCnnNeuronPReLU

The parametric rectified linear unit activation function.

MPSCnnNeuronPReLUNode

A MPSCnnNeuronNode that represents the parametric rectified linear unit activation function.

MPSCnnNeuronReLU

The rectified linear unit activation function.

MPSCnnNeuronReLun

The ReLUN activation function.

MPSCnnNeuronReLunNode

A MPSCnnNeuronNode that represents the ReLUN activation function.

MPSCnnNeuronReLUNode

A MPSCnnNeuronNode that represents the rectified linear unit activation function.

MPSCnnNeuronSigmoid

The sigmoid activation function.

MPSCnnNeuronSigmoidNode

A MPSCnnNeuronNode that represents the sigmoid activation function.

MPSCnnNeuronSoftPlus

The softplus activation function.

MPSCnnNeuronSoftPlusNode

A MPSCnnNeuronNode that represents the softplus activation function.

MPSCnnNeuronSoftSign

The softsign activation function.

MPSCnnNeuronSoftSignNode

A MPSCnnNeuronNode that represents the softsign activation function.

MPSCnnNeuronTanH

The hyperbolic tangent activation function.

MPSCnnNeuronTanHNode

T:MetalPerformanceShaders.MPSCNNNeuronNode

MPSCnnNormalizationGammaAndBetaState
MPSCnnNormalizationMeanAndVarianceState
MPSCnnNormalizationNode

Abstract base class for normalization MPSNNFilterNode subclasses.

MPSCnnPooling

A subclass of MPSCnnKernel that sub-samples its input.

MPSCnnPoolingAverage

An average pooling filter.

MPSCnnPoolingAverageGradient
MPSCnnPoolingAverageGradientNode
MPSCnnPoolingAverageNode

A MPSNNFilterNode that returns the average value of its input region.

MPSCnnPoolingGradient
MPSCnnPoolingGradientNode
MPSCnnPoolingL2Norm

An L2-norm pooling filter.

MPSCnnPoolingL2NormGradient
MPSCnnPoolingL2NormGradientNode
MPSCnnPoolingL2NormNode

Representation of an L2-norm pooling filter.

MPSCnnPoolingMax

A MPSCnnPooling subclass that performs max-pooling.

MPSCnnPoolingMaxGradient
MPSCnnPoolingMaxGradientNode
MPSCnnPoolingMaxNode

A MPSCnnPoolingNode that represents a max-pooling kernel in a convolutional neural net.

MPSCnnPoolingNode

A MPSNNFilterNode that represents a pooling kernel in a convolutional neural net.

MPSCnnSoftMax

A MPSCnnKernel commonly used in categorization tasks.

MPSCnnSoftMaxGradient
MPSCnnSoftMaxGradientNode
MPSCnnSoftMaxNode

A MPSNNFilterNode that represents a softmax filter.

MPSCnnSpatialNormalization

A MPSCnnKernel that performs spatial normalization.

MPSCnnSpatialNormalizationGradient
MPSCnnSpatialNormalizationGradientNode
MPSCnnSpatialNormalizationNode

A MPSCnnNormalizationNode that represents a spatial normalization kernel.

MPSCnnSubPixelConvolutionDescriptor

A MPSCnnConvolutionDescriptor that describes subpixel upsampling and reshaping.

MPSCnnSubtract
MPSCnnSubtractGradient
MPSCnnUpsampling

A MPSCnnKernel that upsamples an image.

MPSCnnUpsamplingBilinear

A MPSCnnUpsampling filter that performs bilinear spatial upsampling.

MPSCnnUpsamplingBilinearGradient
MPSCnnUpsamplingBilinearGradientNode
MPSCnnUpsamplingBilinearNode

A MPSNNFilterNode that performs bilinear spatial upsampling.

MPSCnnUpsamplingGradient
MPSCnnUpsamplingNearest

A MPSCnnUpsampling filter that performs nearest spatial upsampling.

MPSCnnUpsamplingNearestGradient
MPSCnnUpsamplingNearestGradientNode
MPSCnnUpsamplingNearestNode

A MPSNNFilterNode that performs nearest spatial upsampling.

MPSCnnYoloLoss
MPSCnnYoloLossDescriptor
MPSCnnYoloLossNode
MPSGRUDescriptor

Describes a gated recurrent unit layer in a neural net.

MPSImage

An image that may contain more than 4 channels. (For example, an image in a layer of a convolutional neural network.)

MPSImageAdd

A MPSImageArithmetic kernel that performs element-wise addition of two images.

MPSImageAllocator_Extensions
MPSImageAreaMax

Filter that finds the maximum pixel value in a window around each pixel in the source image.(Individual channels are processed separately.)

MPSImageAreaMin

Filter that finds the minimum pixel value in a window around each pixel in the source image.(Individual channels are processed separately.)

MPSImageArithmetic

Base class for MPSBinaryImageKernel classes that perform arithmetic on images.

MPSImageBatch
MPSImageBilinearScale

A MPSImageScale subclass that uses bilinear sampling to scale the image.

MPSImageBox

Filter that blurs by transforming each pixel of the source image to the average of itself and its neighbors.

MPSImageConversion

An image that can convert its color space, alpha, or pixel format.

MPSImageConvolution

Filter that represents a convolution.

MPSImageCopyToMatrix

A MPSKernel that copies image data into a MPSMatrix object.

MPSImageDescriptor

Contains the attributes for a new or existing MPSImage.

MPSImageDilate

Finds the maximum value in a region, offset by a corresponding value in a mask.

MPSImageDivide

A MPSImageArithmetic kernel that performs element-wise division of two images.

MPSImageErode

Finds the mininum value in a region, offset by a corresponding value in a mask.

MPSImageEuclideanDistanceTransform
MPSImageFindKeypoints
MPSImageGaussianBlur

Filter that applies a fast Gaussian blur to an image.

MPSImageGaussianPyramid

Represents a Gaussian image pyramid.

MPSImageGuidedFilter
MPSImageHistogram

Calculates a histogram of image data.

MPSImageHistogramEqualization

A MPSUnaryImageKernel that equalizes the histogram of an image.

MPSImageHistogramSpecification

Transforms an image so that its histogram matches a desired histogram.

MPSImageIntegral

Filter that sums the values of pixels in a region.

MPSImageIntegralOfSquares

Filter that sums the squared values of pixels in a region.

MPSImageLanczosScale

Filter that performs a scaling operation with Lanczos resampling.

MPSImageLaplacian

An optimized Laplacian filter.

MPSImageLaplacianPyramid
MPSImageLaplacianPyramidAdd
MPSImageLaplacianPyramidSubtract
MPSImageMedian

Filter that finds the median value of each channel for pixels in the region around each source image pixel.

MPSImageMultiply

A MPSImageArithmetic kernel that performs element-wise multiplication of two images.

MPSImageNormalizedHistogram
MPSImagePyramid

Base class for image pyramids.

MPSImageReduceColumnMax
MPSImageReduceColumnMean
MPSImageReduceColumnMin
MPSImageReduceColumnSum
MPSImageReduceRowMax
MPSImageReduceRowMean
MPSImageReduceRowMin
MPSImageReduceRowSum
MPSImageReduceUnary
MPSImageScale

A MPSUnaryImageKernel that can resize and change aspect ratio of an image.

MPSImageSobel

Filter that detects edges by using a Sobel filter.

MPSImageStatisticsMean

A MPSUnaryImageKernel that calculates the mean of pixel values for a region.

MPSImageStatisticsMeanAndVariance

A MPSUnaryImageKernel that calculates the mean and variance of pixel values for a region.

MPSImageStatisticsMinAndMax

A MPSUnaryImageKernel that calculates the minimum and maximum pixel values for a region.

MPSImageSubtract

A MPSImageArithmetic kernel that performs element-wise subtraction of two images.

MPSImageTent

Filter that blurs an image with a tent function.

MPSImageThresholdBinary

Filter that changes all pixels above a threshold luminance to a specified maximum single-channel value, and completely darkens the rest.

MPSImageThresholdBinaryInverse

Filter that changes all pixels above a threshold luminance to 0, and brightens the rest to a specified maximum single-channel value.

MPSImageThresholdToZero

Filter that darkens all pixels dimmer than or equal in brightness to a threshold luminance to 0, and leaves the rest unchanged.

MPSImageThresholdToZeroInverse

Filter that leaves all pixels dimmer than or equal in brightness to a threshold luminance unchangedt, and darkens the rest to 0.

MPSImageThresholdTruncate

Filter that clamps brightness values to a threshold value.

MPSImageTranspose

Filter that transposes an image.

MPSInstanceAccelerationStructure
MPSKernel

Base class that represents the kernel of a shader.

MPSKeyedUnarchiver
MPSLSTMDescriptor

Describes a Long-Short Term Memory layer in neural net.

MPSMatrix

A matrix that represents the kernel of a linear transformation.

MPSMatrixBatchNormalization
MPSMatrixBatchNormalizationGradient
MPSMatrixBinaryKernel

A kernel that operates on two matrices to create a new matrix.

MPSMatrixCopy

Performs multiple matrix copy operations.

MPSMatrixCopyDescriptor

Describes multiple matrix copy operations.

MPSMatrixCopyToImage
MPSMatrixDecompositionCholesky

A MPSMatrixUnaryKernel that computes the Cholesky factorization.

MPSMatrixDecompositionLU

A MPSMatrixUnaryKernel that computes LU factorization using partial pivoting.

MPSMatrixDescriptor

Describes the size, data type, and stride of a row-major matrix.

MPSMatrixFindTopK
MPSMatrixFullyConnected
MPSMatrixFullyConnectedGradient
MPSMatrixLogSoftMax
MPSMatrixLogSoftMaxGradient
MPSMatrixMultiplication

Represents a weighted matrix multiplication operation, followed by a weighted addition operation.

MPSMatrixNeuron
MPSMatrixNeuronGradient
MPSMatrixSoftMax
MPSMatrixSoftMaxGradient
MPSMatrixSolveCholesky

A MPSMatrixBinaryKernel that solves a linear system of equations via Cholesky factorization.

MPSMatrixSolveLU
MPSMatrixSolveTriangular

A MPSMatrixBinaryKernel that solves a linear system of equations via a triangular coefficient matrix.

MPSMatrixSum
MPSMatrixUnaryKernel

A kernel that performs a mapping from one matrix to another.

MPSMatrixVectorMultiplication

Performs matrix multiplication.

MPSNNAdditionGradientNode
MPSNNAdditionNode

Adds the results of two kernels.

MPSNNArithmeticGradientNode
MPSNNArithmeticGradientStateNode
MPSNNBilinearScaleNode

A MPSNNFilterNode that performs bilinear sampling.

MPSNNBinaryArithmeticNode

Abstract base class of arithmetic nodes.

MPSNNBinaryGradientState
MPSNNBinaryGradientStateNode
MPSNNCompare
MPSNNComparisonNode
MPSNNConcatenationGradientNode
MPSNNConcatenationNode

Concatenates the results of two kernels.

MPSNNCropAndResizeBilinear
MPSNNDefaultPadding

Predefined common padding policies.

MPSNNDivisionNode

Divides the results of two kernels.

MPSNNFilterNode

A placeholder node in a neural network graph for an image filtering stage.

MPSNNGradientFilterNode
MPSNNGradientState
MPSNNGradientStateNode
MPSNNGraph

An optimized neural network graph.

MPSNNImageNode

A placeholder node for an image in a neural network graph.

MPSNNLabelsNode
MPSNNLanczosScaleNode

A MPSNNFilterNode that performs Lanczos resampling.

MPSNNMultiplicationGradientNode
MPSNNMultiplicationNode

Multiplies the results of two kernels.

MPSNNNeuronDescriptor
MPSNNOptimizer
MPSNNOptimizerAdam
MPSNNOptimizerDescriptor
MPSNNOptimizerRmsProp
MPSNNOptimizerStochasticGradientDescent
MPSNNPad
MPSNNPadding_Extensions
MPSNNPadGradient
MPSNNPadGradientNode
MPSNNPadNode
MPSNNReduceBinary
MPSNNReduceColumnMax
MPSNNReduceColumnMean
MPSNNReduceColumnMin
MPSNNReduceColumnSum
MPSNNReduceFeatureChannelsAndWeightsMean
MPSNNReduceFeatureChannelsAndWeightsSum
MPSNNReduceFeatureChannelsArgumentMax
MPSNNReduceFeatureChannelsArgumentMin
MPSNNReduceFeatureChannelsMax
MPSNNReduceFeatureChannelsMean
MPSNNReduceFeatureChannelsMin
MPSNNReduceFeatureChannelsSum
MPSNNReduceRowMax
MPSNNReduceRowMean
MPSNNReduceRowMin
MPSNNReduceRowSum
MPSNNReduceUnary
MPSNNReductionColumnMaxNode
MPSNNReductionColumnMeanNode
MPSNNReductionColumnMinNode
MPSNNReductionColumnSumNode
MPSNNReductionFeatureChannelsArgumentMaxNode
MPSNNReductionFeatureChannelsArgumentMinNode
MPSNNReductionFeatureChannelsMaxNode
MPSNNReductionFeatureChannelsMeanNode
MPSNNReductionFeatureChannelsMinNode
MPSNNReductionFeatureChannelsSumNode
MPSNNReductionRowMaxNode
MPSNNReductionRowMeanNode
MPSNNReductionRowMinNode
MPSNNReductionRowSumNode
MPSNNReductionSpatialMeanGradientNode
MPSNNReductionSpatialMeanNode
MPSNNReshape
MPSNNReshapeGradient
MPSNNReshapeGradientNode
MPSNNReshapeNode
MPSNNResizeBilinear
MPSNNScaleNode

Abstract neural network graph node for image resampling.

MPSNNSlice
MPSNNStateNode

A state object in a neural network graph.

MPSNNSubtractionGradientNode
MPSNNSubtractionNode

Subtracts the results of two kernels.

MPSNNUnaryReductionNode
MPSRayIntersector
MPSRnnDescriptor

A structural description of a recurrent neural net layer.

MPSRnnImageInferenceLayer

A recurrent neural net layer specifically for image data.

MPSRnnMatrixInferenceLayer

A recurrent neural net layer.

MPSRnnMatrixTrainingLayer
MPSRnnMatrixTrainingState
MPSRnnRecurrentImageState

The image containing the state in an image-baed recurrent neural net as it iterates through its sequence.

MPSRnnRecurrentMatrixState

The matrix containing the state as a recurrent neural net iterates through its sequence.

MPSRnnSingleGateDescriptor

Describes the internal gate in a recurrent neural net.

MPSState

Temporary storage used by convolutional neural nets.

MPSStateBatch
MPSStateResourceList
MPSTemporaryImage

Discardable image data.

MPSTemporaryMatrix

A matrix allocated in GPU private memory.

MPSTemporaryVector

A one-dimensional array allocated in GPU private memory.

MPSTriangleAccelerationStructure
MPSUnaryImageKernel

Represents a shader transformation produces one texture from another.

MPSVector

A one-dimensional array.

MPSVectorDescriptor

Describes the length and data type of a MPSVector.

Structs

MPSAxisAlignedBoundingBox
MPSImageCoordinate
MPSImageHistogramInfo

Specifies the range of histogram data in a histogram, the number of entries, and whether to encode the alpha channel.

MPSImageKeypointRangeInfo

Options for the discovery of keypoints in an image.

MPSImageReadWriteParams

Options for the reading and writing of feature channels in an image.

MPSImageRegion
MPSMatrixCopyOffsets

Describes a copy operation that supports offsets.

MPSOffset

A coordinate that represents an offset.

MPSOrigin

A coordinate that represents the origin of a coordinate system.

MPSRegion

Structure that represents a region as an origin and a size.

MPSScaleTransform

A transformation for use with a Lanczos kernel.

MPSSize

A structure that represents a width, height, and depth.

MPSStateTextureInfo

Interfaces

IMPSCnnBatchNormalizationDataSource
IMPSCnnConvolutionDataSource

Interface representing the required methods (if any) of the protocol MPSCnnConvolutionDataSource.

IMPSCnnInstanceNormalizationDataSource
IMPSDeviceProvider
IMPSHandle

Interface describing a Metal Performance Shaders-specific identifier.

IMPSImageAllocator

Interface defining a factory that generates a MPSImage from a T:MetalPerformanceShaders.MTLCommandBuffer, a MPSImageDescriptor, and a MPSKernel.

IMPSImageSizeEncodingState

Interface defining methods relating to when image size is stored elsewhere in the graph.

IMPSImageTransformProvider

Interface defining image resampling methods.

IMPSNNPadding

Interface describing how kernels should pad their inputs.

IMPSNNTrainableNode

Enums

MPSAccelerationStructureStatus
MPSAccelerationStructureUsage
MPSAlphaType

Enumerates values that indicate if and what kind of color premultiplication will be applied to color values.

MPSBoundingBoxIntersectionTestType
MPSCnnBatchNormalizationFlags
MPSCnnBinaryConvolutionFlags

Flagging enumeration for options available to binary convolution kernels.

MPSCnnBinaryConvolutionType

Enumerates the operation used in a binary convolution.

MPSCnnConvolutionFlags

Developers should not use this deprecated class.

MPSCnnConvolutionGradientOption
MPSCnnLossType
MPSCnnNeuronType

Enumerates the available activation functions of a neuron.

MPSCnnReductionType
MPSCnnWeightsQuantizationType
MPSDataLayout

Enumerates whether a data buffer is row- or column-major

MPSDataType

Enumerates values that specify floating point data types.

MPSImageEdgeMode

Enumerates shader behavior at the edges of regions and images.

MPSImageFeatureChannelFormat

Enumerates image channel descriptions.

MPSIntersectionDataType
MPSIntersectionType
MPSKernelOptions

Enumerates ORable kernel options that improve performance in certain cases.

MPSMatrixDecompositionStatus

Enumerates the result forms of a matrix decomposition.

MPSNNComparisonType
MPSNNConvolutionAccumulatorPrecisionOption
MPSNNPaddingMethod

Options for how a neural network graph will pad results.

MPSNNRegularizationType
MPSNNTrainingStyle
MPSPurgeableState

Enumerates an image's underlying texture's purgeable state.

MPSRayDataType
MPSRayMaskOptions
MPSRnnBidirectionalCombineMode

Enumerates how input matrices or images should be combined in a recurrent neural net.

MPSRnnMatrixId
MPSRnnSequenceDirection

Enumerates the propagation direction in a layer in a recurrent neural net.

MPSStateResourceType
MPSTransformType
MPSTriangleIntersectionTestType

Delegates

MPSAccelerationStructureCompletionHandler
MPSCopyAllocator

Commands to copy a source texture to a new location. Used for out-of-place filters.

MPSGradientNodeHandler

Remarks

The Metal Performance Shaders namespace defines the MPSKernel class and a number of subclasses that provide highly-optimized shaders tuned for available GPU hardware.