hipsparsesgthrz Interface Reference#
hipfort_hipsparse::hipsparsesgthrz Interface Reference
Gather and zero out elements from a dense vector and store them in a sparse vector. More...
Public Member Functions | |
| integer(kind(hipsparse_status_success)) function | hipsparsesgthrz_ (handle, nnz, y, xval, xind, idxbase) |
| integer(kind(hipsparse_status_success)) function | hipsparsesgthrz_rank_0 (handle, nnz, y, xval, xind, idxbase) |
| integer(kind(hipsparse_status_success)) function | hipsparsesgthrz_rank_1 (handle, nnz, y, xval, xind, idxbase) |
Detailed Description
Gather and zero out elements from a dense vector and store them in a sparse vector.
hipsparseXgthrz gathers the elements that are listed in xInd from the dense vector \(y\) and stores them in the sparse vector \(x\). The gathered elements in \(y\) are replaced by zero.
for(i = 0; i < nnz; ++i)
{
xVal[i] = y[xInd[i]];
y[xInd[i]] = 0;
}
- Note
- This function is non-blocking and executed asynchronously with respect to the host. It can return before the actual computation has finished.
-
If
nnzis zero, the function returns successfully without modifyingxValory.
- Deprecated:
- This function is deprecated when using the CUDA backend (CUDA 11.0+) and will be removed in CUDA 12.0. This deprecation does not apply to the ROCm backend.
- Parameters
-
[in] handle - handle to the hipSPARSE library context queue. [in] nnz - number of non-zero entries of \(x\). Must be non-negative. [in,out] y - array of values in dense format. Must be pre-allocated with sufficient size to accommodate all indices specified in xInd. Gathered elements are set to zero.[out] xVal - array of nnzelements that will contain the gathered values of \(x\).[in] xInd - array of nnzelements containing the indices of the non-zero values of \(x\).[in] idxBase - index base. HIPSPARSE_INDEX_BASE_ZEROfor zero-based indexing orHIPSPARSE_INDEX_BASE_ONEfor one-based indexing.
- Return values
-
HIPSPARSE_STATUS_SUCCESS the operation completed successfully. HIPSPARSE_STATUS_NOT_INITIALIZED handleis not initialized.HIPSPARSE_STATUS_INVALID_VALUE handleis nullptr,nnzis negative,y,xVal, orxIndis nullptr whennnzis greater than zero, oridxBaseis neitherHIPSPARSE_INDEX_BASE_ZEROnorHIPSPARSE_INDEX_BASE_ONE.
Member Function/Subroutine Documentation
◆ hipsparsesgthrz_()
| integer(kind(hipsparse_status_success)) function hipfort_hipsparse::hipsparsesgthrz::hipsparsesgthrz_ | ( | type(c_ptr), value | handle, |
| integer(c_int), value | nnz, | ||
| type(c_ptr), value | y, | ||
| type(c_ptr), value | xval, | ||
| type(c_ptr), value | xind, | ||
| integer(kind(hipsparse_index_base_zero)), value | idxbase | ||
| ) |
◆ hipsparsesgthrz_rank_0()
| integer(kind(hipsparse_status_success)) function hipfort_hipsparse::hipsparsesgthrz::hipsparsesgthrz_rank_0 | ( | type(c_ptr) | handle, |
| integer(c_int) | nnz, | ||
| real(c_float), target | y, | ||
| real(c_float), target | xval, | ||
| integer(c_int), target | xind, | ||
| integer(kind(hipsparse_index_base_zero)) | idxbase | ||
| ) |
◆ hipsparsesgthrz_rank_1()
| integer(kind(hipsparse_status_success)) function hipfort_hipsparse::hipsparsesgthrz::hipsparsesgthrz_rank_1 | ( | type(c_ptr) | handle, |
| integer(c_int) | nnz, | ||
| real(c_float), dimension(:), target | y, | ||
| real(c_float), dimension(:), target | xval, | ||
| integer(c_int), dimension(:), target | xind, | ||
| integer(kind(hipsparse_index_base_zero)) | idxbase | ||
| ) |
The documentation for this interface was generated from the following file: