Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix for csr2csr_compress and nnz_compress #123

Merged
merged 3 commits into from
Jun 22, 2020
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 4 additions & 20 deletions library/src/hcc_detail/hipsparse.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6284,10 +6284,6 @@ hipsparseStatus_t hipsparseCcsr2csr_compress(hipsparseHandle_t handle,
int* csrRowPtrC,
hipComplex tol)
{
rocsparse_float_complex rtol;
rtol.x = tol.x;
rtol.y = tol.y;

return rocSPARSEStatusToHIPStatus(
rocsparse_ccsr2csr_compress((rocsparse_handle)handle,
m,
Expand All @@ -6301,7 +6297,7 @@ hipsparseStatus_t hipsparseCcsr2csr_compress(hipsparseHandle_t handle,
(rocsparse_float_complex*)csrValC,
csrRowPtrC,
csrColIndC,
rtol));
{hipCrealf(tol), hipCimagf(tol)}));
}

hipsparseStatus_t hipsparseZcsr2csr_compress(hipsparseHandle_t handle,
Expand All @@ -6318,10 +6314,6 @@ hipsparseStatus_t hipsparseZcsr2csr_compress(hipsparseHandle_t handle,
int* csrRowPtrC,
hipDoubleComplex tol)
{
rocsparse_double_complex rtol;
rtol.x = tol.x;
rtol.y = tol.y;

return rocSPARSEStatusToHIPStatus(
rocsparse_zcsr2csr_compress((rocsparse_handle)handle,
m,
Expand All @@ -6335,7 +6327,7 @@ hipsparseStatus_t hipsparseZcsr2csr_compress(hipsparseHandle_t handle,
(rocsparse_double_complex*)csrValC,
csrRowPtrC,
csrColIndC,
rtol));
{hipCreal(tol), hipCimag(tol)}));
}

hipsparseStatus_t hipsparseShyb2csr(hipsparseHandle_t handle,
Expand Down Expand Up @@ -7006,18 +6998,14 @@ hipsparseStatus_t hipsparseCnnz_compress(hipsparseHandle_t handle,
int* nnzC,
hipComplex tol)
{
rocsparse_float_complex rtol;
rtol.x = tol.x;
rtol.y = tol.y;

RETURN_IF_ROCSPARSE_ERROR(rocsparse_cnnz_compress((rocsparse_handle)handle,
m,
(const rocsparse_mat_descr)descrA,
(const rocsparse_float_complex*)csrValA,
csrRowPtrA,
nnzPerRow,
nnzC,
rtol));
{hipCrealf(tol), hipCimagf(tol)}));
return HIPSPARSE_STATUS_SUCCESS;
}

Expand All @@ -7030,18 +7018,14 @@ hipsparseStatus_t hipsparseZnnz_compress(hipsparseHandle_t handle,
int* nnzC,
hipDoubleComplex tol)
{
rocsparse_double_complex rtol;
rtol.x = tol.x;
rtol.y = tol.y;

RETURN_IF_ROCSPARSE_ERROR(rocsparse_znnz_compress((rocsparse_handle)handle,
m,
(const rocsparse_mat_descr)descrA,
(const rocsparse_double_complex*)csrValA,
csrRowPtrA,
nnzPerRow,
nnzC,
rtol));
{hipCreal(tol), hipCimag(tol)}));
return HIPSPARSE_STATUS_SUCCESS;
}

Expand Down
24 changes: 4 additions & 20 deletions library/src/nvcc_detail/hipsparse.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5213,18 +5213,14 @@ hipsparseStatus_t hipsparseCnnz_compress(hipsparseHandle_t handle,
int* nnzC,
hipComplex tol)
{
cuComplex cutol;
cutol.x = tol.x;
cutol.y = tol.y;

return hipCUSPARSEStatusToHIPStatus(cusparseCnnz_compress((cusparseHandle_t)handle,
m,
(const cusparseMatDescr_t)descrA,
(const cuComplex*)csrValA,
csrRowPtrA,
nnzPerRow,
nnzC,
cutol));
{cuCrealf(tol), cuCimagf(tol)}));
}

hipsparseStatus_t hipsparseZnnz_compress(hipsparseHandle_t handle,
Expand All @@ -5236,18 +5232,14 @@ hipsparseStatus_t hipsparseZnnz_compress(hipsparseHandle_t handle,
int* nnzC,
hipDoubleComplex tol)
{
cuDoubleComplex cutol;
cutol.x = tol.x;
cutol.y = tol.y;

return hipCUSPARSEStatusToHIPStatus(cusparseZnnz_compress((cusparseHandle_t)handle,
m,
(const cusparseMatDescr_t)descrA,
(const cuDoubleComplex*)csrValA,
csrRowPtrA,
nnzPerRow,
nnzC,
cutol));
{cuCreal(tol), cuCimag(tol)}));
}

hipsparseStatus_t hipsparseXcsr2coo(hipsparseHandle_t handle,
Expand Down Expand Up @@ -5773,10 +5765,6 @@ hipsparseStatus_t hipsparseCcsr2csr_compress(hipsparseHandle_t handle,
int* csrRowPtrC,
hipComplex tol)
{
cuComplex cutol;
cutol.x = tol.x;
cutol.y = tol.y;

return hipCUSPARSEStatusToHIPStatus(cusparseCcsr2csr_compress((cusparseHandle_t)handle,
m,
n,
Expand All @@ -5789,7 +5777,7 @@ hipsparseStatus_t hipsparseCcsr2csr_compress(hipsparseHandle_t handle,
(cuComplex*)csrValC,
csrColIndC,
csrRowPtrC,
cutol));
{cuCrealf(tol), cuCimagf(tol)}));
}

hipsparseStatus_t hipsparseZcsr2csr_compress(hipsparseHandle_t handle,
Expand All @@ -5806,10 +5794,6 @@ hipsparseStatus_t hipsparseZcsr2csr_compress(hipsparseHandle_t handle,
int* csrRowPtrC,
hipDoubleComplex tol)
{
cuDoubleComplex cutol;
cutol.x = tol.x;
cutol.y = tol.y;

return hipCUSPARSEStatusToHIPStatus(cusparseZcsr2csr_compress((cusparseHandle_t)handle,
m,
n,
Expand All @@ -5822,7 +5806,7 @@ hipsparseStatus_t hipsparseZcsr2csr_compress(hipsparseHandle_t handle,
(cuDoubleComplex*)csrValC,
csrColIndC,
csrRowPtrC,
cutol));
{cuCreal(tol), cuCimag(tol)}));
}

hipsparseStatus_t hipsparseShyb2csr(hipsparseHandle_t handle,
Expand Down