rocsparse_check_spmat Interface Reference

rocsparse_check_spmat Interface Reference#

HIPFORT API Reference: hipfort_rocsparse::rocsparse_check_spmat Interface Reference
hipfort_rocsparse::rocsparse_check_spmat Interface Reference

Check matrix to see if it is valid. More...

Public Member Functions

integer(kind(rocsparse_status_success)) function rocsparse_check_spmat_ (handle, mat, data_status, stage, buffer_size, temp_buffer)
 

Detailed Description

Check matrix to see if it is valid.

rocsparse_check_spmat checks whether the input matrix is valid.

rocsparse_check_spmat requires two steps to complete. First, call rocsparse_check_spmat with the stage parameter set to rocsparse_check_spmat_stage_buffer_size, which determines the size of the temporary buffer needed in the second step. Allocate this buffer and call rocsparse_check_spmat with the stage parameter set to rocsparse_check_spmat_stage_compute, which checks the input matrix for errors. Any detected errors in the input matrix are reported in the data_status (passed to the function as a host pointer).

Uniform Precisions:
Uniform Precisions
A
rocsparse_datatype_f32_r
rocsparse_datatype_f64_r
rocsparse_datatype_f32_c
rocsparse_datatype_f64_c
Note
This function writes the required allocation size (in bytes) to buffer_size and returns without performing the checking operation when stage is equal to rocsparse_check_spmat_stage_buffer_size.
The sparse matrix formats currently supported are: rocsparse_format_coo, rocsparse_format_csr, rocsparse_format_csc, rocsparse_format_ell, and rocsparse_format_bsr.
check_spmat requires two stages to complete. The first stage rocsparse_check_spmat_stage_buffer_size will return the size of the temporary storage buffer that is required for subsequent calls to rocsparse_check_spmat. In the final stage rocsparse_check_spmat_stage_compute, the actual computation is performed.
This routine does not support execution in a hipGraph context.
This routine does not support batched computation.
Parameters
[in]handle- handle to the rocSPARSE library context queue.
[in]mat- matrix descriptor.
[out]data_status- modified to indicate the status of the data.
[in]stage- check_matrix stage for the matrix computation.
[out]buffer_size- number of bytes of the temporary storage buffer. buffer_size is set when temp_buffer is nullptr.
[in]temp_buffer- temporary storage buffer allocated by the user. When a nullptr is passed, the required allocation size (in bytes) is written to buffer_size and function returns without performing the checking operation.
Return values
rocsparse_status_successthe operation completed successfully.
rocsparse_status_invalid_handlethe library context was not initialized.
rocsparse_status_invalid_pointermat, buffer_size, temp_buffer, or data_status pointer is invalid.
rocsparse_status_invalid_valuethe value of stage is incorrect.
Example
This example checks whether a matrix is upper triangular. The matrix passed to rocsparse_check_spmat is invalid because it contains an entry in the lower triangular part of the matrix.

Member Function/Subroutine Documentation

◆ rocsparse_check_spmat_()

integer(kind(rocsparse_status_success)) function hipfort_rocsparse::rocsparse_check_spmat::rocsparse_check_spmat_ ( type(c_ptr), value  handle,
type(c_ptr), value  mat,
type(c_ptr), value  data_status,
integer(kind(rocsparse_check_spmat_stage_buffer_size)), value  stage,
integer(c_size_t)  buffer_size,
type(c_ptr), value  temp_buffer 
)

The documentation for this interface was generated from the following file: