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.
- x device pointer storing vector x.
- incx [mublas_int] specifies the increment for the elements of y.
- result device pointer or host pointer to store the amax index. return is 0.0 if n,
incx <= 0.
amax finds the first index of the element of maximum magnitude of a vector x. 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_i
- x device array of device pointers storing each vector x_i.
- incx [mublas_int] specifies the increment for the elements of each x_i. incx must be > 0.
- batch_count [mublas_int] number of instances in the batch, must be > 0.
- result device or host array of pointers of batch_count size for results. return is 0 if n,
incx<=0.
amax_batched finds the first index of the element of maximum magnitude of each vector x_i in a batch, for i = 1, ..., batch_count.
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.
- x device pointer storing vector x.
- incx [mublas_int] specifies the increment for the elements of y.
- result device pointer or host pointer to store the amin index. return is 0.0 if n,
incx<=0.
amin finds the first index of the element of minimum magnitude of a vector x.
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_i
- x device array of device pointers storing each vector x_i.
- incx [mublas_int] specifies the increment for the elements of each x_i. incx must be > 0.
- batch_count [mublas_int] number of instances in the batch, must be > 0.
- result device or host pointers to array of batch_count size for results. return is 0 if n,
incx<=0.
amin_batched finds the first index of the element of minimum magnitude of each vector x_i in a batch, for i = 1, ..., batch_count.
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
)
BLAS Level 1 API
Parameters:
- handle [mublasHandle_t] handle to the mublas library context queue.
- n [mublas_int] the number of elements in x and y.
- x device pointer storing vector x.
- incx [mublas_int] specifies the increment for the elements of x. incx must be > 0.
- result device pointer or host pointer to store the asum product. return is 0.0 if
n <= 0.
asum computes the sum of the magnitudes of elements of a real vector x, or the sum of magnitudes of the real and imaginary parts of elements if x is a complex vector
function mublasScasum
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 and y.
- x device pointer storing vector x.
- incx [mublas_int] specifies the increment for the elements of x. incx must be > 0.
- result device pointer or host pointer to store the asum product. return is 0.0 if
n <= 0.
asum computes the sum of the magnitudes of elements of a real vector x, or the sum of magnitudes of the real and imaginary parts of elements if x 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 x and y.
- alpha device pointer or host pointer to specify the scalar alpha.
- x device pointer storing vector x.
- incx [mublas_int] specifies the increment for the elements of x.
- y device pointer storing vector y.
- incy [mublas_int] specifies the increment for the elements of y.
axpy computes constant alpha multiplied by vector x, plus vector y
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 x and y.
- alpha device pointer or host pointer to specify the scalar alpha.
- x device pointer storing vector x.
- incx [mublas_int] specifies the increment for the elements of x.
- y device pointer storing vector y.
- incy [mublas_int] specifies the increment for the elements of y.
axpy computes constant alpha multiplied by vector x, plus vector y
function mublasCcopy
mublasStatus mublasCcopy(
mublasHandle_t handle,
mublas_int n,
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 x to be copied to y.
- x device pointer storing vector x.
- incx [mublas_int] specifies the increment for the elements of x.
- y device pointer storing vector y.
- incy [mublas_int] specifies the increment for the elements of y.
copy copies each element into , for .
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 x to be copied to y.
- x device pointer storing vector x.
- incx [mublas_int] specifies the increment for the elements of x.
- y device pointer storing vector y.
- incy [mublas_int] specifies the increment for the elements of y.
copy copies each element x[i] into y[i], for i = 1 , ... , n
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
)
BLAS Level 1 API
Parameters:
- handle [mublasHandle_t] handle to the mublas library context queue.
- n [mublas_int] the number of elements in x and y.
- x device pointer storing vector x.
- incx [mublas_int] specifies the increment for the elements of x.
- y device pointer storing vector y.
- incy [mublas_int] specifies the increment for the elements of y.
- result device pointer or host pointer to store the dot product. Return is 0.0 if .
dot(u) performs the dot product of vectors x and y:
dotc performs the dot product of the conjugate of complex vector x and complex vector y:
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 x and y.
- x device pointer storing vector x.
- incx [mublas_int] specifies the increment for the elements of x.
- y device pointer storing vector y.
- incy [mublas_int] specifies the increment for the elements of y.
- result device pointer or host pointer to store the dot product. Return is 0.0 if .
dot(u) performs the dot product of vectors x and y:
dotc performs the dot product of the conjugate of complex vector x and complex vector y:
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
)
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 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 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 .
Operation
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.
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 .
Operation
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.
Operation
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.
Operation
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 .
Operation
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 .
Operation
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 .
Operation
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 . .
Operation
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 .
Operation
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 .
Operation
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 .
Operation
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]
MUBLAS_OP_C: ,MUBLAS_OP_N: ,
- 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 .
Operation
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]
MUBLAS_OP_C:MUBLAS_OP_N:
- 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 .
Operation
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]
MUBLAS_FILL_MODE_UPPER: is an upper triangular matrix.MUBLAS_FILL_MODE_LOWER: is a lower triangular matrix.
- transA: [mublasOperation_t]
MUBLAS_OP_C:MUBLAS_OP_N:
- 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.
Operation
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