CgemvBatched
Applicable Products
Hardware Model |
Supported or Not |
|---|---|
Not supported |
|
Not supported |
|
Not supported |
|
Supported |
|
Not supported |
Function Description
API function
- asdBlasMakeCgemvBatchedPlan: initializes the operator configuration corresponding to the handle.
- asdBlasCgemvBatched: computes the product of a batch of complex matrices and vectors.
Formula:
- asdBlasCgemvBatched formula:

op indicates that matrix A is conjugately transposed or not transposed.
- Example:
[ [ 1+i, 1+2i ], [ 1+3i, 1+4i ] ]Input x[i]:
[ 1+i, 1+i ]
The input trans is N, indicating that matrix A is not transposed.
The input m is 2, the input n is 2, the input alpha is 1+0i, and the input beta is 0+0i.
The input lda is 2.
The input batchCount is 1.
After the asdBlasCgemvBatched operator is called, the output y[i] is as follows:
[0+4i, 0+8i]
Function Prototype
- AspbStatus asdBlasMakeCgemvBatchedPlan(asdBlasHandle handle, asdBlasOperation_t trans, const int64_t m)
- AspbStatus asdBlasCgemvBatched(asdBlasHandle handle, asdBlasOperation_t trans, const int64_t m, const int64_t n,const std::complex<float> &alpha, aclTensor *A, const int64_t lda,aclTensor *x, const int64_t incx, const std::complex<float> &beta,aclTensor *y, const int64_t incy, const int64_t batchCount)
Parameter Description
- asdBlasMakeCgemvBatchedPlan
Parameter
Input/Output
Type
Description
handle
Input
asdBlasHandle
Operator handle.
trans
Input
asdBlasOperation_t
Whether matrix A should be transposed.
ASDBLAS_OP_N //Not transposed ASDBLAS_OP_C //Conjugately transposed
m
Input
const int64_t
Number of rows in matrix A in a single batch.
- asdBlasCgemvBatched
Parameter
Input/Output
Type
Description
handle
Input
asdBlasHandle
Operator handle.
trans
Input
asdBlasOperation_t
Whether matrix A should be transposed.
ASDBLAS_OP_N //Not transposed ASDBLAS_OP_C //Conjugately transposed
m
Input
const int64_t
Number of rows in matrix A in a single batch.
n
Input
const int64_t
Number of columns in matrix A in a single batch.
alpha
Input
const std::complex<float> &
alpha in the formula is a complex scalar, and is used to multiply the result of the matrix and vector multiplication. In the current version, the value of alpha can only be 1+0i.
A
Input
aclTensor *
Matrix A in the formula, which is in row-major order and is a tensor on the device. The data type is COMPLEX64, the data format is ND, and the shape is [batchCount ,m, n].
lda
Input
const int64_t
Memory address offset between adjacent elements in matrix A (currently constrained to m).
x
Input
aclTensor *
Vector x in the formula, which is a tensor on the device. The data type must be COMPLEX64, and the data format must be ND.
- When the value of trans is not transposed, shape is [batchCount, n].
- When the value of trans is conjugately transposed, shape is [batchCount, m].
incx
Input
const int64_t
Stride of vector x (currently restricted to 1).
beta
Input
const std::complex<float> &
beta in the formula is a complex scalar, and is used to multiply vector y. In the current version, the value of beta can only be 0+0i.
y
Input/Output
aclTensor *
Vector y in the formula, which is a tensor on the device. The data type must be COMPLEX64 and the data format must be ND.
- When the value of trans is not transposed, shape is [batchCount, m].
- When the value of trans is conjugately transposed, shape is [batchCount, n].
incy
Input
const int64_t
Stride of vector y (currently restricted to 1).
batchCount
Input
const int64_t
Number of batches. The value range is {12 - 314496}.
Return Value Description
For details about the return values, see Return Value.
Constraints
- asdBlasMakeCgemvBatchedPlan: none.
- asdBlasCgemvBatched
- The supported CANN version is CANN 8.0 or later.
- The supported input data type is COMPLEX64.
- The supported output data type is COMPLEX64.
Calling Example
For details about the operator calling example, see CgemvBatched.