-
Notifications
You must be signed in to change notification settings - Fork 173
Home
- For instructions to build rocblas library and clients, see Build rocBLAS libraries and verification code.
- For an example using rocBLAS see Example C code calling rocBLAS function.
- For instructions on how to run/use the client code, see Running.
rocBLAS exports the following BLAS-like functions at this time.
-
The Legacy BLAS routine name is changed to lower case, and prefixed by rocblas_.
-
A first argument rocblas_handle handle is added to all rocBlas functions.
-
Input arguments are declared with the const modifier.
-
Character arguments are replaced with enumerated types defined in rocblas_types.h. They are passed by value on the host.
-
Array arguments are passed by reference on the device.
-
Scalar arguments are passed by value on the host with the following two exceptions:
-
Scalar values alpha and beta are passed by reference on either the host or the device. The rocBLAS functions will check to see it the value is on the device. If this is true, it is used, else the value on the host is used.
-
Where Legacy BLAS functions have return values, the return value is instead added as the last function argument. It is returned by reference on either the host or the device. The rocBLAS functions will check to see it the value is on the device. If this is true, it is used, else the value is returned on the host. This applies to the following functions: xDOT, xDOTU, xNRM2, xASUM, IxAMAX, IxAMIN.
- The return value of all functions is rocblas_status, defined in rocblas_types.h. It is used to check for errors.
-
The rocBLAS library is LP64, so rocblas_int arguments are 32 bit and rocblas_long arguments are 64 bit.
-
rocBLAS uses column-major storage for 2D arrays, and 1 based indexing for the functions xMAX and xMIN. This is the same as Legacy BLAS and cuBLAS. If you need row-major and 0 based indexing (used in C language arrays) download the CBLAS file cblas.tgz. Look at the CBLAS functions that provide a thin interface to Legacy BLAS. They convert from row-major, 0 based, to column-major, 1 based. This is done by swapping the order of function arguments. It is not necessary to transpose matrices.
-
The auxiliary functions rocblas_set_pointer and rocblas_get_pointer are used to set and get the value of the state variable rocblas_pointer_mode. This variable is not used, it is added for compatibility with cuBLAS. rocBLAS will check if your scalar argument passed by reference is on the device. If this is true it will pass by reference on the device, else it passes by reference on the host.