From eeddf18bd127e46bb8f46f06a9299ef0c6196833 Mon Sep 17 00:00:00 2001 From: Evgeny Mankov Date: Sat, 15 Jul 2023 14:31:39 +0200 Subject: [PATCH] [HIPIFY][#674][rocSPARSE][feature] rocSPARSE support - Step 19 - functions + Updated synthetic tests and the regenerated hipify-perl and SPARSE docs --- bin/hipify-perl | 6 ++++ .../CUSPARSE_API_supported_by_HIP_and_ROC.md | 12 +++---- docs/tables/CUSPARSE_API_supported_by_ROC.md | 12 +++---- src/CUDA2HIP_SPARSE_API_functions.cpp | 18 +++++++---- .../synthetic/libraries/cusparse2hipsparse.cu | 32 +++++++++++++++++++ .../synthetic/libraries/cusparse2rocsparse.cu | 32 +++++++++++++++++++ 6 files changed, 94 insertions(+), 18 deletions(-) diff --git a/bin/hipify-perl b/bin/hipify-perl index b134a767..3f044e5d 100755 --- a/bin/hipify-perl +++ b/bin/hipify-perl @@ -1476,6 +1476,7 @@ sub rocSubstitutions { subst("cusparseCreateDnMat", "rocsparse_create_dnmat_descr", "library"); subst("cusparseCreateDnVec", "rocsparse_create_dnvec_descr", "library"); subst("cusparseCreateHybMat", "rocsparse_create_hyb_mat", "library"); + subst("cusparseCreateIdentityPermutation", "rocsparse_create_identity_permutation", "library"); subst("cusparseCreateMatDescr", "rocsparse_create_mat_descr", "library"); subst("cusparseCreateSpVec", "rocsparse_create_spvec_descr", "library"); subst("cusparseCscSetPointers", "rocsparse_csc_set_pointers", "library"); @@ -1543,6 +1544,11 @@ sub rocSubstitutions { subst("cusparseSpVecSetValues", "rocsparse_spvec_set_values", "library"); subst("cusparseXcoosortByColumn", "rocsparse_coosort_by_column", "library"); subst("cusparseXcoosortByRow", "rocsparse_coosort_by_row", "library"); + subst("cusparseXcoosort_bufferSizeExt", "rocsparse_coosort_buffer_size", "library"); + subst("cusparseXcscsort", "rocsparse_cscsort", "library"); + subst("cusparseXcscsort_bufferSizeExt", "rocsparse_cscsort_buffer_size", "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("cusparseZcsrcolor", "rocsparse_zcsrcolor", "library"); 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 bbc87ed2..34a5e78c 100644 --- a/docs/tables/CUSPARSE_API_supported_by_HIP_and_ROC.md +++ b/docs/tables/CUSPARSE_API_supported_by_HIP_and_ROC.md @@ -645,7 +645,7 @@ |`cusparseCnnz`| | | |`hipsparseCnnz`|3.2.0| | | | | | | | | |`cusparseCnnz_compress`|8.0| | |`hipsparseCnnz_compress`|3.5.0| | | | | | | | | |`cusparseCreateCsru2csrInfo`| | | |`hipsparseCreateCsru2csrInfo`|4.2.0| | | | | | | | | -|`cusparseCreateIdentityPermutation`| | | |`hipsparseCreateIdentityPermutation`|1.9.2| | | | | | | | | +|`cusparseCreateIdentityPermutation`| | | |`hipsparseCreateIdentityPermutation`|1.9.2| | | |`rocsparse_create_identity_permutation`|1.9.0| | | | |`cusparseCsr2cscEx`|8.0|10.2|11.0| | | | | | | | | | | |`cusparseCsr2cscEx2`|10.1| | |`hipsparseCsr2cscEx2`|5.4.0| | | | | | | | | |`cusparseCsr2cscEx2_bufferSize`|10.1| | |`hipsparseCsr2cscEx2_bufferSize`|5.4.0| | | | | | | | | @@ -747,14 +747,14 @@ |`cusparseXcoo2csr`| | | |`hipsparseXcoo2csr`|1.9.2| | | | | | | | | |`cusparseXcoosortByColumn`| | | |`hipsparseXcoosortByColumn`|1.9.2| | | |`rocsparse_coosort_by_column`|1.9.0| | | | |`cusparseXcoosortByRow`| | | |`hipsparseXcoosortByRow`|1.9.2| | | |`rocsparse_coosort_by_row`|1.9.0| | | | -|`cusparseXcoosort_bufferSizeExt`| | | |`hipsparseXcoosort_bufferSizeExt`|1.9.2| | | | | | | | | -|`cusparseXcscsort`| | | |`hipsparseXcscsort`|2.10.0| | | | | | | | | -|`cusparseXcscsort_bufferSizeExt`| | | |`hipsparseXcscsort_bufferSizeExt`|2.10.0| | | | | | | | | +|`cusparseXcoosort_bufferSizeExt`| | | |`hipsparseXcoosort_bufferSizeExt`|1.9.2| | | |`rocsparse_coosort_buffer_size`|1.9.0| | | | +|`cusparseXcscsort`| | | |`hipsparseXcscsort`|2.10.0| | | |`rocsparse_cscsort`|2.10.0| | | | +|`cusparseXcscsort_bufferSizeExt`| | | |`hipsparseXcscsort_bufferSizeExt`|2.10.0| | | |`rocsparse_cscsort_buffer_size`|2.10.0| | | | |`cusparseXcsr2bsrNnz`| | | |`hipsparseXcsr2bsrNnz`|3.5.0| | | | | | | | | |`cusparseXcsr2coo`| | | |`hipsparseXcsr2coo`|1.9.2| | | | | | | | | |`cusparseXcsr2gebsrNnz`| | | |`hipsparseXcsr2gebsrNnz`|4.1.0| | | | | | | | | -|`cusparseXcsrsort`| | | |`hipsparseXcsrsort`|1.9.2| | | | | | | | | -|`cusparseXcsrsort_bufferSizeExt`| | | |`hipsparseXcsrsort_bufferSizeExt`|1.9.2| | | | | | | | | +|`cusparseXcsrsort`| | | |`hipsparseXcsrsort`|1.9.2| | | |`rocsparse_csrsort`|1.9.0| | | | +|`cusparseXcsrsort_bufferSizeExt`| | | |`hipsparseXcsrsort_bufferSizeExt`|1.9.2| | | |`rocsparse_csrsort_buffer_size`|1.9.0| | | | |`cusparseXgebsr2csr`| | | | | | | | | | | | | | |`cusparseXgebsr2gebsrNnz`| | | |`hipsparseXgebsr2gebsrNnz`|4.1.0| | | |`rocsparse_gebsr2gebsr_nnz`|4.1.0| | | | |`cusparseZbsr2csr`| | | |`hipsparseZbsr2csr`|3.5.0| | | |`rocsparse_zbsr2csr`|3.10.0| | | | diff --git a/docs/tables/CUSPARSE_API_supported_by_ROC.md b/docs/tables/CUSPARSE_API_supported_by_ROC.md index 2dabb8b1..22f00e66 100644 --- a/docs/tables/CUSPARSE_API_supported_by_ROC.md +++ b/docs/tables/CUSPARSE_API_supported_by_ROC.md @@ -645,7 +645,7 @@ |`cusparseCnnz`| | | | | | | | | |`cusparseCnnz_compress`|8.0| | | | | | | | |`cusparseCreateCsru2csrInfo`| | | | | | | | | -|`cusparseCreateIdentityPermutation`| | | | | | | | | +|`cusparseCreateIdentityPermutation`| | | |`rocsparse_create_identity_permutation`|1.9.0| | | | |`cusparseCsr2cscEx`|8.0|10.2|11.0| | | | | | |`cusparseCsr2cscEx2`|10.1| | | | | | | | |`cusparseCsr2cscEx2_bufferSize`|10.1| | | | | | | | @@ -747,14 +747,14 @@ |`cusparseXcoo2csr`| | | | | | | | | |`cusparseXcoosortByColumn`| | | |`rocsparse_coosort_by_column`|1.9.0| | | | |`cusparseXcoosortByRow`| | | |`rocsparse_coosort_by_row`|1.9.0| | | | -|`cusparseXcoosort_bufferSizeExt`| | | | | | | | | -|`cusparseXcscsort`| | | | | | | | | -|`cusparseXcscsort_bufferSizeExt`| | | | | | | | | +|`cusparseXcoosort_bufferSizeExt`| | | |`rocsparse_coosort_buffer_size`|1.9.0| | | | +|`cusparseXcscsort`| | | |`rocsparse_cscsort`|2.10.0| | | | +|`cusparseXcscsort_bufferSizeExt`| | | |`rocsparse_cscsort_buffer_size`|2.10.0| | | | |`cusparseXcsr2bsrNnz`| | | | | | | | | |`cusparseXcsr2coo`| | | | | | | | | |`cusparseXcsr2gebsrNnz`| | | | | | | | | -|`cusparseXcsrsort`| | | | | | | | | -|`cusparseXcsrsort_bufferSizeExt`| | | | | | | | | +|`cusparseXcsrsort`| | | |`rocsparse_csrsort`|1.9.0| | | | +|`cusparseXcsrsort_bufferSizeExt`| | | |`rocsparse_csrsort_buffer_size`|1.9.0| | | | |`cusparseXgebsr2csr`| | | | | | | | | |`cusparseXgebsr2gebsrNnz`| | | |`rocsparse_gebsr2gebsr_nnz`|4.1.0| | | | |`cusparseZbsr2csr`| | | |`rocsparse_zbsr2csr`|3.10.0| | | | diff --git a/src/CUDA2HIP_SPARSE_API_functions.cpp b/src/CUDA2HIP_SPARSE_API_functions.cpp index b2a24b97..330f26cc 100644 --- a/src/CUDA2HIP_SPARSE_API_functions.cpp +++ b/src/CUDA2HIP_SPARSE_API_functions.cpp @@ -630,17 +630,17 @@ const std::map CUDA_SPARSE_FUNCTION_MAP { {"cusparseCnnz", {"hipsparseCnnz", "", CONV_LIB_FUNC, API_SPARSE, 14, ROC_UNSUPPORTED}}, {"cusparseZnnz", {"hipsparseZnnz", "", CONV_LIB_FUNC, API_SPARSE, 14, ROC_UNSUPPORTED}}, - {"cusparseCreateIdentityPermutation", {"hipsparseCreateIdentityPermutation", "", CONV_LIB_FUNC, API_SPARSE, 14, ROC_UNSUPPORTED}}, + {"cusparseCreateIdentityPermutation", {"hipsparseCreateIdentityPermutation", "rocsparse_create_identity_permutation", CONV_LIB_FUNC, API_SPARSE, 14}}, - {"cusparseXcoosort_bufferSizeExt", {"hipsparseXcoosort_bufferSizeExt", "", CONV_LIB_FUNC, API_SPARSE, 14, ROC_UNSUPPORTED}}, + {"cusparseXcoosort_bufferSizeExt", {"hipsparseXcoosort_bufferSizeExt", "rocsparse_coosort_buffer_size", CONV_LIB_FUNC, API_SPARSE, 14}}, {"cusparseXcoosortByRow", {"hipsparseXcoosortByRow", "rocsparse_coosort_by_row", CONV_LIB_FUNC, API_SPARSE, 14}}, {"cusparseXcoosortByColumn", {"hipsparseXcoosortByColumn", "rocsparse_coosort_by_column", CONV_LIB_FUNC, API_SPARSE, 14}}, - {"cusparseXcsrsort_bufferSizeExt", {"hipsparseXcsrsort_bufferSizeExt", "", CONV_LIB_FUNC, API_SPARSE, 14, ROC_UNSUPPORTED}}, - {"cusparseXcsrsort", {"hipsparseXcsrsort", "", CONV_LIB_FUNC, API_SPARSE, 14, ROC_UNSUPPORTED}}, + {"cusparseXcsrsort_bufferSizeExt", {"hipsparseXcsrsort_bufferSizeExt", "rocsparse_csrsort_buffer_size", CONV_LIB_FUNC, API_SPARSE, 14}}, + {"cusparseXcsrsort", {"hipsparseXcsrsort", "rocsparse_csrsort", CONV_LIB_FUNC, API_SPARSE, 14}}, - {"cusparseXcscsort_bufferSizeExt", {"hipsparseXcscsort_bufferSizeExt", "", CONV_LIB_FUNC, API_SPARSE, 14, ROC_UNSUPPORTED}}, - {"cusparseXcscsort", {"hipsparseXcscsort", "", CONV_LIB_FUNC, API_SPARSE, 14, ROC_UNSUPPORTED}}, + {"cusparseXcscsort_bufferSizeExt", {"hipsparseXcscsort_bufferSizeExt", "rocsparse_cscsort_buffer_size", CONV_LIB_FUNC, API_SPARSE, 14}}, + {"cusparseXcscsort", {"hipsparseXcscsort", "rocsparse_cscsort", CONV_LIB_FUNC, API_SPARSE, 14}}, {"cusparseCreateCsru2csrInfo", {"hipsparseCreateCsru2csrInfo", "", CONV_LIB_FUNC, API_SPARSE, 14, ROC_UNSUPPORTED}}, {"cusparseDestroyCsru2csrInfo", {"hipsparseDestroyCsru2csrInfo", "", CONV_LIB_FUNC, API_SPARSE, 14, ROC_UNSUPPORTED}}, @@ -1895,6 +1895,12 @@ const std::map HIP_SPARSE_FUNCTION_VER_MAP { {"rocsparse_sbsr2csr", {HIP_3100, HIP_0, HIP_0 }}, {"rocsparse_coosort_by_column", {HIP_1090, HIP_0, HIP_0 }}, {"rocsparse_coosort_by_row", {HIP_1090, HIP_0, HIP_0 }}, + {"rocsparse_coosort_buffer_size", {HIP_1090, HIP_0, HIP_0 }}, + {"rocsparse_cscsort", {HIP_2100, HIP_0, HIP_0 }}, + {"rocsparse_cscsort_buffer_size", {HIP_2100, HIP_0, HIP_0 }}, + {"rocsparse_csrsort", {HIP_1090, HIP_0, HIP_0 }}, + {"rocsparse_csrsort_buffer_size", {HIP_1090, HIP_0, HIP_0 }}, + {"rocsparse_create_identity_permutation", {HIP_1090, HIP_0, HIP_0 }}, }; const std::map CUDA_SPARSE_API_SECTION_MAP { diff --git a/tests/unit_tests/synthetic/libraries/cusparse2hipsparse.cu b/tests/unit_tests/synthetic/libraries/cusparse2hipsparse.cu index 615a00b6..2755bc7e 100644 --- a/tests/unit_tests/synthetic/libraries/cusparse2hipsparse.cu +++ b/tests/unit_tests/synthetic/libraries/cusparse2hipsparse.cu @@ -125,6 +125,8 @@ int main() { int nnzb = 0; int innz = 0; int blockDim = 0; + int cscRowIndA = 0; + int cscColPtrA = 0; int csrRowPtrA = 0; int csrColIndA = 0; int ncolors = 0; @@ -412,6 +414,36 @@ int main() { // CHECK: status_t = hipsparseXcoosortByRow(handle_t, m, n, innz, &icooRows, &icooColumns, P, pBuffer); status_t = cusparseXcoosortByRow(handle_t, m, n, innz, &icooRows, &icooColumns, P, pBuffer); + // CUDA: cusparseStatus_t CUSPARSEAPI cusparseXcoosort_bufferSizeExt(cusparseHandle_t handle, int m, int n, int nnz, const int* cooRowsA, const int* cooColsA, size_t* pBufferSizeInBytes); + // HIP: HIPSPARSE_EXPORT hipsparseStatus_t hipsparseXcoosort_bufferSizeExt(hipsparseHandle_t handle, int m, int n, int nnz, const int* cooRows, const int* cooCols, size_t* pBufferSizeInBytes); + // CHECK: status_t = hipsparseXcoosort_bufferSizeExt(handle_t, m, n, innz, &icooRows, &icooColumns, &bufferSize); + status_t = cusparseXcoosort_bufferSizeExt(handle_t, m, n, innz, &icooRows, &icooColumns, &bufferSize); + + // CUDA: cusparseStatus_t CUSPARSEAPI cusparseXcscsort(cusparseHandle_t handle, int m, int n, int nnz, const cusparseMatDescr_t descrA, const int* cscColPtrA, int* cscRowIndA, int* P, void* pBuffer); + // HIP: HIPSPARSE_EXPORT hipsparseStatus_t hipsparseXcscsort(hipsparseHandle_t handle, int m, int n, int nnz, const hipsparseMatDescr_t descrA, const int* cscColPtr, int* cscRowInd, int* P, void* pBuffer); + // CHECK: status_t = hipsparseXcscsort(handle_t, m, n, innz, matDescr_A, &cscColPtrA, &cscRowIndA, P, pBuffer); + status_t = cusparseXcscsort(handle_t, m, n, innz, matDescr_A, &cscColPtrA, &cscRowIndA, P, pBuffer); + + // CUDA: cusparseStatus_t CUSPARSEAPI cusparseXcscsort_bufferSizeExt(cusparseHandle_t handle, int m, int n, int nnz, const int* cscColPtrA, const int* cscRowIndA, size_t* pBufferSizeInBytes); + // HIP: HIPSPARSE_EXPORT hipsparseStatus_t hipsparseXcscsort_bufferSizeExt(hipsparseHandle_t handle, int m, int n, int nnz, const int* cscColPtr, const int* cscRowInd, size_t* pBufferSizeInBytes); + // CHECK: status_t = hipsparseXcscsort_bufferSizeExt(handle_t, m, n, innz, &cscColPtrA, &cscRowIndA, &bufferSize); + status_t = cusparseXcscsort_bufferSizeExt(handle_t, m, n, innz, &cscColPtrA, &cscRowIndA, &bufferSize); + + // CUDA: cusparseStatus_t CUSPARSEAPI cusparseXcsrsort(cusparseHandle_t handle, int m, int n, int nnz, const cusparseMatDescr_t descrA, const int* csrRowPtrA, int* csrColIndA, int* P, void* pBuffer); + // HIP: HIPSPARSE_EXPORT hipsparseStatus_t hipsparseXcsrsort(hipsparseHandle_t handle, int m, int n, int nnz, const hipsparseMatDescr_t descrA, const int* csrRowPtr, int* csrColInd, int* P, void* pBuffer); + // CHECK: status_t = hipsparseXcsrsort(handle_t, m, n, innz, matDescr_A, &cscRowIndA, &cscColPtrA, P, pBuffer); + status_t = cusparseXcsrsort(handle_t, m, n, innz, matDescr_A, &cscRowIndA, &cscColPtrA, P, pBuffer); + + // CUDA: cusparseStatus_t CUSPARSEAPI cusparseXcsrsort_bufferSizeExt(cusparseHandle_t handle, int m, int n, int nnz, const int* csrRowPtrA, const int* csrColIndA, size_t* pBufferSizeInBytes); + // HIP: HIPSPARSE_EXPORT hipsparseStatus_t hipsparseXcsrsort_bufferSizeExt(hipsparseHandle_t handle, int m, int n, int nnz, const int* csrRowPtr, const int* csrColInd, size_t* pBufferSizeInBytes); + // CHECK: status_t = hipsparseXcsrsort_bufferSizeExt(handle_t, m, n, innz, &cscRowIndA, &cscColPtrA, &bufferSize); + status_t = cusparseXcsrsort_bufferSizeExt(handle_t, m, n, innz, &cscRowIndA, &cscColPtrA, &bufferSize); + + // CUDA: cusparseStatus_t CUSPARSEAPI cusparseCreateIdentityPermutation(cusparseHandle_t handle, int n, int* p); + // HIP: HIPSPARSE_EXPORT hipsparseStatus_t hipsparseCreateIdentityPermutation(hipsparseHandle_t handle, int n, int* p); + // CHECK: status_t = hipsparseCreateIdentityPermutation(handle_t, n, P); + status_t = cusparseCreateIdentityPermutation(handle_t, n, P); + #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 4e4d65f6..9565220e 100644 --- a/tests/unit_tests/synthetic/libraries/cusparse2rocsparse.cu +++ b/tests/unit_tests/synthetic/libraries/cusparse2rocsparse.cu @@ -125,6 +125,8 @@ int main() { int nnzb = 0; int innz = 0; int blockDim = 0; + int cscRowIndA = 0; + int cscColPtrA = 0; int csrRowPtrA = 0; int csrColIndA = 0; int ncolors = 0; @@ -416,6 +418,36 @@ int main() { // CHECK: status_t = rocsparse_coosort_by_row(handle_t, m, n, innz, &icooRows, &icooColumns, P, pBuffer); status_t = cusparseXcoosortByRow(handle_t, m, n, innz, &icooRows, &icooColumns, P, pBuffer); + // CUDA: cusparseStatus_t CUSPARSEAPI cusparseXcoosort_bufferSizeExt(cusparseHandle_t handle, int m, int n, int nnz, const int* cooRowsA, const int* cooColsA, size_t* pBufferSizeInBytes); + // ROC: ROCSPARSE_EXPORT rocsparse_status rocsparse_coosort_buffer_size(rocsparse_handle handle, rocsparse_int m, rocsparse_int n, rocsparse_int nnz, const rocsparse_int* coo_row_ind, const rocsparse_int* coo_col_ind, size_t* buffer_size); + // CHECK: status_t = rocsparse_coosort_buffer_size(handle_t, m, n, innz, &icooRows, &icooColumns, &bufferSize); + status_t = cusparseXcoosort_bufferSizeExt(handle_t, m, n, innz, &icooRows, &icooColumns, &bufferSize); + + // CUDA: cusparseStatus_t CUSPARSEAPI cusparseXcscsort(cusparseHandle_t handle, int m, int n, int nnz, const cusparseMatDescr_t descrA, const int* cscColPtrA, int* cscRowIndA, int* P, void* pBuffer); + // ROC: ROCSPARSE_EXPORT rocsparse_status rocsparse_cscsort(rocsparse_handle handle, rocsparse_int m, rocsparse_int n, rocsparse_int nnz, const rocsparse_mat_descr descr, const rocsparse_int* csc_col_ptr, rocsparse_int* csc_row_ind, rocsparse_int* perm, void* temp_buffer); + // CHECK: status_t = rocsparse_cscsort(handle_t, m, n, innz, matDescr_A, &cscColPtrA, &cscRowIndA, P, pBuffer); + status_t = cusparseXcscsort(handle_t, m, n, innz, matDescr_A, &cscColPtrA, &cscRowIndA, P, pBuffer); + + // CUDA: cusparseStatus_t CUSPARSEAPI cusparseXcscsort_bufferSizeExt(cusparseHandle_t handle, int m, int n, int nnz, const int* cscColPtrA, const int* cscRowIndA, size_t* pBufferSizeInBytes); + // ROC: ROCSPARSE_EXPORT rocsparse_status rocsparse_cscsort_buffer_size(rocsparse_handle handle, rocsparse_int m, rocsparse_int n, rocsparse_int nnz, const rocsparse_int* csc_col_ptr, const rocsparse_int* csc_row_ind, size_t* buffer_size); + // CHECK: status_t = rocsparse_cscsort_buffer_size(handle_t, m, n, innz, &cscColPtrA, &cscRowIndA, &bufferSize); + status_t = cusparseXcscsort_bufferSizeExt(handle_t, m, n, innz, &cscColPtrA, &cscRowIndA, &bufferSize); + + // CUDA: cusparseStatus_t CUSPARSEAPI cusparseXcsrsort(cusparseHandle_t handle, int m, int n, int nnz, const cusparseMatDescr_t descrA, const int* csrRowPtrA, int* csrColIndA, int* P, void* pBuffer); + // ROC: ROCSPARSE_EXPORT rocsparse_status rocsparse_csrsort(rocsparse_handle handle, rocsparse_int m, rocsparse_int n, rocsparse_int nnz, const rocsparse_mat_descr descr, const rocsparse_int* csr_row_ptr, rocsparse_int* csr_col_ind, rocsparse_int* perm, void* temp_buffer); + // CHECK: status_t = rocsparse_csrsort(handle_t, m, n, innz, matDescr_A, &cscRowIndA, &cscColPtrA, P, pBuffer); + status_t = cusparseXcsrsort(handle_t, m, n, innz, matDescr_A, &cscRowIndA, &cscColPtrA, P, pBuffer); + + // CUDA: cusparseStatus_t CUSPARSEAPI cusparseXcsrsort_bufferSizeExt(cusparseHandle_t handle, int m, int n, int nnz, const int* csrRowPtrA, const int* csrColIndA, size_t* pBufferSizeInBytes); + // ROC: ROCSPARSE_EXPORT rocsparse_status rocsparse_csrsort_buffer_size(rocsparse_handle handle, rocsparse_int m, rocsparse_int n, rocsparse_int nnz, const rocsparse_int* csr_row_ptr, const rocsparse_int* csr_col_ind, size_t* buffer_size); + // CHECK: status_t = rocsparse_csrsort_buffer_size(handle_t, m, n, innz, &cscRowIndA, &cscColPtrA, &bufferSize); + status_t = cusparseXcsrsort_bufferSizeExt(handle_t, m, n, innz, &cscRowIndA, &cscColPtrA, &bufferSize); + + // CUDA: cusparseStatus_t CUSPARSEAPI cusparseCreateIdentityPermutation(cusparseHandle_t handle, int n, int* p); + // ROC: ROCSPARSE_EXPORT rocsparse_status rocsparse_create_identity_permutation(rocsparse_handle handle, rocsparse_int n, rocsparse_int* p); + // CHECK: status_t = rocsparse_create_identity_permutation(handle_t, n, P); + status_t = cusparseCreateIdentityPermutation(handle_t, n, P); + #if CUDA_VERSION >= 8000 // CHECK: hipDataType dataType_t; // TODO: [#899] There should be rocsparse_datatype