File tree Expand file tree Collapse file tree 2 files changed +19
-6
lines changed Expand file tree Collapse file tree 2 files changed +19
-6
lines changed Original file line number Diff line number Diff line change @@ -450,12 +450,20 @@ if(UMF_BUILD_GPU_TESTS AND UMF_BUILD_CUDA_PROVIDER)
450
450
LIBS ${UMF_UTILS_FOR_TEST} cuda )
451
451
452
452
add_umf_test (
453
- NAME provider_cuda_dlopen
453
+ NAME provider_cuda_dlopen_global
454
454
SRCS providers/provider_cuda.cpp providers/cuda_helpers.cpp
455
455
${BA_SOURCES_FOR_TEST}
456
456
LIBS ${UMF_UTILS_FOR_TEST} )
457
- target_compile_definitions (umf_test-provider_cuda_dlopen
458
- PUBLIC USE_DLOPEN=1 )
457
+ target_compile_definitions (umf_test-provider_cuda_dlopen_global
458
+ PUBLIC USE_DLOPEN=1 OPEN_CU_LIBRARY_GLOBAL=1 )
459
+
460
+ add_umf_test (
461
+ NAME provider_cuda_dlopen_local
462
+ SRCS providers/provider_cuda.cpp providers/cuda_helpers.cpp
463
+ ${BA_SOURCES_FOR_TEST}
464
+ LIBS ${UMF_UTILS_FOR_TEST} )
465
+ target_compile_definitions (umf_test-provider_cuda_dlopen_local
466
+ PUBLIC USE_DLOPEN=1 OPEN_CU_LIBRARY_GLOBAL=0 )
459
467
else ()
460
468
message (
461
469
STATUS
Original file line number Diff line number Diff line change @@ -113,10 +113,15 @@ int InitCUDAOps() {
113
113
const char *lib_name = " libcuda.so" ;
114
114
#endif
115
115
// CUDA symbols
116
- // NOTE that we use UMF_UTIL_OPEN_LIBRARY_GLOBAL which add all loaded
117
- // symbols to the global symbol table.
116
+ #if OPEN_CU_LIBRARY_GLOBAL
117
+ // NOTE UMF_UTIL_OPEN_LIBRARY_GLOBAL adds all loaded symbols to the
118
+ // global symbol table.
119
+ int open_flags = UMF_UTIL_OPEN_LIBRARY_GLOBAL;
120
+ #else
121
+ int open_flags = 0 ;
122
+ #endif
118
123
cuDlHandle = std::unique_ptr<void , DlHandleCloser>(
119
- utils_open_library (lib_name, UMF_UTIL_OPEN_LIBRARY_GLOBAL ));
124
+ utils_open_library (lib_name, open_flags ));
120
125
121
126
// NOTE: some symbols defined in the lib have _vX postfixes - this is
122
127
// important to load the proper version of functions
You can’t perform that action at this time.
0 commit comments