CmatinvBatched
Applicable Products
Hardware Model |
Supported or Not |
|---|---|
Not supported |
|
Not supported |
|
Not supported |
|
Supported |
|
Not supported |
Function Description
API function
- asdBlasMakeCmatinvBatchedPlan: initializes the operator configuration corresponding to the handle.
- asdBlasCmatinvBatched: computes the inverse of a complex matrix.
Formula:
- Computation of asdBlasCmatinvBatched: An inverse matrix of a batch complex matrix is computed. Each complex matrix needs to meet the condition
, where A is a non-singular square matrix and an n*n input square matrix, and I is an identity matrix.
- Example:
[2-2i ,1-i ,1-i, 1-i 1-i, 2-2i, 1-i ,1-i 1-i, 1-i ,2-2i ,1-i 1-i ,1-i, 1-i, 2-2i] [3-3i ,1-i, 1-i, 1-i 1-i, 3-3i, 1-i ,1-i 1-i, 1-i ,3-3i ,1-i 1-i, 1-i, 1-i, 3-3i]
Input n: 4
Input batchSize: 2
After the asdBlasCmatinvBatched operator is called, the output Ainv is as follows:
[0.4+0.4i, -0.1-0.1i,-0.1-0.1i ,-0.1-0.1i -0.1-0.1i ,0.4+0.4i ,-0.1-0.1i ,-0.1-0.1i -0.1-0.1i ,-0.1-0.1i,0.4+0.4i ,-0.1-0.1i -0.1-0.1i ,-0.1-0.1i,-0.1-0.1i,0.4+0.4i] [0.208+0.208i,-0.0417-0.0417i,-0.0417-0.0417i,-0.0417-0.0417i -0.0417-0.0417i,0.208+0.208i,-0.0417-0.0417i,-0.0417-0.0417i -0.0417-0.0417i,-0.0417-0.0417i,0.208+0.208i,-0.0417-0.0417i -0.0417-0.0417i,-0.0417-0.0417i,-0.0417-0.0417i,0.208+0.208i]
Function Prototype
- AspbStatus asdBlasMakeCmatinvBatchedPlan(asdBlasHandle handle, const int64_t n, const int64_t batchSize)
- AspbStatus asdBlasCmatinvBatched(asdBlasHandle handle, const int64_t n, aclTensor *A, const int64_t lda,aclTensor *Ainv, const int64_t lda_inv, aclTensor *info, int64_t batchSize)
Parameter Description
- asdBlasMakeCmatinvBatchedPlan
Parameter
Input/Output
Type
Description
handle
Input
asdBlasHandle
Operator handle.
n
Input
const int64_t
Number of rows in matrix A in a single batch.
batchSize
Input
const int64_t
Number of matrices in the complex matrix inversion.
- asdBlasCmatinvBatched
Parameter
Input/Output
Type
Description
handle
Input
asdBlasHandle
Operator handle.
n
Input
const int64_t
Number of rows in matrix A.
A
Input
aclTensor *
Matrix A in the formula, which is in row-major order and is a tensor on the device.
The data type can only be COMPLEX64, the data format can be ND, and the shape is [batch, n, n].
lda
Input
const int64_t
Memory address offset between the left and right adjacent elements of A (currently, the offset is n).
Ainv
Output
aclTensor *
Output inverse matrix. The data type can only be COMPLEX64, the data format can be ND, and the shape is [batch, n, n].
lda_inv
Input
const int64_t
Memory address offset between the left and right adjacent elements of the output inverse matrix (currently, the offset is n).
info
Input
aclTensor *
Information about the inverse result of each batch matrix. The data type can be int32_t, the data format can be ND, and the shape is [batch, 1].
batchSize
Input
int64_t
Number of matrices in the complex matrix inversion.
Return Value Description
For details about the return values, see Return Value.
Constraints
- asdBlasMakeCmatinvBatchedPlan: none.
- asdBlasCmatinvBatched
- The supported CANN version is CANN 8.0 or later.
- The lda, lda_inv, and info parameters are not enabled in the current version.
- The input parameter n is less than or equal to 256.
- The input parameter batchSize is less than or equal to 3000.
Calling Example
For details about the operator calling example, see CmatinvBatched.