Skip to content

Commit

Permalink
fixing solve(rhs) vs solve(x, rhs) discrepancy (#119)
Browse files Browse the repository at this point in the history
* fixing solve(rhs) vs solve(x, rhs) discrepancy

---------

Co-authored-by: Slaven Peles <[email protected]>
  • Loading branch information
kswirydo and pelesh authored Dec 15, 2023
1 parent 54df520 commit 5c63646
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 8 deletions.
10 changes: 4 additions & 6 deletions resolve/LinSolverDirectRocSolverRf.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -261,7 +261,7 @@ namespace ReSolve
L_csr_->getNnz(),
&(constants::ONE),
descr_L_,
L_csr_->getValues(ReSolve::memory::DEVICE), //vals_,
L_csr_->getValues(ReSolve::memory::DEVICE),
L_csr_->getRowData(ReSolve::memory::DEVICE),
L_csr_->getColData(ReSolve::memory::DEVICE),
info_L_,
Expand All @@ -271,24 +271,22 @@ namespace ReSolve
L_buffer_);
error_sum += status_rocsparse_;

//mem_.deviceSynchronize();
rocsparse_dcsrsv_solve(workspace_->getRocsparseHandle(),
rocsparse_operation_none,
A_->getNumRows(),
U_csr_->getNnz(),
&(constants::ONE),
descr_L_,
U_csr_->getValues(ReSolve::memory::DEVICE), //vals_,
descr_U_,
U_csr_->getValues(ReSolve::memory::DEVICE),
U_csr_->getRowData(ReSolve::memory::DEVICE),
U_csr_->getColData(ReSolve::memory::DEVICE),
info_U_,
d_aux2_, //input
d_aux1_,//result
d_aux1_, //result
rocsparse_solve_policy_auto,
U_buffer_);
error_sum += status_rocsparse_;

//mem_.deviceSynchronize();
permuteVectorQ(A_->getNumRows(), d_Q_,d_aux1_,rhs->getData(ReSolve::memory::DEVICE));
mem_.deviceSynchronize();
}
Expand Down
3 changes: 1 addition & 2 deletions tests/functionality/testKLU_RocSolver_FGMRES.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -197,8 +197,7 @@ int main(int argc, char *argv[])
error_sum += status;

vec_x->update(rhs, ReSolve::memory::HOST, ReSolve::memory::DEVICE);
// TODO: Investigate why results are different when using Rf->solve(vec_x) !!
status = Rf->solve(vec_rhs, vec_x);
status = Rf->solve(vec_x);
error_sum += status;

FGMRES->resetMatrix(A);
Expand Down

0 comments on commit 5c63646

Please sign in to comment.