Skip to content

Commit 357eea6

Browse files
Revert "[libomptarget][cuda] Gracefully handle missing cuda library"
This reverts commit fafd45c.
1 parent fdbfda2 commit 357eea6

File tree

3 files changed

+1
-7
lines changed

3 files changed

+1
-7
lines changed

openmp/libomptarget/plugins/cuda/dynamic_cuda/cuda.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ CUresult cuInit(unsigned X) {
9393
// Note: Called exactly once from cuda rtl.cpp in a global constructor so
9494
// does not need to handle being called repeatedly or concurrently
9595
if (!checkForCUDA()) {
96-
return CUDA_ERROR_INVALID_HANDLE;
96+
return CUDA_ERROR_INVALID_VALUE;
9797
}
9898
return dlwrap_cuInit(X);
9999
}

openmp/libomptarget/plugins/cuda/dynamic_cuda/cuda.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,6 @@ typedef struct CUstream_st *CUstream;
2626
typedef enum cudaError_enum {
2727
CUDA_SUCCESS = 0,
2828
CUDA_ERROR_INVALID_VALUE = 1,
29-
CUDA_ERROR_INVALID_HANDLE = 400,
3029
} CUresult;
3130

3231
typedef enum CUstream_flags_enum {

openmp/libomptarget/plugins/cuda/src/rtl.cpp

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -401,11 +401,6 @@ class DeviceRTLTy {
401401
DP("Start initializing CUDA\n");
402402

403403
CUresult Err = cuInit(0);
404-
if (Err == CUDA_ERROR_INVALID_HANDLE) {
405-
// Can't call cuGetErrorString if dlsym failed
406-
DP("Failed to load CUDA shared library\n");
407-
return;
408-
}
409404
if (!checkResult(Err, "Error returned from cuInit\n")) {
410405
return;
411406
}

0 commit comments

Comments
 (0)