ROCm / hipSPARSE

ROCm SPARSE marshalling library
https://rocm.docs.amd.com/projects/hipSPARSE/en/latest/
MIT License
66 stars 41 forks source link

[5.7.0] Probably typo in `hipsparseCcsrilu02_numericBoost` implementation #397

Closed emankov closed 1 year ago

emankov commented 1 year ago

Shouldn't rocsparse_ccsrilu0_numeric_boost be called from hipsparseCcsrilu02_numericBoost instead of rocsparse_dccsrilu0_numeric_boost?

hipsparseStatus_t hipsparseCcsrilu02_numericBoost(hipsparseHandle_t handle,
                                                  csrilu02Info_t    info,
                                                  int               enable_boost,
                                                  double*           tol,
                                                  hipComplex*       boost_val)
{
    return rocSPARSEStatusToHIPStatus(
        rocsparse_dccsrilu0_numeric_boost((rocsparse_handle)handle, // <== rocsparse_ccsrilu0_numeric_boost ?
                                          (rocsparse_mat_info)info,
                                          enable_boost,
                                          tol,
                                          (rocsparse_float_complex*)boost_val));
}
YvanMokwinski commented 1 year ago

Hello, I don't think this is a typo. It is calling rocsparse_DCcsriliu0_numeric_boost, D relates to the type of the parameter 'tol' and C for the type of the parameter 'boost_val', I don't see anything wrong here. Calling rocsparse_ccsrilu0 would cause a problem with the parameter 'tol'.

Hope this clarifies the code.

emankov commented 1 year ago

Aha, you are right. And it looks like rocsparse_ccsrilu0_numeric_boost doesn't have representation in cuSPARSE at all.

rocsparse_status rocsparse_ccsrilu0_numeric_boost(rocsparse_handle               handle,
                                                  rocsparse_mat_info             info,
                                                  int                            enable_boost,
                                                  const float*                   boost_tol,
                                                  const rocsparse_float_complex* boost_val);
cusparseStatus_t CUSPARSEAPI
cusparseCcsrilu02_numericBoost(cusparseHandle_t handle,
                               csrilu02Info_t   info,
                               int              enable_boost,
                               double*          tol,
                               cuComplex*       boost_val);