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 .
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 .
Operation
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.
Operation
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.
Operation
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 .
Operation
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.
Operation
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.
Operation
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 param vector may be stored in either host or device memory, and the location is specified by calling mublasSetPointerMode.
Operation
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 input scalar that is overwritten.
- d2 device pointer or host pointer to input scalar that is overwritten.
- x1 device pointer or host pointer to input scalar that is overwritten.
- y1 device pointer or host pointer to input scalar.
- param device vector or host vector of 5 elements defining the rotation. param[0] = flag param[1] = H11 param[2] = H21 param[3] = H12 param[4] = H22 The flag parameter defines the form of H: flag = -1 => H = ( H11 H12 H21 H22 ) flag = 0 => H = ( 1.0 H12 H21 1.0 ) flag = 1 => H = ( H11 1.0 -1.0 H22 ) flag = -2 => H = ( 1.0 0.0 0.0 1.0 ) param may be stored in either host or device memory, location is specified by calling mublasSetPointerMode.
rotmg creates the modified Givens rotation matrix for the vector (d1 * x1, d2 * y1). Parameters may be stored in either host or device memory, 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.
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.
Operation
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 .
Operation
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 x.
- alpha device pointer or host pointer for the scalar alpha.
- x device pointer storing vector x.
- incx [mublas_int] specifies the increment for the elements of x.
Operation
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'. If
MUBLAS_FILL_MODE_UPPER, the lower part of is not referenced. IfMUBLAS_FILL_MODE_LOWER, the upper part of is not referenced. - 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 .
Operation
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
Operation
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
Operation
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 .
Operation
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 .
Operation
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 . .
Operation
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.
Operation
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 .
Operation
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 .
Operation
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 .
Operation
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 :
- 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, 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 . .
Operation
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 trans = \text{MUBLAS_OP_T}
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 . .
Operation
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 transA = \text{MUBLAS_OP_N}
- , and is if transA = \text{MUBLAS_OP_T}
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 , otherwise .
- lda [mublas_int] specifies the first dimension of . If , , 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.
Operation
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 transA = \text{MUBLAS_OP_N}
- , and is if transA = \text{MUBLAS_OP_T}
Note: MUBLAS_OP_C is not supported for complex types. See cherk and zherk.
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 , , otherwise .
- B pointer to matrix on the GPU. Matrix dimension is if , otherwise .
- 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 . .
Operation
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.
Operation
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 .
Operation
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 .
Operation
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.
Operation
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 .
Operation
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
)