vSgemm(_:_:_:_:_:_:_:_:_:_:_:)
Multiples two general matrices or their transposes, then scales and adds a third.
Declaration
func vSgemm(_ l: Int32, _ m: Int32, _ n: Int32, _ a: UnsafePointer<vFloat>, _ forma: CChar, _ b: UnsafePointer<vFloat>, _ formb: CChar, _ c: UnsafeMutablePointer<vFloat>, _ alpha: Float, _ beta: Float, _ matrix: UnsafeMutablePointer<vFloat>)Parameters
- l:
Number of rows in matrix
c; must be a multiple of 4. - m:
If
forma= ‘N’,mis the number of columns in matrixa; ifforma= ‘T’,mis the number of rows in matrixa. Also, ifformb= ‘N’,mis the number of rows in matrixb; ifformb= ‘T’,mis the number of columns in matrixb.mmust be a multiple of 4. - n:
Number of columns in matrix
c; must be a multiple of 4. - a:
A matrix with elements of type
float. Ifforma= ‘N’, the matrix itself is used in the calculation and it haslrows andmcolumns. Ifforma= ‘T’, the transpose is used andahasmrows andlcolumns. Thus the matrix used in the calculation islbyn. - forma:
Selector with a value of ‘N’ or ‘T’.
- b:
A matrix with elements of type
float. Ifformb= ‘N’, the matrix itself is used in the calculation and it hasmrows andncolumns. Ifformb= ‘T’, the transpose is used andbhasnrows andmcolumns. Thus the matrix used in the calculation ismbyn. - formb:
Selector with a value of ‘N’ or ‘T’.
- c:
An
lbynmatrix with elements of typefloat. - alpha:
Multiplier for matrix
a. - beta:
Multiplier for matrix
c. - matrix:
Destination matrix with
lrows andncolumns.
Discussion
Matrix a (or its transpose) is multiplied by matrix b (or its transpose); matrix c is multiplied by beta, and the result is added to the result of the matrix multiplication; the result is stored in matrix matrix