Skip to content

Commit

Permalink
deadlock instead of segfault
Browse files Browse the repository at this point in the history
  • Loading branch information
kswirydo committed Oct 28, 2023
1 parent 71e066d commit 7b5b6ec
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
7 changes: 7 additions & 0 deletions resolve/LinSolverDirectRocSolverRf.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ namespace ReSolve
mem_.copyArrayHostToDevice(d_Q_, Q, n);


mem_.deviceSynchronize();
status_rocblas_ = rocsolver_dcsrrf_analysis(workspace_->getRocblasHandle(),
n,
1,
Expand Down Expand Up @@ -68,6 +69,7 @@ namespace ReSolve
int LinSolverDirectRocSolverRf::refactorize()
{
int error_sum = 0;
mem_.deviceSynchronize();
status_rocblas_ = rocsolver_dcsrrf_refactlu(workspace_->getRocblasHandle(),
A_->getNumRows(),
A_->getNnzExpanded(),
Expand All @@ -83,6 +85,7 @@ namespace ReSolve
infoM_);


mem_.deviceSynchronize();
error_sum += status_rocblas_;

return error_sum;
Expand All @@ -92,6 +95,7 @@ namespace ReSolve
int LinSolverDirectRocSolverRf::solve(vector_type* rhs)
{
if (solve_mode_ == 0) {
mem_.deviceSynchronize();
status_rocblas_ = rocsolver_dcsrrf_solve(workspace_->getRocblasHandle(),
A_->getNumRows(),
1,
Expand All @@ -104,6 +108,7 @@ namespace ReSolve
rhs->getData("hip"),
A_->getNumRows(),
infoM_);
mem_.deviceSynchronize();
} else {
// not implemented yet
}
Expand All @@ -116,6 +121,7 @@ namespace ReSolve
x->setDataUpdated("hip");

if (solve_mode_ == 0) {
mem_.deviceSynchronize();
status_rocblas_ = rocsolver_dcsrrf_solve(workspace_->getRocblasHandle(),
A_->getNumRows(),
1,
Expand All @@ -128,6 +134,7 @@ namespace ReSolve
x->getData("hip"),
A_->getNumRows(),
infoM_);
mem_.deviceSynchronize();
} else {
// not implemented yet
}
Expand Down
2 changes: 1 addition & 1 deletion tests/functionality/testKLU_RocSolver.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,7 @@ printf("ERROR in sol %16.16f \n", normDiffMatrix1);
status = Rf->refactorize();
error_sum += status;

#if 0
#if 1
std::cout<<"rocSolverRf refactorization status: "<<status<<std::endl;
status = Rf->solve(vec_rhs, vec_x);
error_sum += status;
Expand Down

0 comments on commit 7b5b6ec

Please sign in to comment.