Prevent throwing in destructors

This commit is contained in:
Tong Dong Qiu 2023-03-24 10:44:37 +01:00
parent 675fab3534
commit bec51c4471

View File

@ -98,10 +98,22 @@ rocsparseSolverBackend<block_size>::rocsparseSolverBackend(int verbosity_, int m
template <unsigned int block_size>
rocsparseSolverBackend<block_size>::~rocsparseSolverBackend() {
HIP_CHECK(hipStreamSynchronize(stream));
HIP_CHECK(hipStreamDestroy(stream));
ROCSPARSE_CHECK(rocsparse_destroy_handle(handle));
ROCBLAS_CHECK(rocblas_destroy_handle(blas_handle));
hipError_t hipstatus = hipStreamSynchronize(stream);
if(hipstatus != hipSuccess){
OpmLog::error("Could not synchronize with hipStream");
}
hipstatus = hipStreamDestroy(stream);
if(hipstatus != hipSuccess){
OpmLog::error("Could not destroy hipStream");
}
rocsparse_status status1 = rocsparse_destroy_handle(handle);
if(status1 != rocsparse_status_success){
OpmLog::error("Could not destroy rocsparse handle");
}
rocblas_status status2 = rocblas_destroy_handle(blas_handle);
if(status2 != rocblas_status_success){
OpmLog::error("Could not destroy rocblas handle");
}
}