BLAS level 2

Overview

Batched matrix-vector operations.

Functions

◆ gemv()

template<Backend B, typename T>
Event batchlas::gemv ( Queue & ctx,
const MatrixView< T, MatrixFormat::Dense > & A,
const VectorView< T > & X,
const VectorView< T > & Y,
T alpha,
T beta,
Transpose transA )

Batched general matrix-vector multiply.

For every batch item \(b\) computes

\[ y_b := \alpha \, \mathrm{op}(A_b) \, x_b + \beta \, y_b \]

where \(\mathrm{op}(A)\) is \(A\), \(A^T\) or \(A^H\) according to transA. For an m x n A, X has length n and Y length m under NoTrans, and the other way round under Trans / ConjTrans. The vectors' inc (element spacing) and stride (batch spacing) are honoured.

Also callable as gemv(ctx, A, x, y, GemvOptions<T>{...}), with owning Matrix / Vector arguments, and without B (taken from ctx.backend()).

Template Parameters
Bbackend the call is compiled for; must match ctx's device
Tscalar type: float, double, std::complex<float> or std::complex<double>
Parameters
ctxqueue the work is enqueued on
Abatch of m x n matrices
Xbatch of input vectors
Ybatch of output vectors; input scaled by beta, overwritten with the result
alphascale of the product
betascale of the input Y
transAop() applied to A
Returns
event of the last enqueued kernel; Y is valid once it completes
Precondition
A, X and Y have the same batch size and conforming lengths.
Exceptions
batchlas::NoRouteErrorin a build without the vendor BLAS for B when no native kernel can run the call (for example a heterogeneous A).
Note
No argument validation is done up front: a shape the native kernels refuse goes to the vendor library, which reports it.
See also
GemvOptions, docs/cpp-api.md