aoclsparse_copy() - 5.2 English - 68552

AOCL API Guide (68552)

Document ID
68552
Release Date
2025-12-29
Version
5.2 English
aoclsparse_status aoclsparse_copy(const aoclsparse_matrix src, const aoclsparse_mat_descr descr, aoclsparse_matrix *dest)#

Creates a copy of source aoclsparse_matrix.

aoclsparse_copy creates a deep copy of source aoclsparse_matrix (hints and optimized data are not copied). Matrix should be destroyed using aoclsparse_destroy(). aoclsparse_convert_csr() can also be used to create a copy of the source matrix while converting it in CSR format.

Parameters:
  • src[in] the source aoclsparse_matrix to copy.

  • descr[in] the source matrix descriptor, this argument is reserved for future releases and it will not be referenced.

  • dest[out] pointer to the newly allocated copied aoclsparse_matrix.

Return values:
  • aoclsparse_status_success – the operation completed successfully.

  • aoclsparse_status_invalid_pointersrc, dest or internal pointers are invalid. or dest points to src.

  • aoclsparse_status_memory_error – memory allocation for matrix failed.

  • aoclsparse_status_invalid_valuesrc matrix type is invalid.

  • aoclsparse_status_wrong_typesrc matrix data type is invalid.