Skip to content

Commit

Permalink
[HIPIFY][SPARSE][fix] CUSPARSE_VERSION >= 10200 (CUDA 10.1.1) fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
emankov committed Feb 6, 2024
1 parent 4324eb7 commit cfe3ce8
Show file tree
Hide file tree
Showing 6 changed files with 58 additions and 47 deletions.
2 changes: 1 addition & 1 deletion docs/tables/CUSPARSE_API_supported_by_HIP.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
|`CUSPARSE_HYB_PARTITION_USER`| |10.2| |11.0|`HIPSPARSE_HYB_PARTITION_USER`|1.9.2| | | | |
|`CUSPARSE_INDEX_16U`|10.1| | | |`HIPSPARSE_INDEX_16U`|4.1.0| | | | |
|`CUSPARSE_INDEX_32I`|10.1| | | |`HIPSPARSE_INDEX_32I`|4.1.0| | | | |
|`CUSPARSE_INDEX_64I`|10.2| | | |`HIPSPARSE_INDEX_64I`|4.1.0| | | | |
|`CUSPARSE_INDEX_64I`|10.1| | | |`HIPSPARSE_INDEX_64I`|4.1.0| | | | |
|`CUSPARSE_INDEX_BASE_ONE`| | | | |`HIPSPARSE_INDEX_BASE_ONE`|1.9.2| | | | |
|`CUSPARSE_INDEX_BASE_ZERO`| | | | |`HIPSPARSE_INDEX_BASE_ZERO`|1.9.2| | | | |
|`CUSPARSE_MATRIX_TYPE_GENERAL`| | | | |`HIPSPARSE_MATRIX_TYPE_GENERAL`|1.9.2| | | | |
Expand Down
2 changes: 1 addition & 1 deletion docs/tables/CUSPARSE_API_supported_by_HIP_and_ROC.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
|`CUSPARSE_HYB_PARTITION_USER`| |10.2| |11.0|`HIPSPARSE_HYB_PARTITION_USER`|1.9.2| | | | |`rocsparse_hyb_partition_user`|1.9.0| | | | |
|`CUSPARSE_INDEX_16U`|10.1| | | |`HIPSPARSE_INDEX_16U`|4.1.0| | | | |`rocsparse_indextype_u16`|4.1.0| | | | |
|`CUSPARSE_INDEX_32I`|10.1| | | |`HIPSPARSE_INDEX_32I`|4.1.0| | | | |`rocsparse_indextype_i32`|4.1.0| | | | |
|`CUSPARSE_INDEX_64I`|10.2| | | |`HIPSPARSE_INDEX_64I`|4.1.0| | | | |`rocsparse_indextype_i64`|4.1.0| | | | |
|`CUSPARSE_INDEX_64I`|10.1| | | |`HIPSPARSE_INDEX_64I`|4.1.0| | | | |`rocsparse_indextype_i64`|4.1.0| | | | |
|`CUSPARSE_INDEX_BASE_ONE`| | | | |`HIPSPARSE_INDEX_BASE_ONE`|1.9.2| | | | |`rocsparse_index_base_one`|1.9.0| | | | |
|`CUSPARSE_INDEX_BASE_ZERO`| | | | |`HIPSPARSE_INDEX_BASE_ZERO`|1.9.2| | | | |`rocsparse_index_base_zero`|1.9.0| | | | |
|`CUSPARSE_MATRIX_TYPE_GENERAL`| | | | |`HIPSPARSE_MATRIX_TYPE_GENERAL`|1.9.2| | | | |`rocsparse_matrix_type_general`|1.9.0| | | | |
Expand Down
2 changes: 1 addition & 1 deletion docs/tables/CUSPARSE_API_supported_by_ROC.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
|`CUSPARSE_HYB_PARTITION_USER`| |10.2| |11.0|`rocsparse_hyb_partition_user`|1.9.0| | | | |
|`CUSPARSE_INDEX_16U`|10.1| | | |`rocsparse_indextype_u16`|4.1.0| | | | |
|`CUSPARSE_INDEX_32I`|10.1| | | |`rocsparse_indextype_i32`|4.1.0| | | | |
|`CUSPARSE_INDEX_64I`|10.2| | | |`rocsparse_indextype_i64`|4.1.0| | | | |
|`CUSPARSE_INDEX_64I`|10.1| | | |`rocsparse_indextype_i64`|4.1.0| | | | |
|`CUSPARSE_INDEX_BASE_ONE`| | | | |`rocsparse_index_base_one`|1.9.0| | | | |
|`CUSPARSE_INDEX_BASE_ZERO`| | | | |`rocsparse_index_base_zero`|1.9.0| | | | |
|`CUSPARSE_MATRIX_TYPE_GENERAL`| | | | |`rocsparse_matrix_type_general`|1.9.0| | | | |
Expand Down
2 changes: 1 addition & 1 deletion src/CUDA2HIP_SPARSE_API_types.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -336,7 +336,7 @@ const std::map<llvm::StringRef, cudaAPIversions> CUDA_SPARSE_TYPE_NAME_VER_MAP {
{"cusparseIndexType_t", {CUDA_101, CUDA_0, CUDA_0 }},
{"CUSPARSE_INDEX_16U", {CUDA_101, CUDA_0, CUDA_0 }},
{"CUSPARSE_INDEX_32I", {CUDA_101, CUDA_0, CUDA_0 }},
{"CUSPARSE_INDEX_64I", {CUDA_102, CUDA_0, CUDA_0 }},
{"CUSPARSE_INDEX_64I", {CUDA_101, CUDA_0, CUDA_0 }}, // CUSPARSE_VERSION 10200
{"cusparseSpGEMMAlg_t", {CUDA_110, CUDA_0, CUDA_0 }},
{"CUSPARSE_SPGEMM_DEFAULT", {CUDA_110, CUDA_0, CUDA_0 }},
{"cusparseSpGEMMDescr", {CUDA_110, CUDA_0, CUDA_0 }},
Expand Down
60 changes: 33 additions & 27 deletions tests/unit_tests/synthetic/libraries/cusparse2hipsparse.cu
Original file line number Diff line number Diff line change
Expand Up @@ -1887,7 +1887,7 @@ int main() {
// CHECK-NEXT: hipsparseIndexType_t ellIdxType;
// CHECK-NEXT: hipsparseIndexType_t INDEX_16U = HIPSPARSE_INDEX_16U;
// CHECK-NEXT: hipsparseIndexType_t INDEX_32I = HIPSPARSE_INDEX_32I;
// CHECK-NEXT: hipsparseIndexType_t INDEX_64I = HIPSPARSE_INDEX_64I;

cusparseIndexType_t indexType_t;
cusparseIndexType_t csrRowOffsetsType;
cusparseIndexType_t cscColOffsetsType;
Expand All @@ -1896,7 +1896,6 @@ int main() {
cusparseIndexType_t ellIdxType;
cusparseIndexType_t INDEX_16U = CUSPARSE_INDEX_16U;
cusparseIndexType_t INDEX_32I = CUSPARSE_INDEX_32I;
cusparseIndexType_t INDEX_64I = CUSPARSE_INDEX_64I;

// CHECK: hipsparseFormat_t format_t;
// CHECK-NEXT: hipsparseFormat_t FORMAT_CSR = HIPSPARSE_FORMAT_CSR;
Expand All @@ -1922,6 +1921,38 @@ int main() {
// CHECK: status_t = hipsparseCreateCoo(&spMatDescr_t, rows, cols, nnz, cooRowInd, cooColInd, cooValues, indexType_t, indexBase_t, dataType);
status_t = cusparseCreateCoo(&spMatDescr_t, rows, cols, nnz, cooRowInd, cooColInd, cooValues, indexType_t, indexBase_t, dataType);

// CUDA: cusparseStatus_t CUSPARSEAPI cusparseCreateDnMat(cusparseDnMatDescr_t* dnMatDescr, int64_t rows, int64_t cols, int64_t ld, void* values, cudaDataType valueType, cusparseOrder_t order);
// HIP: HIPSPARSE_EXPORT hipsparseStatus_t hipsparseCreateDnMat(hipsparseDnMatDescr_t* dnMatDescr, int64_t rows, int64_t cols, int64_t ld, void* values, hipDataType valueType, hipsparseOrder_t order);
// CHECK: status_t = hipsparseCreateDnMat(&dnMatDescr_t, rows, cols, ld, values, dataType, order_t);
status_t = cusparseCreateDnMat(&dnMatDescr_t, rows, cols, ld, values, dataType, order_t);

// CUDA: cusparseStatus_t CUSPARSEAPI cusparseDnMatSetStridedBatch(cusparseDnMatDescr_t dnMatDescr, int batchCount, int64_t batchStride);
// HIP: HIPSPARSE_EXPORT hipsparseStatus_t hipsparseDnMatSetStridedBatch(hipsparseDnMatDescr_t dnMatDescr, int batchCount, int64_t batchStride);
// CHECK: status_t = hipsparseDnMatSetStridedBatch(dnMatDescr_t, batchCount, batchStride);
status_t = cusparseDnMatSetStridedBatch(dnMatDescr_t, batchCount, batchStride);

#if CUSPARSE_VERSION >= 10200
// CHECK: hipsparseIndexType_t INDEX_64I = HIPSPARSE_INDEX_64I;
cusparseIndexType_t INDEX_64I = CUSPARSE_INDEX_64I;

// CUDA: cusparseStatus_t CUSPARSEAPI cusparseCooGet(cusparseSpMatDescr_t spMatDescr, int64_t* rows, int64_t* cols, int64_t* nnz, void** cooRowInd, void** cooColInd, void** cooValues, cusparseIndexType_t* idxType, cusparseIndexBase_t* idxBase, cudaDataType* valueType);
// HIP: hipsparseStatus_t hipsparseCooGet(const hipsparseSpMatDescr_t spMatDescr, int64_t* rows, int64_t* cols, int64_t* nnz, void** cooRowInd, void** cooColInd, void** cooValues, hipsparseIndexType_t* idxType, hipsparseIndexBase_t* idxBase, hipDataType* valueType);
// CHECK: status_t = hipsparseCooGet(spMatDescr_t, &rows, &cols, &nnz, &cooRowInd, &cooColInd, &cooValues, &indexType_t, &indexBase_t, &dataType);
status_t = cusparseCooGet(spMatDescr_t, &rows, &cols, &nnz, &cooRowInd, &cooColInd, &cooValues, &indexType_t, &indexBase_t, &dataType);

// CUDA: cusparseStatus_t CUSPARSEAPI cusparseDnMatGet(cusparseDnMatDescr_t dnMatDescr, int64_t* rows, int64_t* cols, int64_t* ld, void** values, cudaDataType* type, cusparseOrder_t* order);
// HIP: HIPSPARSE_EXPORT hipsparseStatus_t hipsparseDnMatGet(const hipsparseDnMatDescr_t dnMatDescr, int64_t* rows, int64_t* cols, int64_t* ld, void** values, hipDataType* valueType, hipsparseOrder_t* order);
// CHECK: status_t = hipsparseDnMatGet(dnMatDescr_t, &rows, &cols, &ld, &values, &dataType, &order_t);
status_t = cusparseDnMatGet(dnMatDescr_t, &rows, &cols, &ld, &values, &dataType, &order_t);

#if CUDA_VERSION < 12000
// CUDA: cusparseStatus_t CUSPARSEAPI cusparseDnMatGetStridedBatch(cusparseDnMatDescr_t dnMatDescr, int* batchCount, int64_t* batchStride);
// HIP: HIPSPARSE_EXPORT hipsparseStatus_t hipsparseDnMatGetStridedBatch(hipsparseDnMatDescr_t dnMatDescr, int* batchCount, int64_t* batchStride);
// CHECK: status_t = hipsparseDnMatGetStridedBatch(dnMatDescr_t, &batchCount, &batchStride);
status_t = cusparseDnMatGetStridedBatch(dnMatDescr_t, &batchCount, &batchStride);
#endif
#endif

#if CUDA_VERSION < 12000
// CUDA: cusparseStatus_t CUSPARSEAPI cusparseDestroySpMat(cusparseSpMatDescr_t spMatDescr);
// HIP: HIPSPARSE_EXPORT hipsparseStatus_t hipsparseDestroySpMat(hipsparseSpMatDescr_t spMatDescr);
Expand All @@ -1943,11 +1974,6 @@ int main() {
// CHECK: status_t = hipsparseDestroyDnMat(dnMatDescr_t);
status_t = cusparseDestroyDnMat(dnMatDescr_t);

// CUDA: cusparseStatus_t CUSPARSEAPI cusparseDnMatGetStridedBatch(cusparseDnMatDescr_t dnMatDescr, int* batchCount, int64_t* batchStride);
// HIP: HIPSPARSE_EXPORT hipsparseStatus_t hipsparseDnMatGetStridedBatch(hipsparseDnMatDescr_t dnMatDescr, int* batchCount, int64_t* batchStride);
// CHECK: status_t = hipsparseDnMatGetStridedBatch(dnMatDescr_t, &batchCount, &batchStride);
status_t = cusparseDnMatGetStridedBatch(dnMatDescr_t, &batchCount, &batchStride);

// CUDA: cusparseStatus_t CUSPARSEAPI cusparseSpMM_bufferSize(cusparseHandle_t handle, cusparseOperation_t opA, cusparseOperation_t opB, const void* alpha, const cusparseSpMatDescr_t matA, const cusparseDnMatDescr_t matB, const void* beta, cusparseDnMatDescr_t matC, cudaDataType computeType, cusparseSpMMAlg_t alg, size_t* bufferSize);
// HIP: hipsparseStatus_t hipsparseSpMM_bufferSize(hipsparseHandle_t handle, hipsparseOperation_t opA, hipsparseOperation_t opB, const void* alpha, const hipsparseSpMatDescr_t matA, const hipsparseDnMatDescr_t matB, const void* beta, const hipsparseDnMatDescr_t matC, hipDataType computeType, hipsparseSpMMAlg_t alg, size_t* bufferSize);
// CHECK: status_t = hipsparseSpMM_bufferSize(handle_t, opA, opB, alpha, spmatA, dnmatB, beta, dnmatC, dataType, spMMAlg_t, &bufferSize);
Expand All @@ -1959,26 +1985,6 @@ int main() {
// CHECK: status_t = hipsparseSpMM(handle_t, opA, opB, alpha, spmatA, dnmatB, beta, dnmatC, dataType, spMMAlg_t, tempBuffer);
status_t = cusparseSpMM(handle_t, opA, opB, alpha, spmatA, dnmatB, beta, dnmatC, dataType, spMMAlg_t, tempBuffer);
#endif

// CUDA: cusparseStatus_t CUSPARSEAPI cusparseCooGet(cusparseSpMatDescr_t spMatDescr, int64_t* rows, int64_t* cols, int64_t* nnz, void** cooRowInd, void** cooColInd, void** cooValues, cusparseIndexType_t* idxType, cusparseIndexBase_t* idxBase, cudaDataType* valueType);
// HIP: hipsparseStatus_t hipsparseCooGet(const hipsparseSpMatDescr_t spMatDescr, int64_t* rows, int64_t* cols, int64_t* nnz, void** cooRowInd, void** cooColInd, void** cooValues, hipsparseIndexType_t* idxType, hipsparseIndexBase_t* idxBase, hipDataType* valueType);
// CHECK: status_t = hipsparseCooGet(spMatDescr_t, &rows, &cols, &nnz, &cooRowInd, &cooColInd, &cooValues, &indexType_t, &indexBase_t, &dataType);
status_t = cusparseCooGet(spMatDescr_t, &rows, &cols, &nnz, &cooRowInd, &cooColInd, &cooValues, &indexType_t, &indexBase_t, &dataType);

// CUDA: cusparseStatus_t CUSPARSEAPI cusparseCreateDnMat(cusparseDnMatDescr_t* dnMatDescr, int64_t rows, int64_t cols, int64_t ld, void* values, cudaDataType valueType, cusparseOrder_t order);
// HIP: HIPSPARSE_EXPORT hipsparseStatus_t hipsparseCreateDnMat(hipsparseDnMatDescr_t* dnMatDescr, int64_t rows, int64_t cols, int64_t ld, void* values, hipDataType valueType, hipsparseOrder_t order);
// CHECK: status_t = hipsparseCreateDnMat(&dnMatDescr_t, rows, cols, ld, values, dataType, order_t);
status_t = cusparseCreateDnMat(&dnMatDescr_t, rows, cols, ld, values, dataType, order_t);

// CUDA: cusparseStatus_t CUSPARSEAPI cusparseDnMatGet(cusparseDnMatDescr_t dnMatDescr, int64_t* rows, int64_t* cols, int64_t* ld, void** values, cudaDataType* type, cusparseOrder_t* order);
// HIP: HIPSPARSE_EXPORT hipsparseStatus_t hipsparseDnMatGet(const hipsparseDnMatDescr_t dnMatDescr, int64_t* rows, int64_t* cols, int64_t* ld, void** values, hipDataType* valueType, hipsparseOrder_t* order);
// CHECK: status_t = hipsparseDnMatGet(dnMatDescr_t, &rows, &cols, &ld, &values, &dataType, &order_t);
status_t = cusparseDnMatGet(dnMatDescr_t, &rows, &cols, &ld, &values, &dataType, &order_t);

// CUDA: cusparseStatus_t CUSPARSEAPI cusparseDnMatSetStridedBatch(cusparseDnMatDescr_t dnMatDescr, int batchCount, int64_t batchStride);
// HIP: HIPSPARSE_EXPORT hipsparseStatus_t hipsparseDnMatSetStridedBatch(hipsparseDnMatDescr_t dnMatDescr, int batchCount, int64_t batchStride);
// CHECK: status_t = hipsparseDnMatSetStridedBatch(dnMatDescr_t, batchCount, batchStride);
status_t = cusparseDnMatSetStridedBatch(dnMatDescr_t, batchCount, batchStride);
#endif

#if (CUDA_VERSION >= 10010 && CUDA_VERSION < 11000 && !defined(_WIN32)) || (CUDA_VERSION >= 11000 && CUDA_VERSION < 12000)
Expand Down
37 changes: 21 additions & 16 deletions tests/unit_tests/synthetic/libraries/cusparse2rocsparse.cu
Original file line number Diff line number Diff line change
Expand Up @@ -1675,7 +1675,6 @@ int main() {
// CHECK-NEXT: rocsparse_indextype ellIdxType;
// CHECK-NEXT: rocsparse_indextype INDEX_16U = rocsparse_indextype_u16;
// CHECK-NEXT: rocsparse_indextype INDEX_32I = rocsparse_indextype_i32;
// CHECK-NEXT: rocsparse_indextype INDEX_64I = rocsparse_indextype_i64;
cusparseIndexType_t indexType_t;
cusparseIndexType_t csrRowOffsetsType;
cusparseIndexType_t cscColOffsetsType;
Expand All @@ -1684,7 +1683,6 @@ int main() {
cusparseIndexType_t ellIdxType;
cusparseIndexType_t INDEX_16U = CUSPARSE_INDEX_16U;
cusparseIndexType_t INDEX_32I = CUSPARSE_INDEX_32I;
cusparseIndexType_t INDEX_64I = CUSPARSE_INDEX_64I;

// CHECK: rocsparse_format format_t;
// CHECK-NEXT: rocsparse_format FORMAT_CSR = rocsparse_format_csr;
Expand All @@ -1710,25 +1708,37 @@ int main() {
// CHECK: status_t = rocsparse_create_coo_descr(&spMatDescr_t, rows, cols, nnz, cooRowInd, cooColInd, cooValues, indexType_t, indexBase_t, dataType);
status_t = cusparseCreateCoo(&spMatDescr_t, rows, cols, nnz, cooRowInd, cooColInd, cooValues, indexType_t, indexBase_t, dataType);

// CUDA: cusparseStatus_t CUSPARSEAPI cusparseCooGet(cusparseSpMatDescr_t spMatDescr, int64_t* rows, int64_t* cols, int64_t* nnz, void** cooRowInd, void** cooColInd, void** cooValues, cusparseIndexType_t* idxType, cusparseIndexBase_t* idxBase, cudaDataType* valueType);
// ROC: ROCSPARSE_EXPORT rocsparse_status rocsparse_coo_get(const rocsparse_spmat_descr descr, int64_t* rows, int64_t* cols, int64_t* nnz, void** coo_row_ind, void** coo_col_ind, void** coo_val, rocsparse_indextype* idx_type, rocsparse_index_base* idx_base, rocsparse_datatype* data_type);
// CHECK: status_t = rocsparse_coo_get(spMatDescr_t, &rows, &cols, &nnz, &cooRowInd, &cooColInd, &cooValues, &indexType_t, &indexBase_t, &dataType);
status_t = cusparseCooGet(spMatDescr_t, &rows, &cols, &nnz, &cooRowInd, &cooColInd, &cooValues, &indexType_t, &indexBase_t, &dataType);

// CUDA: cusparseStatus_t CUSPARSEAPI cusparseCreateDnMat(cusparseDnMatDescr_t* dnMatDescr, int64_t rows, int64_t cols, int64_t ld, void* values, cudaDataType valueType, cusparseOrder_t order);
// ROC: ROCSPARSE_EXPORT rocsparse_status rocsparse_create_dnmat_descr(rocsparse_dnmat_descr* descr, int64_t rows, int64_t cols, int64_t ld, void* values, rocsparse_datatype data_type, rocsparse_order order);
// CHECK: status_t = rocsparse_create_dnmat_descr(&dnMatDescr_t, rows, cols, ld, values, dataType, order_t);
status_t = cusparseCreateDnMat(&dnMatDescr_t, rows, cols, ld, values, dataType, order_t);

// CUDA: cusparseStatus_t CUSPARSEAPI cusparseDnMatSetStridedBatch(cusparseDnMatDescr_t dnMatDescr, int batchCount, int64_t batchStride);
// ROC: ROCSPARSE_EXPORT rocsparse_status rocsparse_dnmat_set_strided_batch(rocsparse_dnmat_descr descr, int batch_count, int64_t batch_stride);
// CHECK: status_t = rocsparse_dnmat_set_strided_batch(dnMatDescr_t, batchCount, batchStride);
status_t = cusparseDnMatSetStridedBatch(dnMatDescr_t, batchCount, batchStride);

#if CUSPARSE_VERSION >= 10200
// CHECK: rocsparse_indextype INDEX_64I = rocsparse_indextype_i64;
cusparseIndexType_t INDEX_64I = CUSPARSE_INDEX_64I;

// CUDA: cusparseStatus_t CUSPARSEAPI cusparseCooGet(cusparseSpMatDescr_t spMatDescr, int64_t* rows, int64_t* cols, int64_t* nnz, void** cooRowInd, void** cooColInd, void** cooValues, cusparseIndexType_t* idxType, cusparseIndexBase_t* idxBase, cudaDataType* valueType);
// ROC: ROCSPARSE_EXPORT rocsparse_status rocsparse_coo_get(const rocsparse_spmat_descr descr, int64_t* rows, int64_t* cols, int64_t* nnz, void** coo_row_ind, void** coo_col_ind, void** coo_val, rocsparse_indextype* idx_type, rocsparse_index_base* idx_base, rocsparse_datatype* data_type);
// CHECK: status_t = rocsparse_coo_get(spMatDescr_t, &rows, &cols, &nnz, &cooRowInd, &cooColInd, &cooValues, &indexType_t, &indexBase_t, &dataType);
status_t = cusparseCooGet(spMatDescr_t, &rows, &cols, &nnz, &cooRowInd, &cooColInd, &cooValues, &indexType_t, &indexBase_t, &dataType);

// CUDA: cusparseStatus_t CUSPARSEAPI cusparseDnMatGet(cusparseDnMatDescr_t dnMatDescr, int64_t* rows, int64_t* cols, int64_t* ld, void** values, cudaDataType* type, cusparseOrder_t* order);
// ROC: ROCSPARSE_EXPORT rocsparse_status rocsparse_dnmat_get(const rocsparse_dnmat_descr descr, int64_t* rows, int64_t* cols, int64_t* ld, void** values, rocsparse_datatype* data_type, rocsparse_order* order);
// CHECK: status_t = rocsparse_dnmat_get(dnMatDescr_t, &rows, &cols, &ld, &values, &dataType, &order_t);
status_t = cusparseDnMatGet(dnMatDescr_t, &rows, &cols, &ld, &values, &dataType, &order_t);

// CUDA: cusparseStatus_t CUSPARSEAPI cusparseDnMatSetStridedBatch(cusparseDnMatDescr_t dnMatDescr, int batchCount, int64_t batchStride);
// ROC: ROCSPARSE_EXPORT rocsparse_status rocsparse_dnmat_set_strided_batch(rocsparse_dnmat_descr descr, int batch_count, int64_t batch_stride);
// CHECK: status_t = rocsparse_dnmat_set_strided_batch(dnMatDescr_t, batchCount, batchStride);
status_t = cusparseDnMatSetStridedBatch(dnMatDescr_t, batchCount, batchStride);
#if CUDA_VERSION < 12000
// CUDA: cusparseStatus_t CUSPARSEAPI cusparseDnMatGetStridedBatch(cusparseConstDnMatDescr_t dnMatDescr, int* batchCount, int64_t* batchStride);
// ROC: ROCSPARSE_EXPORT rocsparse_status rocsparse_dnmat_get_strided_batch(rocsparse_dnmat_descr descr, int* batch_count, int64_t* batch_stride);
// CHECK: status_t = rocsparse_dnmat_get_strided_batch(dnMatDescr_t, &batchCount, &batchStride);
status_t = cusparseDnMatGetStridedBatch(dnMatDescr_t, &batchCount, &batchStride);
#endif
#endif

#if CUDA_VERSION < 12000
// CUDA: cusparseStatus_t CUSPARSEAPI cusparseDestroySpMat(cusparseSpMatDescr_t spMatDescr);
Expand All @@ -1750,11 +1760,6 @@ int main() {
// ROC: ROCSPARSE_EXPORT rocsparse_status rocsparse_destroy_dnmat_descr(rocsparse_dnmat_descr descr);
// CHECK: status_t = rocsparse_destroy_dnmat_descr(dnMatDescr_t);
status_t = cusparseDestroyDnMat(dnMatDescr_t);

// CUDA: cusparseStatus_t CUSPARSEAPI cusparseDnMatGetStridedBatch(cusparseConstDnMatDescr_t dnMatDescr, int* batchCount, int64_t* batchStride);
// ROC: ROCSPARSE_EXPORT rocsparse_status rocsparse_dnmat_get_strided_batch(rocsparse_dnmat_descr descr, int* batch_count, int64_t* batch_stride);
// CHECK: status_t = rocsparse_dnmat_get_strided_batch(dnMatDescr_t, &batchCount, &batchStride);
status_t = cusparseDnMatGetStridedBatch(dnMatDescr_t, &batchCount, &batchStride);
#endif
#endif

Expand Down

0 comments on commit cfe3ce8

Please sign in to comment.