Skip to content

Commit 85a74ed

Browse files
authored
clean up handling of GPU errors (#116)
1 parent 0196941 commit 85a74ed

File tree

5 files changed

+12
-17
lines changed

5 files changed

+12
-17
lines changed

include/hydrogen/device/gpu/cuda/CUDAError.hpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,8 @@
2121
auto h_check_cuda_error_code__ = cmd; \
2222
H_ASSERT(h_check_cuda_error_code__ == cudaSuccess, \
2323
::hydrogen::CUDAError, \
24-
(cudaDeviceReset(), \
2524
::hydrogen::cuda::BuildCUDAErrorMessage( \
26-
#cmd, h_check_cuda_error_code__))); \
25+
#cmd, h_check_cuda_error_code__)); \
2726
H_SYNC_CUDA(); \
2827
} while (false)
2928

include/hydrogen/device/gpu/cuda/cuBLASError.hpp

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,9 @@
1616
auto h_check_cublas_err_code__ = cmd; \
1717
H_ASSERT(h_check_cublas_err_code__ == CUBLAS_STATUS_SUCCESS, \
1818
cuBLASError, \
19-
(cudaDeviceReset(), \
20-
cublas::BuildcuBLASErrorMessage( \
21-
#cmd, \
22-
h_check_cublas_err_code__))); \
19+
cublas::BuildcuBLASErrorMessage( \
20+
#cmd, \
21+
h_check_cublas_err_code__)); \
2322
H_SYNC_CUDA(); \
2423
} while (false)
2524

include/hydrogen/device/gpu/cuda/cuSOLVERError.hpp

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,9 @@
1616
auto h_check_cusolver_err_code__ = cmd; \
1717
H_ASSERT(h_check_cusolver_err_code__ == CUSOLVER_STATUS_SUCCESS, \
1818
cuSOLVERError, \
19-
(cudaDeviceReset(), \
20-
cusolver::BuildcuSOLVERErrorMessage( \
21-
#cmd, \
22-
h_check_cusolver_err_code__))); \
19+
cusolver::BuildcuSOLVERErrorMessage( \
20+
#cmd, \
21+
h_check_cusolver_err_code__)); \
2322
H_SYNC_CUDA(); \
2423
} while (false)
2524

include/hydrogen/device/gpu/rocm/ROCmError.hpp

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,8 @@
2121
auto h_check_hip_error_code__ = cmd; \
2222
H_ASSERT(h_check_hip_error_code__ == hipSuccess, \
2323
::hydrogen::HIPError, \
24-
(hipDeviceReset(), \
25-
::hydrogen::rocm::BuildHipErrorMessage( \
26-
#cmd, h_check_hip_error_code__))); \
24+
::hydrogen::rocm::BuildHipErrorMessage( \
25+
#cmd, h_check_hip_error_code__)); \
2726
H_SYNC_HIP(); \
2827
} while (false)
2928

include/hydrogen/device/gpu/rocm/rocBLASError.hpp

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,9 @@
1616
auto h_check_rocblas_err_code__ = cmd; \
1717
H_ASSERT(h_check_rocblas_err_code__ == rocblas_status_success, \
1818
rocBLASError, \
19-
(hipDeviceReset(), \
20-
rocblas::BuildrocBLASErrorMessage( \
21-
#cmd, \
22-
h_check_rocblas_err_code__))); \
19+
rocblas::BuildrocBLASErrorMessage( \
20+
#cmd, \
21+
h_check_rocblas_err_code__)); \
2322
H_SYNC_HIP(); \
2423
} while (false)
2524

0 commit comments

Comments
 (0)