- Notifications
You must be signed in to change notification settings - Fork81
ROCm BLAS marshalling library
License
ROCm/hipBLAS
Folders and files
Name | Name | Last commit message | Last commit date | |
---|---|---|---|---|
Repository files navigation
hipBLAS is a Basic Linear Algebra Subprograms (BLAS) marshalling library with multiple supportedbackends. It sits between your application and a 'worker' BLAS library, where it marshals inputs to thebackend library and marshals results to your application. hipBLAS exports an interface that doesn'trequire the client to change, regardless of the chosen backend. Currently, hipBLAS supports rocBLASand cuBLAS backends.
To use hipBLAS, you must first install rocBLAS, rocSPARSE, and rocSOLVER or cuBLAS.
Note
The published hipBLAS documentation is available athipBLAS in an organized, easy-to-read format, with search and a table of contents. The documentation source files reside in the hipBLAS/docs folder of this repository. As with all ROCm projects, the documentation is open source. For more information, seeContribute to ROCm documentation.
To build our documentation locally, use the following code:
cd docspip3 install -r sphinx/requirements.txtpython3 -m sphinx -T -E -b html -d _build/doctrees -D language=en. _build/html
Alternatively, build with CMake:
cmake -DBUILD_DOCS=ON ...
Download the hipBLAS source code (clone this repository):
git clone https://github.com/ROCmSoftwarePlatform/hipBLAS.git
hipBLAS requires specific versions of rocBLAS and rocSOLVER. Refer to [CMakeLists.txt](https://github.com/ROCmSoftwarePlatform/hipBLAS/blob/develop/library/CMakeLists.txt) for details.
Build hipBLAS and install it into
/opt/rocm/hipblas
:cd hipblas ./install.sh -i
The hipBLAS interface is compatible with rocBLAS and cuBLAS-v2 APIs. Porting a CUDA applicationthat originally calls the cuBLAS API to an application that calls the hipBLAS API is relativelystraightforward. For example, the hipBLAS SGEMV interface is:
hipblasStatus_thipblasSgemv(hipblasHandle_thandle,hipblasOperation_ttrans,intm,intn,constfloat*alpha,constfloat*A,intlda,constfloat*x,intincx,constfloat*beta,float*y,intincy );
hipBLAS GEMM can process matrices in batches with regular strides by using the strided-batchedversion of the API:
hipblasStatus_thipblasSgemmStridedBatched(hipblasHandle_thandle,hipblasOperation_ttransa,hipblasOperation_ttransb,intm,intn,intk,constfloat*alpha,constfloat*A,intlda,long longbsa,constfloat*B,intldb,long longbsb,constfloat*beta,float*C,intldc,long longbsc,intbatchCount);
hipBLAS assumes matrix A and vectors x, y are allocated in GPU memory space filled with data. Youare responsible for copying data to and from the host and device memory.
About
ROCm BLAS marshalling library