Metal Performance Shaders
Optimize graphics and compute performance with kernels that are fine-tuned for the unique characteristics of each Metal GPU family.
Overview
The Metal Performance Shaders framework contains a collection of highly optimized compute and graphics shaders that are designed to integrate easily and efficiently into your Metal app. These data-parallel primitives are specially tuned to take advantage of the unique hardware characteristics of each GPU family to ensure optimal performance.
Apps adopting the Metal Performance Shaders framework achieve great performance without needing to create and maintain hand-written shaders for each GPU family. Metal Performance Shaders can be used along with your app’s existing Metal resources (such as the MTLCommandBuffer, MTLTexture, and MTLBuffer objects) and shaders.
The Metal Performance Shaders framework supports the following functionality:
Apply high-performance filters to, and extract statistical and histogram data from images.
Implement and run neural networks for machine learning training and inference.
Solve systems of equations, factorize matrices and multiply matrices and vectors.
Accelerate ray tracing with high-performance ray-geometry intersection testing.
Topics
Fundamentals
Device Support
Image Filters
Neural Networks
Training a Neural Network with Metal Performance ShadersMPSImageMPSTemporaryImageObjects that Simplify the Creation of Neural NetworksConvolutional Neural Network KernelsRecurrent Neural Networks
Matrices and Vectors
Kernel Base Classes
Keyed Archivers
Ray Tracing
Accelerating ray tracing and motion blur using MetalMPSRayIntersectorMPSAccelerationStructureGroupMPSInstanceAccelerationStructureMPSTriangleAccelerationStructureMPSAccelerationStructure
Articles
MetalPerformanceShaders ConstantsMetalPerformanceShaders Data TypesMetalPerformanceShaders EnumerationsMetalPerformanceShaders FunctionsMetalPerformanceShaders Structures
Classes
MPSCNNConvolutionTransposeGradientMPSCNNConvolutionTransposeGradientNodeMPSCNNConvolutionTransposeGradientStateMPSCNNConvolutionTransposeGradientStateNodeMPSCNNFullyConnectedGradientNodeMPSCNNGroupNormalizationMPSCNNGroupNormalizationGradientMPSCNNGroupNormalizationGradientNodeMPSCNNGroupNormalizationGradientStateMPSCNNGroupNormalizationNodeMPSCNNMultiaryKernelMPSCNNNeuronGeLUNodeMPSCommandBufferMPSImageCannyMPSImageEDLinesMPSImageNormalizedHistogramMPSMatrixRandomMPSMatrixRandomDistributionDescriptorMPSMatrixRandomMTGP32MPSMatrixRandomPhiloxMPSNDArrayMPSNDArrayAffineInt4DequantizeMPSNDArrayAffineQuantizationDescriptorMPSNDArrayBinaryKernelMPSNDArrayBinaryPrimaryGradientKernelMPSNDArrayBinarySecondaryGradientKernelMPSNDArrayDescriptorMPSNDArrayGatherMPSNDArrayGatherGradientMPSNDArrayGatherGradientStateMPSNDArrayGradientStateMPSNDArrayIdentityMPSNDArrayLUTDequantizeMPSNDArrayLUTQuantizationDescriptorMPSNDArrayMatrixMultiplicationMPSNDArrayMultiaryBaseMPSNDArrayMultiaryGradientKernelMPSNDArrayMultiaryKernelMPSNDArrayQuantizationDescriptorMPSNDArrayQuantizedMatrixMultiplicationMPSNDArrayStridedSliceMPSNDArrayStridedSliceGradientMPSNDArrayUnaryGradientKernelMPSNDArrayUnaryKernelMPSNDArrayVectorLUTDequantizeMPSNNCompareMPSNNComparisonNodeMPSNNCropAndResizeBilinearMPSNNForwardLossMPSNNForwardLossNodeMPSNNGramMatrixCalculationMPSNNGramMatrixCalculationGradientMPSNNGramMatrixCalculationGradientNodeMPSNNGramMatrixCalculationNodeMPSNNGridSampleMPSNNInitialGradientMPSNNInitialGradientNodeMPSNNLocalCorrelationMPSNNLossGradientMPSNNLossGradientNodeMPSNNMultiaryGradientStateMPSNNMultiaryGradientStateNodeMPSNNPadMPSNNPadGradientMPSNNPadGradientNodeMPSNNPadNodeMPSNNReductionColumnMaxNodeMPSNNReductionColumnMeanNodeMPSNNReductionColumnMinNodeMPSNNReductionColumnSumNodeMPSNNReductionFeatureChannelsArgumentMaxNodeMPSNNReductionFeatureChannelsArgumentMinNodeMPSNNReductionFeatureChannelsMaxNodeMPSNNReductionFeatureChannelsMeanNodeMPSNNReductionFeatureChannelsMinNodeMPSNNReductionFeatureChannelsSumNodeMPSNNReductionRowMaxNodeMPSNNReductionRowMeanNodeMPSNNReductionRowMinNodeMPSNNReductionRowSumNodeMPSNNReductionSpatialMeanGradientNodeMPSNNReductionSpatialMeanNodeMPSNNReshapeGradientMPSNNReshapeGradientNodeMPSNNReshapeNodeMPSNNResizeBilinearMPSNNUnaryReductionNodeMPSPolygonAccelerationStructureMPSPolygonBufferMPSPredicateMPSQuadrilateralAccelerationStructureMPSSVGFMPSSVGFDefaultTextureAllocatorMPSSVGFDenoiserMPSStateResourceListMPSTemporalAAMPSTemporaryNDArray
Protocols
MPSCNNGroupNormalizationDataSourceMPSHeapProviderMPSNDArrayAllocatorMPSNNGramMatrixCallbackMPSNNLossCallbackMPSSVGFTextureAllocator
Structures
Variables
MPSCustomKernelIndexDestIndexMPSCustomKernelIndexSrc0IndexMPSCustomKernelIndexSrc1IndexMPSCustomKernelIndexSrc2IndexMPSCustomKernelIndexSrc3IndexMPSCustomKernelIndexSrc4IndexMPSCustomKernelIndexUserDataIndexMPSDeviceCapsLastMPSDeviceCapsNullMPSDeviceIsAppleDeviceMPSDeviceSupportsBFloat16ArithmeticMPSDeviceSupportsFloat16BicubicFilteringMPSDeviceSupportsFloat32FilteringMPSDeviceSupportsNorm16BicubicFilteringMPSDeviceSupportsQuadShuffleMPSDeviceSupportsReadWriteTexturesMPSDeviceSupportsReadableArrayOfTexturesMPSDeviceSupportsSimdReductionMPSDeviceSupportsSimdShuffleMPSDeviceSupportsSimdShuffleAndFillMPSDeviceSupportsSimdgroupBarrierMPSDeviceSupportsWritableArrayOfTexturesMPSImageType2dMPSImageType2d_arrayMPSImageType2d_array_noAlphaMPSImageType2d_noAlphaMPSImageTypeArray2dMPSImageTypeArray2d_arrayMPSImageTypeArray2d_array_noAlphaMPSImageTypeArray2d_noAlphaMPSImageType_ArrayMaskMPSImageType_BatchMaskMPSImageType_bitCountMPSImageType_maskMPSImageType_noAlphaMPSImageType_texelFormatBFloat16MPSImageType_texelFormatFloat16MPSImageType_texelFormatMaskMPSImageType_texelFormatShiftMPSImageType_texelFormatStandardMPSImageType_texelFormatUnorm8MPSImageType_typeMaskMPSRectNoClip
Type Aliases
See Also
Related Documentation
Metal- Metal Programming Guide