OptimalDesignLab / ODLCommonTools.jl

Some common type definitions used by several different Julia repos
Other
0 stars 0 forks source link

Emulate Blas Interface #3

Open JaredCrean2 opened 5 years ago

JaredCrean2 commented 5 years ago

We should emulate the Blas interface for the smallmatvec and smallmatmat functions. Currently we don't have the alpha and beta coefficients. This is a bit annoying for reverse mode, where we often want to update, not overwrite, the output vector.

Source code here.

JaredCrean2 commented 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:

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.