Skip to content

Commit 2bae0a5

Browse files
committed
UCT/CUDA: CUDA call logging enhancment.
1 parent 5f5638e commit 2bae0a5

File tree

1 file changed

+8
-10
lines changed

1 file changed

+8
-10
lines changed

src/uct/cuda/base/cuda_iface.h

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -48,16 +48,14 @@ const char *uct_cuda_base_cu_get_error_string(CUresult result);
4848

4949
#define UCT_CUDADRV_FUNC(_func, _log_level) \
5050
({ \
51-
ucs_status_t _status = UCS_OK; \
52-
do { \
53-
CUresult _result = (_func); \
54-
if (CUDA_ERROR_NOT_READY == _result) { \
55-
_status = UCS_INPROGRESS; \
56-
} else if (CUDA_SUCCESS != _result) { \
57-
UCT_CUDADRV_LOG(_func, _log_level, _result); \
58-
_status = UCS_ERR_IO_ERROR; \
59-
} \
60-
} while (0); \
51+
CUresult _result = (_func); \
52+
ucs_status_t _status; \
53+
if (ucs_likely(_result == CUDA_SUCCESS)) { \
54+
_status = UCS_OK; \
55+
} else { \
56+
UCT_CUDADRV_LOG(_func, _log_level, _result); \
57+
_status = UCS_ERR_IO_ERROR; \
58+
} \
6159
_status; \
6260
})
6361

0 commit comments

Comments
 (0)