File tree Expand file tree Collapse file tree 5 files changed +15
-12
lines changed Expand file tree Collapse file tree 5 files changed +15
-12
lines changed Original file line number Diff line number Diff line change @@ -146,6 +146,9 @@ endif()
146
146
message (STATUS "Building the offload library with support for "
147
147
"the \" ${LIBOMPTARGET_PLUGINS_TO_BUILD} \" plugins" )
148
148
149
+ set (LIBOMPTARGET_DLOPEN_PLUGINS "${LIBOMPTARGET_PLUGINS_TO_BUILD} " CACHE STRING
150
+ "Semicolon-separated list of plugins to use 'dlopen' for runtime linking" )
151
+
149
152
set (LIBOMPTARGET_ENUM_PLUGIN_TARGETS "" )
150
153
foreach (plugin IN LISTS LIBOMPTARGET_PLUGINS_TO_BUILD )
151
154
set (LIBOMPTARGET_ENUM_PLUGIN_TARGETS
Original file line number Diff line number Diff line change 3
3
#
4
4
# libffi : required to launch target kernels given function and argument
5
5
# pointers.
6
- # CUDA : required to control offloading to NVIDIA GPUs.
7
6
8
7
include (FindPackageHandleStandardArgs )
9
8
@@ -43,13 +42,6 @@ endif()
43
42
find_package (FFI QUIET )
44
43
set (LIBOMPTARGET_DEP_LIBFFI_FOUND ${FFI_FOUND} )
45
44
46
- ################################################################################
47
- # Looking for CUDA...
48
- ################################################################################
49
-
50
- find_package (CUDAToolkit QUIET )
51
- set (LIBOMPTARGET_DEP_CUDA_FOUND ${CUDAToolkit_FOUND} )
52
-
53
45
################################################################################
54
46
# Looking for NVIDIA GPUs...
55
47
################################################################################
Original file line number Diff line number Diff line change @@ -13,8 +13,7 @@ target_sources(omptarget.rtl.amdgpu PRIVATE src/rtl.cpp)
13
13
target_include_directories (omptarget.rtl.amdgpu PRIVATE
14
14
${CMAKE_CURRENT_SOURCE_DIR} /utils )
15
15
16
- option (LIBOMPTARGET_FORCE_DLOPEN_LIBHSA "Build with dlopened libhsa" ON )
17
- if (hsa-runtime64_FOUND AND NOT LIBOMPTARGET_FORCE_DLOPEN_LIBHSA )
16
+ if (hsa-runtime64_FOUND AND NOT "amdgpu" IN_LIST LIBOMPTARGET_DLOPEN_PLUGINS )
18
17
message (STATUS "Building AMDGPU plugin linked against libhsa" )
19
18
target_link_libraries (omptarget.rtl.amdgpu PRIVATE hsa-runtime64::hsa-runtime64 )
20
19
else ()
Original file line number Diff line number Diff line change @@ -10,8 +10,8 @@ add_target_library(omptarget.rtl.cuda CUDA)
10
10
11
11
target_sources (omptarget.rtl.cuda PRIVATE src/rtl.cpp )
12
12
13
- option ( LIBOMPTARGET_FORCE_DLOPEN_LIBCUDA "Build with dlopened libcuda" ON )
14
- if (LIBOMPTARGET_DEP_CUDA_FOUND AND NOT LIBOMPTARGET_FORCE_DLOPEN_LIBCUDA )
13
+ find_package ( CUDAToolkit QUIET )
14
+ if (CUDAToolkit_FOUND AND NOT "cuda" IN_LIST LIBOMPTARGET_DLOPEN_PLUGINS )
15
15
message (STATUS "Building CUDA plugin linked against libcuda" )
16
16
target_link_libraries (omptarget.rtl.cuda PRIVATE CUDA::cuda_driver )
17
17
else ()
Original file line number Diff line number Diff line change @@ -454,6 +454,15 @@ Q: What command line options can I use for OpenMP?
454
454
We recommend taking a look at the OpenMP
455
455
:doc: `command line argument reference <CommandLineArgumentReference >` page.
456
456
457
+ Q: Can I build the offloading runtimes without CUDA or HSA?
458
+ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
459
+ By default, the offloading runtime will load the associated vendor runtime
460
+ during initialization rather than directly linking against them. This allows the
461
+ program to be built and run on many machine. If you wish to directly link
462
+ against these libraries, use the ``LIBOMPTARGET_DLOPEN_PLUGINS="" `` option to
463
+ suppress it for each plugin. The default value is every plugin enabled with
464
+ ``LIBOMPTARGET_PLUGINS_TO_BUILD ``.
465
+
457
466
Q: Why is my build taking a long time?
458
467
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
459
468
When installing OpenMP and other LLVM components, the build time on multicore
You can’t perform that action at this time.
0 commit comments