Skip to content

Commit 228ca96

Browse files
authored
Merge pull request #11396 from wckzhang/error_invalid
accelerator/cuda: Add exception for CUDA_ERROR_INVALID_VALUE
2 parents 7a5e9c5 + 09b63d6 commit 228ca96

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

opal/mca/accelerator/cuda/accelerator_cuda.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -109,8 +109,10 @@ static int accelerator_cuda_check_addr(const void *addr, int *dev_id, uint64_t *
109109
*flags |= MCA_ACCELERATOR_FLAGS_UNIFIED_MEMORY;
110110
}
111111
if (CUDA_SUCCESS != result) {
112-
/* If cuda is not initialized, assume it is a host buffer. */
113-
if (CUDA_ERROR_NOT_INITIALIZED == result) {
112+
/* If cuda is not initialized, assume it is a host buffer. It can also
113+
* return invalid value if the ptr was not allocated by, mapped by,
114+
* or registered with a CUcontext */
115+
if (CUDA_ERROR_NOT_INITIALIZED == result || CUDA_ERROR_INVALID_VALUE == result) {
114116
return 0;
115117
} else {
116118
return OPAL_ERROR;

0 commit comments

Comments
 (0)