Open JaredCrean2 opened 5 years ago
I figured out why I didn't add the alpha
and beta
parameters initially. The Julia generic matrix-vector and matrix-matrix multiplication function doesn't accept them either. See the signature here. The hierarchy is:
smallmatvec
smallmatvec_kernel!
if matrix is small enoughA_mul_B
otherwise
We could create a replacement for A_mul_B
that also accepts the alpha
and beta
parameters, but that would require re-implementing the logic inside A_mul_B
that sorts out what kinds of matrices can be passed to BLAS or not.
In the interim, I added the alpha
and beta
parameters to the matrix-matrix multiplication kernels (because I need those for what I am currently working on), and exported them.
We should emulate the Blas interface for the
smallmatvec
andsmallmatmat
functions. Currently we don't have thealpha
andbeta
coefficients. This is a bit annoying for reverse mode, where we often want to update, not overwrite, the output vector.Source code here.