MPSMatrix(3)

NAME
MPSMatrix -

SYNOPSIS

#import <MPSMatrix.h>

Inherits NSObject.

  Instance Methods
(nonnull instancetype) - initWithBuffer:descriptor:
(nonnull instancetype) - NS_UNAVAILABLE

  Properties
id< MTLDevice > device
NSUInteger rows
NSUInteger columns
MPSDataType dataType
NSUInteger rowBytes
id< MTLBuffer > data

Detailed Description

This depends on Metal.framework

A MPSMatrix object describes a 2-dimensional array of data and provides storage for its values. MPSMatrix objects serve as inputs and outputs of MPSMatrixKernel objects.

Implementation note: A MPSMatrix object maintains its internal storage using a MTLBuffer object and thus the same rules for maintaining coherency of a MTLBuffer's data between CPU memory and GPU memory apply to a MPSMatrix. Data is assumed to be stored in row-major layout.

Method Documentation

  - (nonnull instancetype) initWithBuffer: (nonnull id< MTLBuffer >) buffer(nonnull MPSMatrixDescriptor *) descriptor
Initialize a MPSMatrix object with a MTLBuffer.

Parameters:
    buffer The MTLBuffer object which contains the data to use for the MPSMatrix. May not be NULL.
    descriptor The MPSMatrixDescriptor. May not be NULL.

Returns:
    A valid MPSMatrix object or nil, if failure.

This function returns a MPSMatrix object which uses the supplied MTLBuffer. The dimensions and stride of the matrix are specified by the MPSMatrixDescriptor object.

The provided MTLBuffer must have enough storage to hold

(descriptor.rows-1) * descriptor.rowBytes + descriptor.columns * (element size) bytes.

Property Documentation

  - columns [read], [nonatomic], [assign]
The number of columns in the MPSMatrix.

  - data [read], [nonatomic], [assign]
An MTLBuffer to store the data.

  - dataType [read], [nonatomic], [assign]
The type of the MPSMatrix data.

  - device [read], [nonatomic], [retain]
The device on which the MPSMatrix will be used.

  - rowBytes [read], [nonatomic], [assign]
The stride, in bytes, between corresponding elements of consecutive rows.

  - rows [read], [nonatomic], [assign]
The number of rows in the MPSMatrix.

Author

Generated automatically by Doxygen for MetalPerformanceShaders.framework from the source code.