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()
146146message (STATUS "Building the offload library with support for "
147147 "the \" ${LIBOMPTARGET_PLUGINS_TO_BUILD} \" plugins" )
148148
149+ set (LIBOMPTARGET_DLOPEN_PLUGINS "${LIBOMPTARGET_PLUGINS_TO_BUILD} " CACHE STRING
150+ "Semicolon-separated list of plugins to use 'dlopen' for runtime linking" )
151+
149152set (LIBOMPTARGET_ENUM_PLUGIN_TARGETS "" )
150153foreach (plugin IN LISTS LIBOMPTARGET_PLUGINS_TO_BUILD)
151154 set (LIBOMPTARGET_ENUM_PLUGIN_TARGETS
Original file line number Diff line number Diff line change 33#
44# libffi : required to launch target kernels given function and argument
55# pointers.
6- # CUDA : required to control offloading to NVIDIA GPUs.
76
87include (FindPackageHandleStandardArgs)
98
@@ -43,13 +42,6 @@ endif()
4342find_package (FFI QUIET )
4443set (LIBOMPTARGET_DEP_LIBFFI_FOUND ${FFI_FOUND} )
4544
46- ################################################################################
47- # Looking for CUDA...
48- ################################################################################
49-
50- find_package (CUDAToolkit QUIET )
51- set (LIBOMPTARGET_DEP_CUDA_FOUND ${CUDAToolkit_FOUND} )
52-
5345################################################################################
5446# Looking for NVIDIA GPUs...
5547################################################################################
Original file line number Diff line number Diff line change @@ -13,8 +13,7 @@ target_sources(omptarget.rtl.amdgpu PRIVATE src/rtl.cpp)
1313target_include_directories (omptarget.rtl.amdgpu PRIVATE
1414 ${CMAKE_CURRENT_SOURCE_DIR} /utils)
1515
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)
1817 message (STATUS "Building AMDGPU plugin linked against libhsa" )
1918 target_link_libraries (omptarget.rtl.amdgpu PRIVATE hsa-runtime64::hsa-runtime64)
2019else ()
Original file line number Diff line number Diff line change @@ -10,8 +10,8 @@ add_target_library(omptarget.rtl.cuda CUDA)
1010
1111target_sources (omptarget.rtl.cuda PRIVATE src/rtl.cpp)
1212
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 )
1515 message (STATUS "Building CUDA plugin linked against libcuda" )
1616 target_link_libraries (omptarget.rtl.cuda PRIVATE CUDA::cuda_driver)
1717else ()
Original file line number Diff line number Diff line change @@ -454,6 +454,15 @@ Q: What command line options can I use for OpenMP?
454454We recommend taking a look at the OpenMP
455455:doc: `command line argument reference <CommandLineArgumentReference >` page.
456456
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+
457466Q: Why is my build taking a long time?
458467^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
459468When installing OpenMP and other LLVM components, the build time on multicore
You can’t perform that action at this time.
0 commit comments