Skip to content

Commit

Permalink
clean up handling of GPU errors (#116)
Browse files Browse the repository at this point in the history
  • Loading branch information
benson31 authored Feb 3, 2021
1 parent 0196941 commit 85a74ed
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 17 deletions.
3 changes: 1 addition & 2 deletions include/hydrogen/device/gpu/cuda/CUDAError.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,8 @@
auto h_check_cuda_error_code__ = cmd; \
H_ASSERT(h_check_cuda_error_code__ == cudaSuccess, \
::hydrogen::CUDAError, \
(cudaDeviceReset(), \
::hydrogen::cuda::BuildCUDAErrorMessage( \
#cmd, h_check_cuda_error_code__))); \
#cmd, h_check_cuda_error_code__)); \
H_SYNC_CUDA(); \
} while (false)

Expand Down
7 changes: 3 additions & 4 deletions include/hydrogen/device/gpu/cuda/cuBLASError.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,9 @@
auto h_check_cublas_err_code__ = cmd; \
H_ASSERT(h_check_cublas_err_code__ == CUBLAS_STATUS_SUCCESS, \
cuBLASError, \
(cudaDeviceReset(), \
cublas::BuildcuBLASErrorMessage( \
#cmd, \
h_check_cublas_err_code__))); \
cublas::BuildcuBLASErrorMessage( \
#cmd, \
h_check_cublas_err_code__)); \
H_SYNC_CUDA(); \
} while (false)

Expand Down
7 changes: 3 additions & 4 deletions include/hydrogen/device/gpu/cuda/cuSOLVERError.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,9 @@
auto h_check_cusolver_err_code__ = cmd; \
H_ASSERT(h_check_cusolver_err_code__ == CUSOLVER_STATUS_SUCCESS, \
cuSOLVERError, \
(cudaDeviceReset(), \
cusolver::BuildcuSOLVERErrorMessage( \
#cmd, \
h_check_cusolver_err_code__))); \
cusolver::BuildcuSOLVERErrorMessage( \
#cmd, \
h_check_cusolver_err_code__)); \
H_SYNC_CUDA(); \
} while (false)

Expand Down
5 changes: 2 additions & 3 deletions include/hydrogen/device/gpu/rocm/ROCmError.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,8 @@
auto h_check_hip_error_code__ = cmd; \
H_ASSERT(h_check_hip_error_code__ == hipSuccess, \
::hydrogen::HIPError, \
(hipDeviceReset(), \
::hydrogen::rocm::BuildHipErrorMessage( \
#cmd, h_check_hip_error_code__))); \
::hydrogen::rocm::BuildHipErrorMessage( \
#cmd, h_check_hip_error_code__)); \
H_SYNC_HIP(); \
} while (false)

Expand Down
7 changes: 3 additions & 4 deletions include/hydrogen/device/gpu/rocm/rocBLASError.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,9 @@
auto h_check_rocblas_err_code__ = cmd; \
H_ASSERT(h_check_rocblas_err_code__ == rocblas_status_success, \
rocBLASError, \
(hipDeviceReset(), \
rocblas::BuildrocBLASErrorMessage( \
#cmd, \
h_check_rocblas_err_code__))); \
rocblas::BuildrocBLASErrorMessage( \
#cmd, \
h_check_rocblas_err_code__)); \
H_SYNC_HIP(); \
} while (false)

Expand Down

0 comments on commit 85a74ed

Please sign in to comment.