AlphaSparse documentation
This document provides a detailed stage function interface description of the AlphaSparse sparse matrix algorithm library, including mv, mm and spmmd, etc. The function will perform the corresponding algorithm processing according to the sparse matrix format. The specific format of the sparse matrix will not be reflected in the interface name and the reception parameters.
GENERAL
Function return value
The function has several return values, indicating whether the function is executed successfully, as shown below:
return value |
Return value meaning |
---|---|
|
Successful operation |
|
The matrix is not initialized |
|
Internal space allocation failed |
|
The input parameter contains an illegal value |
|
Execution failed |
|
Algorithm implementation error |
|
The requested operation cannot be supported |
Basic operations of sparse matrix
Algorithm library currently supports the direct creation of CSR, COO, CSC and BSR sparse matrix format, and conversion from COO to CSR, CSC, BSR, DIA and SKY, the interface supports four data formats.
alphasparse_create_coo
alphasparse_status_t alphasparse_?_create_coo(
alphasparse_matrix_t *A,
const alphasparse_index_base_t indexing,
const ALPHA_INT rows,
const ALPHA_INT cols,
const ALPHA_INT nnz,
ALPHA_INT *row_indx,
ALPHA_INT *col_indx,
ALPHA_Number * values)
The alphasparse_?_create_coo creates
a sparse matrix in COO
matrix format. The matrix size is m*k
and stored in variable A
.
“?
” indicates the data format. It corresponds to the
ALPHA_Number
in the interface. s
corresponds to float, d
corresponds to double, and c
corresponds to float complex, that is
single-precision complex number, z
corresponds to double complex,
that is double-precision complex number, other parameters are shown
below:
Input parameters |
Description |
---|---|
A |
COO format |
indexing |
Indicates the addressing mode of the input array, There are the following options:
|
rows |
Number of rows of matrix |
cos |
Number of columns of matrix |
nnz |
The number of non-zero elements of matrix |
row_indx |
The row coordinate index of each non-zero element, the length is |
col_indx |
The column coordinate index of each non-zero element, the length is |
values |
Store the values of non-zero elements in matrix |
alphasparse_create_csc
alphasparse_status_t alphasparse_?_create_csc(
alphasparse_matrix_t *A,
const alphasparse_index_base_t indexing,
const ALPHA_INT rows,
const ALPHA_INT cols,
ALPHA_INT *cols_start,
ALPHA_INT *cols_end,
ALPHA_INT *row_indx,
ALPHA_Number * values)
The alphasparse_?_create_csc
is used to create a sparse matrix in
CSC
matrix format. The matrix size is m*k
and is stored in
variable A
. “?
” indicates the data format. It corresponds to the
ALPHA_Number
in the interface. s
corresponds to float, d
corresponds to double, and c
corresponds to float complex, that is
single-precision complex number, z
corresponds to double complex,
that is double-precision complex number, other parameters are shown
below:
Input parameters |
Description |
---|---|
A |
|
indexing |
Indicates the addressing mode of the input array,
There are the following options:
|
rows |
Number of rows of matrix |
cols |
Number of columns of matrix |
cols_start |
The length is at least m, contains the index of each
column of the matrix, |
cols_end |
The length is at least m, contains the index of each
column of the matrix, |
row_indx |
When addressing based on 1, the array contains the
row index of each non-zero element of |
values |
Store the value of the non-zero element in the matrix
|
alphasparse_create_csr
alphasparse_status_t alphasparse_?_create_csr(
alphasparse_matrix_t *A,
const alphasparse_index_base_t indexing,
const ALPHA_INT rows,
const ALPHA_INT cols,
ALPHA_INT *rows_start,
ALPHA_INT *rows_end,
ALPHA_INT *col_indx,
ALPHA_Number * values)
The alphasparse_?_create_csr
is used to create a sparse matrix in
CSR
matrix format. The matrix size is m*k
and is stored in
variable A
. “?
” indicates the data format. It corresponds to the
ALPHA_Number
in the interface. s
corresponds to float, d
corresponds to double, and c
corresponds to float complex, that is
single-precision complex number, z
corresponds to double complex,
that is double-precision complex number, other parameters are shown
below:
Input parameters |
Description |
---|---|
A |
CSR format |
indexing |
Indicates the addressing mode of the input
array,There are the following
options: |
rows |
Number of rows of matrix |
cols |
Number of columns of matrix |
rows_start |
The length is at least m, contains the index of each
column of the matrix, |
rows_end |
The length is at least m, contains the index of each
column of the matrix, |
col_indx |
When addressing based on 1, the array contains the
row index of each non-zero element of |
values |
Store the value of the non-zero element in the matrix
A, the length is equal to the length of |
alphasparse_create_bsr
alphasparse_status_t alphasparse_?_create_bsr(
alphasparse_matrix_t *A,
const alphasparse_index_base_t indexing,
const alphasparse_layout_t block_layout,
const ALPHA_INT rows,
const ALPHA_INT cols,
const ALPHA_INT block_size,
ALPHA_INT *rows_start,
ALPHA_INT *rows_end,
ALPHA_INT *col_indx,
ALPHA_Number * values)
The alphasparse_?_create_bsr
is used to create a sparse matrix in
BSR
matrix format. The matrix size is m*k
and is stored in
variable A
. “?
” indicates the data format. It corresponds to the
ALPHA_Number
in the interface. s
corresponds to float, d
corresponds to double, and c
corresponds to float complex, that is
single-precision complex number, z
corresponds to double complex,
that is double-precision complex number, other parameters are shown
below:
Input parameters |
Description |
---|---|
A |
BSR format |
indexing |
Indicates the addressing mode of the input
array,There are the following
options: |
block_layout |
Describe the storage mode of non-zero elements in the
sparse matrix block, with the following
options: |
rows |
Number of rows of non-zero block of matrix |
cols |
The number of columns in the non-zero block of matrix
|
block_size |
The length of the non-zero element block of the
sparse matrix, the size of each non-zero element
block is |
rows_start |
The length is at least m, contains the index of each
non-zero block row of the
matrix, |
rows_end |
The length is at least m, contains the index of each
non-zero block row of the matrix,
|
col_indx |
When addressing based on 1, the array contains the
row index of each non-zero block of matrix |
values |
store the value of non-zero elements in |
alphasparse_convert_csr
alphasparse_status_t alphasparse_convert_csr(
const alphasparse_matrix_t source,
const alphasparse_operation_t operation,
alphasparse_matrix_t *dest)
The alphasparse_convert_csr
is used to convert the data structure of
other sparse matrix format into the data structure of CSR matrix format,
which is stored in dest. The parameter explanation is shown below:
Input parameters |
Description |
---|---|
source |
Source matrix |
operation |
For specific operations on the input matrix, there
are the following
options: |
dest |
Matrix in CSR format |
alphasparse_convert_csc
alphasparse_status_t alphasparse_convert_csc(
const alphasparse_matrix_t source,
const alphasparse_operation_t operation,
alphasparse_matrix_t *dest)
The alphasparse_convert_csc
converts the data structure of other
sparse matrix format to the data structure of CSC matrix format, which
is stored in dest. The parameter explanation is shown below:
Input parameters |
Description |
---|---|
source |
Source matrix |
operation |
For specific operations on the input matrix, there
are the following
options: |
dest |
Matrix in CSC format |
alphasparse_convert_sky
alphasparse_status_t alphasparse_convert_sky(
const alphasparse_matrix_t source,
const alphasparse_operation_t operation,
alphasparse_matrix_t *dest)
The alphasparse_convert_sky
converts the data structure of other
sparse matrix format to the data structure of SKY matrix format, which
is stored in dest. The parameter explanation is shown below:
Input parameters |
Description |
---|---|
source |
Source matrix |
operation |
For specific operations on the input matrix, there
are the following
options: |
dest |
Matrix in SKY format |
alphasparse_convert_dia
alphasparse_status_t alphasparse_convert_dia(
const alphasparse_matrix_t source,
const alphasparse_operation_t operation,
alphasparse_matrix_t *dest)
The alphasparse_convert_dia
converts the data structure of other
sparse matrix format to the data structure of DIA matrix format, which
is stored in dest. The parameter explanation is shown below:
Input parameters |
Description |
---|---|
source |
Source matrix |
operation |
For specific operations on the input matrix, there
are the following
options: |
dest |
Matrix in DIA format |
alphasparse_convert_bsr
alphasparse_status_t alphasparse_convert_bsr(
const alphasparse_matrix_t source,
const alphasparse_operation_t operation,
alphasparse_matrix_t *dest)
The alphasparse_convert_bsr
converts the data structure of other
sparse matrix format to the data structure of BSR matrix format, which
is stored in dest. The parameter explanation is shown below:
Input parameters |
Description |
---|---|
source |
Source matrix |
operation |
For specific operations on the input matrix, there
are the following
options: |
dest |
Matrix in BSR format |
alphasparse_convert_csc
alphasparse_status_t alphasparse_?_export_csc(
alphasparse_matrix_t source,
alphasparse_index_base_t *indexing,
ALPHA_INT *rows,
ALPHA_INT *cols,
ALPHA_INT **cols_start,
ALPHA_INT **cols_end,
ALPHA_INT **row_indx,
ALPHA_Number ** values)
The alphasparse_?_export_csc
converts m*k
CSC to a multiple data
variables CSC. “?
” indicates the data format, which corresponds to
the ALPHA_Number
in the interface. s
corresponds to float, d
corresponds to double, c
corresponds to float complex, which is
single-precision complex number, and z
corresponds to double
complex, which is double-precision complex number. Other parameters are
shown below:
Input parameters |
Description |
---|---|
source |
CSC format |
indexing |
Indicates the addressing mode of the input
array,There are the following
options: |
rows |
Number of rows of matrix |
cols |
Number of columns of matrix |
cols_start |
The length is at least m, contains the index of each
column of the matrix, |
cols_end |
The length is at least m, contains the index of each
column of the matrix, |
row_indx |
When addressing based on 1, the array contains the
row index of each non-zero element of |
values |
Store the value of non-zero element in the matrix A,
the length is equivalent to the length of
|
alphasparse_export_csr
alphasparse_status_t alphasparse_?_export_csr(
alphasparse_matrix_t source,
const alphasparse_index_base_t *indexing,
const ALPHA_INT *rows,
const ALPHA_INT *cols,
ALPHA_INT **rows_start,
ALPHA_INT **rows_end,
ALPHA_INT **col_indx,
ALPHA_Number ** values)
The alphasparse_?_export_csr
converts m*k
CSR to a multiple data
variables CSR. “?
” indicates the data format, which corresponds to
the ALPHA_Number
in the interface. s
corresponds to float, d
corresponds to double, c
corresponds to float complex, which is
single-precision complex number, and z
corresponds to double
complex, which is double-precision complex number. Other parameters are
shown below:
Input parameters |
Description |
---|---|
source |
CSR Format |
indexing |
Indicates the addressing mode of the input
array,There are the following
options: |
rows |
Number of rows of matrix |
cols |
Number of columns of matrix |
rows_start |
The length is at least m, contains the index of each
rows of the matrix, |
rows_end |
The length is at least m, contains the index of each
rows of the matrix, |
col_indx |
When addressing based on 1, the array contains the
column index of each non-zero element of |
values |
Store the value of non-zero element in the matrix A, the length is equivalent to the length of row_indx |
alphasparse_export_bsr
alphasparse_status_t alphasparse_?_export_bsr(
alphasparse_matrix_t source,
alphasparse_index_base_t *indexing,
alphasparse_layout_t *block_layout,
ALPHA_INT *rows,
ALPHA_INT *cols,
ALPHA_INT *block_size,
ALPHA_INT **rows_start,
ALPHA_INT **rows_end,
ALPHA_INT **col_indx,
ALPHA_Number ** values)
The alphasparse_?_export_bsr
converts m*k
BSR to a multiple data
variables BSR. “?
” indicates the data format, which corresponds to
the ALPHA_Number
in the interface. s
corresponds to float, d
corresponds to double, c
corresponds to float complex, which is
single-precision complex number, and z
corresponds to double
complex, which is double-precision complex number. Other parameters are
shown below:
Input parameters |
Description |
---|---|
source |
BSR format |
indexing |
Indicates the addressing mode of the input
array,There are the following
options: |
block_layout |
Describe the storage mode of non-zero elements in the
sparse matrix block, with the following
options: |
rows |
Number of rows of non-zero block of matrix |
cols |
The number of columns in the non-zero block of matrix
|
block_size |
length of non-zero element block of matrix, size of
each non-zero block is |
rows_start |
The length is at least m, contains the index of each
non-zero block row of the
matrix, |
rows_end |
The length is at least m, contains the index of each
non-zero block row of the matrix,
|
col_indx |
When addressing based on 1, the array contains the
row index of each non-zero block of matrix |
values |
Store the value of non-zero elements in matrix A, the
length is |
alphasparse_export_coo
alphasparse_status_t alphasparse_?_export_coo(
alphasparse_matrix_t source,
alphasparse_index_base_t *indexing,
ALPHA_INT *rows,
ALPHA_INT *cols,
ALPHA_INT **row_indx,
ALPHA_INT **col_indx,
ALPHA_Number * values,
ALPHA_INT *nnz)
The alphasparse_?_export_coo
converts m*k
COO to a multiple data
variables COO. “?
” indicates the data format, which corresponds to
the ALPHA_Number
in the interface. s
corresponds to float, d
corresponds to double, c
corresponds to float complex, which is
single-precision complex number, and z
corresponds to double
complex, which is double-precision complex number. Other parameters are
shown below:
Input parameters |
Description |
---|---|
source |
COO formatMatrixsourcedata structure |
indexing |
Indicates the addressing mode of the input
array,There are the following
options: |
rows |
Number of rows of matrix |
cols |
Number of columns of matrix |
row_indx |
The row coordinate index of each non-zero element,
the length is |
col_indx |
The column coordinate index of each non-zero element,
the length is |
values |
Store the values of non-zero elements in matrix |
nnz |
The number of non-zero elements of matrix |
alphasparse_destroy
alphasparse_status_t alphasparse_destroy(
alphasparse_matrix_t A)
The alphasparse_destroy
, The function performs the operation of
releasing the memory space occupied by the sparse matrix data structure.
The only input parameter required is the to be released A
of the
sparse matrix.
CPU backend
Multiplying sparse matrix and dense vector
alphasparse_status_t alphasparse_?_mv(
const alphasparse_operation_t operation,
const ALPHA_Number alpha,
const alphasparse_matrix_t A,
const struct AlphaSparse_matrix_descr descr,
const ALPHA_Number *x,
const ALPHA_Number beta,
ALPHA_Number *y)
The alphasparse_?_mv
function performs the operation of multiplying
a sparse matrix and a dense vector:
Alpha and beta are scalar values, A
is a sparse matrix with k
rows and m
columns, x
and y
are vectors. “?
” indicates
the data format, which corresponds to the ALPHA_Number
in the
interface, s
corresponds to float, d
corresponds to double, and
c
corresponds to float complex, which is a single-precision complex
number, and z
corresponds to a double complex, which is a
double-precision complex number. This function stores the output result
in the vector y
. The input parameters of the function are shown
below:
Input parameters |
Description |
---|---|
operation |
For specific operations on the input matrix, there
are the following
options: |
alpha |
Scalar value |
A |
Data structure of sparse matrix |
descr |
This structure describes a sparse matrix with special
structural attributes, and has three members:
|
x |
Dense vector |
beta |
Scalar value |
y |
Dense vector |
Multiplying sparse matrix and dense matrix
alphasparse_status_t alphasparse_?_mm(
const alphasparse_operation_t operation,
const ALPHA_Number alpha,
const alphasparse_matrix_t A,
const struct AlphaSparse_matrix_descr descr,
const alphasparse_layout_t layout,
const ALPHA_Number *x,
const ALPHA_INT columns,
const ALPHA_INT ldx,
const ALPHA_Number beta, ALPHA_Number *y,
const ALPHA_INT ldy)
The alphasparse_?_mm
function performs the operation of multiplying
a sparse matrix and a dense matrix:
Alpha
and beta
are scalar values, A
is a sparse matrix,
x
and y
are dense matrices, “?
” indicates the data format,
which corresponds to the ALPHA_Number
in the interface, s
corresponds to float, d
corresponds to double, and c
corresponds
to float complex, which is a single-precision complex number, z
corresponds to double complex, which is double-precision complex number,
this function stores the result in matrix y. The input parameters of the
function are shown as below:
Input parameters |
Description |
---|---|
operation |
For specific operations on the input matrix, there
are the following
options: |
alpha |
|
A |
Data structure of sparse matrix |
descr |
This structure describes a sparse matrix with special
structural attributes, and has three members:
|
layout |
Describe the storage mode of dense
matrix: |
x |
Dense matrix |
columns |
Number of columns of dense matrix |
ldx |
Specify the size of the main dimension of the matrix
|
beta |
Scalar value |
y |
Dense matrix |
ldy |
Specify the size of the main dimension of the matrix
|
For param denes matrix x
, data layouts is showed below:
Column major design |
Row major design |
|
---|---|---|
The rows value (the number
of rows in matrix |
|
When |
The cols value (the number
of columns of matrix
|
columns |
|
For param denes matrix y
, data layouts is shown below:
Column major design |
Row major design |
|
---|---|---|
The rows value (the number
of rows in matrix |
|
When |
The cols value (the number
of columns of matrix
|
columns |
|
Sparse matrix and sparse matrix multiplication
The functions are divided into two categories according to the different output results:
3.1 alphasparse_spmmd
alphasparse_status_t alphasparse_?_spmmd(
const alphasparse_operation_t operation,
const alphasparse_matrix_t A,
const alphasparse_matrix_t B,
const alphasparse_layout_t layout, ALPHA_Number *C,
const ALPHA_INT ldc)
The alphasparse_?_spmmd
performs the operation of multiplying a
sparse matrix and a dense matrix:
A
is sparse matrices, B
is a dense matrix and C
is a dense
matrix which also stores the output result of the function. “?
”
indicates the data format, which corresponds to the ALPHA_Number
in
the interface. s
corresponds to float, d
corresponds to double,
c
corresponds to float complex, which is a single-precision complex
number, and z
corresponds to double complex, which is double
precision. The input parameters of the function are shown in below:
Input parameters |
Description |
---|---|
operation |
For specific operations on the input matrix, there
are the following
options: |
A |
Data structure of sparse matrix |
B |
Data structure of dense matrix |
layout |
Describe the storage mode of dense matrix:
|
C |
Dense matrix |
ldc |
Specify the size of the main dimension of the matrix
|
3.2 alphasparse_spmm
alphasparse_status_t alphasparse_spmm(
const alphasparse_operation_t operation,
const alphasparse_matrix_t A,
const alphasparse_matrix_t B,
alphasparse_matrix_t *C)
The alphasparse_spmm
performs the operation of multiplying a
sparse matrix and a sparse matrix:
A
and B
are sparse matrices, C
is a sparse matrix, and the
output result of the function is stored at the same time. The input
parameters of the function are shown below:
Input parameters |
Description |
---|---|
operation |
For specific operations on the input matrix, there
are the following
options: |
A |
Data structure of sparse matrix |
B |
Another sparse matrix data structure |
C |
Data structure of sparse matrix C |
Solving linear equations
4.1 alphasparse_trsv
Equations for multiplying a sparse matrix and a dense vector:
alphasparse_status_t alphasparse_?_trsv(
const alphasparse_operation_t operation,
const ALPHA_Number alpha,
const alphasparse_matrix_t A,
const struct AlphaSparse_matrix_descr descr,
const ALPHA_Number *x,ALPHA_Number *y)
The alphasparse_?_trsv
function performs the operation of solving
the equations of the matrix:
Alpha
is a scalar value, and A
is a triangular sparse matrix. If
A is not a triangular matrix, only the needed part of the triangular
matrix is processed. x
and y
are vectors, and “?
” indicates
the data format, which corresponds to the ALPHA_Number
in the
interface. s
corresponds to float, d
corresponds to double,
c
corresponds to float complex, which is a single-precision complex
number, and z
corresponds to double complex, which is a
double-precision complex number. This function stores the output result
in the vector y
. The input parameter is shown below.
Input parameters |
Description |
---|---|
operation |
For specific operations on the input matrix, there
are the following
options: |
alpha |
Scalar value |
A |
Data structure of sparse matrix |
descr |
This structure describes a sparse matrix with special
structural attributes, and has three
members: |
x |
Dense vector |
beta |
Scalar value |
y |
Dense vector |
4.2 alphasparse_trsm
A system of equations for multiplying a sparse matrix and a dense matrix:
alphasparse_status_t alphasparse_?_trsm(
const alphasparse_operation_t operation,
const ALPHA_Number alpha,
const alphasparse_matrix_t A,
const struct AlphaSparse_matrix_descr descr,
const alphasparse_layout_t layout,
const ALPHA_Number *x,
const ALPHA_INT columns,
const ALPHA_INT ldx,
ALPHA_Number *y,
const ALPHA_INT ldy)
The alphasparse_?_trsm
function performs the operation of solving
the equations of the matrix:
Alpha
is a scalar value, and inv(op(A))
is the inverse matrix of
the triangular sparse matrix. If A
is not a triangular matrix, only
the required part of the triangular matrix will be processed. x
and
y
are vectors, and “?
” indicates the data format, which
corresponds to the ALPHA_Number
in the interface. s
corresponds
to float, d
corresponds to double, c
corresponds to float
complex, which is a single-precision complex number, and z
corresponds to double complex, which is a double-precision complex
number. The function stores the output result in the vector y
. The
input parameters of the function are shown below:
Input parameters |
Description |
---|---|
operation |
For specific operations on the input matrix, there
are the following
options: |
alpha |
Scalar value |
A |
Data structure of sparse matrix |
descr |
This structure describes a sparse matrix with special
structural attributes, and has three
members: |
layout |
Describe the storage mode of dense
matrix: |
x |
|
columns |
Number of columns of dense matrix |
ldx |
Specify the size of the main dimension of the matrix x when it is actually stored |
beta |
Scalar value |
y |
Dense matrix |
ldy |
Specify the size of the main dimension of the matrix y when it is actually stored |
For param denes matrix x
, data layouts is showed below:
Column major design |
Row major design |
|
---|---|---|
The rows value (the number
of rows in matrix |
|
When |
The cols value (the number
of columns of matrix
|
columns |
|
For param denes matrix y
, data layouts is shown below:
Column major design |
Row major design |
|
---|---|---|
The rows value (the number
of rows in matrix |
|
When |
The cols value (the number
of columns of matrix
|
columns |
|
level1 Vector operation
alphasparse_axpy
alphasparse_status_t alphasparse_?_axpy (
const ALPHA_INT nz,
const ALPHA_Number a,
const ALPHA_Number *x,
const ALPHA_INT *indx,
ALPHA_Number * y)
The alphasparse_?_ axpy
executes the operation of adding multiple
scalar values of a compressed vector to the full storage vector:
a
is a scalar value, x
is a sparse vector in compressed format,
y
is a fully stored vector. “?
” indicates the data format, which
corresponds to the ALPHA_Number
in the interface. s
corresponds
to float, d
corresponds to double, c
corresponds to float
complex, which is a single-precision complex number, and z
corresponds to double complex, which is a double-precision complex
number. This function stores the output result in In the vector y
.
The input parameters of the function are shown below:
Input parameters |
Description |
---|---|
nz |
Number of elements in vectors |
a |
Scalar value |
x |
Store as an array, The length is at least |
indx |
Given the element index of the vector |
y |
Store as an array, The length is at least
|
alphasparse_gthr
alphasparse_status_t alphasparse_?_gthr (
const ALPHA_INT nz,
const ALPHA_Number * y,
ALPHA_Number *x,
const ALPHA_INT *indx)
The alphasparse_?_ gthr
executes by index of gathering the elements
of a full storage vector into a compressed vector format:
Here x
is a sparse vector in compressed format, y
is a fully
stored vector.“?
” indicates the data format, which corresponds to
the ALPHA_Number
in the interface. s
corresponds to float, d
corresponds to double, c
corresponds to float complex, which is a
single-precision complex number, and z
corresponds to double
complex, which is a double-precision complex number. This function
stores the output result in vector x
. The input parameters of the
function are shown in below:
Input parameters |
Description |
---|---|
nz |
Number of elements in vectors |
y |
Store as an array, The length is at least
|
x |
Store as an array, The length is at least |
indx |
Given the element index of the vector |
alphasparse_gthrz
alphasparse_status_t alphasparse_?_gthrz (
const ALPHA_INT nz,
ALPHA_Number * y,
ALPHA_Number *x,
const ALPHA_INT *indx)
The alphasparse_?_ gthrz
executes by index of gathering the elements
of a full storage vector into the compressed vector format, and zeroing
the elements at the corresponding positions in the original vector:
Here x
is a sparse vector in compressed format, y
is a fully
stored vector. “?
” indicates the data format, which corresponds to
the ALPHA_Number
in the interface. s
corresponds to float, d
corresponds to double, c
corresponds to float complex, which is a
single-precision complex number, and z
corresponds to double
complex, which is a double-precision complex number. This output result
is the updated compression vector x
and updated y
. The input
parameters of the function are shown in below:
Input parameters |
Description |
---|---|
nz |
Number of elements in vectors |
y |
Store as an array, The length is at least
|
x |
Store as an array, The length is at least |
indx |
Given the element index of the vector |
alphasparse_rot
alphasparse_status_t alphasparse_?_rot (
const ALPHA_INT nz,
ALPHA_Number *x,
const ALPHA_INT *indx,
ALPHA_Number * y,
const ALPHA_Number c,
const ALPHA_Number s)
The alphasparse_?_ rot
, performs the conversion operation of two
real number vectors:
Here x
is a sparse vector in compressed format, y
is a fully
stored vector, The value of indx must be unique. “?
” indicates the
data format, which corresponds to the ALPHA_Number
in the interface.
s
corresponds to float and d
corresponds to double. This output
is updated vector x
and y
. The input parameters of the function
are shown in below:
Input parameters |
Description |
---|---|
nz |
Number of elements in vectors |
x |
Store as an array, The length is at least |
indx |
Index of the vector |
y |
Store as an array, the length is at least
|
c |
Scalar value |
s |
Scalar value |
alphasparse_sctr
alphasparse_status_t alphasparse_?_sctr (
const ALPHA_INT nz,
ALPHA_Number * x,
const ALPHA_INT *indx,
ALPHA_Number *y)
The alphasparse_?_ sctr
execute the operation of dispersing the
elements of a compressed vector into the full storage vector:
Here x
is a sparse vector in compressed format, y
is a fully
stored vector. “?
” indicates the data format, which corresponds to
the ALPHA_Number
in the interface. s
corresponds to float, d
corresponds to double, c
corresponds to float complex, which is a
single-precision complex number, and z
corresponds to double
complex, which is a double-precision complex number. Output is the
updated y
. The input parameters of the function are shown below:
Input parameters |
Description |
---|---|
nz |
Number of elements in vectors |
x |
Store as an array, length is at least |
indx |
Given the element index of |
y |
Store as an array, length is at least
|
alphasparse_doti
ALPHA_Number alphasparse_?_doti (
const ALPHA_INT nz,
const ALPHA_Number * x,
const ALPHA_INT *indx,
const ALPHA_Number *y)
The alphasparse_?_doti executes dot product operation of compressed real number vector and full storage real number vector and return the result value:
X
is a compressed sparse vector, y
is a fully stored vector.
“?
” indicates the data format, which corresponds to the
ALPHA_Number
in the interface, s
corresponds to float, d
corresponds to double,The value of indx must be unique. Output result is
res, when nz
>0, Res is the result of dot product, otherwise the
value is 0. The input parameters of the function are shown in below:
Input parameters |
Description |
---|---|
nz |
Number of elements in vectors x and indx |
x |
Store as an array, The length is at least nz |
indx |
Given the element index of the vector x,Store as an array, The length is at least nz |
y |
Store as an array, The length is at least max(indx[i]) |
alphasparse_dotci_sub
void alphasparse_?_dotci_sub (
const ALPHA_INT nz,
const ALPHA_Number * x,
const ALPHA_INT *indx,
const ALPHA_Number *y,
ALPHA_Number *dotci)
The alphasparse_?_dotci_sub performs complex numbers conjugate dot product operation of compressed vector and real full storage vector and return the result value:
X
is a sparse vector in a compressed format of complex numbers,
y
is a full storage of real numbers, and conjg(x[i])
represents
the conjugation operation on the elements of the vector x
.“?
”
indicates the data format, which corresponds to the ALPHA_Number
in
the interface.There are two: first, c
corresponds to float complex,
the data type of x
is single-precision complex numbers, the data
type of y
is float single-precision real number; second, z
corresponds to double complex, the data type of x
is
double-precision complex number, the data type of y
is double
double-precision real number. The value of indx
must be unique.
Output is Dotci
. The input parameters of the function are shown in
below:
Input parameters |
Description |
---|---|
nz |
Number of elements in vectors |
x |
Store as an array, The length is at least |
indx |
Given the element index of the vector |
y |
Store as an array, The length is at least
|
dotci |
When |
alphasparse_dotui_sub
void alphasparse_?_dotui_sub (
const ALPHA_INT nz,
const ALPHA_Number * x,
const ALPHA_INT *indx,
const ALPHA_Number *y,
ALPHA_Number *dotui)
The alphasparse_?_dotui_sub
performs complex numbers dot product of
compressed vector and real number full storage vector and return the
result value:
X
is a sparse vector in a compressed format of complex numbers,
y
is a full storage of real numbers vector. “?
” indicates the
data format, which corresponds to the ALPHA_Number
in the interface,
There are two ALPHA_Numbers
: first, c
corresponds to float
complex, the data type of x
is single-precision complex numbers, the
data type of y
is float single-precision real number; second, z
corresponds to double complex, the data type of x
is
double-precision complex number, the data type of y
is double
double-precision real number. The value of indx must be unique. Output
result is dotui
. The input parameters of the function are shown
below:
Input parameters |
Description |
---|---|
nz |
Number of elements in vectors |
x |
Store as an array, The length is at least |
indx |
Given the element index of the vector |
y |
Store as an array, The length is at least
|
dotui |
When |
DCU backend
Sparse Level1 Functions
alphasparse_dcu_axpyi
alphasparse_status_t alphasparse_dcu_?_axpyi (
ALPHA_INT nnz,
const ALPHA_Number alpha,
const ALPHA_Number *x_val,
const ALPHA_INT *x_ind,
ALPHA_Number *y
)
The alphasparse_dcu_?_axpyi
function multiplies the sparse vector
x
with scalar alpha
and adds the result to the dense vector
y
, such that
“?
” indicates the data format, which corresponds to the
ALPHA_Number
in the interface. s
corresponds to float, d
corresponds to double, c
corresponds to float complex, which is a
single-precision complex number, and z
corresponds to double
complex, which is a double-precision complex number. This function
stores the output result in In the vector y
. The input parameters of
the function are shown below:
Input parameters |
Description |
---|---|
[in] handle |
handle to the alphasparse library context queue. |
[in] nnz |
number of non-zero entries of vector |
[in] alpha |
scalar |
[in] x_val |
array of |
[in] x_ind |
array of |
[inout] y |
array of values in dense format. |
[in] idx_base |
Indicates the addressing mode of the input
array,There are the following
options: |
This function is non blocking and executed asynchronously with respect to the host. It may return before the actual computation has finished.
alphasparse_dcu_doti
alphasparse_status_t alphasparse_dcu_?_doti (
alphasparse_dcu_handle_t handle,
ALPHA_INT nnz,
const ALPHA_Number *x_val,
const ALPHA_INT *x_ind,
const ALPHA_Number *y,
ALPHA_Number *result,
alphasparse_index_base_t idx_base)
Compute the dot product of a sparse vector with a dense vector.
alphasparse_dcu_?_doti
computes the dot product of the sparse vector
x
with the dense vector y
, such that
“?
” indicates the data format, which corresponds to the
ALPHA_Number
in the interface. s
corresponds to float, d
corresponds to double, c
corresponds to float complex, which is a
single-precision complex number, and z
corresponds to double
complex, which is a double-precision complex number. This function
stores the output result in In the vector y
. The input parameters of
the function are shown below:
Input parameters |
Description |
---|---|
[in] handle |
handle to the alphasparse library context queue. |
[in] nnz |
number of non-zero entries of vector |
[in] x_val |
array of |
[in] x_ind |
array of |
[in] y |
array of values in dense format. |
[out] result |
pointer to the result, can be host or device memory |
[in] idx_base |
Indicates the addressing mode of the input
array,There are the following
options: |
This function is non blocking and executed asynchronously with respect to the host. It may return before the actual computation has finished.
alphasparse_dcu_dotci
alphasparse_status_t alphasparse_dcu_?_dotci (
alphasparse_dcu_handle_t handle,
ALPHA_INT nnz,
const ALPHA_Number *x_val,
const ALPHA_INT *x_ind,
const ALPHA_Number *y,
ALPHA_Number *result,
alphasparse_index_base_t idx_base)
Compute the dot product of a complex conjugate sparse vector with a dense vector.
alphasparse_dcu_?_dotci
computes the dot product of the complex
conjugate sparse vector x
with the dense vector y
, such that
“?
” indicates the data format, which corresponds to the
ALPHA_Number
in the interface. c
corresponds to float complex,
which is a single-precision complex number and z
corresponds to
double complex, which is a double-precision complex number. This
function stores the output result in In the vector y
. The input
parameters of the function are shown below:
Input parameters |
Description |
---|---|
[in] handle |
handle to the alphasparse library context queue. |
[in] nnz |
number of non-zero entries of vector |
[in] x_val |
array of |
[in] x_ind |
array of |
[inout] y |
array of values in dense format. |
[out] result |
pointer to the result, can be host or device memory |
[in] idx_base |
Indicates the addressing mode of the input
array,There are the following
options: |
This function is non blocking and executed asynchronously with respect to the host. It may return before the actual computation has finished.
alphasparse_dcu_gthr
alphasparse_status_t alphasparse_dcu_?_gthr(
alphasparse_dcu_handle_t handle,
ALPHA_INT nnz,
const ALPHA_Number *y,
ALPHA_Number *x_val,
const ALPHA_INT *x_ind,
alphasparse_index_base_t idx_base)
Gather elements from a dense vector and store them into a sparse vector.
alphasparse_dcu_?_gthr
gathers the elements that are listed in
x_ind
from the dense vector y
and stores them in the sparse
vector x
.
“?
” indicates the data format, which corresponds to the
ALPHA_Number
in the interface. s
corresponds to float, d
corresponds to double, c
corresponds to float complex, which is a
single-precision complex number, and z
corresponds to double
complex, which is a double-precision complex number. This function
stores the output result in In the vector y
. The input parameters of
the function are shown below:
Input parameters |
Description |
---|---|
[in] handle |
handle to the alphasparse library context queue. |
[in] nnz |
number of non-zero entries of |
[in] y |
array of values in dense format. |
[out] x_val |
array of |
[in] x_ind |
array of |
[in] idx_base |
Indicates the addressing mode of the input
array,There are the following
options: |
This function is non blocking and executed asynchronously with respect to the host. It may return before the actual computation has finished.
alphasparse_dcu_gthrz
alphasparse_status_t alphasparse_dcu_?_gthrz(
alphasparse_dcu_handle_t handle,
ALPHA_INT nnz,
const ALPHA_Number *y,
ALPHA_Number *x_val,
const ALPHA_INT *x_ind,
alphasparse_index_base_t idx_base)
Gather and zero out elements from a dense vector and store them into a sparse vector.
alphasparse_dcu_?_gthrz
gathers the elements that are listed in
x_ind
from the dense vector y
and stores them in the sparse
vector x
. The gathered elements in y
are replaced by zero.
“?
” indicates the data format, which corresponds to the
ALPHA_Number
in the interface. s
corresponds to float, d
corresponds to double, c
corresponds to float complex, which is a
single-precision complex number, and z
corresponds to double
complex, which is a double-precision complex number. This function
stores the output result in In the vector y
. The input parameters of
the function are shown below:
Input parameters |
Description |
---|---|
[in] handle |
handle to the alphasparse library context queue. |
[in] nnz |
number of non-zero entries of |
[in] y |
array of values in dense format. |
[out] x_val |
array of |
[in] x_ind |
array of |
[in] idx_base |
Indicates the addressing mode of the input
array,There are the following
options: |
This function is non blocking and executed asynchronously with respect to the host. It may return before the actual computation has finished.
alphasparse_dcu_roti
alphasparse_status_t alphasparse_dcu_?_roti(
alphasparse_dcu_handle_t handle,
ALPHA_INT nnz,
ALPHA_Number *x_val,
const ALPHA_INT *x_ind,
ALPHA_Number *y,
const ALPHA_Number *c,
const ALPHA_Number *s,
alphasparse_index_base_t idx_base)
Apply Givens rotation to a dense and a sparse vector.
alphasparse_dcu_?_roti
applies the Givens rotation matrix GG to the
sparse vector x
and the dense vector y
, where
“?
” indicates the data format, which corresponds to the
ALPHA_Number
in the interface. s
corresponds to float and d
corresponds to double. This function stores the output result in In the
vector y
. The input parameters of the function are shown below:
Input parameters |
Description |
---|---|
[in] handle |
handle to the alphasparse library context queue. |
[in] nnz |
number of non-zero entries of |
[inout] x_val |
array of |
[in] x_ind |
array of |
[inout] y |
array of values in dense format. |
[in] c |
pointer to the cosine element of |
[in] s |
pointer to the sine element of |
[in] idx_base |
Indicates the addressing mode of the input
array,There are the following
options: |
This function is non blocking and executed asynchronously with respect to the host. It may return before the actual computation has finished.
alphasparse_dcu_sctr
alphasparse_status_t alphasparse_dcu_?_sctr(
alphasparse_dcu_handle_t handle,
ALPHA_INT nnz,
const ALPHA_Number *x_val,
const ALPHA_INT *x_ind,
ALPHA_Number *y,
alphasparse_index_base_t idx_base)
Scatter elements from a dense vector across a sparse vector.
alphasparse_dcu_?_sctr
scatters the elements that are listed in
x_ind
from the sparse vector x
into the dense vector y
.
Indices of y
that are not listed in x_ind
remain unchanged.
“?
” indicates the data format, which corresponds to the
ALPHA_Number
in the interface. s
corresponds to float, d
corresponds to double, c
corresponds to float complex, which is a
single-precision complex number, and z
corresponds to double
complex, which is a double-precision complex number. This function
stores the output result in In the vector y
. The input parameters of
the function are shown below:
Input parameters |
Description |
---|---|
[in] handle |
handle to the alphasparse library context queue. |
[in] nnz |
number of non-zero entries of |
[in] x_val |
array of |
[in] x_ind |
array of |
[inout] y |
array of values in dense format. |
[in] idx_base |
Indicates the addressing mode of the input
array,There are the following
options: |
This function is non blocking and executed asynchronously with respect to the host. It may return before the actual computation has finished.
Sparse Level 2 Functions
alphasparse_dcu_csrmv
alphasparse_status_t alphasparse_dcu_?_csrmv(
alphasparse_dcu_handle_t handle,
alphasparse_operation_t trans,
ALPHA_INT m,
ALPHA_INT n,
ALPHA_INT nnz,
const ALPHA_Number *alpha,
const alpha_dcu_matrix_descr_t descr,
const ALPHA_Number *csr_val,
const ALPHA_INT *csr_row_ptr,
const ALPHA_INT *csr_col_ind,
alphasparse_dcu_mat_info_t info,
const ALPHA_Number *x,
const ALPHA_Number *beta,
ALPHA_Number *y)
Sparse matrix vector multiplication using CSR storage format.
alphasparse_dcu_?_csrmv
multiplies the scalar α
with a sparse
m×n
matrix, defined in CSR storage format, and the dense vector
x
and adds the result to the dense vector y
that is multiplied
by the scalar β
, such that
“?
” indicates the data format, which corresponds to the
ALPHA_Number
in the interface. c
corresponds to float complex,
which is a single-precision complex number and z
corresponds to
double complex, which is a double-precision complex number. This
function stores the output result in In the vector y
. The input
parameters of the function are shown below:
Input parameters |
Description |
---|---|
[in] handle |
handle to the alphasparse library context queue. |
[in] trans |
For specific operations on the input matrix,
there are the following
opt
ions:
Conjugation Transpose, |
[in] m |
number of rows of the sparse CSR matrix. |
[in] n |
number of columns of the sparse CSR matrix. |
[in] nnz |
number of non-zero entries of the sparse CSR matrix. |
[in] alpha |
scalar |
[in] descr |
This structure describes a sparse matrix with
special structural attributes, and has three
members: |
[in] csr_val |
array of |
[in] csr_row_ptr |
array of |
[in] csr_col_ind |
array of |
[in] info |
NULL |
[in] x |
array of |
[in] beta |
scalar |
[inout] y |
array of |
This function is non blocking and executed asynchronously with respect to the host. It may return before the actual computation has finished.
alphasparse_dcu_coomv
alphasparse_status_t alphasparse_dcu_?_csrmv(
alphasparse_dcu_handle_t handle,
alphasparse_operation_t trans,
ALPHA_INT m,
ALPHA_INT n,
ALPHA_INT nnz,
const ALPHA_Number *alpha,
const alpha_dcu_matrix_descr_t descr,
const ALPHA_Number *coo_val,
const ALPHA_INT *coo_row_ind,
const ALPHA_INT *coo_col_ind,
const ALPHA_Number *x,
const ALPHA_Number *beta,
ALPHA_Number *y)
Sparse matrix vector multiplication using COO storage format.
alphasparse_dcu_?_coomv
multiplies the scalar α
with a sparse
m×n
matrix, defined in COO storage format, and the dense vector
x
and adds the result to the dense vector y
that is multiplied
by the scalar β
, such that
The COO matrix has to be sorted by row indices.
“?
” indicates the data format, which corresponds to the
ALPHA_Number
in the interface. c
corresponds to float complex,
which is a single-precision complex number and z
corresponds to
double complex, which is a double-precision complex number. This
function stores the output result in In the vector y
. The input
parameters of the function are shown below:
Input parameters |
Description |
---|---|
[in] handle |
handle to the alphasparse library context queue. |
[in] trans |
For specific operations on the input matrix,
there are the following
opt
ions:
Conjugation Transpose, |
[in] m |
number of rows of the sparse COO matrix. |
[in] n |
number of columns of the sparse COO matrix. |
[in] nnz |
number of non-zero entries of the sparse COO matrix. |
[in] alpha |
scalar |
[in] descr |
This structure describes a sparse matrix with
special structural attributes, and has three
members: |
[in] coo_val |
array of |
[in] coo_row_ind |
array of |
[in] coo_col_ind |
array of |
[in] x |
array of |
[in] beta |
scalar |
[inout] y |
array of |
This function is non blocking and executed asynchronously with respect to the host. It may return before the actual computation has finished.
alphasparse_dcu_ellmv
alphasparse_status_t alphasparse_dcu_?_ellmv(
alphasparse_dcu_handle_t handle,
alphasparse_operation_t trans,
ALPHA_INT m,
ALPHA_INT n,
const ALPHA_Number *alpha,
const alpha_dcu_matrix_descr_t descr,
const ALPHA_Number *ell_val,
const ALPHA_INT *ell_col_ind,
ALPHA_INT ell_width,
const ALPHA_Number *x,
const ALPHA_Number *beta,
ALPHA_Number *y)
Sparse matrix vector multiplication using ELL storage format.
alphasparse_dcu_?_ellmv
multiplies the scalar α
with a sparse
m×n
matrix, defined in ELL storage format, and the dense vector
x
and adds the result to the dense vector y
that is multiplied
by the scalar β
, such that
“?
” indicates the data format, which corresponds to the
ALPHA_Number
in the interface. c
corresponds to float complex,
which is a single-precision complex number and z
corresponds to
double complex, which is a double-precision complex number. This
function stores the output result in In the vector y
. The input
parameters of the function are shown below:
Input parameters |
Description |
---|---|
[in] handle |
handle to the alphasparse library context queue. |
[in] trans |
For specific operations on the input matrix,
there are the following
opt
ions:
Conjugation Transpose, |
[in] m |
number of rows of the sparse ELL matrix. |
[in] n |
number of columns of the sparse ELL matrix. |
[in] alpha |
scalar |
[in] descr |
This structure describes a sparse matrix with
special structural attributes, and has three
members: |
[in] ell_val |
array that contains the elements of the sparse ELL matrix. Padded elements should be zero. |
[in] ell_col_ind |
array that contains the column indices of the sparse ELL matrix. Padded column indices should be -1. |
[in] ell_width |
number of non-zero elements per row of the sparse ELL matrix. |
[in] x |
array of |
[in] beta |
scalar |
[inout] y |
array of |
This function is non blocking and executed asynchronously with respect to the host. It may return before the actual computation has finished.
alphasparse_dcu_bsrmv
alphasparse_status_t alphasparse_dcu_?_bsrmv(
alphasparse_dcu_handle_t handle,
alphasparse_layout_t dir,
alphasparse_operation_t trans,
ALPHA_INT mb,
ALPHA_INT nb,
ALPHA_INT nnzb,
const ALPHA_Number *alpha,
const alpha_dcu_matrix_descr_t descr,
const ALPHA_Number *bsr_val,
const ALPHA_INT *bsr_row_ptr,
const ALPHA_INT *bsr_col_ind,
ALPHA_INT bsr_dim,
const ALPHA_Number *x,
const ALPHA_Number *beta,
ALPHA_Number *y)
Sparse matrix vector multiplication using BSR storage format.
alphasparse_dcu_?_bsrmv
multiplies the scalar α
with a sparse
(mb⋅bsr_dim)×(nb⋅bsr_dim)
matrix, defined in BSR storage format, and
the dense vector x
and adds the result to the dense vector y
that is multiplied by the scalar β
, such that
“?
” indicates the data format, which corresponds to the
ALPHA_Number
in the interface. c
corresponds to float complex,
which is a single-precision complex number and z
corresponds to
double complex, which is a double-precision complex number. This
function stores the output result in In the vector y
. The input
parameters of the function are shown below:
Input parameters |
Description |
---|---|
[in] handle |
handle to the alphasparse library context queue. |
[in] trans |
For specific operations on the input matrix,
there are the following
opt
ions:
Conjugation Transpose, |
[in] mb |
number of block rows of the sparse BSR matrix. |
[in] nb |
number of block columns of the sparse BSR matrix. |
[in] nnzb |
number of non-zero blocks of the sparse BSR matrix. |
[in] alpha |
scalar |
[in] descr |
This structure describes a sparse matrix with
special structural attributes, and has three
members: |
[in] bsr_val |
array of |
[in] bsr_row_ptr |
array of |
[in] bsr_col_ind |
array of |
[in] bsr_dim |
block dimension of the sparse BSR matrix. |
[in] x |
array of |
[in] beta |
scalar |
[inout] y |
array of |
This function is non blocking and executed asynchronously with respect to the host. It may return before the actual computation has finished.
alphasparse_dcu_hybmv
alphasparse_status_t alphasparse_dcu_?_hybmv(
alphasparse_dcu_handle_t handle,
alphasparse_operation_t trans,
const ALPHA_Number *alpha,
const alpha_dcu_matrix_descr_t descr,
const alphasparse_dcu_hyb_mat_t hyb,
const ALPHA_Number *x,
const ALPHA_Number *beta,
ALPHA_Number *y)
Sparse matrix vector multiplication using HYB storage format.
alphasparse_dcu_?_hybmv
multiplies the scalar α
with a sparse
m×n
matrix, defined in HYB storage format, and the dense vector
x
and adds the result to the dense vector y
that is multiplied
by the scalar β
, such that
“?
” indicates the data format, which corresponds to the
ALPHA_Number
in the interface. c
corresponds to float complex,
which is a single-precision complex number and z
corresponds to
double complex, which is a double-precision complex number. This
function stores the output result in In the vector y
. The input
parameters of the function are shown below:
Input parameters |
Description |
---|---|
[in] handle |
handle to the alphasparse library context queue. |
[in] trans |
For specific operations on the input matrix, there
are the following
options: |
[in] alpha |
scalar |
[in] descr |
This structure describes a sparse matrix with
special structural attributes, and has three
members: |
[in] hyb |
matrix in HYB storage format. |
[in] x |
array of |
[in] beta |
scalar |
[inout] y |
array of |
This function is non blocking and executed asynchronously with respect to the host. It may return before the actual computation has finished.
alphasparse_dcu_csrsv
alphasparse_status_t alphasparse_dcu_?_csrsv_solve(
alphasparse_dcu_handle_t handle,
alphasparse_operation_t trans,
ALPHA_INT m,
ALPHA_INT nnz,
const ALPHA_Number *alpha,
const alpha_dcu_matrix_descr_t descr,
const ALPHA_Number *csr_val,
const ALPHA_INT *csr_row_ptr,
const ALPHA_INT *csr_col_ind,
alphasparse_dcu_mat_info_t info,
const ALPHA_Number *x,
ALPHA_Number *y,
alphasparse_dcu_solve_policy_t policy,
void *temp_buffer)
Sparse triangular solve using CSR storage format.
alphasparse_dcu_?_csrsv_solve
solves a sparse triangular linear
system of a sparse m×m
matrix, defined in CSR storage format, a
dense solution vector y
and the right-hand side x
that is
multiplied by α
, such that
The sparse CSR matrix has to be sorted.
“?
” indicates the data format, which corresponds to the
ALPHA_Number
in the interface. c
corresponds to float complex,
which is a single-precision complex number and z
corresponds to
double complex, which is a double-precision complex number. This
function stores the output result in In the vector y
. The input
parameters of the function are shown below:
Input parameters |
Description |
---|---|
[in] handle |
handle to the alphasparse library context queue. |
[in] trans |
For specific operations on the input matrix,
there are the following
opt
ions:
Conjugation Transpose, |
[in] m |
number of rows of the sparse CSR matrix. |
[in] nnz |
number of non-zero entries of the sparse CSR matrix. |
[in] alpha |
scalar |
[in] descr |
This structure describes a sparse matrix with
special structural attributes, and has three
members: |
[in] csr_val |
array of |
[in] csr_row_ptr |
array of |
[in] csr_col_ind |
array of |
[in] info |
nullptr |
[in] x |
array of |
[out] y |
array of |
[in] policy |
nullptr |
[in] temp_buffer |
temporary storage buffer allocated by the user.(nullptr) |
This function is non blocking and executed asynchronously with respect to the host. It may return before the actual computation has finished.
alphasparse_dcu_bsrsv
alphasparse_status_t alphasparse_dcu_?_bsrsv_solve(
alphasparse_dcu_handle_t handle,
alphasparse_layout_t dir,
alphasparse_operation_t trans,
ALPHA_INT mb,
ALPHA_INT nnzb,
const ALPHA_Number *alpha,
const alpha_dcu_matrix_descr_t descr,
const ALPHA_Number *bsr_val,
const ALPHA_INT *bsr_row_ptr,
const ALPHA_INT *bsr_col_ind,
ALPHA_INT bsr_dim,
alphasparse_dcu_mat_info_t info,
const ALPHA_Number *x,
ALPHA_Number *y,
alphasparse_dcu_solve_policy_t policy,
void *temp_buffer)
Sparse triangular solve using BSR storage format.
alphasparse_dcu_?_bsrsv_solve
solves a sparse triangular linear
system of a sparse m×m
matrix, defined in BSR storage format, a
dense solution vector y
and the right-hand side x
that is
multiplied by α
, such that
The sparse BSR matrix has to be sorted.
“?
” indicates the data format, which corresponds to the
ALPHA_Number
in the interface. c
corresponds to float complex,
which is a single-precision complex number and z
corresponds to
double complex, which is a double-precision complex number. This
function stores the output result in In the vector y
. The input
parameters of the function are shown below:
Input parameters |
Description |
---|---|
[in] handle |
handle to the alphasparse library context queue. |
[in] dir |
Describe the storage mode of BSR
blocks: |
[in] trans |
For specific operations on the input matrix,
there are the following
opt
ions:
Conjugation Transpose, |
[in] mb |
number of block rows of the sparse BSR matrix. |
[in] nnzb |
number of non-zero blocks of the sparse BSR matrix. |
[in] alpha |
scalar |
[in] descr |
This structure describes a sparse matrix with
special structural attributes, and has three
members: |
[in] bsr_val |
array of |
[in] bsr_row_ptr |
array of |
[in] bsr_col_ind |
array of |
[in] bsr_dim |
block dimension of the sparse BSR matrix. |
[in] info |
nullptr |
[in] x |
array of |
[out] y |
array of |
[in] policy |
nullptr |
[in] temp_buffer |
temporary storage buffer allocated by the user.(nullptr) |
This function is non blocking and executed asynchronously with respect to the host. It may return before the actual computation has finished.
Sparse Level3 Functions
alphasparse_dcu_csrmm
alphasparse_status_t alphasparse_dcu_?_csrmm(
alphasparse_dcu_handle_t handle,
alphasparse_operation_t trans_A,
alphasparse_operation_t trans_B,
alphasparse_layout_t layout,
ALPHA_INT m,
ALPHA_INT n,
ALPHA_INT k,
ALPHA_INT nnz,
const ALPHA_Number *alpha,
const alpha_dcu_matrix_descr_t descr,
const ALPHA_Number *csr_val,
const ALPHA_INT *csr_row_ptr,
const ALPHA_INT *csr_col_ind,
const ALPHA_Number *B,
ALPHA_INT ldb,
const ALPHA_Number *beta,
ALPHA_Number *matC,
ALPHA_INT ldc)
Sparse matrix dense matrix multiplication using CSR storage format.
alphasparse_dcu_?_csrmm
multiplies the scalar α
with a sparse
m×k
matrix A
, defined in CSR storage format, and the dense
k×n
matrix B
and adds the result to the dense m×n
matrix
C
that is multiplied by the scalar β
, such that
“?
” indicates the data format, which corresponds to the
ALPHA_Number
in the interface. c
corresponds to float complex,
which is a single-precision complex number and z
corresponds to
double complex, which is a double-precision complex number. This
function stores the output result in In the vector y
. The input
parameters of the function are shown below:
Input parameters |
Description |
---|---|
[in] handle |
handle to the alphasparse library context queue. |
[in] transA |
For specific operations on the input matrix A,
there are the following
opt
ions:
Conjugation Transpose, |
[in] transB |
For specific operations on the input matrix B,
there are the following
opt
ions:
Conjugation Transpose, |
[in] m |
number of rows of the sparse CSR matrix |
[in] n |
number of columns of the dense matrix |
[in] k |
number of columns of the sparse CSR matrix
|
[in] nnz |
number of non-zero entries of the sparse CSR
matrix |
[in] alpha |
scalar |
[in] descr |
This structure describes a sparse matrix with
special structural attributes, and has three
members: |
[in] csr_val |
array of |
[in] csr_row_ptr |
array of |
[in] csr_col_ind |
array of |
[in] B |
array of dimension |
[in] ldb |
leading dimension of |
[in] beta |
scalar |
[inout] C |
array of dimension |
[in] ldc |
leading dimension of |
This function is non blocking and executed asynchronously with respect to the host. It may return before the actual computation has finished.
alphasparse_dcu_bsrmm
alphasparse_status_t alphasparse_dcu_?_bsrmm(
alphasparse_dcu_handle_t handle,
alphasparse_layout_t dir,
alphasparse_operation_t trans_A,
alphasparse_operation_t trans_B,
ALPHA_INT mb,
ALPHA_INT n,
ALPHA_INT kb,
ALPHA_INT nnzb,
const ALPHA_Number *alpha,
const alpha_dcu_matrix_descr_t descr,
const ALPHA_Number *bsr_val,
const ALPHA_INT *bsr_row_ptr,
const ALPHA_INT *bsr_col_ind,
ALPHA_INT block_dim,
const ALPHA_Number *matB,
ALPHA_INT ldb,
const ALPHA_Number *beta,
ALPHA_Number *matC,
ALPHA_INT ldc)
Sparse matrix dense matrix multiplication using BSR storage format.
alphasparse_dcu_?_bsrmm
multiplies the scalar α
with a sparse
mb×kb
matrix A
, defined in BSR storage format, and the dense
k×n
matrix B
(where k=block_dim×kb
) and adds the result to
the dense m×n
matrix C
(where m=block_dim×mb
) that is
multiplied by the scalar β
, such that
“?
” indicates the data format, which corresponds to the
ALPHA_Number
in the interface. c
corresponds to float complex,
which is a single-precision complex number and z
corresponds to
double complex, which is a double-precision complex number. This
function stores the output result in In the vector y
. The input
parameters of the function are shown below:
Input parameters |
Description |
---|---|
[in] handle |
handle to the alphasparse library context queue. |
[in] dir |
Describe the storage mode of BSR
blocks: |
[in] transA |
For specific operations on the input matrix A,
there are the following
opt
ions:
Conjugation Transpose, |
[in] transB |
For specific operations on the input matrix B,
there are the following
opt
ions:
Conjugation Transpose, |
[in] mb |
number of block rows of the sparse BSR matrix
|
[in] nn |
number of columns of the dense matrix |
[in] kb |
number of block columns of the sparse BSR matrix AA. |
[in] nnzb |
number of non-zero blocks of the sparse BSR matrix AA. |
[in] alpha |
scalar |
[in] descr |
This structure describes a sparse matrix with
special structural attributes, and has three
members: |
[in] bsr_val |
array of |
[in] bsr_row_ptr |
array of |
[in] bsr_col_ind |
array of |
[in] block_dim |
size of the blocks in the sparse BSR matrix. |
[in] B |
array of dimension |
[in] ldb |
leading dimension of |
[in] beta |
scalar |
[inout] C |
array of dimension |
[in] ldc |
leading dimension of |
This function is non blocking and executed asynchronously with respect to the host. It may return before the actual computation has finished.
alphasparse_dcu_csrsm_solve
alphasparse_status_t alphasparse_dcu_?_csrsm_solve(
alphasparse_dcu_handle_t handle,
alphasparse_operation_t trans_A,
alphasparse_operation_t trans_B,
ALPHA_INT m,
ALPHA_INT nrhs,
ALPHA_INT nnz,
const ALPHA_Number *alpha,
const alpha_dcu_matrix_descr_t descr,
const ALPHA_Number *csr_val,
const ALPHA_INT *csr_row_ptr,
const ALPHA_INT *csr_col_ind,
ALPHA_Number *B,
ALPHA_INT ldb,
alphasparse_dcu_mat_info_t info,
alphasparse_dcu_solve_policy_t policy,
void *temp_buffer)
Sparse triangular system solve using CSR storage format.
alphasparse_dcu_?_csrsm_solve
solves a sparse triangular linear
system of a sparse m×m
matrix, defined in CSR storage format, a
dense solution matrix X
and the right-hand side matrix B
that is
multiplied by α
, such that
“?
” indicates the data format, which corresponds to the
ALPHA_Number
in the interface. c
corresponds to float complex,
which is a single-precision complex number and z
corresponds to
double complex, which is a double-precision complex number. This
function stores the output result in In the vector y
. The input
parameters of the function are shown below:
Input parameters |
Description |
---|---|
[in] handle |
handle to the alphasparse library context queue. |
[in] transA |
For specific operations on the input matrix A,
there are the following
opt
ions:
Conjugation Transpose, |
[in] transB |
For specific operations on the input matrix B,
there are the following
opt
ions:
Conjugation Transpose, |
[in] m |
number of rows of the sparse CSR matrix |
[in] nrhs |
number of columns of the dense matrix |
[in] nnz |
number of non-zero entries of the sparse CSR
matrix |
[in] alpha |
scalar |
[in] descr |
This structure describes a sparse matrix with
special structural attributes, and has three
members: |
[in] csr_val |
array of |
[in] csr_row_ptr |
array of |
[in] csr_col_ind |
array of |
[in] B |
array of |
[in] ldb |
leading dimension of rhs matrix |
[in] info |
nullptr |
[in] policy |
nullptr |
[in] temp_buffer |
nullptr |
This function is non blocking and executed asynchronously with respect to the host. It may return before the actual computation has finished.
alphasparse_dcu_gemmi
alphasparse_status_t alphasparse_dcu_?_gemmi(
alphasparse_dcu_handle_t handle,
alphasparse_operation_t trans_A,
alphasparse_operation_t trans_B,
ALPHA_INT m,
ALPHA_INT n,
ALPHA_INT k,
ALPHA_INT nnz,
const ALPHA_Number *alpha,
const ALPHA_Number *matA,
ALPHA_INT lda,
const alpha_dcu_matrix_descr_t descr,
const ALPHA_Number *csr_val,
const ALPHA_INT *csr_row_ptr,
const ALPHA_INT *csr_col_ind,
const ALPHA_Number *beta,
ALPHA_Number *matC,
ALPHA_INT ldc)
Dense matrix sparse matrix multiplication using CSR storage format.
alphasparse_dcu_?_gemmi
multiplies the scalar α
with a dense
m×k
matrix A
and the sparse k×n
matrix B
, defined in CSR
storage format and adds the result to the dense m×n
matrix C
that is multiplied by the scalar β
, such that
“?
” indicates the data format, which corresponds to the
ALPHA_Number
in the interface. c
corresponds to float complex,
which is a single-precision complex number and z
corresponds to
double complex, which is a double-precision complex number. This
function stores the output result in In the vector y
. The input
parameters of the function are shown below:
Input parameters |
Description |
---|---|
[in] handle |
handle to the alphasparse library context queue. |
[in] transA |
For specific operations on the input matrix A,
there are the following
opt
ions:
Conjugation Transpose, |
[in] transB |
For specific operations on the input matrix B,
there are the following
opt
ions:
Conjugation Transpose, |
[in] m |
number of rows of the sparse CSR matrix |
[in] n |
number of columns of the dense matrix |
[in] k |
number of columns of the sparse CSR matrix
|
[in] nnz |
number of non-zero entries of the sparse CSR
matrix |
[in] alpha |
scalar |
[in] A |
array of dimension |
[in] lda |
leading dimension of |
[in] descr |
This structure describes a sparse matrix with
special structural attributes, and has three
members: |
[in] csr_val |
array of |
[in] csr_row_ptr |
array of |
[in] csr_col_ind |
array of |
[in] beta |
scalar |
[inout] C |
array of dimension |
[in] ldc |
leading dimension of |
This function is non blocking and executed asynchronously with respect to the host. It may return before the actual computation has finished.
Sparse Extra Functions
alphasparse_dcu_csrgeam_nnz
alphasparse_status_t alphasparse_dcu_csrgeam_nnz(
alphasparse_dcu_handle_t handle,
ALPHA_INT m,
ALPHA_INT n,
const alpha_dcu_matrix_descr_t descr_A,
ALPHA_INT nnz_A,
const ALPHA_INT *csr_row_ptr_A,
const ALPHA_INT *csr_col_ind_A,
const alpha_dcu_matrix_descr_t descr_B,
ALPHA_INT nnz_B,
const ALPHA_INT *csr_row_ptr_B,
const ALPHA_INT *csr_col_ind_B,
const alpha_dcu_matrix_descr_t descr_C,
ALPHA_INT *csr_row_ptr_C,
ALPHA_INT *nnz_C)
Sparse matrix sparse matrix addition using CSR storage format.
alphasparse_dcu_csrgeam_nnz
computes the total CSR non-zero elements
and the CSR row offsets, that point to the start of every row of the
sparse CSR matrix, of the resulting matrix C
. It is assumed that
csr_row_ptr_C
has been allocated with size m
+ 1.
Input parameters |
Description |
---|---|
[in] handle |
handle to the alphasparse library context queue. |
[in] m |
number of rows of the sparse CSR matrix |
[in] n |
number of columns of the sparse CSR matrix
|
[in] descr_A |
descriptor of the sparse CSR matrix |
[in] nnz_A |
number of non-zero entries of the sparse CSR
matrix |
[in] csr_row_ptr_A |
array of |
[in] csr_col_ind_A |
array of |
[in] descr_B |
descriptor of the sparse CSR matrix |
[in] nnz_B |
number of non-zero entries of the sparse CSR
matrix |
[in] csr_row_ptr_B |
array of |
[in] csr_col_ind_B |
array of |
[in] descr_C |
descriptor of the sparse CSR matrix |
[out] csr_row_ptr_C |
array of |
[out] nnz_C |
pointer to the number of non-zero entries of
the sparse CSR matrix |
This function is non blocking and executed asynchronously with respect to the host. It may return before the actual computation has finished.
alphasparse_dcu_csrgeam
alphasparse_status_t alphasparse_dcu_?_csrgeam(
alphasparse_dcu_handle_t handle,
ALPHA_INT m,
ALPHA_INT n,
const ALPHA_Number *alpha,
const alpha_dcu_matrix_descr_t descr_A,
ALPHA_INT nnz_A,
const ALPHA_Number *csr_val_A,
const ALPHA_INT *csr_row_ptr_A,
const ALPHA_INT *csr_col_ind_A,
const ALPHA_Number *beta,
const alpha_dcu_matrix_descr_t descr_B,
ALPHA_INT nnz_B,
const ALPHA_Number *csr_val_B,
const ALPHA_INT *csr_row_ptr_B,
const ALPHA_INT *csr_col_ind_B,
const alpha_dcu_matrix_descr_t descr_C,
ALPHA_Number *csr_val_C,
const ALPHA_INT *csr_row_ptr_C,
ALPHA_INT *csr_col_ind_C)
Sparse matrix sparse matrix addition using CSR storage format.
alphasparse_dcu_?_csrgeam
multiplies the scalar α
with the
sparse m×n
matrix A
, defined in CSR storage format, multiplies
the scalar β
with the sparse m×n
matrix B
, defined in CSR
storage format, and adds both resulting matrices to obtain the sparse
m×n
matrix C
, defined in CSR storage format, such that
It is assumed that csr_row_ptr_C
has already been filled and that
csr_val_C
and csr_col_ind_C
are allocated by the user.
csr_row_ptr_C
and allocation size of csr_col_ind_C
and
csr_val_C
is defined by the number of non-zero elements of the
sparse CSR matrix C
. Both can be obtained by
alphasparse_dcu_csrgeam_nnz
.
“?
” indicates the data format, which corresponds to the
ALPHA_Number
in the interface. c
corresponds to float complex,
which is a single-precision complex number and z
corresponds to
double complex, which is a double-precision complex number. This
function stores the output result in In the vector y
. The input
parameters of the function are shown below:
Input parameters |
Description |
---|---|
[in] handle |
handle to the alphasparse library context queue. |
[in] m |
number of rows of the sparse CSR matrix |
[in] n |
number of columns of the sparse CSR matrix
|
[in] alpha |
scalar |
[in] descr_A |
descriptor of the sparse CSR matrix |
[in] nnz_A |
number of non-zero entries of the sparse CSR
matrix |
[in] csr_val_A |
array of |
[in] csr_row_ptr_A |
array of |
[in] csr_col_ind_A |
array of |
[in] beta |
scalar |
[in] descr_B |
descriptor of the sparse CSR matrix |
[in] nnz_B |
number of non-zero entries of the sparse CSR
matrix |
[in] csr_val_B |
array of |
[in] csr_row_ptr_B |
array of |
[in] csr_col_ind_B |
array of |
[in] descr_C |
descriptor of the sparse CSR matrix |
[out] csr_val_C |
array of elements of the sparse CSR matrix
|
[in] csr_row_ptr_C |
array of |
[out] csr_col_ind_C |
array of elements containing the column
indices of the sparse CSR matrix |
This function is non blocking and executed asynchronously with respect to the host. It may return before the actual computation has finished.
Both scalars α
and beta
have to be valid.
alphasparse_dcu_csrgemm_nnz
alphasparse_status_t alphasparse_dcu_csrgemm_nnz(
alphasparse_dcu_handle_t handle,
alphasparse_operation_t trans_A,
alphasparse_operation_t trans_B,
ALPHA_INT m,
ALPHA_INT n,
ALPHA_INT k,
const alpha_dcu_matrix_descr_t descr_A,
ALPHA_INT nnz_A,
const ALPHA_INT *csr_row_ptr_A,
const ALPHA_INT *csr_col_ind_A,
const alpha_dcu_matrix_descr_t descr_B,
ALPHA_INT nnz_B,
const ALPHA_INT *csr_row_ptr_B,
const ALPHA_INT *csr_col_ind_B,
const alpha_dcu_matrix_descr_t descr_D,
ALPHA_INT nnz_D,
const ALPHA_INT *csr_row_ptr_D,
const ALPHA_INT *csr_col_ind_D,
const alpha_dcu_matrix_descr_t descr_C,
ALPHA_INT *csr_row_ptr_C,
ALPHA_INT *nnz_C,
const alphasparse_dcu_mat_info_t info_C,
void *temp_buffer)
Sparse matrix sparse matrix multiplication using CSR storage format.
alphasparse_dcu_csrgemm_nnz
computes the total CSR non-zero elements
and the CSR row offsets, that point to the start of every row of the
sparse CSR matrix, of the resulting multiplied matrix C. It is assumed
that csr_row_ptr_C
has been allocated with size m
+ 1.
Input parameters |
Description |
---|---|
[in] handle |
handle to the alphasparse library context queue. |
[in] trans_A |
matrix |
[in] trans_B |
matrix |
[in] m |
number of rows of the sparse CSR matrix |
[in] n |
number of columns of the sparse CSR matrix
|
[in] k |
number of columns of the sparse CSR matrix
|
[in] descr_A |
descriptor of the sparse CSR matrix |
[in] nnz_A |
number of non-zero entries of the sparse CSR
matrix |
[in] csr_row_ptr_A |
array of |
[in] csr_col_ind_A |
array of |
[in] descr_B |
descriptor of the sparse CSR matrix |
[in] nnz_B |
number of non-zero entries of the sparse CSR
matrix |
[in] csr_row_ptr_B |
array of |
[in] csr_col_ind_B |
array of |
[in] descr_D |
descriptor of the sparse CSR matrix |
[in] nnz_D |
number of non-zero entries of the sparse CSR
matrix |
[in] csr_row_ptr_D |
array of |
[in] csr_col_ind_D |
array of |
[in] descr_C |
descriptor of the sparse CSR matrix |
[out] csr_row_ptr_C |
array of |
[out] nnz_C |
pointer to the number of non-zero entries of
the sparse CSR matrix |
[in] info_C |
nullptr |
[in] temp_buffer |
nullptr |
This function is non blocking and executed asynchronously with respect to the host. It may return before the actual computation has finished.
alphasparse_dcu_csrgemm
alphasparse_status_t alphasparse_dcu_?_csrgemm(
alphasparse_dcu_handle_t handle,
alphasparse_operation_t trans_A,
alphasparse_operation_t trans_B,
ALPHA_INT m,
ALPHA_INT n,
ALPHA_INT k,
const ALPHA_Number *alpha,
const alpha_dcu_matrix_descr_t descr_A,
ALPHA_INT nnz_A,
const ALPHA_Number *csr_val_A,
const ALPHA_INT *csr_row_ptr_A,
const ALPHA_INT *csr_col_ind_A,
const alpha_dcu_matrix_descr_t descr_B,
ALPHA_INT nnz_B,
const ALPHA_Number *csr_val_B,
const ALPHA_INT *csr_row_ptr_B,
const ALPHA_INT *csr_col_ind_B,
const ALPHA_Number *beta,
const alpha_dcu_matrix_descr_t descr_D,
ALPHA_INT nnz_D,
const ALPHA_Number *csr_val_D,
const ALPHA_INT *csr_row_ptr_D,
const ALPHA_INT *csr_col_ind_D,
const alpha_dcu_matrix_descr_t descr_C,
ALPHA_Number *csr_val_C,
const ALPHA_INT *csr_row_ptr_C,
ALPHA_INT *csr_col_ind_C,
const alphasparse_dcu_mat_info_t info_C,
void *temp_buffer)
Sparse matrix sparse matrix multiplication using CSR storage format.
alphasparse_dcu_?_csrgemm
multiplies the scalar α
with the
sparse m×k
matrix A
, defined in CSR storage format, and the
sparse k×n
matrix B
, defined in CSR storage format, and adds the
result to the sparse m×n
matrix D
that is multiplied by β
.
The final result is stored in the sparse m×n
matrix C
, defined
in CSR storage format, such that
It is assumed that csr_row_ptr_C
has already been filled and that
csr_val_C
and csr_col_ind_C
are allocated by the user.
csr_row_ptr_C
and allocation size of csr_col_ind_C
and
csr_val_C
is defined by the number of non-zero elements of the
sparse CSR matrix C. Both can be obtained by
alphasparse_dcu_csrgemm_nnz
.
“?
” indicates the data format, which corresponds to the
ALPHA_Number
in the interface. c
corresponds to float complex,
which is a single-precision complex number and z
corresponds to
double complex, which is a double-precision complex number. This
function stores the output result in In the vector y
. The input
parameters of the function are shown below:
Input parameters |
Description |
---|---|
[in] handle |
handle to the alphasparse library context queue. |
[in] trans_A |
matrix |
[in] trans_B |
matrix |
[in] m |
number of rows of the sparse CSR matrix |
[in] n |
number of columns of the sparse CSR matrix
|
[in] k |
number of columns of the sparse CSR matrix
|
[in] alpha |
scalar |
[in] descr_A |
descriptor of the sparse CSR matrix |
[in] nnz_A |
number of non-zero entries of the sparse CSR
matrix |
[in] csr_val_A |
array of |
[in] csr_row_ptr_A |
array of |
[in] csr_col_ind_A |
array of |
[in] descr_B |
descriptor of the sparse CSR matrix |
[in] nnz_B |
number of non-zero entries of the sparse CSR
matrix |
[in] csr_val_B |
array of |
[in] csr_row_ptr_B |
array of |
[in] csr_col_ind_B |
array of |
[in] beta |
scalar |
[in] descr_D |
descriptor of the sparse CSR matrix |
[in] nnz_D |
number of non-zero entries of the sparse CSR
matrix |
[in] csr_val_D |
array of |
[in] csr_row_ptr_D |
array of |
[in] csr_col_ind_D |
array of |
[in] descr_C |
descriptor of the sparse CSR matrix |
[out] csr_val_C |
array of |
[in] csr_row_ptr_C |
array of |
[out] csr_col_ind_C |
array of |
[in] info_C |
nullptr |
[in] temp_buffer |
nullptr |
This function is non blocking and executed asynchronously with respect to the host. It may return before the actual computation has finished.
If α==0
, then C=β⋅D
will be computed.
If β==0
, then C=α⋅op(A)⋅op(B)
will be computed.
α==beta==0
is invalid.