-
Notifications
You must be signed in to change notification settings - Fork 56
Exported functions
Function name |
---|
rocsparse_create_handle |
rocsparse_destroy_handle |
rocsparse_set_stream |
rocsparse_get_stream |
rocsparse_set_pointer_mode |
rocsparse_get_pointer_mode |
rocsparse_get_version |
rocsparse_create_mat_descr |
rocsparse_copy_mat_descr |
rocsparse_destroy_mat_descr |
rocsparse_set_mat_index_base |
rocsparse_get_mat_index_base |
rocsparse_set_mat_type |
rocsparse_get_mat_type |
rocsparse_set_mat_fill_mode |
rocsparse_get_mat_fill_mode |
rocsparse_set_mat_diag_type |
rocsparse_get_mat_diag_type |
rocsparse_create_hyb_matrix |
rocsparse_destroy_hyb_matrix |
rocsparse_create_mat_info |
rocsparse_destroy_mat_info |
Function | single | double | single complex | double complex | half |
---|---|---|---|---|---|
rocsparse_Xaxpyi | x | x | |||
rocsparse_Xdoti | x | x | |||
rocsparse_Xgthr | x | x | |||
rocsparse_Xgthrz | x | x | |||
rocsparse_Xroti | x | x | |||
rocsparse_Xsctr | x | x |
Function | single | double | single complex | double complex | half |
---|---|---|---|---|---|
rocsparse_Xcoomv | x | x | |||
rocsparse_Xcsrmv_analysis | x | x | |||
rocsparse_csrmv_clear | |||||
rocsparse_Xcsrmv | x | x | |||
rocsparse_Xcsrsv_buffer_size | x | x | |||
rocsparse_Xcsrsv_analysis | x | x | |||
rocsparse_csrsv_zero_pivot | |||||
rocsparse_csrsv_clear | |||||
rocsparse_Xcsrsv_solve | x | x | |||
rocsparse_Xellmv | x | x | |||
rocsparse_Xhybmv | x | x |
Function | single | double | single complex | double complex | half |
---|---|---|---|---|---|
rocsparse_Xcsrmm | x | x |
Function | single | double | single complex | double complex | half |
---|---|---|---|---|---|
rocsparse_Xcsrilu0_buffer_size | x | x | |||
rocsparse_Xcsrilu0_analysis | x | x | |||
rocsparse_csrilu0_zero_pivot | |||||
rocsparse_csrilu0_clear | |||||
rocsparse_Xcsrilu0 | x | x |
Function | single | double | single complex | double complex | half |
---|---|---|---|---|---|
rocsparse_csr2coo | |||||
rocsparse_csr2csc_buffer_size | |||||
rocsparse_Xcsr2csc | x | x | |||
rocsparse_csr2ell_width | |||||
rocsparse_Xcsr2ell | x | x | |||
rocsparse_Xcsr2hyb | x | x | |||
rocsparse_coo2csr | |||||
rocsparse_ell2csr_nnz | |||||
rocsparse_Xell2csr | x | x | |||
rocsparse_create_identity_permutation | |||||
rocsparse_csrsort_buffer_size | |||||
rocsparse_csrsort | |||||
rocsparse_coosort_buffer_size | |||||
rocsparse_coosort_by_row | |||||
rocsparse_coosort_by_column |
-
The rocSPARSE library is LP64, so
rocsparse_int
arguments are 32 bit androcsparse_long
arguments are 64 bit. -
rocSPARSE supports 0 and 1 based indexing. The index base is selected by
rocsparse_index_base
type which is either passed as standalone parameter or part of therocsparse_mat_descr
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
rocsparse_set_pointer
androcsparse_get_pointer
are used to set and get the value of the state variablerocsparse_pointer_mode
. Ifrocsparse_pointer_mode == rocsparse_pointer_mode_host
, then scalar parameters must be allocated on the host. Ifrocsparse_pointer_mode == rocsparse_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
rocsparse_pointer_mode == rocsparse_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. Whenrocsparse_pointer_mode == rocsparse_pointer_mode_device
, the scalar parameter must not be changed till the kernel completes.For scalar results, when
rocsparse_pointer_mode == rocsparse_pointer_mode_host
, then the function blocks the CPU till the GPU has copied the result back to the host. Usingrocsparse_pointer_mode == rocsparse_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.