rocsparse_sparse_to_dense Interface Reference#
Sparse matrix to dense matrix conversion. More...
Public Member Functions | |
| integer(c_int) function | rocsparse_sparse_to_dense_ (handle, mat_a, mat_b, alg, buffer_size, temp_buffer) |
| integer(kind(rocsparse_status_success)) function | rocsparse_sparse_to_dense_typed (handle, mat_a, mat_b, alg, buffer_size, temp_buffer) |
Detailed Description
Sparse matrix to dense matrix conversion.
rocsparse_sparse_to_dense performs the conversion of a sparse matrix in CSR, CSC, or COO format to a dense matrix.
rocsparse_sparse_to_dense requires multiple steps to complete. First, call rocsparse_sparse_to_dense with nullptr passed into temp_buffer:
After this is called, the buffer_size will be filled with the size of the required buffer that must be allocated. Finally, the conversion is completed by calling rocsparse_sparse_to_dense with both the buffer_size and temp_buffer:
Currently, rocsparse_sparse_to_dense only supports the algorithm rocsparse_sparse_to_dense_alg_default. See the full example below.
rocsparse_sparse_to_dense supports rocsparse_datatype_f16_r, rocsparse_datatype_bf16_r, rocsparse_datatype_f32_r, rocsparse_datatype_f64_r, rocsparse_datatype_f32_c, and rocsparse_datatype_f64_c for values arrays in the sparse matrix (stored in CSR, CSC, or COO format) and the dense matrix. For the row/column offset and row/column index arrays of the sparse matrix, rocsparse_sparse_to_dense supports the precisions rocsparse_indextype_i32 and rocsparse_indextype_i64.
- Uniform Precisions:
-
Uniform Precisions A / B rocsparse_datatype_f16_r rocsparse_datatype_bf16_r 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_sizeand returns without performing the sparse to dense operation when NULL is passed fortemp_buffer. - This function is blocking with respect to the host.
- 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_A - sparse matrix descriptor. [in] mat_B - dense matrix descriptor. [in] alg - algorithm for the sparse to dense computation. [out] buffer_size - number of bytes of the temporary storage buffer. buffer_size is set when temp_bufferis 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_sizeand the function returns without performing the sparse to dense operation.
- Return values
-
rocsparse_status_success the operation completed successfully. rocsparse_status_invalid_handle the library context was not initialized. rocsparse_status_invalid_pointer mat_A,mat_B, orbuffer_sizepointer is invalid.
- Example
Member Function/Subroutine Documentation
◆ rocsparse_sparse_to_dense_()
| integer(c_int) function hipfort_rocsparse::rocsparse_sparse_to_dense::rocsparse_sparse_to_dense_ | ( | type(c_ptr), value | handle, |
| type(c_ptr), value | mat_a, | ||
| type(c_ptr), value | mat_b, | ||
| integer(c_int), value | alg, | ||
| type(c_ptr), value | buffer_size, | ||
| type(c_ptr), value | temp_buffer | ||
| ) |
◆ rocsparse_sparse_to_dense_typed()
| integer(kind(rocsparse_status_success)) function hipfort_rocsparse::rocsparse_sparse_to_dense::rocsparse_sparse_to_dense_typed | ( | type(c_ptr), value | handle, |
| type(c_ptr), value | mat_a, | ||
| type(c_ptr), value | mat_b, | ||
| integer(kind(rocsparse_sparse_to_dense_alg_default)) | alg, | ||
| integer(c_size_t), target | buffer_size, | ||
| type(c_ptr), value | temp_buffer | ||
| ) |
The documentation for this interface was generated from the following file: