muBLAS API Reference
Functions
function mublasIsamax
mublasStatus mublasIsamax(
mublasHandle_t handle,
mublas_int n,
const float * x,
mublas_int incx,
mublas_int * result
)
function mublasIdamax
mublasStatus mublasIdamax(
mublasHandle_t handle,
mublas_int n,
const double * x,
mublas_int incx,
mublas_int * result
)
function mublasIzamax
mublasStatus mublasIzamax(
mublasHandle_t handle,
mublas_int n,
const muDoubleComplex * x,
mublas_int incx,
mublas_int * result
)
BLAS Level 1 API
Parameters
-
handle [mublasHandle_t]
Handle to the mublas library context queue. -
n [mublas_int]
The number of elements in . -
x
Device pointer storing vector . -
incx [mublas_int]
Specifies the increment for the elements of . -
result
Device pointer or host pointer to store the amax index. Returns0.0if .
amax finds the first index of the element with the maximum magnitude in vector .
function mublasIcamax
mublasStatus mublasIcamax(
mublasHandle_t handle,
mublas_int n,
const muComplex * x,
mublas_int incx,
mublas_int * result
)
BLAS Level 1 API
Parameters
-
handle [mublasHandle_t]
Handle to the mublas library context queue. -
n [mublas_int]
Number of elements in each vector . -
x
Device array of device pointers storing each vector . -
incx [mublas_int]
Specifies the increment for the elements of each . Must be . -
batch_count [mublas_int]
Number of instances in the batch. Must be . -
result
Device or host array of pointers of size batch_count for results. Returns0if .
amax_batched finds the first index of the element with the maximum magnitude for each vector in a batch, for .
function mublasIsamin
mublasStatus mublasIsamin(
mublasHandle_t handle,
mublas_int n,
const float * x,
mublas_int incx,
mublas_int * result
)
function mublasIdamin
mublasStatus mublasIdamin(
mublasHandle_t handle,
mublas_int n,
const double * x,
mublas_int incx,
mublas_int * result
)
function mublasIzamin
mublasStatus mublasIzamin(
mublasHandle_t handle,
mublas_int n,
const muDoubleComplex * x,
mublas_int incx,
mublas_int * result
)
BLAS Level 1 API
Parameters
-
handle [mublasHandle_t]
Handle to the mublas library context queue. -
n [mublas_int]
The number of elements in . -
x
Device pointer storing vector . -
incx [mublas_int]
Specifies the increment for the elements of . -
result
Device pointer or host pointer to store the index of the element with the minimum magnitude. Returns0.0if .
amin finds the first index of the element with the minimum magnitude of a vector .
function mublasIcamin
mublasStatus mublasIcamin(
mublasHandle_t handle,
mublas_int n,
const muComplex * x,
mublas_int incx,
mublas_int * result
)
BLAS Level 1 API
Parameters
-
handle [mublasHandle_t]
Handle to the mublas library context queue. -
n [mublas_int]
Number of elements in each vector . -
x
Device array of device pointers storing each vector . -
incx [mublas_int]
Specifies the increment for the elements of each . . -
batch_count [mublas_int]
Number of instances in the batch, must be . -
result
Device or host pointers to an array of size for results. Returns0if .
amin_batched finds the first index of the element with the minimum magnitude of each vector in a batch, for .
function mublasSasum
mublasStatus mublasSasum(
mublasHandle_t handle,
mublas_int n,
const float * x,
mublas_int incx,
float * result
)
function mublasDasum
mublasStatus mublasDasum(
mublasHandle_t handle,
mublas_int n,
const double * x,
mublas_int incx,
double * result
)
function mublasDzasum
mublasStatus mublasDzasum(
mublasHandle_t handle,
mublas_int n,
const muDoubleComplex * x,
mublas_int incx,
double * result
)
mublasStatus mublasScasum(
mublasHandle_t handle,
mublas_int n,
const muComplex * x,
mublas_int incx,
float * result
)
BLAS Level 1 API
Parameters
-
handle [mublasHandle_t]
Handle to the mublas library context queue. -
n [mublas_int]
The number of elements in . -
x
Device pointer storing vector . -
incx [mublas_int]
Specifies the increment for the elements of . Must satisfy . -
result
Device pointer or host pointer to store the result. Returns0.0if .
asum computes the sum of the magnitudes of elements of a real vector , or the sum of magnitudes of the real and imaginary parts of elements if is a complex vector.
function mublasSaxpy
mublasStatus mublasSaxpy(
mublasHandle_t handle,
mublas_int n,
const float * alpha,
const float * x,
mublas_int incx,
float * y,
mublas_int incy
)
function mublasDaxpy
mublasStatus mublasDaxpy(
mublasHandle_t handle,
mublas_int n,
const double * alpha,
const double * x,
mublas_int incx,
double * y,
mublas_int incy
)
function mublasZaxpy
mublasStatus mublasZaxpy(
mublasHandle_t handle,
mublas_int n,
const muDoubleComplex * alpha,
const muDoubleComplex * x,
mublas_int incx,
muDoubleComplex * y,
mublas_int incy
)
BLAS Level 1 API
Parameters
-
handle [mublasHandle_t]
Handle to the mublas library context queue. -
n [mublas_int]
The number of elements in and . -
alpha
Device pointer or host pointer specifying the scalar . -
x
Device pointer storing vector . -
incx [mublas_int]
Specifies the increment for the elements of . -
y
Device pointer storing vector . -
incy [mublas_int]
Specifies the increment for the elements of .
axpy computes the operation:
function mublasCaxpy
mublasStatus mublasCaxpy(
mublasHandle_t handle,
mublas_int n,
const muComplex * alpha,
const muComplex * x,
mublas_int incx,
muComplex * y,
mublas_int incy
)
BLAS Level 1 API
Parameters
-
handle [mublasHandle_t]
Handle to the mublas library context queue. -
n [mublas_int]
The number of elements in and . -
alpha
Device pointer or host pointer specifying the scalar . -
x
Device pointer storing vector . -
incx [mublas_int]
Specifies the increment for the elements of . -
y
Device pointer storing vector . -
incy [mublas_int]
Specifies the increment for the elements of .
axpy computes the operation:
function mublasCcopy
mublasStatus mublasCcopy(
mublasHandle_t handle,
mublas_int n,
const muComplex * x,
mublas_int incx,
muComplex * y,
mublas_int incy
)
function mublasScopy
mublasStatus mublasScopy(
mublasHandle_t handle,
mublas_int n,
const float * x,
mublas_int incx,
float * y,
mublas_int incy
)
function mublasDcopy
mublasStatus mublasDcopy(
mublasHandle_t handle,
mublas_int n,
const double * x,
mublas_int incx,
double * y,
mublas_int incy
)
function mublasZcopy
mublasStatus mublasZcopy(
mublasHandle_t handle,
mublas_int n,
const muDoubleComplex * x,
mublas_int incx,
muDoubleComplex * y,
mublas_int incy
)
BLAS Level 1 API
Parameters
-
handle [mublasHandle_t]
Handle to the mublas library context queue. -
n [mublas_int]
The number of elements in to be copied to . -
x
Device pointer storing vector . -
incx [mublas_int]
Specifies the increment for the elements of . -
y
Device pointer storing vector . -
incy [mublas_int]
Specifies the increment for the elements of .
copy copies each element into , for :
function mublasSdot
mublasStatus mublasSdot(
mublasHandle_t handle,
mublas_int n,
const float * x,
mublas_int incx,
const float * y,
mublas_int incy,
float * result
)
function mublasZdotc
mublasStatus mublasZdotc(
mublasHandle_t handle,
mublas_int n,
const muDoubleComplex * x,
mublas_int incx,
const muDoubleComplex * y,
mublas_int incy,
muDoubleComplex * result
)
function mublasDdot
mublasStatus mublasDdot(
mublasHandle_t handle,
mublas_int n,
const double * x,
mublas_int incx,
const double * y,
mublas_int incy,
double * result
)
function mublasZdotu
mublasStatus mublasZdotu(
mublasHandle_t handle,
mublas_int n,
const muDoubleComplex * x,
mublas_int incx,
const muDoubleComplex * y,
mublas_int incy,
muDoubleComplex * result
)
function mublasCdotu
mublasStatus mublasCdotu(
mublasHandle_t handle,
mublas_int n,
const muComplex * x,
mublas_int incx,
const muComplex * y,
mublas_int incy,
muComplex * result
)
BLAS Level 1 API
Parameters
-
handle [mublasHandle_t]
Handle to the mublas library context queue. -
n [mublas_int]
The number of elements in and . -
x
Device pointer storing vector . -
incx [mublas_int]
Specifies the increment for the elements of . -
y
Device pointer storing vector . -
incy [mublas_int]
Specifies the increment for the elements of . -
result
Device pointer or host pointer to store the dot product.
Return is if .
dot(u) performs the dot product of vectors and :
dotc performs the dot product of the conjugate of complex vector and complex vector :
function mublasCgbmv
mublasStatus mublasCgbmv(
mublasHandle_t handle,
mublasOperation_t trans,
mublas_int m,
mublas_int n,
mublas_int kl,
mublas_int ku,
const muComplex * alpha,
const muComplex * A,
mublas_int lda,
const muComplex * x,
mublas_int incx,
const muComplex * beta,
muComplex * y,
mublas_int incy
)
function mublasSgbmv
mublasStatus mublasSgbmv(
mublasHandle_t handle,
mublasOperation_t trans,
mublas_int m,
mublas_int n,
mublas_int kl,
mublas_int ku,
const float * alpha,
const float * A,
mublas_int lda,
const float * x,
mublas_int incx,
const float * beta,
float * y,
mublas_int incy
)
function mublasDgbmv
mublasStatus mublasDgbmv(
mublasHandle_t handle,
mublasOperation_t trans,
mublas_int m,
mublas_int n,
mublas_int kl,
mublas_int ku,
const double * alpha,
const double * A,
mublas_int lda,
const double * x,
mublas_int incx,
const double * beta,
double * y,
mublas_int incy
)
function mublasZgbmv
mublasStatus mublasZgbmv(
mublasHandle_t handle,
mublasOperation_t trans,
mublas_int m,
mublas_int n,
mublas_int kl,
mublas_int ku,
const muDoubleComplex * alpha,
const muDoubleComplex * A,
mublas_int lda,
const muDoubleComplex * x,
mublas_int incx,
const muDoubleComplex * beta,
muDoubleComplex * y,
mublas_int incy
)
BLAS Level 2 API
Parameters
- handle: [mublasHandle_t] Handle to the mublas library context queue.
- trans: [mublasOperation_t] Indicates whether matrix is transposed (conjugated) or not.
- m: [mublas_int] Number of rows of matrix .
- n: [mublas_int] Number of columns of matrix .
- kl: [mublas_int] Number of sub-diagonals of .
- ku: [mublas_int] Number of super-diagonals of .
- alpha: Device pointer or host pointer to scalar .
- A: Device pointer storing banded matrix . The matrix contains coefficients in a leading by part. The leading diagonal resides in row , the first super-diagonal on the RHS of row , and the first sub-diagonal on the LHS of row . The structure propagates up and down across sub/super-diagonals.
- lda: [mublas_int] Leading dimension of . Must be .
- x: Device pointer storing vector .
- incx: [mublas_int] Specifies the increment for the elements of .
- beta: Device pointer or host pointer to scalar .
- y: Device pointer storing vector .
- incy: [mublas_int] Specifies the increment for the elements of .
The gbmv function performs one of the following matrix-vector operations:
Where:
- and are scalars.
- and are vectors.
- is an banded matrix with sub-diagonals and super-diagonals.
Example
For example, when , , and :
Matrix :
The matrix will be stored in a compressed format, considering the sub- and super-diagonals. Empty elements, which do not correspond to data, will not be referenced.
function mublasCgemm
mublasStatus mublasCgemm(
mublasHandle_t handle,
mublasOperation_t transA,
mublasOperation_t transB,
mublas_int m,
mublas_int n,
mublas_int k,
const muComplex * alpha,
const muComplex * A,
mublas_int lda,
const muComplex * B,
mublas_int ldb,
const muComplex * beta,
muComplex * C,
mublas_int ldc
)
function mublasSgemm
mublasStatus mublasSgemm(
mublasHandle_t handle,
mublasOperation_t transA,
mublasOperation_t transB,
mublas_int m,
mublas_int n,
mublas_int k,
const float * alpha,
const float * A,
mublas_int lda,
const float * B,
mublas_int ldb,
const float * beta,
float * C,
mublas_int ldc
)
function mublasZgemm
mublasStatus mublasZgemm(
mublasHandle_t handle,
mublasOperation_t transA,
mublasOperation_t transB,
mublas_int m,
mublas_int n,
mublas_int k,
const muDoubleComplex * alpha,
const muDoubleComplex * A,
mublas_int lda,
const muDoubleComplex * B,
mublas_int ldb,
const muDoubleComplex * beta,
muDoubleComplex * C,
mublas_int ldc
)
function mublasDgemm
mublasStatus mublasDgemm(
mublasHandle_t handle,
mublasOperation_t transA,
mublasOperation_t transB,
mublas_int m,
mublas_int n,
mublas_int k,
const double * alpha,
const double * A,
mublas_int lda,
const double * B,
mublas_int ldb,
const double * beta,
double * C,
mublas_int ldc
)
BLAS Level 3 API
Parameters
- handle: [mublasHandle_t] Handle to the mublas library context queue.
- transA: [mublasOperation_t] Specifies the form of .
- transB: [mublasOperation_t] Specifies the form of .
- m: [mublas_int] Number of rows of matrices and .
- n: [mublas_int] Number of columns of matrices and .
- k: [mublas_int] Number of columns of matrix and number of rows of matrix .
- alpha: Device pointer or host pointer specifying the scalar .
- A: Device pointer storing matrix .
- lda: [mublas_int] Specifies the leading dimension of .
- B: Device pointer storing matrix .
- ldb: [mublas_int] Specifies the leading dimension of .
- beta: Device pointer or host pointer specifying the scalar .
- C: Device pointer storing matrix on the GPU.
- ldc: [mublas_int] Specifies the leading dimension of .
The gemm function performs one of the following matrix-matrix operations:
Where is one of:
Where:
- and are scalars.
- , , and are matrices, with being an matrix, being a matrix, and being an matrix.
function mublasCgemmBatched
mublasStatus mublasCgemmBatched(
mublasHandle_t handle,
mublasOperation_t transA,
mublasOperation_t transB,
mublas_int m,
mublas_int n,
mublas_int k,
const muComplex * alpha,
const muComplex *const A[],
mublas_int lda,
const muComplex *const B[],
mublas_int ldb,
const muComplex * beta,
muComplex *const C[],
mublas_int ldc,
mublas_int batch_count
)
function mublasSgemmBatched
mublasStatus mublasSgemmBatched(
mublasHandle_t handle,
mublasOperation_t transA,
mublasOperation_t transB,
mublas_int m,
mublas_int n,
mublas_int k,
const float * alpha,
const float *const A[],
mublas_int lda,
const float *const B[],
mublas_int ldb,
const float * beta,
float *const C[],
mublas_int ldc,
mublas_int batch_count
)
function mublasZgemmBatched
mublasStatus mublasZgemmBatched(
mublasHandle_t handle,
mublasOperation_t transA,
mublasOperation_t transB,
mublas_int m,
mublas_int n,
mublas_int k,
const muDoubleComplex * alpha,
const muDoubleComplex *const A[],
mublas_int lda,
const muDoubleComplex *const B[],
mublas_int ldb,
const muDoubleComplex * beta,
muDoubleComplex *const C[],
mublas_int ldc,
mublas_int batch_count
)
function mublasDgemmBatched
mublasStatus mublasDgemmBatched(
mublasHandle_t handle,
mublasOperation_t transA,
mublasOperation_t transB,
mublas_int m,
mublas_int n,
mublas_int k,
const double * alpha,
const double *const A[],
mublas_int lda,
const double *const B[],
mublas_int ldb,
const double * beta,
double *const C[],
mublas_int ldc,
mublas_int batch_count
)
BLAS Level 3 API
Parameters
- handle: [mublasHandle_t] Handle to the mublas library context queue.
- transA: [mublasOperation_t] Specifies the form of .
- transB: [mublasOperation_t] Specifies the form of .
- m: [mublas_int] Matrix dimension .
- n: [mublas_int] Matrix dimension .
- k: [mublas_int] Matrix dimension .
- alpha: Device pointer or host pointer specifying the scalar .
- A: Device array of device pointers storing each matrix .
- lda: [mublas_int] Specifies the leading dimension of each .
- B: Device array of device pointers storing each matrix .
- ldb: [mublas_int] Specifies the leading dimension of each .
- beta: Device pointer or host pointer specifying the scalar .
- C: Device array of device pointers storing each matrix .
- ldc: [mublas_int] Specifies the leading dimension of each .
- batch_count: [mublas_int] Number of GEMM operations in the batch.
The gemm_batched function performs one of the batched matrix-matrix operations:
Where is one of:
Where:
- and are scalars.
- , , and are strided batched matrices:
- is an by
batch_countstrided-batched matrix. - is a by
batch_countstrided-batched matrix. - is an by
batch_countstrided-batched matrix.
- is an by
function mublasCgemmStridedBatched
mublasStatus mublasCgemmStridedBatched(
mublasHandle_t handle,
mublasOperation_t transA,
mublasOperation_t transB,
mublas_int m,
mublas_int n,
mublas_int k,
const muComplex * alpha,
const muComplex * A,
mublas_int lda,
mublas_stride stride_a,
const muComplex * B,
mublas_int ldb,
mublas_stride stride_b,
const muComplex * beta,
muComplex * C,
mublas_int ldc,
mublas_stride stride_c,
mublas_int batch_count
)
function mublasSgemmStridedBatched
mublasStatus mublasSgemmStridedBatched(
mublasHandle_t handle,
mublasOperation_t transA,
mublasOperation_t transB,
mublas_int m,
mublas_int n,
mublas_int k,
const float * alpha,
const float * A,
mublas_int lda,
mublas_stride stride_a,
const float * B,
mublas_int ldb,
mublas_stride stride_b,
const float * beta,
float * C,
mublas_int ldc,
mublas_stride stride_c,
mublas_int batch_count
)
BLAS Level 3 API
Parameters
- handle: [mublasHandle_t] Handle to the mublas library context queue.
- transA: [mublasOperation_t] Specifies the form of .
- transB: [mublasOperation_t] Specifies the form of .
- m: [mublas_int] Matrix dimension .
- n: [mublas_int] Matrix dimension .
- k: [mublas_int] Matrix dimension .
- alpha: Device pointer or host pointer specifying the scalar .
- A: Device pointer pointing to the first matrix .
- lda: [mublas_int] Specifies the leading dimension of each .
- stride_a: [mublas_stride] Stride from the start of one matrix to the next .
- B: Device pointer pointing to the first matrix .
- ldb: [mublas_int] Specifies the leading dimension of each .
- stride_b: [mublas_stride] Stride from the start of one matrix to the next .
- beta: Device pointer or host pointer specifying the scalar .
- C: Device pointer pointing to the first matrix .
- ldc: [mublas_int] Specifies the leading dimension of each .
- stride_c: [mublas_stride] Stride from the start of one matrix to the next .
- batch_count: [mublas_int] Number of GEMM operations in the batch.
The gemm_strided_batched function performs one of the strided batched matrix-matrix operations:
Where is one of:
Where:
- and are scalars.
- , , and are strided batched matrices:
- is an by
batch_countstrided-batched matrix. - is a by
batch_countstrided-batched matrix. - is an by
batch_countstrided-batched matrix.
- is an by
function mublasCgemv
mublasStatus mublasCgemv(
mublasHandle_t handle,
mublasOperation_t trans,
mublas_int m,
mublas_int n,
const muComplex * alpha,
const muComplex * A,
mublas_int lda,
const muComplex * x,
mublas_int incx,
const muComplex * beta,
muComplex * y,
mublas_int incy
)
function mublasSgemv
mublasStatus mublasSgemv(
mublasHandle_t handle,
mublasOperation_t trans,
mublas_int m,
mublas_int n,
const float * alpha,
const float * A,
mublas_int lda,
const float * x,
mublas_int incx,
const float * beta,
float * y,
mublas_int incy
)
function mublasDgemv
mublasStatus mublasDgemv(
mublasHandle_t handle,
mublasOperation_t trans,
mublas_int m,
mublas_int n,
const double * alpha,
const double * A,
mublas_int lda,
const double * x,
mublas_int incx,
const double * beta,
double * y,
mublas_int incy
)
function mublasZgemv
mublasStatus mublasZgemv(
mublasHandle_t handle,
mublasOperation_t trans,
mublas_int m,
mublas_int n,
const muDoubleComplex * alpha,
const muDoubleComplex * A,
mublas_int lda,
const muDoubleComplex * x,
mublas_int incx,
const muDoubleComplex * beta,
muDoubleComplex * y,
mublas_int incy
)
BLAS Level 2 API
Parameters
- handle: [mublasHandle_t] Handle to the mublas library context queue.
- trans: [mublasOperation_t] Indicates whether matrix is transposed (conjugated) or not.
- m: [mublas_int] Number of rows of matrix .
- n: [mublas_int] Number of columns of matrix .
- alpha: Device pointer or host pointer to scalar .
- A: Device pointer storing matrix .
- lda: [mublas_int] Specifies the leading dimension of .
- x: Device pointer storing vector .
- incx: [mublas_int] Specifies the increment for the elements of .
- beta: Device pointer or host pointer to scalar .
- y: Device pointer storing vector .
- incy: [mublas_int] Specifies the increment for the elements of .
The gemv function performs one of the following matrix-vector operations:
Where:
- and are scalars.
- and are vectors.
- is an matrix.
function mublasSger
mublasStatus mublasSger(
mublasHandle_t handle,
mublas_int m,
mublas_int n,
const float * alpha,
const float * x,
mublas_int incx,
const float * y,
mublas_int incy,
float * A,
mublas_int lda
)
function mublasDger
mublasStatus mublasDger(
mublasHandle_t handle,
mublas_int m,
mublas_int n,
const double * alpha,
const double * x,
mublas_int incx,
const double * y,
mublas_int incy,
double * A,
mublas_int lda
)
function mublasCgeru
mublasStatus mublasCgeru(
mublasHandle_t handle,
mublas_int m,
mublas_int n,
const muComplex * alpha,
const muComplex * x,
mublas_int incx,
const muComplex * y,
mublas_int incy,
muComplex * A,
mublas_int lda
)
function mublasZgeru
mublasStatus mublasZgeru(
mublasHandle_t handle,
mublas_int m,
mublas_int n,
const muDoubleComplex * alpha,
const muDoubleComplex * x,
mublas_int incx,
const muDoubleComplex * y,
mublas_int incy,
muDoubleComplex * A,
mublas_int lda
)
function mublasCgerc
mublasStatus mublasCgerc(
mublasHandle_t handle,
mublas_int m,
mublas_int n,
const muComplex * alpha,
const muComplex * x,
mublas_int incx,
const muComplex * y,
mublas_int incy,
muComplex * A,
mublas_int lda
)
function mublasZgerc
mublasStatus mublasZgerc(
mublasHandle_t handle,
mublas_int m,
mublas_int n,
const muDoubleComplex * alpha,
const muDoubleComplex * x,
mublas_int incx,
const muDoubleComplex * y,
mublas_int incy,
muDoubleComplex * A,
mublas_int lda
)
BLAS Level 2 API
Parameters
- handle: [mublasHandle_t] Handle to the mublas library context queue.
- m: [mublas_int] The number of rows of the matrix .
- n: [mublas_int] The number of columns of the matrix .
- alpha: Device pointer or host pointer to scalar .
- x: Device pointer storing vector .
- incx: [mublas_int] Specifies the increment for the elements of .
- y: Device pointer storing vector .
- incy: [mublas_int] Specifies the increment for the elements of .
- A: Device pointer storing matrix .
- lda: [mublas_int] Specifies the leading dimension of .
The ger, geru, and gerc functions perform the following matrix-vector operations:
Where:
- is a scalar.
- and are vectors.
- is an matrix.
function mublasChbmv
mublasStatus mublasChbmv(
mublasHandle_t handle,
mublasFillMode_t uplo,
mublas_int n,
mublas_int k,
const muComplex * alpha,
const muComplex * A,
mublas_int lda,
const muComplex * x,
mublas_int incx,
const muComplex * beta,
muComplex * y,
mublas_int incy
)
function mublasZhbmv
mublasStatus mublasZhbmv(
mublasHandle_t handle,
mublasFillMode_t uplo,
mublas_int n,
mublas_int k,
const muDoubleComplex * alpha,
const muDoubleComplex * A,
mublas_int lda,
const muDoubleComplex * x,
mublas_int incx,
const muDoubleComplex * beta,
muDoubleComplex * y,
mublas_int incy
)
BLAS Level 2 API
Parameters
- handle: [mublasHandle_t] Handle to the mublas library context queue.
- uplo: [mublasFillMode_t]
MUBLAS_FILL_MODE_UPPER: The upper triangular part of A is being supplied.MUBLAS_FILL_MODE_LOWER: The lower triangular part of A is being supplied.
- n: [mublas_int] The order of the matrix .
- k: [mublas_int] The number of super-diagonals of the matrix . Must be >= 0.
- alpha: Device pointer or host pointer to scalar .
- A: Device pointer storing matrix . Dimension is .
- If
uplo == MUBLAS_FILL_MODE_UPPER: The leading part of A contains the upper triangular band part of the Hermitian matrix, with the leading diagonal in row , the first super-diagonal on the RHS of row , and so on. - If
uplo == MUBLAS_FILL_MODE_LOWER: The leading part of A contains the lower triangular band part of the Hermitian matrix, with the leading diagonal in row 1, the first sub-diagonal on the LHS of row 2, and so on.
- If
- lda: [mublas_int] Specifies the leading dimension of . Must be >= .
- x: Device pointer storing vector .
- incx: [mublas_int] Specifies the increment for the elements of .
- beta: Device pointer or host pointer to scalar .
- y: Device pointer storing vector .
- incy: [mublas_int] Specifies the increment for the elements of .
The hbmv function performs the following matrix-vector operation:
Where:
- and are scalars.
- and are vectors with elements.
- is an Hermitian band matrix with super-diagonals.
If uplo == MUBLAS_FILL_MODE_UPPER, the matrix contains the upper triangular part of the Hermitian matrix. If uplo == MUBLAS_FILL_MODE_LOWER, the matrix contains the lower triangular part.
function mublasChemm
mublasStatus mublasChemm(
mublasHandle_t handle,
mublasSideMode_t side,
mublasFillMode_t uplo,
mublas_int m,
mublas_int n,
const muComplex * alpha,
const muComplex * A,
mublas_int lda,
const muComplex * B,
mublas_int ldb,
const muComplex * beta,
muComplex * C,
mublas_int ldc
)
function mublasZhemm
mublasStatus mublasZhemm(
mublasHandle_t handle,
mublasSideMode_t side,
mublasFillMode_t uplo,
mublas_int m,
mublas_int n,
const muDoubleComplex * alpha,
const muDoubleComplex * A,
mublas_int lda,
const muDoubleComplex * B,
mublas_int ldb,
const muDoubleComplex * beta,
muDoubleComplex * C,
mublas_int ldc
)
BLAS Level 3 API
Parameters
- handle: [mublasHandle_t] Handle to the mublas library context queue.
- side: [mublasSideMode_t]
- MUBLAS_SIDE_LEFT:
- MUBLAS_SIDE_RIGHT:
- uplo: [mublasFillMode_t]
- MUBLAS_FILL_MODE_UPPER: is an upper triangular matrix.
- MUBLAS_FILL_MODE_LOWER: is a lower triangular matrix.
- m: [mublas_int] The number of rows of and . Must be .
- n: [mublas_int] The number of columns of and . Must be .
- alpha: Scalar . If , then and are not referenced.
- A: Pointer storing matrix on the GPU.
- If side = MUBLAS_SIDE_LEFT: is .
- If side = MUBLAS_SIDE_RIGHT: is .
- Only the upper or lower triangular part of is accessed.
- The imaginary part of the diagonal elements is not used.
- lda: [mublas_int] Specifies the first dimension of .
- If side = MUBLAS_SIDE_LEFT, .
- If side = MUBLAS_SIDE_RIGHT, .
- B: Pointer storing matrix on the GPU. Matrix dimension is .
- ldb: [mublas_int] Specifies the first dimension of . .
- beta: Scalar . If , then does not need to be set before entry.
- C: Pointer storing matrix on the GPU. Matrix dimension is .
- ldc: [mublas_int] Specifies the first dimension of . .
The hemm function performs the following matrix-matrix operation:
-
If
side == MUBLAS_SIDE_LEFT: -
If
side == MUBLAS_SIDE_RIGHT:
Where:
- and are scalars.
- and are matrices.
- is a Hermitian matrix stored as either upper or lower triangular.
function mublasChemv
mublasStatus mublasChemv(
mublasHandle_t handle,
mublasFillMode_t uplo,
mublas_int n,
const muComplex * alpha,
const muComplex * A,
mublas_int lda,
const muComplex * x,
mublas_int incx,
const muComplex * beta,
muComplex * y,
mublas_int incy
)
function mublasZhemv
mublasStatus mublasZhemv(
mublasHandle_t handle,
mublasFillMode_t uplo,
mublas_int n,
const muDoubleComplex * alpha,
const muDoubleComplex * A,
mublas_int lda,
const muDoubleComplex * x,
mublas_int incx,
const muDoubleComplex * beta,
muDoubleComplex * y,
mublas_int incy
)
BLAS Level 2 API
Parameters
- handle: [mublasHandle_t] Handle to the mublas library context queue.
- uplo: [mublasFillMode_t]
MUBLAS_FILL_MODE_UPPER: The upper triangular part of the Hermitian matrix is supplied.MUBLAS_FILL_MODE_LOWER: The lower triangular part of the Hermitian matrix is supplied.
- n: [mublas_int] The order of the matrix .
- alpha: Scalar .
- A: Pointer storing matrix .
- If
uplo == MUBLAS_FILL_MODE_UPPER: The upper triangular part of must contain the upper triangular part of a Hermitian matrix. The lower triangular part will not be referenced. - If
uplo == MUBLAS_FILL_MODE_LOWER: The lower triangular part of must contain the lower triangular part of a Hermitian matrix. The upper triangular part will not be referenced. - The imaginary part of the main diagonal of is assumed to be zero (Hermitian matrix).
- If
- lda: [mublas_int] Specifies the leading dimension of . Must be .
- x: Pointer storing vector .
- incx: [mublas_int] Specifies the increment for the elements of .
- beta: Scalar .
- y: Pointer storing vector .
- incy: [mublas_int] Specifies the increment for the elements of .
The hemv function performs the following matrix-vector operation:
Where:
- and are scalars.
- and are -element vectors.
- is an Hermitian matrix, with the appropriate triangular part (upper or lower) referenced based on
uplo.
function mublasCher
mublasStatus mublasCher(
mublasHandle_t handle,
mublasFillMode_t uplo,
mublas_int n,
const float * alpha,
const muComplex * x,
mublas_int incx,
muComplex * A,
mublas_int lda
)
function mublasZher
mublasStatus mublasZher(
mublasHandle_t handle,
mublasFillMode_t uplo,
mublas_int n,
const double * alpha,
const muDoubleComplex * x,
mublas_int incx,
muDoubleComplex * A,
mublas_int lda
)
BLAS Level 2 API
Parameters
- handle: [mublasHandle_t] Handle to the mublas library context queue.
- uplo: [mublasFillMode_t]
MUBLAS_FILL_MODE_UPPER: The upper triangular part of matrix is supplied.MUBLAS_FILL_MODE_LOWER: The lower triangular part of matrix is supplied.
- n: [mublas_int] The number of rows and columns of matrix , must be at least 0.
- alpha: Scalar .
- x: Pointer storing vector .
- incx: [mublas_int] Specifies the increment for the elements of .
- A: Pointer storing the specified triangular portion of the Hermitian matrix .
- If
uplo == MUBLAS_FILL_MODE_UPPER: The upper triangular portion of is supplied. The lower triangular portion will not be accessed. - If
uplo == MUBLAS_FILL_MODE_LOWER: The lower triangular portion of is supplied. The upper triangular portion will not be accessed. - The imaginary part of the diagonal elements of is not accessed and is assumed to be 0 (Hermitian matrix).
- If
- lda: [mublas_int] Specifies the leading dimension of . Must be at least .
The her function performs the following matrix-vector operation:
Where:
- is a real scalar.
- is a vector.
- is an Hermitian matrix.
- is the conjugate transpose of .
function mublasCher2
mublasStatus mublasCher2(
mublasHandle_t handle,
mublasFillMode_t uplo,
mublas_int n,
const muComplex * alpha,
const muComplex * x,
mublas_int incx,
const muComplex * y,
mublas_int incy,
muComplex * A,
mublas_int lda
)
function mublasZher2
mublasStatus mublasZher2(
mublasHandle_t handle,
mublasFillMode_t uplo,
mublas_int n,
const muDoubleComplex * alpha,
const muDoubleComplex * x,
mublas_int incx,
const muDoubleComplex * y,
mublas_int incy,
muDoubleComplex * A,
mublas_int lda
)
BLAS Level 2 API
Parameters
- handle: [mublasHandle_t] Handle to the mublas library context queue.
- uplo: [mublasFillMode_t]
MUBLAS_FILL_MODE_UPPER: The upper triangular part of matrix is supplied.MUBLAS_FILL_MODE_LOWER: The lower triangular part of matrix is supplied.
- n: [mublas_int] The number of rows and columns of matrix , must be at least 0.
- alpha: Scalar (complex scalar).
- x: Pointer storing vector .
- incx: [mublas_int] Specifies the increment for the elements of .
- y: Pointer storing vector .
- incy: [mublas_int] Specifies the increment for the elements of .
- A: Pointer storing the specified triangular portion of the Hermitian matrix .
- If
uplo == MUBLAS_FILL_MODE_UPPER: The upper triangular portion of is supplied. The lower triangular portion will not be accessed. - If
uplo == MUBLAS_FILL_MODE_LOWER: The lower triangular portion of is supplied. The upper triangular portion will not be accessed. - The imaginary part of the diagonal elements of is not accessed and is assumed to be 0 (Hermitian matrix).
- If
- lda: [mublas_int] Specifies the leading dimension of . Must be at least .
The her2 function performs the following matrix-vector operation:
Where:
- is a complex scalar.
- and are vectors.
- is an Hermitian matrix.
- and are the conjugate transposes of and , respectively.
- denotes the complex conjugate of .
function mublasCher2k
mublasStatus mublasCher2k(
mublasHandle_t handle,
mublasFillMode_t uplo,
mublasOperation_t trans,
mublas_int n,
mublas_int k,
const muComplex * alpha,
const muComplex * A,
mublas_int lda,
const muComplex * B,
mublas_int ldb,
const float * beta,
muComplex * C,
mublas_int ldc
)
function mublasZher2k
mublasStatus mublasZher2k(
mublasHandle_t handle,
mublasFillMode_t uplo,
mublasOperation_t trans,
mublas_int n,
mublas_int k,
const muDoubleComplex * alpha,
const muDoubleComplex * A,
mublas_int lda,
const muDoubleComplex * B,
mublas_int ldb,
const double * beta,
muDoubleComplex * C,
mublas_int ldc
)
BLAS Level 3 API
- handle: [mublasHandle_t] Handle to the mublas library context queue.
- uplo: [mublasFillMode_t]
MUBLAS_FILL_MODE_UPPER: is an upper triangular matrix.MUBLAS_FILL_MODE_LOWER: is a lower triangular matrix.
- trans: [mublasOperation_t]
- = : ,
- = : ,
- n: [mublas_int] The number of rows and columns of matrix . Must be .
- k: [mublas_int] The number of columns of . Must be .
- alpha: Scalar . When , is not referenced, and need not be set before entry.
- A: Pointer storing matrix on the GPU. Matrix dimension is:
- when = ,
- when = .
- Only the upper/lower triangular part is accessed.
- lda: [mublas_int] The leading dimension of .
- If = , .
- Otherwise, .
- B: Pointer storing matrix on the GPU. Matrix dimension is:
- when = ,
- when = .
- Only the upper/lower triangular part is accessed.
- ldb: [mublas_int] The leading dimension of .
- If = , .
- Otherwise, .
- beta: Scalar . When , need not be set before entry.
- C: Pointer storing matrix on the GPU. The imaginary part of the diagonal elements of is not accessed and is assumed to be 0 unless a quick return is performed.
- ldc: [mublas_int] The leading dimension of . Must be .
The her2k function performs the Hermitian rank-2k update for matrix-matrix operations:
Where:
- and are scalars.
- and are matrices.
- is an Hermitian matrix.
- If = , then and .
- If = , then and .
function mublasCherk
mublasStatus mublasCherk(
mublasHandle_t handle,
mublasFillMode_t uplo,
mublasOperation_t transA,
mublas_int n,
mublas_int k,
const float * alpha,
const muComplex * A,
mublas_int lda,
const float * beta,
muComplex * C,
mublas_int ldc
)
function mublasZherk
mublasStatus mublasZherk(
mublasHandle_t handle,
mublasFillMode_t uplo,
mublasOperation_t transA,
mublas_int n,
mublas_int k,
const double * alpha,
const muDoubleComplex * A,
mublas_int lda,
const double * beta,
muDoubleComplex * C,
mublas_int ldc
)
BLAS Level 3 API
Parameters
- handle: [mublasHandle_t] Handle to the mublas library context queue.
- uplo: [mublasFillMode_t]
MUBLAS_FILL_MODE_UPPER: is an upper triangular matrix.MUBLAS_FILL_MODE_LOWER: is a lower triangular matrix.
- transA: [mublasOperation_t]
- = :
- = :
- n: [mublas_int] The number of rows and columns of matrix . Must be .
- k: [mublas_int] The number of columns of . Must be .
- alpha: Scalar . When , is not referenced, and need not be set before entry.
- A: Pointer storing matrix on the GPU. Matrix dimension is:
- when = ,
- when = .
- Only the upper/lower triangular part is accessed.
- lda: [mublas_int] The leading dimension of .
- If = , .
- Otherwise, .
- beta: Scalar . When , need not be set before entry.
- C: Pointer storing matrix on the GPU. The imaginary component of the diagonal elements of is not accessed and is assumed to be 0 unless a quick return is performed.
- ldc: [mublas_int] The leading dimension of . Must be .
The herk function performs one of the matrix-matrix operations for a Hermitian rank-k update:
Where:
- and are scalars.
- is an matrix.
- is an Hermitian matrix stored as either upper or lower.
- If = , then and is .
- If = , then and is .
function mublasCherkStridedBatched
mublasStatus mublasCherkStridedBatched(
mublasHandle_t handle,
mublasFillMode_t uplo,
mublasOperation_t transA,
mublas_int n,
mublas_int k,
const float * alpha,
const muComplex * A,
mublas_int lda,
mublas_stride stride_A,
const float * beta,
muComplex * C,
mublas_int ldc,
mublas_stride stride_C,
mublas_int batch_count
)
BLAS Level 3 API
Parameters
- handle: [mublasHandle_t] Handle to the mublas library context queue.
- uplo: [mublasFillMode_t]
- : is an upper triangular matrix.
- : is a lower triangular matrix.
- transA: [mublasOperation_t]
- :
- :
- n: [mublas_int] The number of rows and columns of matrix . Must be .
- k: [mublas_int] The number of columns of . Must be .
- alpha: Scalar . When , is not referenced, and need not be set before entry.
- A: Device pointer to the first matrix on the GPU. Matrix dimension is:
- when .
- when .
- lda: [mublas_int] The leading dimension of .
- If , .
- Otherwise, .
- stride_A: [mublas_stride] The stride from the start of one matrix () and the next one ().
- beta: Scalar . When , need not be set before entry.
- C: Device pointer to the first matrix on the GPU. The imaginary part of the diagonal elements of is not accessed and is assumed to be 0 unless a quick return is performed.
- ldc: [mublas_int] The leading dimension of . Must be .
- stride_C: [mublas_stride] The stride from the start of one matrix () and the next one ().
- batch_count: [mublas_int] The number of instances in the batch.
The herk_strided_batched function performs a batch of matrix-matrix operations for a Hermitian rank-k update:
Where:
- and are scalars.
- is an matrix.
- is an Hermitian matrix.
- If , then .
- If , then .
function mublasChpmv
mublasStatus mublasChpmv(
mublasHandle_t handle,
mublasFillMode_t uplo,
mublas_int n,
const muComplex * alpha,
const muComplex * AP,
const muComplex * x,
mublas_int incx,
const muComplex * beta,
muComplex * y,
mublas_int incy
)
function mublasZhpmv
mublasStatus mublasZhpmv(
mublasHandle_t handle,
mublasFillMode_t uplo,
mublas_int n,
const muDoubleComplex * alpha,
const muDoubleComplex * AP,
const muDoubleComplex * x,
mublas_int incx,
const muDoubleComplex * beta,
muDoubleComplex * y,
mublas_int incy
)
BLAS Level 2 API
Parameters
- handle: [mublasHandle_t] Handle to the mublas library context queue.
- uplo: [mublasFillMode_t]
MUBLAS_FILL_MODE_UPPER: The upper triangular part of the Hermitian matrix is supplied in .MUBLAS_FILL_MODE_LOWER: The lower triangular part of the Hermitian matrix is supplied in .
- n: [mublas_int] The order of the matrix . Must be .
- alpha: Device pointer or host pointer to scalar .
- AP: Device pointer storing the packed version of the specified triangular portion of the Hermitian matrix . It must be of at least size . If , the upper triangular portion of is supplied. The matrix is packed such that:
- ,
- ,
- , and so on.
- If , the lower triangular portion of is supplied. The matrix is packed such that:
- ,
- ,
- , and so on.
- Note: The imaginary part of the diagonal elements is not accessed and is assumed to be 0.
- x: Device pointer storing vector .
- incx: [mublas_int] Specifies the increment for the elements of .
- beta: Device pointer or host pointer to scalar .
- y: Device pointer storing vector .
- incy: [mublas_int] Specifies the increment for the elements of .
The hpmv function performs the matrix-vector operation:
Where:
- and are scalars.
- is an Hermitian matrix supplied in packed form.
- and are -element vectors.
function mublasChpr
mublasStatus mublasChpr(
mublasHandle_t handle,
mublasFillMode_t uplo,
mublas_int n,
const float * alpha,
const muComplex * x,
mublas_int incx,
muComplex * AP
)
function mublasZhpr
mublasStatus mublasZhpr(
mublasHandle_t handle,
mublasFillMode_t uplo,
mublas_int n,
const double * alpha,
const muDoubleComplex * x,
mublas_int incx,
muDoubleComplex * AP
)
BLAS Level 2 API
Parameters
- handle: [mublasHandle_t] Handle to the mublas library context queue.
- uplo: [mublasFillMode_t] Specifies whether the upper or lower triangular part of is supplied in .
MUBLAS_FILL_MODE_UPPER: The upper triangular part of is supplied in .MUBLAS_FILL_MODE_LOWER: The lower triangular part of is supplied in .
- n: [mublas_int] The number of rows and columns of matrix . Must be at least 0.
- alpha: Device or host pointer to scalar .
- x: Device pointer storing vector .
- incx: [mublas_int] Specifies the increment for the elements of .
- AP: Device pointer storing the packed version of the specified triangular portion of the Hermitian matrix . The size must be at least .
- If = : The upper triangular portion of is supplied.
- If = : The lower triangular portion of is supplied.
The hpr function performs the matrix-vector operation:
Where:
- is a real scalar.
- is a vector.
- is an Hermitian matrix, supplied in packed form.
function mublasChpr2
mublasStatus mublasChpr2(
mublasHandle_t handle,
mublasFillMode_t uplo,
mublas_int n,
const muComplex * alpha,
const muComplex * x,
mublas_int incx,
const muComplex * y,
mublas_int incy,
muComplex * AP
)
function mublasZhpr2
mublasStatus mublasZhpr2(
mublasHandle_t handle,
mublasFillMode_t uplo,
mublas_int n,
const muDoubleComplex * alpha,
const muDoubleComplex * x,
mublas_int incx,
const muDoubleComplex * y,
mublas_int incy,
muDoubleComplex * AP
)
BLAS Level 2 API
Parameters
-
handle: [mublasHandle_t] Handle to the mublas library context queue.
-
uplo: [mublasFillMode_t] Specifies whether the upper or lower triangular part of is supplied in .
MUBLAS_FILL_MODE_UPPER: The upper triangular part of is supplied in .MUBLAS_FILL_MODE_LOWER: The lower triangular part of is supplied in .
-
n: [mublas_int] The number of rows and columns of matrix . Must be at least 0.
-
alpha: Device or host pointer to complex scalar .
-
x: Device pointer storing vector .
-
incx: [mublas_int] Specifies the increment for the elements of .
-
y: Device pointer storing vector .
-
incy: [mublas_int] Specifies the increment for the elements of .
-
AP: Device pointer storing the packed version of the specified triangular portion of the Hermitian matrix . The size must be at least .
- If = : The upper triangular portion of is supplied.
- If = : The lower triangular portion of is supplied.
The hpr2 function performs the matrix-vector operation:
Where:
- is a complex scalar.
- and are vectors.
- is an Hermitian matrix, supplied in packed form.
function mublasSnrm2
mublasStatus mublasSnrm2(
mublasHandle_t handle,
mublas_int n,
const float * x,
mublas_int incx,
float * result
)
function mublasScnrm2
mublasStatus mublasScnrm2(
mublasHandle_t handle,
mublas_int n,
const muComplex * x,
mublas_int incx,
float * result
)
function mublasDznrm2
mublasStatus mublasDznrm2(
mublasHandle_t handle,
mublas_int n,
const muDoubleComplex * x,
mublas_int incx,
double * result
)
function mublasDnrm2
mublasStatus mublasDnrm2(
mublasHandle_t handle,
mublas_int n,
const double * x,
mublas_int incx,
double * result
)
BLAS Level 1 API
Parameters
- handle: [mublasHandle_t] Handle to the mublas library context queue.
- n: [mublas_int] The number of elements in vector .
- x: Device pointer storing vector .
- incx: [mublas_int] Specifies the increment for the elements of .
- result: Device or host pointer to store the result. The return value is if or .
The nrm2 function computes the Euclidean norm of a real or complex vector:
- For real vectors:
- For complex vectors:
function mublasSrot
mublasStatus mublasSrot(
mublasHandle_t handle,
mublas_int n,
float * x,
mublas_int incx,
float * y,
mublas_int incy,
const float * c,
const float * s
)
function mublasCsrot
mublasStatus mublasCsrot(
mublasHandle_t handle,
mublas_int n,
muComplex * x,
mublas_int incx,
muComplex * y,
mublas_int incy,
const float * c,
const float * s
)
function mublasDrot
mublasStatus mublasDrot(
mublasHandle_t handle,
mublas_int n,
double * x,
mublas_int incx,
double * y,
mublas_int incy,
const double * c,
const double * s
)
function mublasZdrot
mublasStatus mublasZdrot(
mublasHandle_t handle,
mublas_int n,
muDoubleComplex * x,
mublas_int incx,
muDoubleComplex * y,
mublas_int incy,
const double * c,
const double * s
)
BLAS Level 1 API
Parameters
- handle: [mublasHandle_t] Handle to the mublas library context queue.
- n: [mublas_int] The number of elements in the vectors and .
- x: Device pointer storing vector .
- incx: [mublas_int] Specifies the increment between elements of .
- y: Device pointer storing vector .
- incy: [mublas_int] Specifies the increment between elements of .
- c: Device or host pointer storing the scalar cosine component () of the rotation matrix.
- s: Device or host pointer storing the scalar sine component () of the rotation matrix.
The rot function applies the Givens rotation matrix to vectors and . The rotation is defined by the cosine and sine components and , respectively, which are related to an angle :
Where:
function mublasSrotg
mublasStatus mublasSrotg(
mublasHandle_t handle,
float * a,
float * b,
float * c,
float * s
)
function mublasCrotg
mublasStatus mublasCrotg(
mublasHandle_t handle,
muComplex * a,
muComplex * b,
float * c,
muComplex * s
)
function mublasDrotg
mublasStatus mublasDrotg(
mublasHandle_t handle,
double * a,
double * b,
double * c,
double * s
)
function mublasZrotg
mublasStatus mublasZrotg(
mublasHandle_t handle,
muDoubleComplex * a,
muDoubleComplex * b,
double * c,
muDoubleComplex * s
)
BLAS Level 1 API
Parameters
- handle: [mublasHandle_t] Handle to the mublas library context queue.
- a: Device pointer or host pointer to the input vector element, overwritten with .
- b: Device pointer or host pointer to the input vector element, overwritten with .
- c: Device pointer or host pointer to the cosine element of the Givens rotation.
- s: Device pointer or host pointer to the sine element of the Givens rotation.
The rotg function creates the Givens rotation matrix for the vector . The rotation matrix is defined by the cosine and sine components and , and is applied to the vector:
Where:
- is the new value of after the rotation.
- is the new value of after the rotation.
The result of the rotation is stored in and as and , respectively.
If the pointer mode is set to MUBLAS_POINTER_MODE_HOST, the function blocks the CPU until the GPU finishes and the results are available in host memory. If set to MUBLAS_POINTER_MODE_DEVICE, the function returns immediately, and synchronization is required to read the results.
function mublasSrotm
mublasStatus mublasSrotm(
mublasHandle_t handle,
mublas_int n,
float * x,
mublas_int incx,
float * y,
mublas_int incy,
const float * param
)
function mublasDrotm
mublasStatus mublasDrotm(
mublasHandle_t handle,
mublas_int n,
double * x,
mublas_int incx,
double * y,
mublas_int incy,
const double * param
)
BLAS Level 1 API
Parameters
-
handle: [mublasHandle_t] Handle to the mublas library context queue.
-
n: [mublas_int] The number of elements in the vectors and .
-
x: Device pointer storing vector .
-
incx: [mublas_int] Specifies the increment between elements of .
-
y: Device pointer storing vector .
-
incy: [mublas_int] Specifies the increment between elements of .
-
param: Device or host vector of 5 elements defining the rotation:
param[0]: flag (Defines the form of matrix ).param[1]: (Element in the first row, first column).param[2]: (Element in the second row, first column).param[3]: (Element in the first row, second column).param[4]: (Element in the second row, second column).
The flag defines the form of the matrix :
flag = -1:flag = 0:flag = 1:flag = -2:
The
paramvector may be stored in either host or device memory, and the location is specified by callingmublasSetPointerMode.
The rotm function applies the modified Givens rotation matrix defined by param to the vectors and . The operation performed is:
Where is one of the four possible matrices defined by the param vector.
function mublasSrotmg
mublasStatus mublasSrotmg(
mublasHandle_t handle,
float * d1,
float * d2,
float * x1,
const float * y1,
float * param
)
function mublasDrotmg
mublasStatus mublasDrotmg(
mublasHandle_t handle,
double * d1,
double * d2,
double * x1,
const double * y1,
double * param
)
BLAS Level 1 API
Parameters
- handle: [mublasHandle_t] Handle to the mublas library context queue.
- d1: Device pointer or host pointer to the input scalar that is overwritten.
- d2: Device pointer or host pointer to the input scalar that is overwritten.
- x1: Device pointer or host pointer to the input scalar that is overwritten.
- y1: Device pointer or host pointer to the input scalar.
- param: Device or host vector of 5 elements defining the rotation:
param[0]: flag (Defines the form of matrix ).param[1]: (Element in the first row, first column).param[2]: (Element in the second row, first column).param[3]: (Element in the first row, second column).param[4]: (Element in the second row, second column).
The flag defines the form of the matrix :
flag = -1:flag = 0:flag = 1:flag = -2:
The param vector may be stored in either host or device memory, and the location is specified by calling mublasSetPointerMode.
The rotmg function creates the modified Givens rotation matrix for the vector . Parameters may be stored in either host or device memory, and the location is specified by calling mublasSetPointerMode.
If the pointer mode is set to MUBLAS_POINTER_MODE_HOST, this function blocks the CPU until the GPU has finished and the results are available in host memory.
If the pointer mode is set to MUBLAS_POINTER_MODE_DEVICE, this function returns immediately, and synchronization is required to read the results.
function mublasSsbmv
mublasStatus mublasSsbmv(
mublasHandle_t handle,
mublasFillMode_t uplo,
mublas_int n,
mublas_int k,
const float * alpha,
const float * A,
mublas_int lda,
const float * x,
mublas_int incx,
const float * beta,
float * y,
mublas_int incy
)
function mublasDsbmv
mublasStatus mublasDsbmv(
mublasHandle_t handle,
mublasFillMode_t uplo,
mublas_int n,
mublas_int k,
const double * alpha,
const double * A,
mublas_int lda,
const double * x,
mublas_int incx,
const double * beta,
double * y,
mublas_int incy
)
BLAS Level 2 API
Parameters
- handle: [mublasHandle_t] Handle to the mublas library context queue.
- uplo: [mublasFillMode_t] Specifies whether the upper (
MUBLAS_FILL_MODE_UPPER) or lower (MUBLAS_FILL_MODE_LOWER) part of is used. IfMUBLAS_FILL_MODE_UPPER, the lower part of is not referenced. IfMUBLAS_FILL_MODE_LOWER, the upper part of is not referenced. - n: [mublas_int] Specifies the order of the symmetric banded matrix (number of rows and columns).
- k: [mublas_int] Specifies the number of sub- and super-diagonals in the symmetric banded matrix .
- alpha: [float] Specifies the scalar .
- A: Pointer to the symmetric banded matrix stored on the GPU.
- lda: [mublas_int] Specifies the leading dimension of the array containing . Must be at least .
- x: Pointer to the vector stored on the GPU.
- incx: [mublas_int] Specifies the increment for the elements of .
- beta: [float] Specifies the scalar .
- y: Pointer to the vector stored on the GPU.
- incy: [mublas_int] Specifies the increment for the elements of .
The sbmv function performs the matrix-vector operation:
where:
- and are scalars,
- and are -element vectors,
- is a symmetric banded matrix of order with sub- and super-diagonals, stored in a compact form as specified by the
ldaparameter.
function mublasCscal
mublasStatus mublasCscal(
mublasHandle_t handle,
mublas_int n,
const muComplex * alpha,
muComplex * x,
mublas_int incx
)
function mublasZscal
mublasStatus mublasZscal(
mublasHandle_t handle,
mublas_int n,
const muDoubleComplex * alpha,
muDoubleComplex * x,
mublas_int incx
)
function mublasCsscal
mublasStatus mublasCsscal(
mublasHandle_t handle,
mublas_int n,
const float * alpha,
muComplex * x,
mublas_int incx
)
function mublasSscal
mublasStatus mublasSscal(
mublasHandle_t handle,
mublas_int n,
const float * alpha,
float * x,
mublas_int incx
)
function mublasDscal
mublasStatus mublasDscal(
mublasHandle_t handle,
mublas_int n,
const double * alpha,
double * x,
mublas_int incx
)
function mublasZscal
mublasStatus mublasZscal(
mublasHandle_t handle,
mublas_int n,
const muDoubleComplex * alpha,
muDoubleComplex * x,
mublas_int incx
)
BLAS Level 1 API
Parameters
- handle [mublasHandle_t]: Handle to the mublas library context queue.
- n [mublas_int]: The number of elements in .
- alpha: Device pointer or host pointer for the scalar .
- x: Device pointer storing vector .
- incx [mublas_int]: Specifies the increment for the elements of .
scal scales each element of vector with scalar :
function mublasSspmv
mublasStatus mublasSspmv(
mublasHandle_t handle,
mublasFillMode_t uplo,
mublas_int n,
const float * alpha,
const float * A,
const float * x,
mublas_int incx,
const float * beta,
float * y,
mublas_int incy
)
function mublasDspmv
mublasStatus mublasDspmv(
mublasHandle_t handle,
mublasFillMode_t uplo,
mublas_int n,
const double * alpha,
const double * A,
const double * x,
mublas_int incx,
const double * beta,
double * y,
mublas_int incy
)
BLAS Level 2 API
Parameters
- handle [mublasHandle_t]: Handle to the mublas library context queue.
- uplo [mublasFillMode_t]: Specifies whether the upper (
MUBLAS_FILL_MODE_UPPER) or lower (MUBLAS_FILL_MODE_LOWER) triangular part of is referenced.- If
MUBLAS_FILL_MODE_UPPER: The lower part of is not referenced. - If
MUBLAS_FILL_MODE_LOWER: The upper part of is not referenced.
- If
- n [mublas_int]: The number of elements in the vectors and .
- alpha: Specifies the scalar .
- A: Pointer storing matrix on the GPU.
- x: Pointer storing vector on the GPU.
- incx [mublas_int]: Specifies the increment for the elements of .
- beta: Specifies the scalar .
- y: Pointer storing vector on the GPU.
- incy [mublas_int]: Specifies the increment for the elements of .
The spmv function performs the matrix-vector operation:
Where and are scalars, and are -element vectors, and is a packed symmetric matrix of size that is either upper or lower triangular.
function mublasSspr
mublasStatus mublasSspr(
mublasHandle_t handle,
mublasFillMode_t uplo,
mublas_int n,
const float * alpha,
const float * x,
mublas_int incx,
float * AP
)
function mublasDspr
mublasStatus mublasDspr(
mublasHandle_t handle,
mublasFillMode_t uplo,
mublas_int n,
const double * alpha,
const double * x,
mublas_int incx,
double * AP
)
BLAS Level 2 API
Parameters
- handle [mublasHandle_t] handle to the mublas library context queue.
- uplo [mublasFillMode_t] specifies whether the upper 'MUBLAS_FILL_MODE_UPPER' or lower 'MUBLAS_FILL_MODE_LOWER':
MUBLAS_FILL_MODE_UPPER: The upper triangular part of is supplied in .MUBLAS_FILL_MODE_LOWER: The lower triangular part of is supplied in .
- n [mublas_int] the number of rows and columns of matrix , must be at least 0.
- alpha device pointer or host pointer to scalar .
- x device pointer storing vector .
- incx [mublas_int] specifies the increment for the elements of .
- AP device pointer storing the packed version of the specified triangular portion of the symmetric matrix , of at least size .
- If
uplo == MUBLAS_FILL_MODE_UPPER, the upper triangular portion of the symmetric matrix is supplied. The matrix is compacted so that contains the triangular portion column-by-column. - If
uplo == MUBLAS_FILL_MODE_LOWER, the lower triangular portion of the symmetric matrix is supplied. The matrix is compacted so that contains the triangular portion column-by-column.
- If
The spr function performs the matrix-vector operation:
Where is a scalar, is a vector, and is an symmetric matrix, supplied in packed form.
function mublasSspr2
mublasStatus mublasSspr2(
mublasHandle_t handle,
mublasFillMode_t uplo,
mublas_int n,
const float * alpha,
const float * x,
mublas_int incx,
const float * y,
mublas_int incy,
float * AP
)
function mublasDspr2
mublasStatus mublasDspr2(
mublasHandle_t handle,
mublasFillMode_t uplo,
mublas_int n,
const double * alpha,
const double * x,
mublas_int incx,
const double * y,
mublas_int incy,
double * AP
)
BLAS Level 2 API
Parameters
- handle [mublasHandle_t] handle to the mublas library context queue.
- uplo [mublasFillMode_t] specifies whether the upper 'MUBLAS_FILL_MODE_UPPER' or lower 'MUBLAS_FILL_MODE_LOWER':
MUBLAS_FILL_MODE_UPPER: The upper triangular part of is supplied in .MUBLAS_FILL_MODE_LOWER: The lower triangular part of is supplied in .
- n [mublas_int] the number of rows and columns of matrix , must be at least 0.
- alpha device pointer or host pointer to scalar .
- x device pointer storing vector .
- incx [mublas_int] specifies the increment for the elements of .
- y device pointer storing vector .
- incy [mublas_int] specifies the increment for the elements of .
- AP device pointer storing the packed version of the specified triangular portion of the symmetric matrix , of at least size .
- If
uplo == MUBLAS_FILL_MODE_UPPER, the upper triangular portion of the symmetric matrix is supplied. The matrix is compacted so that contains the triangular portion column-by-column. - If
uplo == MUBLAS_FILL_MODE_LOWER, the lower triangular portion of the symmetric matrix is supplied. The matrix is compacted so that contains the triangular portion column-by-column.
- If
The spr2 function performs the matrix-vector operation:
Where is a scalar, and are vectors, and is an symmetric matrix, supplied in packed form.
function mublasCswap
mublasStatus mublasCswap(
mublasHandle_t handle,
mublas_int n,
muComplex * x,
mublas_int incx,
muComplex * y,
mublas_int incy
)
BLAS Level 1 API
Parameters
- handle [mublasHandle_t] handle to the mublas library context queue.
- n [mublas_int] the number of elements in and .
- x device pointer storing vector .
- incx [mublas_int] specifies the increment for the elements of .
- y device pointer storing vector .
- incy [mublas_int] specifies the increment for the elements of .
The swap function interchanges vectors and :
function mublasSswap
mublasStatus mublasSswap(
mublasHandle_t handle,
mublas_int n,
float * x,
mublas_int incx,
float * y,
mublas_int incy
)
function mublasDswap
mublasStatus mublasDswap(
mublasHandle_t handle,
mublas_int n,
double * x,
mublas_int incx,
double * y,
mublas_int incy
)
function mublasZswap
mublasStatus mublasZswap(
mublasHandle_t handle,
mublas_int n,
muDoubleComplex * x,
mublas_int incx,
muDoubleComplex * y,
mublas_int incy
)
BLAS Level 1 API
Parameters
- handle [mublasHandle_t] handle to the mublas library context queue.
- n [mublas_int] the number of elements in and .
- x device pointer storing vector .
- incx [mublas_int] specifies the increment for the elements of .
- y device pointer storing vector .
- incy [mublas_int] specifies the increment for the elements of .
The swap function interchanges vectors and :
function mublasSsymm
mublasStatus mublasSsymm(
mublasHandle_t handle,
mublasSideMode_t side,
mublasFillMode_t uplo,
mublas_int m,
mublas_int n,
const float * alpha,
const float * A,
mublas_int lda,
const float * B,
mublas_int ldb,
const float * beta,
float * C,
mublas_int ldc
)
function mublasCsymm
mublasStatus mublasCsymm(
mublasHandle_t handle,
mublasSideMode_t side,
mublasFillMode_t uplo,
mublas_int m,
mublas_int n,
const muComplex * alpha,
const muComplex * A,
mublas_int lda,
const muComplex * B,
mublas_int ldb,
const muComplex * beta,
muComplex * C,
mublas_int ldc
)
function mublasDsymm
mublasStatus mublasDsymm(
mublasHandle_t handle,
mublasSideMode_t side,
mublasFillMode_t uplo,
mublas_int m,
mublas_int n,
const double * alpha,
const double * A,
mublas_int lda,
const double * B,
mublas_int ldb,
const double * beta,
double * C,
mublas_int ldc
)
function mublasZsymm
mublasStatus mublasZsymm(
mublasHandle_t handle,
mublasSideMode_t side,
mublasFillMode_t uplo,
mublas_int m,
mublas_int n,
const muDoubleComplex * alpha,
const muDoubleComplex * A,
mublas_int lda,
const muDoubleComplex * B,
mublas_int ldb,
const muDoubleComplex * beta,
muDoubleComplex * C,
mublas_int ldc
)
BLAS Level 3 API
Parameters
- handle [mublasHandle_t] handle to the mublas library context queue.
- side [mublasSideMode_t]
- MUBLAS_SIDE_LEFT:
- MUBLAS_SIDE_RIGHT:
- uplo [mublasFillMode_t]
- MUBLAS_FILL_MODE_UPPER: is an upper triangular matrix
- MUBLAS_FILL_MODE_LOWER: is a lower triangular matrix
- m [mublas_int] the number of rows of and , .
- n [mublas_int] the number of columns of and , .
- alpha scalar . When is zero, and are not referenced.
- A pointer storing matrix on the GPU. is if
side == MUBLAS_SIDE_LEFT, is ifside == MUBLAS_SIDE_RIGHT; only the upper/lower triangular part is accessed. - lda [mublas_int] specifies the first dimension of . If
side == MUBLAS_SIDE_LEFT, , otherwise . - B pointer storing matrix on the GPU. Matrix dimension is .
- ldb [mublas_int] specifies the first dimension of . .
- beta scalar . When is zero, need not be set before entry.
- C pointer storing matrix on the GPU. Matrix dimension is .
- ldc [mublas_int] specifies the first dimension of . .
The symm function performs one of the matrix-matrix operations:
- if
side == MUBLAS_SIDE_LEFT - if
side == MUBLAS_SIDE_RIGHT
where and are scalars, and are matrices, and is a symmetric matrix stored as either upper or lower triangular.
function mublasSsymmStridedBatched
mublasStatus mublasSsymmStridedBatched(
mublasHandle_t handle,
mublasSideMode_t side,
mublasFillMode_t uplo,
mublas_int m,
mublas_int n,
const float * alpha,
const float * A,
mublas_int lda,
mublas_stride stride_A,
const float * B,
mublas_int ldb,
mublas_stride stride_B,
const float * beta,
float * C,
mublas_int ldc,
mublas_stride stride_C,
mublas_int batch_count
)
function mublasCsymmStridedBatched
mublasStatus mublasCsymmStridedBatched(
mublasHandle_t handle,
mublasSideMode_t side,
mublasFillMode_t uplo,
mublas_int m,
mublas_int n,
const muComplex * alpha,
const muComplex * A,
mublas_int lda,
mublas_stride stride_A,
const muComplex * B,
mublas_int ldb,
mublas_stride stride_B,
const muComplex * beta,
muComplex * C,
mublas_int ldc,
mublas_stride stride_C,
mublas_int batch_count
)
BLAS Level 3 API
Parameters
- handle [mublasHandle_t] handle to the mublas library context queue.
- side [mublasSideMode_t]
- MUBLAS_SIDE_LEFT:
- MUBLAS_SIDE_RIGHT:
- uplo [mublasFillMode_t]
- MUBLAS_FILL_MODE_UPPER: is an upper triangular matrix
- MUBLAS_FILL_MODE_LOWER: is a lower triangular matrix
- m [mublas_int] specifies the number of rows of and , .
- n [mublas_int] specifies the number of columns of and , .
- alpha scalar . When is zero, and are not referenced.
- A device pointer to the first matrix . is if
side == MUBLAS_SIDE_LEFT, is ifside == MUBLAS_SIDE_RIGHT; only the upper/lower triangular part is accessed. - lda [mublas_int] specifies the first dimension of . If
side == MUBLAS_SIDE_LEFT, , otherwise . - stride_A [mublas_stride] stride from the start of one matrix () to the next one ().
- B device pointer to the first matrix of dimension on the GPU.
- ldb [mublas_int] specifies the first dimension of . .
- stride_B [mublas_stride] stride from the start of one matrix () to the next one ().
- beta scalar . When is zero, need not be set before entry.
- C device pointer to the first matrix of dimension on the GPU.
- ldc [mublas_int] specifies the first dimension of . .
- stride_C [mublas_stride] stride from the start of one matrix () to the next one ().
- batch_count [mublas_int] the number of instances in the batch.
The symm_strided_batched function performs a batch of the matrix-matrix operations:
- if
side == MUBLAS_SIDE_LEFT - if
side == MUBLAS_SIDE_RIGHT
where and are scalars, and are matrices, and is a symmetric matrix stored as either upper or lower triangular.
function mublasSsymv
mublasStatus mublasSsymv(
mublasHandle_t handle,
mublasFillMode_t uplo,
mublas_int n,
const float * alpha,
const float * A,
mublas_int lda,
const float * x,
mublas_int incx,
const float * beta,
float * y,
mublas_int incy
)
function mublasDsymv
mublasStatus mublasDsymv(
mublasHandle_t handle,
mublasFillMode_t uplo,
mublas_int n,
const double * alpha,
const double * A,
mublas_int lda,
const double * x,
mublas_int incx,
const double * beta,
double * y,
mublas_int incy
)
BLAS Level 2 API
Parameters
- handle [mublasHandle_t] handle to the mublas library context queue.
- uplo [mublasFillMode_t] specifies whether the upper or lower part of is referenced:
- MUBLAS_FILL_MODE_UPPER: the lower part of is not referenced
- MUBLAS_FILL_MODE_LOWER: the upper part of is not referenced
- n [mublas_int] the number of elements in vector and .
- alpha scalar .
- A pointer storing matrix on the GPU. is an symmetric matrix, stored either as upper or lower triangular.
- lda [mublas_int] specifies the leading dimension of .
- x pointer storing vector on the GPU.
- incx [mublas_int] specifies the increment for the elements of .
- beta scalar .
- y pointer storing vector on the GPU.
- incy [mublas_int] specifies the increment for the elements of .
The symv function performs the matrix-vector operation:
where and are scalars, and are -element vectors, and is a symmetric matrix, stored in either upper or lower triangular form.
function mublasSsyr
mublasStatus mublasSsyr(
mublasHandle_t handle,
mublasFillMode_t uplo,
mublas_int n,
const float * alpha,
const float * x,
mublas_int incx,
float * A,
mublas_int lda
)
function mublasDsyr
mublasStatus mublasDsyr(
mublasHandle_t handle,
mublasFillMode_t uplo,
mublas_int n,
const double * alpha,
const double * x,
mublas_int incx,
double * A,
mublas_int lda
)
BLAS Level 2 API
Parameters
- handle [mublasHandle_t] handle to the mublas library context queue.
- uplo [mublasFillMode_t] specifies whether the upper or lower part of is referenced:
- MUBLAS_FILL_MODE_UPPER: the lower part of is not referenced
- MUBLAS_FILL_MODE_LOWER: the upper part of is not referenced
- n [mublas_int] the number of rows and columns of matrix .
- alpha device pointer or host pointer to scalar .
- x device pointer storing vector .
- incx [mublas_int] specifies the increment for the elements of .
- A device pointer storing matrix .
- lda [mublas_int] specifies the leading dimension of .
The syr function performs the matrix-vector operation:
where is a scalar, is a vector, and is an symmetric matrix.
function mublasSsyr2
mublasStatus mublasSsyr2(
mublasHandle_t handle,
mublasFillMode_t uplo,
mublas_int n,
const float * alpha,
const float * x,
mublas_int incx,
const float * y,
mublas_int incy,
float * A,
mublas_int lda
)
function mublasDsyr2
mublasStatus mublasDsyr2(
mublasHandle_t handle,
mublasFillMode_t uplo,
mublas_int n,
const double * alpha,
const double * x,
mublas_int incx,
const double * y,
mublas_int incy,
double * A,
mublas_int lda
)
BLAS Level 2 API
Parameters
- handle [mublasHandle_t] handle to the mublas library context queue.
- uplo [mublasFillMode_t] specifies whether the upper or lower part of is referenced:
- MUBLAS_FILL_MODE_UPPER: the lower part of is not referenced
- MUBLAS_FILL_MODE_LOWER: the upper part of is not referenced
- n [mublas_int] the number of rows and columns of matrix .
- alpha device pointer or host pointer to scalar .
- x device pointer storing vector .
- incx [mublas_int] specifies the increment for the elements of .
- y device pointer storing vector .
- incy [mublas_int] specifies the increment for the elements of .
- A device pointer storing matrix .
- lda [mublas_int] specifies the leading dimension of .
The syr2 function performs the matrix-vector operation:
where is a scalar, and are vectors, and is an symmetric matrix.
function mublasCsyr2k
mublasStatus mublasCsyr2k(
mublasHandle_t handle,
mublasFillMode_t uplo,
mublasOperation_t trans,
mublas_int n,
mublas_int k,
const muComplex * alpha,
const muComplex * A,
mublas_int lda,
const muComplex * B,
mublas_int ldb,
const muComplex * beta,
muComplex * C,
mublas_int ldc
)
function mublasSsyr2k
mublasStatus mublasSsyr2k(
mublasHandle_t handle,
mublasFillMode_t uplo,
mublasOperation_t trans,
mublas_int n,
mublas_int k,
const float * alpha,
const float * A,
mublas_int lda,
const float * B,
mublas_int ldb,
const float * beta,
float * C,
mublas_int ldc
)
BLAS Level 3 API
Parameters
- handle [mublasHandle_t] handle to the mublas library context queue.
- uplo [mublasFillMode_t] specifies whether matrix is stored as upper or lower triangular:
- MUBLAS_FILL_MODE_UPPER: is an upper triangular matrix
- MUBLAS_FILL_MODE_LOWER: is a lower triangular matrix
- trans [mublasOperation_t] specifies the operation on matrices and :
- = : ,
- = : ,
- n [mublas_int] specifies the number of rows and columns of . .
- k [mublas_int] specifies the number of columns of and . .
- alpha specifies the scalar . When is zero, and are not referenced.
- A pointer to matrix on the GPU. Matrix dimension is if = , otherwise . Only the upper/lower triangular part of is accessed.
- lda [mublas_int] specifies the first dimension of . If = , , otherwise .
- B pointer to matrix on the GPU. Matrix dimension is if = , otherwise . Only the upper/lower triangular part of is accessed.
- ldb [mublas_int] specifies the first dimension of . If = , , otherwise .
- beta specifies the scalar . When is zero, need not be set before entry.
- C pointer to matrix on the GPU.
- ldc [mublas_int] specifies the first dimension of . .
The syr2k function performs the symmetric rank-2k update:
where and are scalars, and are matrices, and is an symmetric matrix stored as either upper or lower triangular.
The operation can be either:
- , when =
- , when =
function mublasCsyrk
mublasStatus mublasCsyrk(
mublasHandle_t handle,
mublasFillMode_t uplo,
mublasOperation_t transA,
mublas_int n,
mublas_int k,
const muComplex * alpha,
const muComplex * A,
mublas_int lda,
const muComplex * beta,
muComplex * C,
mublas_int ldc
)
function mublasSsyrk
mublasStatus mublasSsyrk(
mublasHandle_t handle,
mublasFillMode_t uplo,
mublasOperation_t transA,
mublas_int n,
mublas_int k,
const float * alpha,
const float * A,
mublas_int lda,
const float * beta,
float * C,
mublas_int ldc
)
function mublasDsyrk
mublasStatus mublasDsyrk(
mublasHandle_t handle,
mublasFillMode_t uplo,
mublasOperation_t transA,
mublas_int n,
mublas_int k,
const double * alpha,
const double * A,
mublas_int lda,
const double * beta,
double * C,
mublas_int ldc
)
function mublasZsyrk
mublasStatus mublasZsyrk(
mublasHandle_t handle,
mublasFillMode_t uplo,
mublasOperation_t transA,
mublas_int n,
mublas_int k,
const muDoubleComplex * alpha,
const muDoubleComplex * A,
mublas_int lda,
const muDoubleComplex * beta,
muDoubleComplex * C,
mublas_int ldc
)
BLAS Level 3 API
Parameters
- handle [mublasHandle_t] handle to the mublas library context queue.
- uplo [mublasFillMode_t] specifies whether matrix is stored as upper or lower triangular:
- MUBLAS_FILL_MODE_UPPER: is an upper triangular matrix
- MUBLAS_FILL_MODE_LOWER: is a lower triangular matrix
- transA [mublasOperation_t] specifies the operation on matrix :
- MUBLAS_OP_T:
- MUBLAS_OP_N:
- MUBLAS_OP_C:
- n [mublas_int] specifies the number of rows and columns of . .
- k [mublas_int] specifies the number of columns of . .
- alpha specifies the scalar . When is zero, is not referenced and need not be set before entry.
- A pointer to matrix on the GPU. Matrix dimension is if , otherwise . Only the upper/lower triangular part of is accessed.
- lda [mublas_int] specifies the first dimension of . If , , otherwise .
- beta specifies the scalar . When is zero, need not be set before entry.
- C pointer to matrix on the GPU.
- ldc [mublas_int] specifies the first dimension of . .
The syrk function performs the symmetric rank-k update:
where and are scalars, is an matrix, and is a symmetric matrix stored as either upper or lower triangular.
The operation can be either:
- , and is if
- , and is if
Note: MUBLAS_OP_C is not supported for complex types. See cherk and zherk.
function mublasCsyrkStridedBatched
mublasStatus mublasCsyrkStridedBatched(
mublasHandle_t handle,
mublasFillMode_t uplo,
mublasOperation_t transA,
mublas_int n,
mublas_int k,
const muComplex * alpha,
const muComplex * A,
mublas_int lda,
mublas_stride stride_A,
const muComplex * beta,
muComplex * C,
mublas_int ldc,
mublas_stride stride_C,
mublas_int batch_count
)
function mublasSsyrkStridedBatched
mublasStatus mublasSsyrkStridedBatched(
mublasHandle_t handle,
mublasFillMode_t uplo,
mublasOperation_t transA,
mublas_int n,
mublas_int k,
const float * alpha,
const float * A,
mublas_int lda,
mublas_stride stride_A,
const float * beta,
float * C,
mublas_int ldc,
mublas_stride stride_C,
mublas_int batch_count
)
BLAS Level 3 API
Parameters
- handle [mublasHandle_t] handle to the mublas library context queue.
- uplo [mublasFillMode_t] specifies whether matrix is stored as upper or lower triangular:
- MUBLAS_FILL_MODE_UPPER: is an upper triangular matrix
- MUBLAS_FILL_MODE_LOWER: is a lower triangular matrix
- transA [mublasOperation_t] specifies the operation on matrix :
- MUBLAS_OP_T:
- MUBLAS_OP_N:
- MUBLAS_OP_C:
- n [mublas_int] specifies the number of rows and columns of . .
- k [mublas_int] specifies the number of columns of . .
- alpha specifies the scalar . When is zero, is not referenced and need not be set before entry.
- A pointer to the first matrix on the GPU. The matrix dimension is if = MUBLAS_OP_N, otherwise .
- lda [mublas_int] specifies the first dimension of . If = MUBLAS_OP_N, , otherwise .
- stride_A [mublas_stride] stride from the start of one matrix () and the next one ().
- beta specifies the scalar . When is zero, need not be set before entry.
- C pointer to the first matrix on the GPU.
- ldc [mublas_int] specifies the first dimension of . .
- stride_C [mublas_stride] stride from the start of one matrix () and the next one ().
- batch_count [mublas_int] number of instances in the batch.
The syrk_strided_batched function performs a batch of the matrix-matrix operations for a symmetric rank-k update:
where and are scalars, is an matrix, and is a symmetric matrix stored as either upper or lower triangular.
The operation can be either:
- , and is if
- , and is if
Note:
MUBLAS_OP_Cis not supported for complex types. Seecherkandzherk.
function mublasCsyrkx
mublasStatus mublasCsyrkx(
mublasHandle_t handle,
mublasFillMode_t uplo,
mublasOperation_t trans,
mublas_int n,
mublas_int k,
const muComplex * alpha,
const muComplex * A,
mublas_int lda,
const muComplex * B,
mublas_int ldb,
const muComplex * beta,
muComplex * C,
mublas_int ldc
)
BLAS Level 3 API
Parameters
- handle [mublasHandle_t] handle to the mublas library context queue.
- uplo [mublasFillMode_t] specifies whether matrix is stored as upper or lower triangular:
- MUBLAS_FILL_MODE_UPPER: is an upper triangular matrix
- MUBLAS_FILL_MODE_LOWER: is a lower triangular matrix
- trans [mublasOperation_t] specifies the operation on matrices and :
- MUBLAS_OP_T: ,
- MUBLAS_OP_N: ,
- n [mublas_int] specifies the number of rows and columns of . .
- k [mublas_int] specifies the number of columns of and . .
- alpha specifies the scalar . When is zero, is not referenced and need not be set before entry.
- A pointer to matrix on the GPU. Matrix dimension is if , otherwise .
- lda [mublas_int] specifies the first dimension of . If = MUBLAS_OP_N, , otherwise .
- B pointer to matrix on the GPU. Matrix dimension is if = MUBLAS_OP_N, otherwise .
- ldb [mublas_int] specifies the first dimension of . If = MUBLAS_OP_N, , otherwise .
- beta specifies the scalar . When is zero, need not be set before entry.
- C pointer to matrix on the GPU.
- ldc [mublas_int] specifies the first dimension of . .
The syrkx function performs a matrix-matrix operation for a symmetric rank-k update:
where and are scalars, and are matrices, and is a symmetric matrix stored as either upper or lower triangular.
The operation can be either:
- , , and and are if
- , , and and are if
This routine should only be used when the result of is guaranteed to be symmetric.
function mublasCsyrkxStridedBatched
mublasStatus mublasCsyrkxStridedBatched(
mublasHandle_t handle,
mublasFillMode_t uplo,
mublasOperation_t trans,
mublas_int n,
mublas_int k,
const muComplex * alpha,
const muComplex * A,
mublas_int lda,
mublas_stride stride_A,
const muComplex * B,
mublas_int ldb,
mublas_stride stride_B,
const muComplex * beta,
muComplex * C,
mublas_int ldc,
mublas_stride stride_C,
mublas_int batch_count
)
BLAS Level 3 API
Parameters
- handle [mublasHandle_t] handle to the mublas library context queue.
- uplo [mublasFillMode_t] specifies whether matrix is stored as upper or lower triangular:
- MUBLAS_FILL_MODE_UPPER: is an upper triangular matrix
- MUBLAS_FILL_MODE_LOWER: is a lower triangular matrix
- trans [mublasOperation_t] specifies the operation on matrices and :
- MUBLAS_OP_T: ,
- MUBLAS_OP_N: ,
- n [mublas_int] specifies the number of rows and columns of . .
- k [mublas_int] specifies the number of columns of . .
- alpha specifies the scalar . When is zero, is not referenced and need not be set before entry.
- A pointer to matrix on the GPU. Matrix dimension is if , otherwise .
- lda [mublas_int] specifies the first dimension of . If , , otherwise .
- stride_A [mublas_stride] specifies the stride from the start of one matrix () to the next one ().
- B pointer to matrix on the GPU. Matrix dimension is if , otherwise .
- ldb [mublas_int] specifies the first dimension of . If , , otherwise .
- stride_B [mublas_stride] specifies the stride from the start of one matrix () to the next one ().
- beta specifies the scalar . When is zero, need not be set before entry.
- C pointer to matrix on the GPU.
- ldc [mublas_int] specifies the first dimension of . .
- stride_C [mublas_stride] specifies the stride from the start of one matrix () to the next one ().
- batch_count [mublas_int] specifies the number of instances in the batch.
The syrkx_strided_batched function performs a batch of matrix-matrix operations for a symmetric rank-k update:
where and are scalars, and are matrices, and is a symmetric matrix stored as either upper or lower triangular.
The operation can be either:
- , , and , are if
- , , and , are if
This routine should only be used when the result of is guaranteed to be symmetric.
function mublasStbmv
mublasStatus mublasStbmv(
mublasHandle_t handle,
mublasFillMode_t uplo,
mublasOperation_t trans,
mublasDiagType_t diag,
mublas_int m,
mublas_int k,
const float * A,
mublas_int lda,
float * x,
mublas_int incx
)
function mublasCtbmv
mublasStatus mublasCtbmv(
mublasHandle_t handle,
mublasFillMode_t uplo,
mublasOperation_t trans,
mublasDiagType_t diag,
mublas_int m,
mublas_int k,
const muComplex * A,
mublas_int lda,
muComplex * x,
mublas_int incx
)
function mublasDtbmv
mublasStatus mublasDtbmv(
mublasHandle_t handle,
mublasFillMode_t uplo,
mublasOperation_t trans,
mublasDiagType_t diag,
mublas_int m,
mublas_int k,
const double * A,
mublas_int lda,
double * x,
mublas_int incx
)
function mublasZtbmv
mublasStatus mublasZtbmv(
mublasHandle_t handle,
mublasFillMode_t uplo,
mublasOperation_t trans,
mublasDiagType_t diag,
mublas_int m,
mublas_int k,
const muDoubleComplex * A,
mublas_int lda,
muDoubleComplex * x,
mublas_int incx
)
BLAS Level 2 API
Parameters
- handle [mublasHandle_t] handle to the mublas library context queue.
- uplo [mublasFillMode_t] specifies whether matrix is stored as upper or lower banded triangular:
- MUBLAS_FILL_MODE_UPPER: is an upper banded triangular matrix
- MUBLAS_FILL_MODE_LOWER: is a lower banded triangular matrix
- trans [mublasOperation_t] specifies the operation on matrix :
- MUBLAS_OP_T:
- MUBLAS_OP_N:
- diag [mublasDiagType_t] specifies the type of diagonal of :
- MUBLAS_DIAG_UNIT: The main diagonal of is assumed to consist of only 1's and is not referenced
- MUBLAS_DIAG_NON_UNIT: No assumptions are made about 's main diagonal
- m [mublas_int] specifies the number of rows and columns of the matrix represented by .
- k [mublas_int] specifies the number of diagonals of :
- If , specifies the number of super-diagonals.
- If , specifies the number of sub-diagonals.
- must satisfy and
- A device pointer storing the banded triangular matrix .
- If , represents an upper banded triangular matrix with the main diagonal and super-diagonals.
- If , represents a lower banded triangular matrix with the main diagonal and sub-diagonals.
- lda [mublas_int] specifies the leading dimension of . Must satisfy .
- x device pointer storing the vector .
- incx [mublas_int] specifies the increment for the elements of .
The tbmv function performs one of the following matrix-vector operations:
where is a vector and is a banded matrix.
function mublasStbsv
mublasStatus mublasStbsv(
mublasHandle_t handle,
mublasFillMode_t uplo,
mublasOperation_t transA,
mublasDiagType_t diag,
mublas_int n,
mublas_int k,
const float * A,
mublas_int lda,
float * x,
mublas_int incx
)
function mublasCtbsv
mublasStatus mublasCtbsv(
mublasHandle_t handle,
mublasFillMode_t uplo,
mublasOperation_t transA,
mublasDiagType_t diag,
mublas_int n,
mublas_int k,
const muComplex * A,
mublas_int lda,
muComplex * x,
mublas_int incx
)
function mublasDtbsv
mublasStatus mublasDtbsv(
mublasHandle_t handle,
mublasFillMode_t uplo,
mublasOperation_t transA,
mublasDiagType_t diag,
mublas_int n,
mublas_int k,
const double * A,
mublas_int lda,
double * x,
mublas_int incx
)
function mublasZtbsv
mublasStatus mublasZtbsv(
mublasHandle_t handle,
mublasFillMode_t uplo,
mublasOperation_t transA,
mublasDiagType_t diag,
mublas_int n,
mublas_int k,
const muDoubleComplex * A,
mublas_int lda,
muDoubleComplex * x,
mublas_int incx
)
BLAS Level 2 API
Parameters
- handle [mublasHandle_t] handle to the mublas library context queue.
- uplo [mublasFillMode_t] specifies whether matrix is stored as upper or lower triangular:
- MUBLAS_FILL_MODE_UPPER: is an upper triangular matrix
- MUBLAS_FILL_MODE_LOWER: is a lower triangular matrix
- transA [mublasOperation_t] specifies the operation on matrix :
- MUBLAS_OP_N: Solves
- MUBLAS_OP_T: Solves
- MUBLAS_OP_C: Solves
- diag [mublasDiagType_t] specifies the type of diagonal of :
- MUBLAS_DIAG_UNIT: is assumed to be unit triangular (i.e., the diagonal elements of are not used in computations)
- MUBLAS_DIAG_NON_UNIT: is not assumed to be unit triangular
- n [mublas_int] specifies the number of rows of . .
- k [mublas_int] specifies the number of diagonals of :
- If , specifies the number of super-diagonals of .
- If , specifies the number of sub-diagonals of .
- A device pointer storing the matrix in banded format.
- lda [mublas_int] specifies the leading dimension of . .
- x device pointer storing input vector . Overwritten by the output vector .
- incx [mublas_int] specifies the increment for the elements of .
The tbsv function solves the following systems of equations:
where and are vectors, and is a banded triangular matrix.
function mublasCtpmv
mublasStatus mublasCtpmv(
mublasHandle_t handle,
mublasFillMode_t uplo,
mublasOperation_t transA,
mublasDiagType_t diag,
mublas_int m,
const muComplex * A,
muComplex * x,
mublas_int incx
)
function mublasStpmv
mublasStatus mublasStpmv(
mublasHandle_t handle,
mublasFillMode_t uplo,
mublasOperation_t transA,
mublasDiagType_t diag,
mublas_int m,
const float * A,
float * x,
mublas_int incx
)
function mublasDtpmv
mublasStatus mublasDtpmv(
mublasHandle_t handle,
mublasFillMode_t uplo,
mublasOperation_t transA,
mublasDiagType_t diag,
mublas_int m,
const double * A,
double * x,
mublas_int incx
)
function mublasZtpmv
mublasStatus mublasZtpmv(
mublasHandle_t handle,
mublasFillMode_t uplo,
mublasOperation_t transA,
mublasDiagType_t diag,
mublas_int m,
const muDoubleComplex * A,
muDoubleComplex * x,
mublas_int incx
)
BLAS Level 2 API
Parameters
- handle [mublasHandle_t] handle to the mublas library context queue.
- uplo [mublasFillMode_t] specifies whether matrix is stored as upper or lower triangular:
- MUBLAS_FILL_MODE_UPPER: is an upper triangular matrix
- MUBLAS_FILL_MODE_LOWER: is a lower triangular matrix
- transA [mublasOperation_t] specifies the operation on matrix :
- MUBLAS_OP_N: Solves
- MUBLAS_OP_T: Solves
- diag [mublasDiagType_t] specifies the type of diagonal of :
- MUBLAS_DIAG_UNIT: is assumed to be unit triangular (i.e., the diagonal elements of are not used in computations)
- MUBLAS_DIAG_NON_UNIT: is not assumed to be unit triangular
- m [mublas_int] specifies the number of rows of . .
- A device pointer storing the matrix . The matrix is stored in packed form:
- If , the array contains the upper triangular matrix packed sequentially, column by column.
- If , the array contains the lower triangular matrix packed sequentially, column by column.
- When , the diagonal elements of are not referenced, but are assumed to be unity.
- x device pointer storing vector .
- incx [mublas_int] specifies the increment for the elements of . must not be zero.
The tpmv function performs the following matrix-vector operation:
where is an -element vector, and is an unit or non-unit upper or lower triangular matrix, supplied in packed form.
The vector is overwritten.
function mublasCtpsv
mublasStatus mublasCtpsv(
mublasHandle_t handle,
mublasFillMode_t uplo,
mublasOperation_t transA,
mublasDiagType_t diag,
mublas_int n,
const muComplex * AP,
muComplex * x,
mublas_int incx
)
function mublasStpsv
mublasStatus mublasStpsv(
mublasHandle_t handle,
mublasFillMode_t uplo,
mublasOperation_t transA,
mublasDiagType_t diag,
mublas_int n,
const float * AP,
float * x,
mublas_int incx
)
function mublasDtpsv
mublasStatus mublasDtpsv(
mublasHandle_t handle,
mublasFillMode_t uplo,
mublasOperation_t transA,
mublasDiagType_t diag,
mublas_int n,
const double * AP,
double * x,
mublas_int incx
)
function mublasZtpsv
mublasStatus mublasZtpsv(
mublasHandle_t handle,
mublasFillMode_t uplo,
mublasOperation_t transA,
mublasDiagType_t diag,
mublas_int n,
const muDoubleComplex * AP,
muDoubleComplex * x,
mublas_int incx
)
BLAS Level 2 API
Parameters
- handle [mublasHandle_t] handle to the mublas library context queue.
- uplo [mublasFillMode_t] specifies whether matrix is stored as upper or lower triangular:
- MUBLAS_FILL_MODE_UPPER: is an upper triangular matrix
- MUBLAS_FILL_MODE_LOWER: is a lower triangular matrix
- transA [mublasOperation_t] specifies the operation on matrix :
- MUBLAS_OP_N: Solves
- MUBLAS_OP_T: Solves
- MUBLAS_OP_C: Solves
- diag [mublasDiagType_t] specifies the type of diagonal of :
- MUBLAS_DIAG_UNIT: is assumed to be unit triangular (i.e., the diagonal elements of are not used in computations)
- MUBLAS_DIAG_NON_UNIT: is not assumed to be unit triangular
- n [mublas_int] specifies the number of rows of . .
- AP device pointer storing the packed version of matrix , with dimension .
- x device pointer storing vector on input, overwritten by on output.
- incx [mublas_int] specifies the increment for the elements of .
The tpsv function performs the following matrix-vector operation:
where and are vectors, and is a triangular matrix stored in packed format.
The input vector is overwritten by the output vector .
function mublasCtrmm
mublasStatus mublasCtrmm(
mublasHandle_t handle,
mublasSideMode_t side,
mublasFillMode_t uplo,
mublasOperation_t transA,
mublasDiagType_t diag,
mublas_int m,
mublas_int n,
const muComplex * alpha,
const muComplex * A,
mublas_int lda,
muComplex * B,
mublas_int ldb
)
function mublasStrmm
mublasStatus mublasStrmm(
mublasHandle_t handle,
mublasSideMode_t side,
mublasFillMode_t uplo,
mublasOperation_t transA,
mublasDiagType_t diag,
mublas_int m,
mublas_int n,
const float * alpha,
const float * A,
mublas_int lda,
float * B,
mublas_int ldb
)
function mublasDtrmm
mublasStatus mublasDtrmm(
mublasHandle_t handle,
mublasSideMode_t side,
mublasFillMode_t uplo,
mublasOperation_t transA,
mublasDiagType_t diag,
mublas_int m,
mublas_int n,
const double * alpha,
const double * A,
mublas_int lda,
double * B,
mublas_int ldb
)
function mublasZtrmm
mublasStatus mublasZtrmm(
mublasHandle_t handle,
mublasSideMode_t side,
mublasFillMode_t uplo,
mublasOperation_t transA,
mublasDiagType_t diag,
mublas_int m,
mublas_int n,
const muDoubleComplex * alpha,
const muDoubleComplex * A,
mublas_int lda,
muDoubleComplex * B,
mublas_int ldb
)
BLAS Level 3 API
Parameters
- handle [mublasHandle_t] handle to the mublas library context queue.
- side [mublasSideMode_t] specifies whether op() multiplies from the left or right:
- MUBLAS_SIDE_LEFT:
- MUBLAS_SIDE_RIGHT:
- uplo [mublasFillMode_t] specifies whether matrix is upper or lower triangular:
- MUBLAS_FILL_MODE_UPPER: is an upper triangular matrix
- MUBLAS_FILL_MODE_LOWER: is a lower triangular matrix
- transA [mublasOperation_t] specifies the form of to be used in the matrix multiplication:
- MUBLAS_OP_N:
- MUBLAS_OP_T:
- MUBLAS_OP_C:
- diag [mublasDiagType_t] specifies whether or not is unit triangular:
- MUBLAS_DIAG_UNIT: is assumed to be unit triangular
- MUBLAS_DIAG_NON_UNIT: is not assumed to be unit triangular
- m [mublas_int] specifies the number of rows of . .
- n [mublas_int] specifies the number of columns of . .
- alpha specifies the scalar . When , is not referenced, and need not be set before entry.
- A device pointer to matrix on the GPU. has dimension , where is when and is when .
- lda [mublas_int] specifies the first dimension of . If , , if , .
- B device pointer to the first matrix on the GPU. On entry, the leading part of the array must contain the matrix , and on exit, it is overwritten by the transformed matrix.
- ldb [mublas_int] specifies the first dimension of . .
The trmm function performs one of the matrix-matrix operations:
where is a scalar, is an matrix, is a unit or non-unit upper or lower triangular matrix, and is one of:
- When , the leading upper triangular part of the array must contain the upper triangular matrix, and the strictly lower triangular part of is not referenced. Here, is when and is when .
- When , the leading lower triangular part of the array must contain the lower triangular matrix, and the strictly upper triangular part of is not referenced. Here, is when and is when .
Note that when , the diagonal elements of are not referenced and are assumed to be unity.
function mublasCtrmmStridedBatched
mublasStatus mublasCtrmmStridedBatched(
mublasHandle_t handle,
mublasSideMode_t side,
mublasFillMode_t uplo,
mublasOperation_t transA,
mublasDiagType_t diag,
mublas_int m,
mublas_int n,
const muComplex * alpha,
const muComplex * A,
mublas_int lda,
mublas_stride stride_A,
muComplex * B,
mublas_int ldb,
mublas_stride stride_B,
mublas_int batch_count
)
function mublasStrmmStridedBatched
mublasStatus mublasStrmmStridedBatched(
mublasHandle_t handle,
mublasSideMode_t side,
mublasFillMode_t uplo,
mublasOperation_t transA,
mublasDiagType_t diag,
mublas_int m,
mublas_int n,
const float * alpha,
const float * A,
mublas_int lda,
mublas_stride stride_A,
float * B,
mublas_int ldb,
mublas_stride stride_B,
mublas_int batch_count
)
BLAS Level 3 API
Parameters
- handle [mublasHandle_t] handle to the mublas library context queue.
- side [mublasSideMode_t] specifies whether op() multiplies from the left or right:
- MUBLAS_SIDE_LEFT:
- MUBLAS_SIDE_RIGHT:
- uplo [mublasFillMode_t] specifies whether matrix is upper or lower triangular:
- MUBLAS_FILL_MODE_UPPER: is an upper triangular matrix
- MUBLAS_FILL_MODE_LOWER: is a lower triangular matrix
- transA [mublasOperation_t] specifies the form of to be used in the matrix multiplication:
- MUBLAS_OP_N:
- MUBLAS_OP_T:
- MUBLAS_OP_C:
- diag [mublasDiagType_t] specifies whether or not is unit triangular:
- MUBLAS_DIAG_UNIT: is assumed to be unit triangular
- MUBLAS_DIAG_NON_UNIT: is not assumed to be unit triangular
- m [mublas_int] specifies the number of rows of . .
- n [mublas_int] specifies the number of columns of . .
- alpha specifies the scalar . When , is not referenced, and need not be set before entry.
- A device pointer to the first matrix on the GPU. Each is of dimension , where is when and is when .
- lda [mublas_int] specifies the first dimension of . If , , if , .
- stride_A [mublas_stride] stride from the start of one matrix () to the next one ().
- B device pointer to the first matrix on the GPU. On entry, the leading part of the array must contain the matrix , and on exit, it is overwritten by the transformed matrix.
- ldb [mublas_int] specifies the first dimension of . .
- stride_B [mublas_stride] stride from the start of one matrix () to the next one ().
- batch_count [mublas_int] specifies the number of instances in the batch.
The trmm_strided_batched function performs one of the strided-batched matrix-matrix operations:
where is a scalar, is an matrix, is a unit or non-unit upper or lower triangular matrix, and is one of:
- When , the leading upper triangular part of the array must contain the upper triangular matrix, and the strictly lower triangular part of is not referenced.
- When , the leading lower triangular part of the array must contain the lower triangular matrix, and the strictly upper triangular part of is not referenced.
Note that when , the diagonal elements of are not referenced and are assumed to be unity.
function mublasStrmv
mublasStatus mublasStrmv(
mublasHandle_t handle,
mublasFillMode_t uplo,
mublasOperation_t transA,
mublasDiagType_t diag,
mublas_int m,
const float * A,
mublas_int lda,
float * x,
mublas_int incx
)
function mublasCtrmv
mublasStatus mublasCtrmv(
mublasHandle_t handle,
mublasFillMode_t uplo,
mublasOperation_t transA,
mublasDiagType_t diag,
mublas_int m,
const muComplex * A,
mublas_int lda,
muComplex * x,
mublas_int incx
)
function mublasDtrmv
mublasStatus mublasDtrmv(
mublasHandle_t handle,
mublasFillMode_t uplo,
mublasOperation_t transA,
mublasDiagType_t diag,
mublas_int m,
const double * A,
mublas_int lda,
double * x,
mublas_int incx
)
function mublasZtrmv
mublasStatus mublasZtrmv(
mublasHandle_t handle,
mublasFillMode_t uplo,
mublasOperation_t transA,
mublasDiagType_t diag,
mublas_int m,
const muDoubleComplex * A,
mublas_int lda,
muDoubleComplex * x,
mublas_int incx
)
BLAS Level 2 API
Parameters
- handle [mublasHandle_t] handle to the mublas library context queue.
- uplo [mublasFillMode_t] specifies whether matrix is upper or lower triangular:
- MUBLAS_FILL_MODE_UPPER: is an upper triangular matrix
- MUBLAS_FILL_MODE_LOWER: is a lower triangular matrix
- transA [mublasOperation_t] specifies the form of to be used in the matrix-vector operation:
- MUBLAS_OP_N:
- MUBLAS_OP_T:
- MUBLAS_OP_C:
- diag [mublasDiagType_t] specifies whether or not is unit triangular:
- MUBLAS_DIAG_UNIT: is assumed to be unit triangular
- MUBLAS_DIAG_NON_UNIT: is not assumed to be unit triangular
- m [mublas_int] specifies the number of rows of . .
- A device pointer storing matrix , of dimension .
- lda [mublas_int] specifies the leading dimension of . .
- x device pointer storing vector .
- incx [mublas_int] specifies the increment for the elements of .
trmv performs one of the matrix-vector operations:
where is an -element vector and is an unit, or non-unit, upper or lower triangular matrix.
The vector is overwritten.
function mublasCtrsm
mublasStatus mublasCtrsm(
mublasHandle_t handle,
mublasSideMode_t side,
mublasFillMode_t uplo,
mublasOperation_t transA,
mublasDiagType_t diag,
mublas_int m,
mublas_int n,
const muComplex * alpha,
const muComplex * A,
mublas_int lda,
muComplex * B,
mublas_int ldb
)
function mublasStrsm
mublasStatus mublasStrsm(
mublasHandle_t handle,
mublasSideMode_t side,
mublasFillMode_t uplo,
mublasOperation_t transA,
mublasDiagType_t diag,
mublas_int m,
mublas_int n,
const float * alpha,
const float * A,
mublas_int lda,
float * B,
mublas_int ldb
)
function mublasDtrsm
mublasStatus mublasDtrsm(
mublasHandle_t handle,
mublasSideMode_t side,
mublasFillMode_t uplo,
mublasOperation_t transA,
mublasDiagType_t diag,
mublas_int m,
mublas_int n,
const double * alpha,
const double * A,
mublas_int lda,
double * B,
mublas_int ldb
)
function mublasZtrsm
mublasStatus mublasZtrsm(
mublasHandle_t handle,
mublasSideMode_t side,
mublasFillMode_t uplo,
mublasOperation_t transA,
mublasDiagType_t diag,
mublas_int m,
mublas_int n,
const muDoubleComplex * alpha,
const muDoubleComplex * A,
mublas_int lda,
muDoubleComplex * B,
mublas_int ldb
)
BLAS Level 3 API
Parameters
- handle [mublasHandle_t] handle to the mublas library context queue.
- side [mublasSideMode_t] MUBLAS_SIDE_LEFT: . MUBLAS_SIDE_RIGHT: .
- uplo [mublasFillMode_t] MUBLAS_FILL_MODE_UPPER: is an upper triangular matrix. MUBLAS_FILL_MODE_LOWER: is a lower triangular matrix.
- transA [mublasOperation_t] MUBLAS_OP_N: . MUBLAS_OP_T: . MUBLAS_OP_C: .
- diag [mublasDiagType_t] MUBLAS_DIAG_UNIT: is assumed to be unit triangular. MUBLAS_DIAG_NON_UNIT: is not assumed to be unit triangular.
- m [mublas_int] specifies the number of rows of . .
- n [mublas_int] specifies the number of columns of . .
- alpha device pointer or host pointer specifying the scalar . When is zero then is not referenced and need not be set before entry.
- A device pointer storing matrix , of dimension (, ), where is when MUBLAS_SIDE_LEFT and is when MUBLAS_SIDE_RIGHT. Only the upper/lower triangular part is accessed.
- lda [mublas_int] specifies the first dimension of . If side = MUBLAS_SIDE_LEFT, , if side = MUBLAS_SIDE_RIGHT, .
- B device pointer storing matrix .
- ldb [mublas_int] specifies the first dimension of . .
trsm solves one of the following matrix equations:
where is a scalar, and are matrices, is a triangular matrix and is one of:
The matrix is overwritten on .
Note about memory allocation: When
trsmis launched with a evenly divisible by the internal block size of 128, and is no larger than 10 of these blocks, the API takes advantage of utilizing pre-allocated memory found in the handle to increase overall performance. This memory can be managed by using the environment variableWORKBUF_TRSM_B_CHNK. When this variable is not set, the device memory used for temporary storage will default to 1 MB and may result in chunking, which in turn may reduce performance. Under these circumstances, it is recommended thatWORKBUF_TRSM_B_CHNKbe set to the desired chunk of right-hand sides to be used at a time.
(where is when MUBLAS_SIDE_LEFT and is when MUBLAS_SIDE_RIGHT)
function mublasStrsv
mublasStatus mublasStrsv(
mublasHandle_t handle,
mublasFillMode_t uplo,
mublasOperation_t transA,
mublasDiagType_t diag,
mublas_int m,
const float * A,
mublas_int lda,
float * x,
mublas_int incx
)
function mublasDtrsv
mublasStatus mublasDtrsv(
mublasHandle_t handle,
mublasFillMode_t uplo,
mublasOperation_t transA,
mublasDiagType_t diag,
mublas_int m,
const double * A,
mublas_int lda,
double * x,
mublas_int incx
)
function mublasCtrsv
mublasStatus mublasCtrsv(
mublasHandle_t handle,
mublasFillMode_t uplo,
mublasOperation_t transA,
mublasDiagType_t diag,
mublas_int m,
const muComplex * A,
mublas_int lda,
muComplex * x,
mublas_int incx
)
function mublasZtrsv
mublasStatus mublasZtrsv(
mublasHandle_t handle,
mublasFillMode_t uplo,
mublasOperation_t transA,
mublasDiagType_t diag,
mublas_int m,
const muDoubleComplex * A,
mublas_int lda,
muDoubleComplex * x,
mublas_int incx
)
BLAS Level 2 API
Parameters
- handle [mublasHandle_t] handle to the mublas library context queue.
- uplo [mublasFillMode_t] specifies whether matrix is upper or lower triangular:
- MUBLAS_FILL_MODE_UPPER: is an upper triangular matrix
- MUBLAS_FILL_MODE_LOWER: is a lower triangular matrix
- transA [mublasOperation_t] specifies the form of to be used in the matrix-vector operation:
- MUBLAS_OP_N:
- MUBLAS_OP_T:
- MUBLAS_OP_C:
- diag [mublasDiagType_t] specifies whether or not is unit triangular:
- MUBLAS_DIAG_UNIT: is assumed to be unit triangular
- MUBLAS_DIAG_NON_UNIT: is not assumed to be unit triangular
- m [mublas_int] specifies the number of rows of . .
- A device pointer storing matrix , of dimension .
- lda [mublas_int] specifies the leading dimension of . .
- x device pointer storing vector .
- incx [mublas_int] specifies the increment for the elements of .
trsv solves:
where and are vectors and is a triangular matrix.
The vector is overwritten on .
function mublasSgemvBatched
mublasStatus mublasSgemvBatched(
mublasHandle_t handle,
mublasOperation_t trans,
mublas_int m,
mublas_int n,
const float * alpha,
const float *const A[],
mublas_int lda,
const float *const x[],
mublas_int incx,
const float * beta,
float *const y[],
mublas_int incy,
mublas_int batch_count
)
BLAS Level 2 API
Parameters
- handle [mublasHandle_t] handle to the mublas library context queue.
- trans [mublasOperation_t] indicates whether matrices are transposed (conjugated) or not.
- m [mublas_int] number of rows of each matrix .
- n [mublas_int] number of columns of each matrix .
- alpha device pointer or host pointer to scalar .
- A device array of device pointers storing each matrix .
- lda [mublas_int] specifies the leading dimension of each matrix .
- x device array of device pointers storing each vector .
- incx [mublas_int] specifies the increment for the elements of each vector .
- beta device pointer or host pointer to scalar .
- y device array of device pointers storing each vector .
- incy [mublas_int] specifies the increment for the elements of each vector .
- batch_count [mublas_int] number of instances in the batch.
gemv_batched performs a batch of matrix-vector operations:
where is the -th instance of the batch. and are scalars, and are vectors, and is an matrix, for .
function mublasGetMathMode
mublasStatus mublasGetMathMode(
mublasHandle_t handle,
mublasMathMode_t * math_mode
)
Retrieves the current math mode.
function mublasSetMathMode
mublasStatus mublasSetMathMode(
mublasHandle_t handle,
mublasMathMode_t math_mode
)
Sets the math mode.
function mublasGetVersion
mublasStatus mublasGetVersion(
mublasHandle_t handle,
int * version
)
Retrieves the version number of the muBLAS library.
function mublasCreate
mublasStatus mublasCreate(
mublasHandle_t * handle
)
create handle
function mublasDestroy
mublasStatus mublasDestroy(
mublasHandle_t handle
)
destroy handle
function mublasSetStream
mublasStatus mublasSetStream(
mublasHandle_t handle,
MUstream stream
)
set stream for handle
function mublasGetPointerMode
mublasStatus mublasGetPointerMode(
mublasHandle_t handle,
mublasPointerMode_t * pointer_mode
)
get mublasPointerMode_t
function mublasSetPointerMode
mublasStatus mublasSetPointerMode(
mublasHandle_t handle,
mublasPointerMode_t pointer_mode
)
set mublasPointerMode_t
function mublasGetMatrixAsync
mublasStatus mublasGetMatrixAsync(
mublas_int rows,
mublas_int cols,
mublas_int elem_size,
const void * a,
mublas_int lda,
void * b,
mublas_int ldb,
MUstream stream
)
asynchronously copy matrix from device to host
Parameters
-
rows [mublas_int]
Number of rows in the matrices. -
cols [mublas_int]
Number of columns in the matrices. -
elem_size [mublas_int]
Number of bytes per element in the matrix. -
a
Pointer to the matrix on the GPU. -
lda [mublas_int]
Specifies the leading dimension of , where . -
b
Pointer to the matrix on the host. -
ldb [mublas_int]
Specifies the leading dimension of , where . -
stream
Specifies the stream into which this transfer request is queued.
mublasGetMatrixAsync copies a matrix from device memory to pinned host memory asynchronously.
- Host memory must be allocated with
hipHostMalloc. - If the host memory is not pinned, the transfer will occur synchronously.
function mublasGetError
mublasStatus mublasGetError(
void
)
This function is deprecated.
function mublasGetMatrix
mublasStatus mublasGetMatrix(
mublas_int rows,
mublas_int cols,
mublas_int elem_size,
const void * a,
mublas_int lda,
void * b,
mublas_int ldb
)
copy matrix from device to host
Parameters
-
rows [mublas_int]
Number of rows in the matrices. -
cols [mublas_int]
Number of columns in the matrices. -
elem_size [mublas_int]
Number of bytes per element in the matrix. -
a
Pointer to the matrix on the GPU. -
lda [mublas_int]
Specifies the leading dimension of , where . -
b
Pointer to the matrix on the host. -
ldb [mublas_int]
Specifies the leading dimension of , where .
function mublasShutdown
mublasStatus mublasShutdown(
void
)
This function is deprecated.
function mublasGetVector
mublasStatus mublasGetVector(
mublas_int n,
mublas_int elem_size,
const void * x,
mublas_int incx,
void * y,
mublas_int incy
)
copy vector from device to host
Parameters
-
n [mublas_int]
Number of elements in the vector. -
elem_size [mublas_int]
Number of bytes per element in the vector. -
x
Pointer to the vector on the device. -
incx [mublas_int]
Specifies the increment for the elements of the vector . -
y
Pointer to the vector on the host. -
incy [mublas_int]
Specifies the increment for the elements of the vector .
function mublasGetLoggerCallback
mublasStatus mublasGetLoggerCallback(
mublasLogCallback * userCallback
)
This function retrieves function pointer to previously installed custom user defined callback function via mublasSetLoggerCallback() or zero otherwise.
Parameters
- userCallback Pointer to user defined callback function.
function mublasGetProperty
mublasStatus mublasGetProperty(
libraryPropertyType_t type,
int * value
)
get the value of the requested property
function mublasSetMatrixAsync
mublasStatus mublasSetMatrixAsync(
mublas_int rows,
mublas_int cols,
mublas_int elem_size,
const void * a,
mublas_int lda,
void * b,
mublas_int ldb,
MUstream stream
)
Asynchronously copies a matrix from host to device.
Parameters:
- rows: [mublas_int] Number of rows in matrices.
- cols: [mublas_int] Number of columns in matrices.
- elem_size: [mublas_int] Number of bytes per element in the matrix.
- a: Pointer to matrix on the host.
- lda: [mublas_int] Specifies the leading dimension of , .
- b: Pointer to matrix on the GPU.
- ldb: [mublas_int] Specifies the leading dimension of , .
- stream: Specifies the stream into which this transfer request is queued.
mublasSetMatrixAsync copies a matrix from pinned host memory to device memory asynchronously. Memory on the host must be allocated with hipHostMalloc or the transfer will be synchronous.
function mublasSetMatrix
mublasStatus mublasSetMatrix(
mublas_int rows,
mublas_int cols,
mublas_int elem_size,
const void * a,
mublas_int lda,
void * b,
mublas_int ldb
)
Copies a matrix from host to device.
Parameters
- rows: [mublas_int] Number of rows in matrices.
- cols: [mublas_int] Number of columns in matrices.
- elem_size: [mublas_int] Number of bytes per element in the matrix.
- a: [const void *] Pointer to matrix on the host.
- lda: [mublas_int] Specifies the leading dimension of , .
- b: [void *] Pointer to matrix on the GPU.
- ldb: [mublas_int] Specifies the leading dimension of , .
function mublasGetVectorAsync
mublasStatus mublasGetVectorAsync(
mublas_int n,
mublas_int elem_size,
const void * x,
mublas_int incx,
void * y,
mublas_int incy,
MUstream stream
)
Asynchronously copies a vector from device to host.
Parameters
- n [mublas_int] number of elements in the vector
- elem_size [mublas_int] number of bytes per element in the matrix
- x pointer to vector on the device
- incx [mublas_int] specifies the increment for the elements of the vector
- y pointer to vector on the host
- incy [mublas_int] specifies the increment for the elements of the vector
- stream specifies the stream into which this transfer request is queued
mublasGetVectorAsync copies a vector from pinned host memory to device memory asynchronously. Memory on the host must be allocated with hipHostMalloc or the transfer will be synchronous.
function mublasFree
mublasStatus mublasFree(
void * devicePtr
)
Frees the memory space pointed to by devicePtr.
Parameters
- devicePtr: Pointer to the memory on the device to be freed.
function mublasSetAtomicsMode
mublasStatus mublasSetAtomicsMode(
mublasHandle_t handle,
mublasAtomicsMode_t atomics_mode
)
Sets the atomics mode for the muBLAS library.
function mublasSetVectorAsync
mublasStatus mublasSetVectorAsync(
mublas_int n,
mublas_int elem_size,
const void * x,
mublas_int incx,
void * y,
mublas_int incy,
MUstream stream
)
Asynchronously copies a vector from the host to the device.
Parameters:
- n: [mublas_int] Number of elements in the vector.
- elem_size: [mublas_int] Number of bytes per element in the vector.
- x: Pointer to the vector on the host.
- incx: [mublas_int] Specifies the increment for the elements of the vector on the host.
- y: Pointer to the vector on the device.
- incy: [mublas_int] Specifies the increment for the elements of the vector on the device.
- stream: Specifies the stream into which this transfer request is queued.
The mublasSetVectorAsync function copies a vector from pinned host memory to device memory asynchronously. Host memory must be allocated with hipHostMalloc; otherwise, the transfer will be synchronous.
function mublasGetAtomicsMode
mublasStatus mublasGetAtomicsMode(
mublasHandle_t handle,
mublasAtomicsMode_t * atomics_mode
)
Retrieves the current mublasAtomicsMode_t.
mublasGetmudartVersion
function mublasSetVector
mublasStatus mublasSetVector(
mublas_int n,
mublas_int elem_size,
const void * x,
mublas_int incx,
void * y,
mublas_int incy
)
Copies a vector from host memory to device memory.
Parameters
- n: [mublas_int] Number of elements in the vector.
- elem_size: [mublas_int] Number of bytes per element in the matrix.
- x: Pointer to the vector on the host.
- incx: [mublas_int] Specifies the increment for the elements of the vector.
- y: Pointer to the vector on the device.
- incy: [mublas_int] Specifies the increment for the elements of the vector.
function mublasInit
mublasStatus mublasInit(
void
)
This function is deprecated.
function mublasAlloc
mublasStatus mublasAlloc(
int n,
int elemSize,
void ** devicePtr
)
function mublasSetKernelStream
mublasStatus mublasSetKernelStream(
mublasHandle_t handle,
MUstream stream
)
Sets the stream for the specified handle.
function mublasSetLoggerCallback
mublasStatus mublasSetLoggerCallback(
mublasLogCallback userCallback
)
Installs a custom user-defined callback function via the muBLAS C public API.
Parameters:
- userCallback: Pointer to the user-defined callback function.
function mublasLoggerConfigure
mublasStatus mublasLoggerConfigure(
int logIsOn,
int logToStdOut,
int logToStdErr,
const char * logFileName
)
Configures logging during runtime.
function mublasGemmEx
mublasStatus mublasGemmEx(
mublasHandle_t handle,
mublasOperation_t transA,
mublasOperation_t transB,
mublas_int m,
mublas_int n,
mublas_int k,
const void * alpha,
const void * a,
musaDataType_t a_type,
mublas_int lda,
const void * b,
musaDataType_t b_type,
mublas_int ldb,
const void * beta,
void * c,
musaDataType_t c_type,
mublas_int ldc,
mublasComputeType_t compute_type,
mublasGemmAlgo_t algo
)
static inline mublasStatus mublasGemmEx(
mublasHandle_t handle,
mublasOperation_t transA,
mublasOperation_t transB,
mublas_int m,
mublas_int n,
mublas_int k,
const void * alpha,
const void * a,
musaDataType_t a_type,
mublas_int lda,
const void * b,
musaDataType_t b_type,
mublas_int ldb,
const void * beta,
void * c,
musaDataType_t c_type,
mublas_int ldc,
musaDataType_t compute_type,
mublasGemmAlgo_t algo
)
BLAS EX API
Parameters
- handle: [mublasHandle_t] Handle to the mublas library context queue.
- transA: [mublasOperation_t] Specifies the form of .
- transB: [mublasOperation_t] Specifies the form of .
- m: [mublas_int] Matrix dimension .
- n: [mublas_int] Matrix dimension .
- k: [mublas_int] Matrix dimension .
- alpha: [const void *] Device pointer or host pointer specifying the scalar . Same datatype as compute_type.
- a: [void *] Device pointer storing matrix .
- a_type: [musaDataType_t] Specifies the datatype of matrix .
- lda: [mublas_int] Specifies the leading dimension of .
- b: [void *] Device pointer storing matrix .
- b_type: [musaDataType_t] Specifies the datatype of matrix .
- ldb: [mublas_int] Specifies the leading dimension of .
- beta: [const void *] Device pointer or host pointer specifying the scalar . Same datatype as compute_type.
- c: [void *] Device pointer storing matrix .
- c_type: [musaDataType_t] Specifies the datatype of matrix .
- ldc: [mublas_int] Specifies the leading dimension of .
- compute_type: Specifies the datatype of computation.
- algo: [mublasGemmAlgo_t] Enumerant specifying the algorithm type.
gemm_ex performs one of the matrix-matrix operations:
where is one of:
and and are scalars. , , and are matrices, with being an matrix, a matrix, and an matrix.
Supported types:
| compute_type | a_type / b_type | c_type |
|---|---|---|
MUSA_R_16F or MUBLAS_COMPUTE_16F | MUSA_R_16F | MUSA_R_16F |
MUSA_R_32F or MUBLAS_COMPUTE_32F | MUSA_R_16F | MUSA_R_32F |
MUBLAS_COMPUTE_32F_FAST_TF32 | MUSA_R_32F | MUSA_R_32F |
MUSA_R_16BF or MUBLAS_COMPUTE_32F | MUSA_R_16BF | MUSA_R_16BF |
MUSA_R_32F or MUBLAS_COMPUTE_32F | MUSA_R_32F | MUSA_R_32F |
MUSA_R_64F or MUBLAS_COMPUTE_64F | MUSA_R_64F | MUSA_R_64F |
function mublasGemmStridedBatchedEx
mublasStatus mublasGemmStridedBatchedEx(
mublasHandle_t handle,
mublasOperation_t transa,
mublasOperation_t transb,
mublas_int m,
mublas_int n,
mublas_int k,
const void * alpha,
const void * a,
musaDataType_t a_type,
mublas_int lda,
mublas_stride stride_a,
const void * b,
musaDataType_t b_type,
mublas_int ldb,
mublas_stride stride_b,
const void * beta,
void * c,
musaDataType_t c_type,
mublas_int ldc,
mublas_stride stride_c,
mublas_int batch_count,
mublasComputeType_t compute_type,
mublasGemmAlgo_t algo
)
static inline mublasStatus mublasGemmStridedBatchedEx(
mublasHandle_t handle,
mublasOperation_t transa,
mublasOperation_t transb,
mublas_int m,
mublas_int n,
mublas_int k,
const void * alpha,
const void * a,
musaDataType_t a_type,
mublas_int lda,
mublas_stride stride_a,
const void * b,
musaDataType_t b_type,
mublas_int ldb,
mublas_stride stride_b,
const void * beta,
void * c,
musaDataType_t c_type,
mublas_int ldc,
mublas_stride stride_c,
mublas_int batch_count,
musaDataType_t compute_type,
mublasGemmAlgo_t algo
)