matvec#
Matrix-vector multiplication
-
template<typename OpA, typename OpB>
__MATX_INLINE__ auto matx::matvec(const OpA &A, const OpB &B, float alpha = 1.0, float beta = 0.0)# Run a GEMV without a plan
Performs the GEMV: C = beta*C + alpha*A*B where A is a matrix and B and C are vectors.
Creates a new GEMM plan in the cache if none exists, and uses that to execute the GEMM. This function is preferred over creating a plan directly for both efficiency and simpler code. Since it only uses the signature of the GEMM to decide if a plan is cached, it may be able to reused plans for different A/B/C matrices as long as they were configured with the same dimensions.
- Template Parameters:
OpA – Data type of A operator
OpB – Data type of B operator
- Parameters:
A – A input operator
B – B input operator
alpha – Scalar multiplier to apply to operator A
beta – Scalar multiplier to apply to operator C on input
Examples#
// "a" is a matrix and "bs" is a vector
(cs = matvec(a, bs)).run(this->exec);