MPSMatrix(3) MetalPerformanceShaders.framework MPSMatrix(3)
NAME
MPSMatrix
SYNOPSIS
#import <MPSMatrixTypes.h>
Inherits NSObject.
Inherited by MPSTemporaryMatrix.
Instance Methods
(nonnull instancetype) - initWithBuffer:descriptor:
(nonnull instancetype) - init
Properties
id< MTLDevice > device
NSUInteger rows
NSUInteger columns
NSUInteger matrices
MPSDataType dataType
NSUInteger rowBytes
NSUInteger matrixBytes
id< MTLBuffer > data
Detailed Description
This depends on Metal.framework
A MPSMatrix object describes a set of 2-dimensional arrays 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. An MPSMatrix object's data refers to an array of
matrices. Data is assumed to be ordered by matrix first, followed by
row, followed by column.
For example, index [i,j] of the k'th matrix of an MPSMatrix is located
at byte offset: k * matrixBytes + i * rowBytes + j * sizeof(dataType)
Where matrixBytes is a multiple of rowBytes at least equal to rows *
rowBytes.
Method Documentation
- (nonnull instancetype) init
- (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.matrices-1) * descriptor.matrixBytes +
(descriptor.rows-1) * descriptor.rowBytes +
descriptor.columns * (element size) bytes.
Reimplemented in MPSTemporaryMatrix.
Property Documentation
- columns [read], [nonatomic], [assign]
The number of columns in a matrix 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.
- matrices [read], [nonatomic], [assign]
The number of matrices in the MPSMatrix.
- matrixBytes [read], [nonatomic], [assign]
The stride, in bytes, between corresponding elements of consecutive
matrices.
- rowBytes [read], [nonatomic], [assign]
The stride, in bytes, between corresponding elements of consecutive
rows.
- rows [read], [nonatomic], [assign]
The number of rows in a matrix in the MPSMatrix.
Author
Generated automatically by Doxygen for
MetalPerformanceShaders.framework from the source code.
Version MetalPerformanceShaders-Thu2Jul 13 2017 MPSMatrix(3)
Mac OS X 10.13.1 - Generated Tue Nov 7 18:18:32 CST 2017