OpenBLAS icon indicating copy to clipboard operation
OpenBLAS copied to clipboard

[Feature Request] cblas_zomatadd should be supported.

Open xqch1983 opened this issue 2 years ago • 5 comments

The clbas_zomatadd should be supported same with the interface in MKL. implement the addition of two matrixes as bellow: C := alphaop(A) + betaop(B)

The API in MKL is mkl_?omatadd, which scales and adds two matrices, as well as performing out-of-place transposition operations.

xqch1983 avatar Sep 21 '23 10:09 xqch1983

So something like omatcopy plus axpby looping over all columns... may I ask what the use case for this is, apart from it being part of MKL's BLAS-like extensions ?

martin-frbg avatar Sep 21 '23 14:09 martin-frbg

Cast matrices to vectors. Scal one and axpy other?

brada4 avatar Sep 22 '23 09:09 brada4

So something like omatcopy plus axpby looping over all columns... may I ask what the use case for this is, apart from it being part of MKL's BLAS-like extensions ?

Yes, I checked the use case of matrix is that rows=m, cols=1 or rows=1, cols=n, so this omatadd case can be replaced by omatcopy and axpy. Actually, users want to replace the MKL BLAS API using OpenBLAS API one-to-one directly.

xqch1983 avatar Sep 23 '23 11:09 xqch1983

So make supercompat header to do the casts. BLAS L1 is quite well optimised by modern compilers.

brada4 avatar Sep 23 '23 11:09 brada4

So something like omatcopy plus axpby looping over all columns... may I ask what the use case for this is, apart from it being part of MKL's BLAS-like extensions ?

Yes, I checked the use case of matrix is that rows=m, cols=1 or rows=1, cols=n, so this omatadd case can be replaced by omatcopy and axpy. Actually, users want to replace the MKL BLAS API using OpenBLAS API one-to-one directly.

do you happen to have sample code and/or a testcase ? I'm primarily curious in what kind of context this particular function is useful (and of course it is a general problem with BLAS extensions that few libraries implement them - besides the one who "invented" it)

martin-frbg avatar Sep 23 '23 14:09 martin-frbg