rowBytes(fromColumns:dataType:)
Determines the recommended matrix row stride, in bytes, for a given number of columns.
Declaration
class func rowBytes(fromColumns columns: Int, dataType: MPSDataType) -> IntParameters
- columns:
The number of columns in the matrix.
- dataType:
The type of the data to be stored in the matrix.
Return Value
The recommended matrix row stride, in bytes.
Discussion
The optimal stride between the rows of a matrix is not necessarily equivalent to the number of columns in the matrix. This method returns the row stride, in bytes, which gives the best performance for a given number of columns. Using this row stride to construct your matrix descriptor is recommended, but not required (as long as the stride used is still large enough to allocate a full row of data).