init(device:transposeLeft:transposeRight:resultRows:resultColumns:interiorColumns:alpha:beta:)
Initializes a matrix multiplication kernel.
Declaration
init(device: any MTLDevice, transposeLeft: Bool, transposeRight: Bool, resultRows: Int, resultColumns: Int, interiorColumns: Int, alpha: Double, beta: Double)Parameters
- device:
The device on which the matrix multiplication kernel will run.
- transposeLeft:
A boolean value that indicates if the left input matrix should be used in its transposed form. If the value is True, then
op(A) = A**T; otherwise,op(A) = A. - transposeRight:
A boolean value that indicates if the right input matrix should be used in its transposed form. If the value is True, then
op(B) = B**T; otherwise,op(B) = B. - resultRows:
The number of rows in the result matrix (
Min the BLAS GEMM description). - resultColumns:
The number of columns in the result matrix (
Nin the BLAS GEMM description). - interiorColumns:
The number of columns of the left input matrix after the appropriate transpose operation has been applied (
Kin the BLAS GEMM description). - alpha:
The scale factor to apply to the product, specified in
doubleprecision. This value will be converted to the appropriate precision in the implementation itself, subject to rounding and/or clamping as necessary. - beta:
The scale factor to apply to the initial values of
C, specified indoubleprecision. This value will be converted to the appropriate precision in the implementation itself, subject to rounding and/or clamping as necessary.
Return Value
A valid MPSMatrixMultiplication object or nil, if failure.