Skip to content

Latest commit

 

History

History
89 lines (65 loc) · 3.58 KB

README.md

File metadata and controls

89 lines (65 loc) · 3.58 KB

hipSPARSE

hipSPARSE is a SPARSE marshalling library with multiple supported backends. It sits between your application and a 'worker' SPARSE library, where it marshals inputs to the backend library and marshals results to your application. hipSPARSE exports an interface that doesn't require the client to change, regardless of the chosen backend. Currently, hipSPARSE supports rocSPARSE and NVIDIA CUDA cuSPARSE backends.

Documentation

Note

The published hipSPARSE documentation is available at https://rocm.docs.amd.com/projects/hipSPARSE/en/latest/ in an organized, easy-to-read format, with search and a table of contents. The documentation source files reside in the hipSPARSE/docs folder of this repository. As with all ROCm projects, the documentation is open source. For more information, see Contribute to ROCm documentation.

To build our documentation locally, run the following code:

cd docs

pip3 install -r sphinx/requirements.txt

python3 -m sphinx -T -E -b html -d _build/doctrees -D language=en . _build/html

Alternatively, build with CMake:

cmake -DBUILD_DOCS=ON ...

Installing pre-built packages

Download pre-built packages from ROCm's package servers using the following code:

`sudo apt update && sudo apt install hipsparse`

Build hipSPARSE

To build hipSPARSE, you can use our bash helper script (for Ubuntu only) or you can perform a manual build (for all supported platforms).

  • Bash helper script (install.sh): This script, which is located in the root of this repository, builds and installs hipSPARSE on Ubuntu with a single command. Note that this option doesn't allow much customization and hard-codes configurations that can be specified through invoking CMake directly. Some commands in the script require sudo access, so it may prompt you for a password.

    `./install -h`  # shows help
    `./install -id` # builds library, dependencies, then installs (the `-d` flag only needs to be passed once on a system)
  • Manual build: If you use a distribution other than Ubuntu, or would like more control over the build process, the hipSPARSE build wiki provides information on how to configure CMake and build hipSPARSE manually.

Supported functions

You can find a list of exported functions on our wiki.

Interface examples

The hipSPARSE interface is compatible with rocSPARSE and CUDA cuSPARSE-v2 APIs. Porting a CUDA application that calls the CUDA cuSPARSE API to an application that calls the hipSPARSE API is relatively straightforward. For example, the hipSPARSE SCSRMV interface is:

CSRMV API

hipsparseStatus_t
hipsparseScsrmv(hipsparseHandle_t handle,
                hipsparseOperation_t transA,
                int m, int n, int nnz, const float *alpha,
                const hipsparseMatDescr_t descrA,
                const float *csrValA,
                const int *csrRowPtrA, const int *csrColIndA,
                const float *x, const float *beta,
                float *y);

hipSPARSE assumes matrix A and vectors x, y are allocated in GPU memory space filled with data. Users are responsible for copying data to and from the host and device memory.