<!--
{
  "availability" : [
    "iOS: 10.0.0 -",
    "iPadOS: 10.0.0 -",
    "macCatalyst: 13.0.0 -",
    "macOS: 10.13.0 -",
    "tvOS: 10.0.0 -",
    "visionOS: 1.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "MetalPerformanceShaders",
  "identifier" : "/documentation/MetalPerformanceShaders/MPSMatrixMultiplication",
  "metadataVersion" : "0.1.0",
  "role" : "Class",
  "symbol" : {
    "kind" : "Class",
    "modules" : [
      "Metal Performance Shaders"
    ],
    "preciseIdentifier" : "c:objc(cs)MPSMatrixMultiplication"
  },
  "title" : "MPSMatrixMultiplication"
}
-->

# MPSMatrixMultiplication

A matrix multiplication kernel.

```
class MPSMatrixMultiplication
```

## Overview

An [`MPSMatrixMultiplication`](/documentation/MetalPerformanceShaders/MPSMatrixMultiplication) object computes the following operation:

*C = alpha * op(A) * op(B) + beta * C*

Where *A*, *B*_,_ and *C* are matrices represented by [`MPSMatrix`](/documentation/MetalPerformanceShaders/MPSMatrix) objects, and *alpha* and *beta* are scalar values of the same data type as the values of *C*. *A* and *B* may each have an optional transposition operation applied.

Matrices *A*, *B*, and *C* are also referred to as the left input matrix, the right input matrix, and the result matrix respectively.

## Topics

### Methods

[`init(device:transposeLeft:transposeRight:resultRows:resultColumns:interiorColumns:alpha:beta:)`](/documentation/MetalPerformanceShaders/MPSMatrixMultiplication/init(device:transposeLeft:transposeRight:resultRows:resultColumns:interiorColumns:alpha:beta:))

Initializes a matrix multiplication kernel.

[`encode(commandBuffer:leftMatrix:rightMatrix:resultMatrix:)`](/documentation/MetalPerformanceShaders/MPSMatrixMultiplication/encode(commandBuffer:leftMatrix:rightMatrix:resultMatrix:))

Encodes a matrix multiplication kernel to a command buffer.

### Properties

[`leftMatrixOrigin`](/documentation/MetalPerformanceShaders/MPSMatrixMultiplication/leftMatrixOrigin)

The origin of the left input matrix.

[`rightMatrixOrigin`](/documentation/MetalPerformanceShaders/MPSMatrixMultiplication/rightMatrixOrigin)

The origin of the right input matrix.

[`resultMatrixOrigin`](/documentation/MetalPerformanceShaders/MPSMatrixMultiplication/resultMatrixOrigin)

The origin of the result matrix.

[`batchSize`](/documentation/MetalPerformanceShaders/MPSMatrixMultiplication/batchSize)

[`batchStart`](/documentation/MetalPerformanceShaders/MPSMatrixMultiplication/batchStart)



---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)