---
title: MPSMatrixMultiplication
framework: metalperformanceshaders
role: symbol
role_heading: Class
path: metalperformanceshaders/mpsmatrixmultiplication
---

# MPSMatrixMultiplication

A matrix multiplication kernel.

## Declaration

```swift
class MPSMatrixMultiplication
```

## Overview

Overview An MPSMatrixMultiplication object computes the following operation: C = alpha * op(A) * op(B) + beta * C Where A, B_,_ and C are matrices represented by 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:)](metalperformanceshaders/mpsmatrixmultiplication/init(device:transposeleft:transposeright:resultrows:resultcolumns:interiorcolumns:alpha:beta:).md)
- [encode(commandBuffer:leftMatrix:rightMatrix:resultMatrix:)](metalperformanceshaders/mpsmatrixmultiplication/encode(commandbuffer:leftmatrix:rightmatrix:resultmatrix:).md)

### Properties

- [leftMatrixOrigin](metalperformanceshaders/mpsmatrixmultiplication/leftmatrixorigin.md)
- [rightMatrixOrigin](metalperformanceshaders/mpsmatrixmultiplication/rightmatrixorigin.md)
- [resultMatrixOrigin](metalperformanceshaders/mpsmatrixmultiplication/resultmatrixorigin.md)
- [batchSize](metalperformanceshaders/mpsmatrixmultiplication/batchsize.md)
- [batchStart](metalperformanceshaders/mpsmatrixmultiplication/batchstart.md)

### Initializers

- [init(device:resultRows:resultColumns:interiorColumns:)](metalperformanceshaders/mpsmatrixmultiplication/init(device:resultrows:resultcolumns:interiorcolumns:).md)

## Relationships

### Inherits From

- [MPSKernel](metalperformanceshaders/mpskernel.md)

### Conforms To

- [CVarArg](swift/cvararg.md)
- [CustomDebugStringConvertible](swift/customdebugstringconvertible.md)
- [CustomStringConvertible](swift/customstringconvertible.md)
- [Equatable](swift/equatable.md)
- [Hashable](swift/hashable.md)
- [NSCoding](foundation/nscoding.md)
- [NSCopying](foundation/nscopying.md)
- [NSObjectProtocol](objectivec/nsobjectprotocol.md)
- [NSSecureCoding](foundation/nssecurecoding.md)

## See Also

### Matrix Arithmetic Operations

- [MPSMatrixSum](metalperformanceshaders/mpsmatrixsum.md)
- [MPSMatrixVectorMultiplication](metalperformanceshaders/mpsmatrixvectormultiplication.md)
- [MPSMatrixFindTopK](metalperformanceshaders/mpsmatrixfindtopk.md)
