matvec#

Matrix-vector multiplication

template<typename TensorTypeA, typename TensorTypeB>
__MATX_INLINE__ auto matx::matvec(const TensorTypeA A, const TensorTypeB 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:
  • TensorTypeA – Data type of A tensor or operator

  • TensorTypeB – Data type of B tensor or operator

Parameters:
  • A – A input tensor or operator

  • B – B input tensor or 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();