-
Notifications
You must be signed in to change notification settings - Fork 42
Exported functions
Function name |
---|
hipsparseCreate |
hipsparseDestroy |
hipsparseGetVersion |
hipsparseSetStream |
hipsparseGetStream |
hipsparseSetPointerMode |
hipsparseGetPointerMode |
hipsparseCreateMatDescr |
hipsparseDestroyMatDescr |
hipsparseSetMatIndexBase |
hipsparseGetMatIndexBase |
hipsparseSetMatType |
hipsparseGetMatType |
hipsparseCreateHybMatrix |
hipsparseDestroyHybMatrix |
Function | single | double | single complex | double complex | half |
---|---|---|---|---|---|
hipsparseXaxpyi | x | x | |||
hipsparseXdoti | x | x | |||
hipsparseXgthr | x | x | |||
hipsparseXgthrz | x | x | |||
hipsparseXroti | x | x | |||
hipsparseXsctr | x | x |
Function | single | double | single complex | double complex | half |
---|---|---|---|---|---|
hipsparseXcoomv | x | x | |||
hipsparseXcsrmv | x | x | |||
hipsparseXellmv | x | x | |||
hipsparseXhybmv | x | x |
Function | single | double | single complex | double complex | half |
---|---|---|---|---|---|
hipsparseXcsrmm | x | x | |||
hipsparseXcsrmm2 | x | x |
Function | integer | single | double | single complex | double complex | half |
---|---|---|---|---|---|---|
hipsparseXcsr2coo | x | |||||
hipsparseXcsr2csc | x | x | ||||
hipsparseXcsr2ellWidth | x | |||||
hipsparseXcsr2ell | x | x | ||||
hipsparseXcsr2hyb | x | x | ||||
hipsparseXcoo2csr | x | |||||
hipsparseXell2csrNnz | x | |||||
hipsparseXell2csr | x | x | ||||
hipsparseCreateIdentityPermutation | x | |||||
hipsparseXcsrsort_bufferSizeExt | x | |||||
hipsparseXcsrsort | x | |||||
hipsparseXcoosort_bufferSizeExt | x | |||||
hipsparseXcoosortByRow | x | |||||
hipsparseXcoosortByColumn | x |
-
hipSPARSE supports 0 and 1 based indexing. The index base is selected by
hipsparseIndexBase_t
type, which is either passed as standalone parameter or part of thehipsparseMatDescr_t
type. -
Dense vectors are represented with a 1D array stored linearly in memory.
-
Sparse vectors are represented with a 1D data array stored linearly in memory that holds all non-zero elements and a 1D indexing array stored linearly in memory that holds the positions of the corresponding non-zero elements.
-
The auxiliary functions
hipsparseSetPointer
andhipsparseGetPointer
are used to set and get the value of the state variablehipsparsePointerMode_t
. IfhipsparsePointerMode_t == HIPSPARSE_POINTER_MODE_HOST
, then scalar parameters must be allocated on the host. IfhipsparsePointerMode_t == HIPSPARSE_POINTER_MODE_DEVICE
, then scalar parameters must be allocated on the device.There are two types of scalar parameter:
- Scaling parameters, such as alpha and beta used in e.g. csrmv, coomv, ...
- Scalar results from functions such as doti, dotci, ...
For scalar parameters such as alpha and beta, memory can be allocated on the host heap or stack, when
hipsparsePointerMode_t == HIPSPARSE_POINTER_MODE_HOST
. The kernel launch is asynchronous, and if the scalar parameter is on the heap, it can be freed after the return from the kernel launch. WhenhipsparsePointerMode_t == HIPSPARSE_POINTER_MODE_DEVICE
, the scalar parameter must not be changed till the kernel completes.For scalar results, when
hipsparsePointerMode_t == HIPSPARSE_POINTER_MODE_HOST
, then the function blocks the CPU till the GPU has copied the result back to the host. UsinghipsparsePointerMode_t == HIPSPARSE_POINTER_MODE_DEVICE
, the function will return after the asynchronous launch. Similarly to vector and matrix results, the scalar result is only available when the kernel has completed execution.