diff --git a/bin/hipify-perl b/bin/hipify-perl index 66b4024a..e2a557f3 100755 --- a/bin/hipify-perl +++ b/bin/hipify-perl @@ -1674,6 +1674,7 @@ sub rocSubstitutions { subst("cusparseAxpby", "rocsparse_axpby", "library"); subst("cusparseBlockedEllGet", "rocsparse_bell_get", "library"); subst("cusparseCbsr2csr", "rocsparse_cbsr2csr", "library"); + subst("cusparseCbsrilu02", "rocsparse_cbsrilu0", "library"); subst("cusparseCcsc2dense", "rocsparse_ccsc2dense", "library"); subst("cusparseCcsr2bsr", "rocsparse_ccsr2bsr", "library"); subst("cusparseCcsr2csr_compress", "rocsparse_ccsr2csr_compress", "library"); @@ -1732,6 +1733,7 @@ sub rocSubstitutions { subst("cusparseCsrSetPointers", "rocsparse_csr_set_pointers", "library"); subst("cusparseCsrSetStridedBatch", "rocsparse_csr_set_strided_batch", "library"); subst("cusparseDbsr2csr", "rocsparse_dbsr2csr", "library"); + subst("cusparseDbsrilu02", "rocsparse_dbsrilu0", "library"); subst("cusparseDcsc2dense", "rocsparse_dcsc2dense", "library"); subst("cusparseDcsr2bsr", "rocsparse_dcsr2bsr", "library"); subst("cusparseDcsr2csr_compress", "rocsparse_dcsr2csr_compress", "library"); @@ -1808,6 +1810,7 @@ sub rocSubstitutions { subst("cusparseSDDMM_bufferSize", "rocsparse_sddmm_buffer_size", "library"); subst("cusparseSDDMM_preprocess", "rocsparse_sddmm_preprocess", "library"); subst("cusparseSbsr2csr", "rocsparse_sbsr2csr", "library"); + subst("cusparseSbsrilu02", "rocsparse_sbsrilu0", "library"); subst("cusparseScatter", "rocsparse_scatter", "library"); subst("cusparseScsc2dense", "rocsparse_scsc2dense", "library"); subst("cusparseScsr2bsr", "rocsparse_scsr2bsr", "library"); @@ -1876,6 +1879,7 @@ sub rocSubstitutions { subst("cusparseSpruneDense2csrNnz", "rocsparse_sprune_dense2csr_nnz", "library"); subst("cusparseSpruneDense2csrNnzByPercentage", "rocsparse_sprune_dense2csr_nnz_by_percentage", "library"); subst("cusparseSpruneDense2csr_bufferSizeExt", "rocsparse_sprune_dense2csr_buffer_size", "library"); + subst("cusparseXbsrilu02_zeroPivot", "rocsparse_bsrilu0_zero_pivot", "library"); subst("cusparseXcoo2csr", "rocsparse_coo2csr", "library"); subst("cusparseXcoosortByColumn", "rocsparse_coosort_by_column", "library"); subst("cusparseXcoosortByRow", "rocsparse_coosort_by_row", "library"); @@ -1885,11 +1889,13 @@ sub rocSubstitutions { subst("cusparseXcsr2bsrNnz", "rocsparse_csr2bsr_nnz", "library"); subst("cusparseXcsr2coo", "rocsparse_csr2coo", "library"); subst("cusparseXcsr2gebsrNnz", "rocsparse_csr2gebsr_nnz", "library"); + subst("cusparseXcsric02_zeroPivot", "rocsparse_csric0_zero_pivot", "library"); subst("cusparseXcsrilu02_zeroPivot", "rocsparse_csrilu0_zero_pivot", "library"); subst("cusparseXcsrsort", "rocsparse_csrsort", "library"); subst("cusparseXcsrsort_bufferSizeExt", "rocsparse_csrsort_buffer_size", "library"); subst("cusparseXgebsr2gebsrNnz", "rocsparse_gebsr2gebsr_nnz", "library"); subst("cusparseZbsr2csr", "rocsparse_zbsr2csr", "library"); + subst("cusparseZbsrilu02", "rocsparse_zbsrilu0", "library"); subst("cusparseZcsc2dense", "rocsparse_zcsc2dense", "library"); subst("cusparseZcsr2bsr", "rocsparse_zcsr2bsr", "library"); subst("cusparseZcsr2csr_compress", "rocsparse_zcsr2csr_compress", "library"); @@ -1927,6 +1933,8 @@ sub rocSubstitutions { subst("cusparseZnnz_compress", "rocsparse_znnz_compress", "library"); subst("cublas.h", "rocblas.h", "include_cuda_main_header"); subst("cublas_v2.h", "rocblas.h", "include_cuda_main_header_v2"); + subst("bsrilu02Info", "_rocsparse_mat_info", "type"); + subst("bsrilu02Info_t", "rocsparse_mat_info", "type"); subst("csric02Info", "_rocsparse_mat_info", "type"); subst("csric02Info_t", "rocsparse_mat_info", "type"); subst("csrilu02Info", "_rocsparse_mat_info", "type"); diff --git a/docs/tables/CUSPARSE_API_supported_by_HIP_and_ROC.md b/docs/tables/CUSPARSE_API_supported_by_HIP_and_ROC.md index 516ff386..417c4199 100644 --- a/docs/tables/CUSPARSE_API_supported_by_HIP_and_ROC.md +++ b/docs/tables/CUSPARSE_API_supported_by_HIP_and_ROC.md @@ -110,8 +110,8 @@ |`CUSPARSE_STATUS_ZERO_PIVOT`| | | |`HIPSPARSE_STATUS_ZERO_PIVOT`|1.9.2| | | |`rocsparse_status_zero_pivot`|1.9.0| | | | |`bsric02Info`| | | |`bsric02Info`|3.8.0| | | | | | | | | |`bsric02Info_t`| | | |`bsric02Info_t`|3.8.0| | | | | | | | | -|`bsrilu02Info`| |12.2| |`bsrilu02Info`|3.9.0| | | | | | | | | -|`bsrilu02Info_t`| |12.2| |`bsrilu02Info_t`|3.9.0| | | | | | | | | +|`bsrilu02Info`| |12.2| |`bsrilu02Info`|3.9.0| | | |`_rocsparse_mat_info`|1.9.0| | | | +|`bsrilu02Info_t`| |12.2| |`bsrilu02Info_t`|3.9.0| | | |`rocsparse_mat_info`|1.9.0| | | | |`bsrsm2Info`| |12.2| |`bsrsm2Info`|4.5.0| | | | | | | | | |`bsrsm2Info_t`| |12.2| |`bsrsm2Info_t`|4.5.0| | | | | | | | | |`bsrsv2Info`| |12.2| |`bsrsv2Info`|3.6.0| | | | | | | | | @@ -473,7 +473,7 @@ |`cusparseCbsric02_analysis`| |12.2| |`hipsparseCbsric02_analysis`|3.8.0| | | | | | | | | |`cusparseCbsric02_bufferSize`| |12.2| |`hipsparseCbsric02_bufferSize`|3.8.0| | | | | | | | | |`cusparseCbsric02_bufferSizeExt`| |12.2| | | | | | | | | | | | -|`cusparseCbsrilu02`| |12.2| |`hipsparseCbsrilu02`|3.9.0| | | | | | | | | +|`cusparseCbsrilu02`| |12.2| |`hipsparseCbsrilu02`|3.9.0| | | |`rocsparse_cbsrilu0`|3.9.0| | | | |`cusparseCbsrilu02_analysis`| |12.2| |`hipsparseCbsrilu02_analysis`|3.9.0| | | | | | | | | |`cusparseCbsrilu02_bufferSize`| |12.2| |`hipsparseCbsrilu02_bufferSize`|3.9.0| | | | | | | | | |`cusparseCbsrilu02_bufferSizeExt`| |12.2| | | | | | | | | | | | @@ -507,7 +507,7 @@ |`cusparseDbsric02_analysis`| |12.2| |`hipsparseDbsric02_analysis`|3.8.0| | | | | | | | | |`cusparseDbsric02_bufferSize`| |12.2| |`hipsparseDbsric02_bufferSize`|3.8.0| | | | | | | | | |`cusparseDbsric02_bufferSizeExt`| |12.2| | | | | | | | | | | | -|`cusparseDbsrilu02`| |12.2| |`hipsparseDbsrilu02`|3.9.0| | | | | | | | | +|`cusparseDbsrilu02`| |12.2| |`hipsparseDbsrilu02`|3.9.0| | | |`rocsparse_dbsrilu0`|3.9.0| | | | |`cusparseDbsrilu02_analysis`| |12.2| |`hipsparseDbsrilu02_analysis`|3.9.0| | | | | | | | | |`cusparseDbsrilu02_bufferSize`| |12.2| |`hipsparseDbsrilu02_bufferSize`|3.9.0| | | | | | | | | |`cusparseDbsrilu02_bufferSizeExt`| |12.2| | | | | | | | | | | | @@ -540,7 +540,7 @@ |`cusparseSbsric02_analysis`| |12.2| |`hipsparseSbsric02_analysis`|3.8.0| | | | | | | | | |`cusparseSbsric02_bufferSize`| |12.2| |`hipsparseSbsric02_bufferSize`|3.8.0| | | | | | | | | |`cusparseSbsric02_bufferSizeExt`| |12.2| | | | | | | | | | | | -|`cusparseSbsrilu02`| |12.2| |`hipsparseSbsrilu02`|3.9.0| | | | | | | | | +|`cusparseSbsrilu02`| |12.2| |`hipsparseSbsrilu02`|3.9.0| | | |`rocsparse_sbsrilu0`|3.9.0| | | | |`cusparseSbsrilu02_analysis`| |12.2| |`hipsparseSbsrilu02_analysis`|3.9.0| | | | | | | | | |`cusparseSbsrilu02_bufferSize`| |12.2| |`hipsparseSbsrilu02_bufferSize`|3.9.0| | | | | | | | | |`cusparseSbsrilu02_bufferSizeExt`| |12.2| | | | | | | | | | | | @@ -570,14 +570,14 @@ |`cusparseSgtsvStridedBatch`| |10.2|11.0| | | | | | | | | | | |`cusparseSgtsv_nopivot`| |10.2|11.0| | | | | | | | | | | |`cusparseXbsric02_zeroPivot`| | | |`hipsparseXbsric02_zeroPivot`|3.8.0| | | | | | | | | -|`cusparseXbsrilu02_zeroPivot`| |12.2| |`hipsparseXbsrilu02_zeroPivot`|3.9.0| | | | | | | | | -|`cusparseXcsric02_zeroPivot`| |12.2| |`hipsparseXcsric02_zeroPivot`|3.1.0| | | | | | | | | +|`cusparseXbsrilu02_zeroPivot`| |12.2| |`hipsparseXbsrilu02_zeroPivot`|3.9.0| | | |`rocsparse_bsrilu0_zero_pivot`|3.9.0| | | | +|`cusparseXcsric02_zeroPivot`| |12.2| |`hipsparseXcsric02_zeroPivot`|3.1.0| | | |`rocsparse_csric0_zero_pivot`|3.1.0| | | | |`cusparseXcsrilu02_zeroPivot`| |12.2| |`hipsparseXcsrilu02_zeroPivot`|1.9.2| | | |`rocsparse_csrilu0_zero_pivot`|1.9.0| | | | |`cusparseZbsric02`| |12.2| |`hipsparseZbsric02`|3.8.0| | | | | | | | | |`cusparseZbsric02_analysis`| |12.2| |`hipsparseZbsric02_analysis`|3.8.0| | | | | | | | | |`cusparseZbsric02_bufferSize`| |12.2| |`hipsparseZbsric02_bufferSize`|3.8.0| | | | | | | | | |`cusparseZbsric02_bufferSizeExt`| |12.2| | | | | | | | | | | | -|`cusparseZbsrilu02`| |12.2| |`hipsparseZbsrilu02`|3.9.0| | | | | | | | | +|`cusparseZbsrilu02`| |12.2| |`hipsparseZbsrilu02`|3.9.0| | | |`rocsparse_zbsrilu0`|3.9.0| | | | |`cusparseZbsrilu02_analysis`| |12.2| |`hipsparseZbsrilu02_analysis`|3.9.0| | | | | | | | | |`cusparseZbsrilu02_bufferSize`| |12.2| |`hipsparseZbsrilu02_bufferSize`|3.9.0| | | | | | | | | |`cusparseZbsrilu02_bufferSizeExt`| |12.2| | | | | | | | | | | | diff --git a/docs/tables/CUSPARSE_API_supported_by_ROC.md b/docs/tables/CUSPARSE_API_supported_by_ROC.md index 66b41b30..ada0506a 100644 --- a/docs/tables/CUSPARSE_API_supported_by_ROC.md +++ b/docs/tables/CUSPARSE_API_supported_by_ROC.md @@ -110,8 +110,8 @@ |`CUSPARSE_STATUS_ZERO_PIVOT`| | | |`rocsparse_status_zero_pivot`|1.9.0| | | | |`bsric02Info`| | | | | | | | | |`bsric02Info_t`| | | | | | | | | -|`bsrilu02Info`| |12.2| | | | | | | -|`bsrilu02Info_t`| |12.2| | | | | | | +|`bsrilu02Info`| |12.2| |`_rocsparse_mat_info`|1.9.0| | | | +|`bsrilu02Info_t`| |12.2| |`rocsparse_mat_info`|1.9.0| | | | |`bsrsm2Info`| |12.2| | | | | | | |`bsrsm2Info_t`| |12.2| | | | | | | |`bsrsv2Info`| |12.2| | | | | | | @@ -473,7 +473,7 @@ |`cusparseCbsric02_analysis`| |12.2| | | | | | | |`cusparseCbsric02_bufferSize`| |12.2| | | | | | | |`cusparseCbsric02_bufferSizeExt`| |12.2| | | | | | | -|`cusparseCbsrilu02`| |12.2| | | | | | | +|`cusparseCbsrilu02`| |12.2| |`rocsparse_cbsrilu0`|3.9.0| | | | |`cusparseCbsrilu02_analysis`| |12.2| | | | | | | |`cusparseCbsrilu02_bufferSize`| |12.2| | | | | | | |`cusparseCbsrilu02_bufferSizeExt`| |12.2| | | | | | | @@ -507,7 +507,7 @@ |`cusparseDbsric02_analysis`| |12.2| | | | | | | |`cusparseDbsric02_bufferSize`| |12.2| | | | | | | |`cusparseDbsric02_bufferSizeExt`| |12.2| | | | | | | -|`cusparseDbsrilu02`| |12.2| | | | | | | +|`cusparseDbsrilu02`| |12.2| |`rocsparse_dbsrilu0`|3.9.0| | | | |`cusparseDbsrilu02_analysis`| |12.2| | | | | | | |`cusparseDbsrilu02_bufferSize`| |12.2| | | | | | | |`cusparseDbsrilu02_bufferSizeExt`| |12.2| | | | | | | @@ -540,7 +540,7 @@ |`cusparseSbsric02_analysis`| |12.2| | | | | | | |`cusparseSbsric02_bufferSize`| |12.2| | | | | | | |`cusparseSbsric02_bufferSizeExt`| |12.2| | | | | | | -|`cusparseSbsrilu02`| |12.2| | | | | | | +|`cusparseSbsrilu02`| |12.2| |`rocsparse_sbsrilu0`|3.9.0| | | | |`cusparseSbsrilu02_analysis`| |12.2| | | | | | | |`cusparseSbsrilu02_bufferSize`| |12.2| | | | | | | |`cusparseSbsrilu02_bufferSizeExt`| |12.2| | | | | | | @@ -570,14 +570,14 @@ |`cusparseSgtsvStridedBatch`| |10.2|11.0| | | | | | |`cusparseSgtsv_nopivot`| |10.2|11.0| | | | | | |`cusparseXbsric02_zeroPivot`| | | | | | | | | -|`cusparseXbsrilu02_zeroPivot`| |12.2| | | | | | | -|`cusparseXcsric02_zeroPivot`| |12.2| | | | | | | +|`cusparseXbsrilu02_zeroPivot`| |12.2| |`rocsparse_bsrilu0_zero_pivot`|3.9.0| | | | +|`cusparseXcsric02_zeroPivot`| |12.2| |`rocsparse_csric0_zero_pivot`|3.1.0| | | | |`cusparseXcsrilu02_zeroPivot`| |12.2| |`rocsparse_csrilu0_zero_pivot`|1.9.0| | | | |`cusparseZbsric02`| |12.2| | | | | | | |`cusparseZbsric02_analysis`| |12.2| | | | | | | |`cusparseZbsric02_bufferSize`| |12.2| | | | | | | |`cusparseZbsric02_bufferSizeExt`| |12.2| | | | | | | -|`cusparseZbsrilu02`| |12.2| | | | | | | +|`cusparseZbsrilu02`| |12.2| |`rocsparse_zbsrilu0`|3.9.0| | | | |`cusparseZbsrilu02_analysis`| |12.2| | | | | | | |`cusparseZbsrilu02_bufferSize`| |12.2| | | | | | | |`cusparseZbsrilu02_bufferSizeExt`| |12.2| | | | | | | diff --git a/src/CUDA2HIP_SPARSE_API_functions.cpp b/src/CUDA2HIP_SPARSE_API_functions.cpp index 97b80016..7665748c 100644 --- a/src/CUDA2HIP_SPARSE_API_functions.cpp +++ b/src/CUDA2HIP_SPARSE_API_functions.cpp @@ -343,7 +343,7 @@ const std::map CUDA_SPARSE_FUNCTION_MAP { {"cusparseCcsric02", {"hipsparseCcsric02", "rocsparse_ccsric0", CONV_LIB_FUNC, API_SPARSE, 12, CUDA_DEPRECATED}}, {"cusparseZcsric02", {"hipsparseZcsric02", "rocsparse_zcsric0", CONV_LIB_FUNC, API_SPARSE, 12, CUDA_DEPRECATED}}, - {"cusparseXcsric02_zeroPivot", {"hipsparseXcsric02_zeroPivot", "", CONV_LIB_FUNC, API_SPARSE, 12, ROC_UNSUPPORTED | CUDA_DEPRECATED}}, + {"cusparseXcsric02_zeroPivot", {"hipsparseXcsric02_zeroPivot", "rocsparse_csric0_zero_pivot", CONV_LIB_FUNC, API_SPARSE, 12, CUDA_DEPRECATED}}, {"cusparseSbsric02_bufferSize", {"hipsparseSbsric02_bufferSize", "", CONV_LIB_FUNC, API_SPARSE, 12, ROC_UNSUPPORTED | CUDA_DEPRECATED}}, {"cusparseSbsric02_bufferSizeExt", {"hipsparseSbsric02_bufferSizeExt", "", CONV_LIB_FUNC, API_SPARSE, 12, UNSUPPORTED | CUDA_DEPRECATED}}, {"cusparseDbsric02_bufferSize", {"hipsparseDbsric02_bufferSize", "", CONV_LIB_FUNC, API_SPARSE, 12, ROC_UNSUPPORTED | CUDA_DEPRECATED}}, @@ -416,11 +416,11 @@ const std::map CUDA_SPARSE_FUNCTION_MAP { {"cusparseCbsrilu02_analysis", {"hipsparseCbsrilu02_analysis", "", CONV_LIB_FUNC, API_SPARSE, 12, ROC_UNSUPPORTED | CUDA_DEPRECATED}}, {"cusparseZbsrilu02_analysis", {"hipsparseZbsrilu02_analysis", "", CONV_LIB_FUNC, API_SPARSE, 12, ROC_UNSUPPORTED | CUDA_DEPRECATED}}, - {"cusparseSbsrilu02", {"hipsparseSbsrilu02", "", CONV_LIB_FUNC, API_SPARSE, 12, ROC_UNSUPPORTED | CUDA_DEPRECATED}}, - {"cusparseDbsrilu02", {"hipsparseDbsrilu02", "", CONV_LIB_FUNC, API_SPARSE, 12, ROC_UNSUPPORTED | CUDA_DEPRECATED}}, - {"cusparseCbsrilu02", {"hipsparseCbsrilu02", "", CONV_LIB_FUNC, API_SPARSE, 12, ROC_UNSUPPORTED | CUDA_DEPRECATED}}, - {"cusparseZbsrilu02", {"hipsparseZbsrilu02", "", CONV_LIB_FUNC, API_SPARSE, 12, ROC_UNSUPPORTED | CUDA_DEPRECATED}}, - {"cusparseXbsrilu02_zeroPivot", {"hipsparseXbsrilu02_zeroPivot", "", CONV_LIB_FUNC, API_SPARSE, 12, ROC_UNSUPPORTED | CUDA_DEPRECATED}}, + {"cusparseSbsrilu02", {"hipsparseSbsrilu02", "rocsparse_sbsrilu0", CONV_LIB_FUNC, API_SPARSE, 12, CUDA_DEPRECATED}}, + {"cusparseDbsrilu02", {"hipsparseDbsrilu02", "rocsparse_dbsrilu0", CONV_LIB_FUNC, API_SPARSE, 12, CUDA_DEPRECATED}}, + {"cusparseCbsrilu02", {"hipsparseCbsrilu02", "rocsparse_cbsrilu0", CONV_LIB_FUNC, API_SPARSE, 12, CUDA_DEPRECATED}}, + {"cusparseZbsrilu02", {"hipsparseZbsrilu02", "rocsparse_zbsrilu0", CONV_LIB_FUNC, API_SPARSE, 12, CUDA_DEPRECATED}}, + {"cusparseXbsrilu02_zeroPivot", {"hipsparseXbsrilu02_zeroPivot", "rocsparse_bsrilu0_zero_pivot", CONV_LIB_FUNC, API_SPARSE, 12, CUDA_DEPRECATED}}, // 12.3. Tridiagonal Solve // NOTE: rocsparse_(s|d|c|z)gtsv have an additional parameter void* temp_buffer @@ -2204,6 +2204,12 @@ const std::map HIP_SPARSE_FUNCTION_VER_MAP { {"rocsparse_ccsric0_buffer_size", {HIP_3010, HIP_0, HIP_0 }}, {"rocsparse_dcsric0_buffer_size", {HIP_3010, HIP_0, HIP_0 }}, {"rocsparse_scsric0_buffer_size", {HIP_3010, HIP_0, HIP_0 }}, + {"rocsparse_csric0_zero_pivot", {HIP_3010, HIP_0, HIP_0 }}, + {"rocsparse_zbsrilu0", {HIP_3090, HIP_0, HIP_0 }}, + {"rocsparse_cbsrilu0", {HIP_3090, HIP_0, HIP_0 }}, + {"rocsparse_dbsrilu0", {HIP_3090, HIP_0, HIP_0 }}, + {"rocsparse_sbsrilu0", {HIP_3090, HIP_0, HIP_0 }}, + {"rocsparse_bsrilu0_zero_pivot", {HIP_3090, HIP_0, HIP_0 }}, }; const std::map CUDA_SPARSE_API_SECTION_MAP { diff --git a/src/CUDA2HIP_SPARSE_API_types.cpp b/src/CUDA2HIP_SPARSE_API_types.cpp index 3a008b00..0aeaade0 100644 --- a/src/CUDA2HIP_SPARSE_API_types.cpp +++ b/src/CUDA2HIP_SPARSE_API_types.cpp @@ -56,8 +56,8 @@ const std::map CUDA_SPARSE_TYPE_NAME_MAP { {"csrilu02Info", {"csrilu02Info", "_rocsparse_mat_info", CONV_TYPE, API_SPARSE, 4, CUDA_DEPRECATED}}, {"csrilu02Info_t", {"csrilu02Info_t", "rocsparse_mat_info", CONV_TYPE, API_SPARSE, 4, CUDA_DEPRECATED}}, - {"bsrilu02Info", {"bsrilu02Info", "", CONV_TYPE, API_SPARSE, 4, ROC_UNSUPPORTED | CUDA_DEPRECATED}}, - {"bsrilu02Info_t", {"bsrilu02Info_t", "", CONV_TYPE, API_SPARSE, 4, ROC_UNSUPPORTED | CUDA_DEPRECATED}}, + {"bsrilu02Info", {"bsrilu02Info", "_rocsparse_mat_info", CONV_TYPE, API_SPARSE, 4, CUDA_DEPRECATED}}, + {"bsrilu02Info_t", {"bsrilu02Info_t", "rocsparse_mat_info", CONV_TYPE, API_SPARSE, 4, CUDA_DEPRECATED}}, {"csru2csrInfo", {"csru2csrInfo", "", CONV_TYPE, API_SPARSE, 4, ROC_UNSUPPORTED | CUDA_DEPRECATED}}, {"csru2csrInfo_t", {"csru2csrInfo_t", "", CONV_TYPE, API_SPARSE, 4, ROC_UNSUPPORTED | CUDA_DEPRECATED}}, diff --git a/src/HipifyAction.cpp b/src/HipifyAction.cpp index f66f2ba3..5e3f8158 100644 --- a/src/HipifyAction.cpp +++ b/src/HipifyAction.cpp @@ -115,6 +115,10 @@ const std::string sCusparseZcsric02_bufferSize = "cusparseZcsric02_bufferSize"; const std::string sCusparseCcsric02_bufferSize = "cusparseCcsric02_bufferSize"; const std::string sCusparseDcsric02_bufferSize = "cusparseDcsric02_bufferSize"; const std::string sCusparseScsric02_bufferSize = "cusparseScsric02_bufferSize"; +const std::string sCusparseZbsrilu02 = "cusparseZbsrilu02"; +const std::string sCusparseCbsrilu02 = "cusparseCbsrilu02"; +const std::string sCusparseDbsrilu02 = "cusparseDbsrilu02"; +const std::string sCusparseSbsrilu02 = "cusparseSbsrilu02"; // CUDA_OVERLOADED const std::string sCudaEventCreate = "cudaEventCreate"; const std::string sCudaGraphInstantiate = "cudaGraphInstantiate"; @@ -714,6 +718,42 @@ std::map FuncArgCasts { false } }, + {sCusparseZbsrilu02, + { + { + {10, {e_replace_argument_with_const, cw_None, "rocsparse_solve_policy_auto"}} + }, + true, + false + } + }, + {sCusparseCbsrilu02, + { + { + {10, {e_replace_argument_with_const, cw_None, "rocsparse_solve_policy_auto"}} + }, + true, + false + } + }, + {sCusparseDbsrilu02, + { + { + {10, {e_replace_argument_with_const, cw_None, "rocsparse_solve_policy_auto"}} + }, + true, + false + } + }, + {sCusparseSbsrilu02, + { + { + {10, {e_replace_argument_with_const, cw_None, "rocsparse_solve_policy_auto"}} + }, + true, + false + } + }, }; void HipifyAction::RewriteString(StringRef s, clang::SourceLocation start) { @@ -1457,7 +1497,11 @@ std::unique_ptr HipifyAction::CreateASTConsumer(clang::Compi sCusparseZcsric02_bufferSize, sCusparseCcsric02_bufferSize, sCusparseDcsric02_bufferSize, - sCusparseScsric02_bufferSize + sCusparseScsric02_bufferSize, + sCusparseZbsrilu02, + sCusparseCbsrilu02, + sCusparseDbsrilu02, + sCusparseSbsrilu02 ) ) ) diff --git a/tests/unit_tests/synthetic/libraries/cusparse2hipsparse.cu b/tests/unit_tests/synthetic/libraries/cusparse2hipsparse.cu index 964f6a7b..07c3cf74 100644 --- a/tests/unit_tests/synthetic/libraries/cusparse2hipsparse.cu +++ b/tests/unit_tests/synthetic/libraries/cusparse2hipsparse.cu @@ -254,6 +254,7 @@ int main() { pruneInfo_t prune_info; csrilu02Info_t csrilu02_info; csric02Info_t csric02_info; + bsrilu02Info_t bsrilu02_info; // CHECK: hipDoubleComplex dcomplex, dcomplexA, dcomplexB, dComplexbsrSortedValA, dComplexbsrSortedValC, dComplexcsrSortedValA, dComplexcsrSortedValC, dcomplextol, dComplexbsrSortedVal, dComplexbscVal, dComplexcscSortedVal, dcomplexds, dcomplexdl, dcomplexd, dcomplexdu, dcomplexdw, dcomplexx, dcomplex_boost_val; cuDoubleComplex dcomplex, dcomplexA, dcomplexB, dComplexbsrSortedValA, dComplexbsrSortedValC, dComplexcsrSortedValA, dComplexcsrSortedValC, dcomplextol, dComplexbsrSortedVal, dComplexbscVal, dComplexcscSortedVal, dcomplexds, dcomplexdl, dcomplexd, dcomplexdu, dcomplexdw, dcomplexx, dcomplex_boost_val; @@ -849,6 +850,36 @@ int main() { // CHECK: status_t = hipsparseScsric02_bufferSizeExt(handle_t, m, innz, matDescr_A, &csrSortedValA, &csrRowPtrA, &csrColIndA, csric02_info, &bufferSize); status_t = cusparseScsric02_bufferSizeExt(handle_t, m, innz, matDescr_A, &csrSortedValA, &csrRowPtrA, &csrColIndA, csric02_info, &bufferSize); + // CUDA: CUSPARSE_DEPRECATED cusparseStatus_t CUSPARSEAPI cusparseXcsric02_zeroPivot(cusparseHandle_t handle, csric02Info_t info, int* position); + // HIP: HIPSPARSE_EXPORT hipsparseStatus_t hipsparseXcsric02_zeroPivot(hipsparseHandle_t handle, csric02Info_t info, int* position); + // CHECK: status_t = hipsparseXcsric02_zeroPivot(handle_t, csric02_info, &iposition); + status_t = cusparseXcsric02_zeroPivot(handle_t, csric02_info, &iposition); + + // CUDA: CUSPARSE_DEPRECATED cusparseStatus_t CUSPARSEAPI cusparseZbsrilu02(cusparseHandle_t handle, cusparseDirection_t dirA, int mb, int nnzb, const cusparseMatDescr_t descrA, cuDoubleComplex* bsrSortedVal, const int* bsrSortedRowPtr, const int* bsrSortedColInd, int blockDim, bsrilu02Info_t info, cusparseSolvePolicy_t policy, void* pBuffer); + // HIP: HIPSPARSE_EXPORT hipsparseStatus_t hipsparseZbsrilu02(hipsparseHandle_t handle, hipsparseDirection_t dirA, int mb, int nnzb, const hipsparseMatDescr_t descrA, hipDoubleComplex* bsrSortedValA_valM, const int* bsrSortedRowPtrA, const int* bsrSortedColIndA, int blockDim, bsrilu02Info_t info, hipsparseSolvePolicy_t policy, void* pBuffer); + // CHECK: status_t = hipsparseZbsrilu02(handle_t, direction_t, mb, nnzb, matDescr_A, &dComplexbsrSortedVal, &bsrSortedRowPtr, &bsrSortedColInd, blockDim, bsrilu02_info, solvePolicy_t, pBuffer); + status_t = cusparseZbsrilu02(handle_t, direction_t, mb, nnzb, matDescr_A, &dComplexbsrSortedVal, &bsrSortedRowPtr, &bsrSortedColInd, blockDim, bsrilu02_info, solvePolicy_t, pBuffer); + + // CUDA: CUSPARSE_DEPRECATED cusparseStatus_t CUSPARSEAPI cusparseCbsrilu02(cusparseHandle_t handle, cusparseDirection_t dirA, int mb, int nnzb, const cusparseMatDescr_t descrA, cuComplex* bsrSortedVal, const int* bsrSortedRowPtr, const int* bsrSortedColInd, int blockDim, bsrilu02Info_t info, cusparseSolvePolicy_t policy, void* pBuffer); + // HIP: HIPSPARSE_EXPORT hipsparseStatus_t hipsparseCbsrilu02(hipsparseHandle_t handle, hipsparseDirection_t dirA, int mb, int nnzb, const hipsparseMatDescr_t descrA, hipComplex* bsrSortedValA_valM, const int* bsrSortedRowPtrA, const int* bsrSortedColIndA, int blockDim, bsrilu02Info_t info, hipsparseSolvePolicy_t policy, void* pBuffer); + // CHECK: status_t = hipsparseCbsrilu02(handle_t, direction_t, mb, nnzb, matDescr_A, &complexbsrSortedVal, &bsrSortedRowPtr, &bsrSortedColInd, blockDim, bsrilu02_info, solvePolicy_t, pBuffer); + status_t = cusparseCbsrilu02(handle_t, direction_t, mb, nnzb, matDescr_A, &complexbsrSortedVal, &bsrSortedRowPtr, &bsrSortedColInd, blockDim, bsrilu02_info, solvePolicy_t, pBuffer); + + // CUDA: CUSPARSE_DEPRECATED cusparseStatus_t CUSPARSEAPI cusparseDbsrilu02(cusparseHandle_t handle, cusparseDirection_t dirA, int mb, int nnzb, const cusparseMatDescr_t descrA, double* bsrSortedVal, const int* bsrSortedRowPtr, const int* bsrSortedColInd, int blockDim, bsrilu02Info_t info, cusparseSolvePolicy_t policy, void* pBuffer); + // HIP: HIPSPARSE_EXPORT hipsparseStatus_t hipsparseDbsrilu02(hipsparseHandle_t handle, hipsparseDirection_t dirA, int mb, int nnzb, const hipsparseMatDescr_t descrA, double* bsrSortedValA_valM, const int* bsrSortedRowPtrA, const int* bsrSortedColIndA, int blockDim, bsrilu02Info_t info, hipsparseSolvePolicy_t policy, void* pBuffer); + // CHECK: status_t = hipsparseDbsrilu02(handle_t, direction_t, mb, nnzb, matDescr_A, &dbsrSortedVal, &bsrSortedRowPtr, &bsrSortedColInd, blockDim, bsrilu02_info, solvePolicy_t, pBuffer); + status_t = cusparseDbsrilu02(handle_t, direction_t, mb, nnzb, matDescr_A, &dbsrSortedVal, &bsrSortedRowPtr, &bsrSortedColInd, blockDim, bsrilu02_info, solvePolicy_t, pBuffer); + + // CUDA: CUSPARSE_DEPRECATED cusparseStatus_t CUSPARSEAPI cusparseSbsrilu02(cusparseHandle_t handle, cusparseDirection_t dirA, int mb, int nnzb, const cusparseMatDescr_t descrA, float* bsrSortedVal, const int* bsrSortedRowPtr, const int* bsrSortedColInd, int blockDim, bsrilu02Info_t info, cusparseSolvePolicy_t policy, void* pBuffer); + // HIP: HIPSPARSE_EXPORT hipsparseStatus_t hipsparseSbsrilu02(hipsparseHandle_t handle, hipsparseDirection_t dirA, int mb, int nnzb, const hipsparseMatDescr_t descrA, float* bsrSortedValA_valM, const int* bsrSortedRowPtrA, const int* bsrSortedColIndA, int blockDim, bsrilu02Info_t info, hipsparseSolvePolicy_t policy, void* pBuffer); + // CHECK: status_t = hipsparseSbsrilu02(handle_t, direction_t, mb, nnzb, matDescr_A, &fbsrSortedVal, &bsrSortedRowPtr, &bsrSortedColInd, blockDim, bsrilu02_info, solvePolicy_t, pBuffer); + status_t = cusparseSbsrilu02(handle_t, direction_t, mb, nnzb, matDescr_A, &fbsrSortedVal, &bsrSortedRowPtr, &bsrSortedColInd, blockDim, bsrilu02_info, solvePolicy_t, pBuffer); + + // CUDA: CUSPARSE_DEPRECATED cusparseStatus_t CUSPARSEAPI cusparseXbsrilu02_zeroPivot(cusparseHandle_t handle, bsrilu02Info_t info, int* position); + // HIP: HIPSPARSE_EXPORT hipsparseStatus_t hipsparseXbsrilu02_zeroPivot(hipsparseHandle_t handle, bsrilu02Info_t info, int* position); + // CHECK: status_t = hipsparseXbsrilu02_zeroPivot(handle_t, bsrilu02_info, &iposition); + status_t = cusparseXbsrilu02_zeroPivot(handle_t, bsrilu02_info, &iposition); + #if CUDA_VERSION >= 8000 // CHECK: hipDataType dataType_t; // CHECK-NEXT: hipDataType dataType; diff --git a/tests/unit_tests/synthetic/libraries/cusparse2rocsparse.cu b/tests/unit_tests/synthetic/libraries/cusparse2rocsparse.cu index 292a8ed4..b030cd87 100644 --- a/tests/unit_tests/synthetic/libraries/cusparse2rocsparse.cu +++ b/tests/unit_tests/synthetic/libraries/cusparse2rocsparse.cu @@ -261,6 +261,9 @@ int main() { // CHECK: rocsparse_mat_info csric02_info; csric02Info_t csric02_info; + // CHECK: rocsparse_mat_info bsrilu02_info; + bsrilu02Info_t bsrilu02_info; + // TODO: should be rocsparse_double_complex // TODO: add to TypeOverloads cuDoubleComplex -> rocsparse_double_complex under a new option --sparse // CHECK: rocblas_double_complex dcomplex, dcomplexA, dcomplexB, dComplexbsrSortedValA, dComplexbsrSortedValC, dComplexcsrSortedValA, dComplexcsrSortedValC, dcomplextol, dComplexbsrSortedVal, dComplexbscVal, dComplexcscSortedVal, dcomplexds, dcomplexdl, dcomplexd, dcomplexdu, dcomplexdw, dcomplexx, dcomplex_boost_val; @@ -859,6 +862,36 @@ int main() { // CHECK: status_t = rocsparse_scsric0_buffer_size(handle_t, m, innz, matDescr_A, &csrSortedValA, &csrRowPtrA, &csrColIndA, csric02_info, &bufferSize); status_t = cusparseScsric02_bufferSizeExt(handle_t, m, innz, matDescr_A, &csrSortedValA, &csrRowPtrA, &csrColIndA, csric02_info, &bufferSize); + // CUDA: CUSPARSE_DEPRECATED cusparseStatus_t CUSPARSEAPI cusparseXcsric02_zeroPivot(cusparseHandle_t handle, csric02Info_t info, int* position); + // ROC: ROCSPARSE_EXPORT rocsparse_status rocsparse_csric0_zero_pivot(rocsparse_handle handle, rocsparse_mat_info info, rocsparse_int* position); + // CHECK: status_t = rocsparse_csric0_zero_pivot(handle_t, csric02_info, &iposition); + status_t = cusparseXcsric02_zeroPivot(handle_t, csric02_info, &iposition); + + // CUDA: CUSPARSE_DEPRECATED cusparseStatus_t CUSPARSEAPI cusparseZbsrilu02(cusparseHandle_t handle, cusparseDirection_t dirA, int mb, int nnzb, const cusparseMatDescr_t descrA, cuDoubleComplex* bsrSortedVal, const int* bsrSortedRowPtr, const int* bsrSortedColInd, int blockDim, bsrilu02Info_t info, cusparseSolvePolicy_t policy, void* pBuffer); + // ROC: ROCSPARSE_EXPORT rocsparse_status rocsparse_zbsrilu0(rocsparse_handle handle, rocsparse_direction dir, rocsparse_int mb, rocsparse_int nnzb, const rocsparse_mat_descr descr, rocsparse_double_complex* bsr_val, const rocsparse_int* bsr_row_ptr, const rocsparse_int* bsr_col_ind, rocsparse_int block_dim, rocsparse_mat_info info, rocsparse_solve_policy policy, void* temp_buffer); + // CHECK: status_t = rocsparse_zbsrilu0(handle_t, direction_t, mb, nnzb, matDescr_A, &dComplexbsrSortedVal, &bsrSortedRowPtr, &bsrSortedColInd, blockDim, bsrilu02_info, rocsparse_solve_policy_auto, pBuffer); + status_t = cusparseZbsrilu02(handle_t, direction_t, mb, nnzb, matDescr_A, &dComplexbsrSortedVal, &bsrSortedRowPtr, &bsrSortedColInd, blockDim, bsrilu02_info, solvePolicy_t, pBuffer); + + // CUDA: CUSPARSE_DEPRECATED cusparseStatus_t CUSPARSEAPI cusparseCbsrilu02(cusparseHandle_t handle, cusparseDirection_t dirA, int mb, int nnzb, const cusparseMatDescr_t descrA, cuComplex* bsrSortedVal, const int* bsrSortedRowPtr, const int* bsrSortedColInd, int blockDim, bsrilu02Info_t info, cusparseSolvePolicy_t policy, void* pBuffer); + // ROC: ROCSPARSE_EXPORT rocsparse_status rocsparse_cbsrilu0(rocsparse_handle handle, rocsparse_direction dir, rocsparse_int mb, rocsparse_int nnzb, const rocsparse_mat_descr descr, rocsparse_float_complex* bsr_val, const rocsparse_int* bsr_row_ptr, const rocsparse_int* bsr_col_ind, rocsparse_int block_dim, rocsparse_mat_info info, rocsparse_solve_policy policy, void* temp_buffer); + // CHECK: status_t = rocsparse_cbsrilu0(handle_t, direction_t, mb, nnzb, matDescr_A, &complexbsrSortedVal, &bsrSortedRowPtr, &bsrSortedColInd, blockDim, bsrilu02_info, rocsparse_solve_policy_auto, pBuffer); + status_t = cusparseCbsrilu02(handle_t, direction_t, mb, nnzb, matDescr_A, &complexbsrSortedVal, &bsrSortedRowPtr, &bsrSortedColInd, blockDim, bsrilu02_info, solvePolicy_t, pBuffer); + + // CUDA: CUSPARSE_DEPRECATED cusparseStatus_t CUSPARSEAPI cusparseDbsrilu02(cusparseHandle_t handle, cusparseDirection_t dirA, int mb, int nnzb, const cusparseMatDescr_t descrA, double* bsrSortedVal, const int* bsrSortedRowPtr, const int* bsrSortedColInd, int blockDim, bsrilu02Info_t info, cusparseSolvePolicy_t policy, void* pBuffer); + // ROC: ROCSPARSE_EXPORT rocsparse_status rocsparse_dbsrilu0(rocsparse_handle handle, rocsparse_direction dir, rocsparse_int mb, rocsparse_int nnzb, const rocsparse_mat_descr descr, double* bsr_val, const rocsparse_int* bsr_row_ptr, const rocsparse_int* bsr_col_ind, rocsparse_int block_dim, rocsparse_mat_info info, rocsparse_solve_policy policy, void* temp_buffer); + // CHECK: status_t = rocsparse_dbsrilu0(handle_t, direction_t, mb, nnzb, matDescr_A, &dbsrSortedVal, &bsrSortedRowPtr, &bsrSortedColInd, blockDim, bsrilu02_info, rocsparse_solve_policy_auto, pBuffer); + status_t = cusparseDbsrilu02(handle_t, direction_t, mb, nnzb, matDescr_A, &dbsrSortedVal, &bsrSortedRowPtr, &bsrSortedColInd, blockDim, bsrilu02_info, solvePolicy_t, pBuffer); + + // CUDA: CUSPARSE_DEPRECATED cusparseStatus_t CUSPARSEAPI cusparseSbsrilu02(cusparseHandle_t handle, cusparseDirection_t dirA, int mb, int nnzb, const cusparseMatDescr_t descrA, float* bsrSortedVal, const int* bsrSortedRowPtr, const int* bsrSortedColInd, int blockDim, bsrilu02Info_t info, cusparseSolvePolicy_t policy, void* pBuffer); + // ROC: ROCSPARSE_EXPORT rocsparse_status rocsparse_sbsrilu0(rocsparse_handle handle, rocsparse_direction dir, rocsparse_int mb, rocsparse_int nnzb, const rocsparse_mat_descr descr, float* bsr_val, const rocsparse_int* bsr_row_ptr, const rocsparse_int* bsr_col_ind, rocsparse_int block_dim, rocsparse_mat_info info, rocsparse_solve_policy policy, void* temp_buffer); + // CHECK: status_t = rocsparse_sbsrilu0(handle_t, direction_t, mb, nnzb, matDescr_A, &fbsrSortedVal, &bsrSortedRowPtr, &bsrSortedColInd, blockDim, bsrilu02_info, rocsparse_solve_policy_auto, pBuffer); + status_t = cusparseSbsrilu02(handle_t, direction_t, mb, nnzb, matDescr_A, &fbsrSortedVal, &bsrSortedRowPtr, &bsrSortedColInd, blockDim, bsrilu02_info, solvePolicy_t, pBuffer); + + // CUDA: CUSPARSE_DEPRECATED cusparseStatus_t CUSPARSEAPI cusparseXbsrilu02_zeroPivot(cusparseHandle_t handle, bsrilu02Info_t info, int* position); + // ROC: ROCSPARSE_EXPORT rocsparse_status rocsparse_bsrilu0_zero_pivot(rocsparse_handle handle, rocsparse_mat_info info, rocsparse_int* position); + // CHECK: status_t = rocsparse_bsrilu0_zero_pivot(handle_t, bsrilu02_info, &iposition); + status_t = cusparseXbsrilu02_zeroPivot(handle_t, bsrilu02_info, &iposition); + #if CUDA_VERSION >= 8000 // CHECK: hipDataType dataType_t; // TODO: [#899] There should be rocsparse_datatype