muBLAS API Reference
mublas-auxiliary.h provides auxilary functions in mublas
Types Documentation
typedef mublasLogCallback
typedef void(* mublasLogCallback) (const char *msg);
Functions Documentation
function mublasCreate
mublasStatus mublasCreate(
mublasHandle_t * handle
)
create handle
function mublasDestroy
mublasStatus mublasDestroy(
mublasHandle_t handle
)
destroy handle
function mublasGetProperty
mublasStatus mublasGetProperty(
libraryPropertyType_t type,
int * value
)
get the value of the requested property
function mublasSetStream
mublasStatus mublasSetStream(
mublasHandle_t handle,
MUstream stream
)
set stream for handle
function mublasSetKernelStream
mublasStatus mublasSetKernelStream(
mublasHandle_t handle,
MUstream stream
)
set stream for handle
function mublasGetStream
mublasStatus mublasGetStream(
mublasHandle_t handle,
MUstream * stream
)
get stream [0] from handle
function mublasLoggerConfigure
mublasStatus mublasLoggerConfigure(
int logIsOn,
int logToStdOut,
int logToStdErr,
const char * logFileName
)
configures logging during runtime
function mublasSetPointerMode
mublasStatus mublasSetPointerMode(
mublasHandle_t handle,
mublasPointerMode_t pointer_mode
)
set mublasPointerMode_t
function mublasGetPointerMode
mublasStatus mublasGetPointerMode(
mublasHandle_t handle,
mublasPointerMode_t * pointer_mode
)
get mublasPointerMode_t
function mublasSetMathMode
mublasStatus mublasSetMathMode(
mublasHandle_t handle,
mublasMathMode_t math_mode
)
set mublasMathMode_t
function mublasGetMathMode
mublasStatus mublasGetMathMode(
mublasHandle_t handle,
mublasMathMode_t * math_mode
)
get mublasMathMode_t
function mublasGetVersion
mublasStatus mublasGetVersion(
mublasHandle_t handle,
int * version
)
get mublasVersion
function mublasSetAtomicsMode
mublasStatus mublasSetAtomicsMode(
mublasHandle_t handle,
mublasAtomicsMode_t atomics_mode
)
set mublasAtomicsMode_t
function mublasGetAtomicsMode
mublasStatus mublasGetAtomicsMode(
mublasHandle_t handle,
mublasAtomicsMode_t * atomics_mode
)
get mublasAtomicsMode_t
function mublas_query_int8_layout_flag
mublasStatus mublas_query_int8_layout_flag(
mublasHandle_t handle,
mublas_gemm_flags * flag
)
query the preferable supported int8 input layout for gemm
Parameters:
- handle [mublasHandle_t] the handle of device
- flag pointer to mublas_gemm_flags
Indicates the supported int8 input layout for gemm according to the device. If the device supports packed-int8x4 (1) only, output flag is MUBLAS_GEMM_FLAGS_PACK_INT8x4 and users must bitwise-or your flag with MUBLAS_GEMM_FLAGS_PACK_INT8x4. If output flag is MUBLAS_GEMM_FLAGS_NONE (0), then unpacked int8 is preferable and suggested.
function mublas_pointer_to_mode
mublasPointerMode_t mublas_pointer_to_mode(
void * ptr
)
Indicates whether the pointer is on the host or device.
function mublasSetVector
mublasStatus mublasSetVector(
mublas_int n,
mublas_int elem_size,
const void * x,
mublas_int incx,
void * y,
mublas_int incy
)
copy vector from host to device
Parameters:
- n [mublas_int] number of elements in the vector
- elem_size [mublas_int] number of bytes per element in the matrix
- x pointer to vector on the host
- incx [mublas_int] specifies the increment for the elements of the vector
- y pointer to vector on the device
- incy [mublas_int] specifies the increment for the elements of the vector
function mublasGetVector
mublasStatus mublasGetVector(
mublas_int n,
mublas_int elem_size,
const void * x,
mublas_int incx,
void * y,
mublas_int incy
)
copy vector from device to host
Parameters:
- n [mublas_int] number of elements in the vector
- elem_size [mublas_int] number of bytes per element in the matrix
- x pointer to vector on the device
- incx [mublas_int] specifies the increment for the elements of the vector
- y pointer to vector on the host
- incy [mublas_int] specifies the increment for the elements of the vector
function mublasSetMatrix
mublasStatus mublasSetMatrix(
mublas_int rows,
mublas_int cols,
mublas_int elem_size,
const void * a,
mublas_int lda,
void * b,
mublas_int ldb
)
copy matrix from host to device
Parameters:
- rows [mublas_int] number of rows in matrices
- cols [mublas_int] number of columns in matrices
- elem_size [mublas_int] number of bytes per element in the matrix
- a pointer to matrix on the host
- lda [mublas_int] specifies the leading dimension of A, lda >= rows
- b pointer to matrix on the GPU
- ldb [mublas_int] specifies the leading dimension of B, ldb >= rows
function mublasGetMatrix
mublasStatus mublasGetMatrix(
mublas_int rows,
mublas_int cols,
mublas_int elem_size,
const void * a,
mublas_int lda,
void * b,
mublas_int ldb
)
copy matrix from device to host
Parameters:
- rows [mublas_int] number of rows in matrices
- cols [mublas_int] number of columns in matrices
- elem_size [mublas_int] number of bytes per element in the matrix
- a pointer to matrix on the GPU
- lda [mublas_int] specifies the leading dimension of A, lda >= rows
- b pointer to matrix on the host
- ldb [mublas_int] specifies the leading dimension of B, ldb >= rows
function mublasSetVectorAsync
mublasStatus mublasSetVectorAsync(
mublas_int n,
mublas_int elem_size,
const void * x,
mublas_int incx,
void * y,
mublas_int incy,
MUstream stream
)
asynchronously copy vector from host to device
Parameters:
- n [mublas_int] number of elements in the vector
- elem_size [mublas_int] number of bytes per element in the matrix
- x pointer to vector on the host
- incx [mublas_int] specifies the increment for the elements of the vector
- y pointer to vector on the device
- incy [mublas_int] specifies the increment for the elements of the vector
- stream specifies the stream into which this transfer request is queued
mublasSetVectorAsync copies a vector from pinned host memory to device memory asynchronously. Memory on the host must be allocated with hipHostMalloc or the transfer will be synchronous.
function mublasGetVectorAsync
mublasStatus mublasGetVectorAsync(
mublas_int n,
mublas_int elem_size,
const void * x,
mublas_int incx,
void * y,
mublas_int incy,
MUstream stream
)
asynchronously copy vector from device to host
Parameters:
- n [mublas_int] number of elements in the vector
- elem_size [mublas_int] number of bytes per element in the matrix
- x pointer to vector on the device
- incx [mublas_int] specifies the increment for the elements of the vector
- y pointer to vector on the host
- incy [mublas_int] specifies the increment for the elements of the vector
- stream specifies the stream into which this transfer request is queued
mublasGetVectorAsync copies a vector from pinned host memory to device memory asynchronously. Memory on the host must be allocated with hipHostMalloc or the transfer will be synchronous.
function mublasSetMatrixAsync
mublasStatus mublasSetMatrixAsync(
mublas_int rows,
mublas_int cols,
mublas_int elem_size,
const void * a,
mublas_int lda,
void * b,
mublas_int ldb,
MUstream stream
)
asynchronously copy matrix from host to device
Parameters:
- rows [mublas_int] number of rows in matrices
- cols [mublas_int] number of columns in matrices
- elem_size [mublas_int] number of bytes per element in the matrix
- a pointer to matrix on the host
- lda [mublas_int] specifies the leading dimension of A, lda >= rows
- b pointer to matrix on the GPU
- ldb [mublas_int] specifies the leading dimension of B, ldb >= rows
- stream specifies the stream into which this transfer request is queued
mublasSetMatrixAsync copies a matrix from pinned host memory to device memory asynchronously. Memory on the host must be allocated with hipHostMalloc or the transfer will be synchronous.
function mublasGetMatrixAsync
mublasStatus mublasGetMatrixAsync(
mublas_int rows,
mublas_int cols,
mublas_int elem_size,
const void * a,
mublas_int lda,
void * b,
mublas_int ldb,
MUstream stream
)
asynchronously copy matrix from device to host
Parameters:
- rows [mublas_int] number of rows in matrices
- cols [mublas_int] number of columns in matrices
- elem_size [mublas_int] number of bytes per element in the matrix
- a pointer to matrix on the GPU
- lda [mublas_int] specifies the leading dimension of A, lda >= rows
- b pointer to matrix on the host
- ldb [mublas_int] specifies the leading dimension of B, ldb >= rows
- stream specifies the stream into which this transfer request is queued
mublasGetMatrixAsync copies a matrix from device memory to pinned host memory asynchronously. Memory on the host must be allocated with hipHostMalloc or the transfer will be synchronous.
function mublas_set_start_stop_events
mublasStatus mublas_set_start_stop_events(
mublasHandle_t handle,
MUevent startEvent,
MUevent stopEvent
)
function mublas_set_solution_fitness_query
mublasStatus mublas_set_solution_fitness_query(
mublasHandle_t handle,
double * fitness
)