CodeQL / Analyze (actions) (push) Canceled after 0s
CodeQL / Analyze (python) (push) Canceled after 0s
pre-commit / pre-commit (push) Canceled after 0s
Multi-Arch CI / setup (push) Canceled after 0s
Publish build_manylinux_x86_64 images / publish_build_manylinux_x86_64 (push) Canceled after 0s
Setup (Multi-Arch) / setup (push) Canceled after 0s
Multi-Arch CI / Linux::${{ fromJSON(needs.setup.outputs.linux_build_config || '{}').build_variant_label || 'skip' }} (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Publish no_rocm_image_ubi10 image / publish_no_rocm_image_ubi10 (push) Canceled after 0s
Multi-Arch CI / Windows::${{ fromJSON(needs.setup.outputs.windows_build_config || '{}').build_variant_label || 'skip' }} (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Multi-Arch CI / Manifest Diff (push) Canceled after 0s
TheRock Manifest Diff Report / Generate Manifest Diff Report (push) Canceled after 0s
Multi-Arch CI / CI Summary (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04 (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04_ocl_rt images / publish_no_rocm_image_ubuntu24_04_ocl_rt (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_rocgdb (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04_rocgdb images / publish_no_rocm_image_ubuntu24_04_rocgdb (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_ocl_rt (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Unit Tests / Unit Tests :: ubuntu-24.04 (push) Canceled after 0s
Unit Tests / Unit Tests :: windows-2022 (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_media (push) Canceled after 0s
Unit Tests / Unit Tests Summary (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_openmpi (push) Canceled after 0s
75 lines
3.2 KiB
CMake
75 lines
3.2 KiB
CMake
# Try to detect in the system several dependencies required by the different
|
|
# components of libomptarget. These are the dependencies we have:
|
|
|
|
include (FindPackageHandleStandardArgs)
|
|
|
|
################################################################################
|
|
# Looking for LLVM...
|
|
################################################################################
|
|
# Note that OPENMP_STANDALONE_BUILD is FALSE, when
|
|
# openmp is built with -DLLVM_ENABLE_RUNTIMES="openmp" vs
|
|
# -DLLVM_ENABLE_PROJECTS="openmp", but openmp build
|
|
# is actually done as a standalone project build with many
|
|
# LLVM CMake variables propagated to it.
|
|
list(APPEND LIBOMPTARGET_LLVM_INCLUDE_DIRS
|
|
${LLVM_MAIN_INCLUDE_DIR} ${LLVM_BINARY_DIR}/include
|
|
)
|
|
message(STATUS
|
|
"Using LLVM include directories: ${LIBOMPTARGET_LLVM_INCLUDE_DIRS}")
|
|
|
|
################################################################################
|
|
# Looking for offload-arch...
|
|
################################################################################
|
|
if(TARGET offload-arch)
|
|
get_property(LIBOMPTARGET_OFFLOAD_ARCH TARGET offload-arch PROPERTY LOCATION)
|
|
else()
|
|
find_program(LIBOMPTARGET_OFFLOAD_ARCH NAMES offload-arch
|
|
PATHS ${LLVM_TOOLS_BINARY_DIR})
|
|
endif()
|
|
|
|
################################################################################
|
|
# Looking for NVIDIA GPUs...
|
|
################################################################################
|
|
if(LIBOMPTARGET_OFFLOAD_ARCH)
|
|
execute_process(COMMAND ${LIBOMPTARGET_OFFLOAD_ARCH} "--only=nvptx"
|
|
OUTPUT_VARIABLE LIBOMPTARGET_NVPTX_ARCH_OUTPUT
|
|
OUTPUT_STRIP_TRAILING_WHITESPACE)
|
|
string(FIND "${LIBOMPTARGET_NVPTX_ARCH_OUTPUT}" "\n" first_arch_string)
|
|
string(SUBSTRING "${LIBOMPTARGET_NVPTX_ARCH_OUTPUT}" 0 ${first_arch_string}
|
|
arch_string)
|
|
if(arch_string)
|
|
set(LIBOMPTARGET_FOUND_NVIDIA_GPU TRUE)
|
|
set(LIBOMPTARGET_NVPTX_DETECTED_ARCH_LIST "${nvptx_arch_list}")
|
|
endif()
|
|
endif()
|
|
|
|
################################################################################
|
|
# Looking for AMD GPUs...
|
|
################################################################################
|
|
if(LIBOMPTARGET_OFFLOAD_ARCH)
|
|
execute_process(COMMAND ${LIBOMPTARGET_OFFLOAD_ARCH} "--only=amdgpu"
|
|
OUTPUT_VARIABLE LIBOMPTARGET_AMDGPU_ARCH_OUTPUT
|
|
OUTPUT_STRIP_TRAILING_WHITESPACE)
|
|
string(REPLACE "\n" ";" amdgpu_arch_list "${LIBOMPTARGET_AMDGPU_ARCH_OUTPUT}")
|
|
if(amdgpu_arch_list)
|
|
set(LIBOMPTARGET_FOUND_AMDGPU_GPU TRUE)
|
|
set(LIBOMPTARGET_AMDGPU_DETECTED_ARCH_LIST "${amdgpu_arch_list}")
|
|
endif()
|
|
endif()
|
|
|
|
################################################################################
|
|
# Looking for Level0
|
|
################################################################################
|
|
if(LIBOMPTARGET_OFFLOAD_ARCH)
|
|
execute_process(COMMAND ${LIBOMPTARGET_OFFLOAD_ARCH} "--only=intel"
|
|
OUTPUT_VARIABLE LIBOMPTARGET_INTELGPU_ARCH_OUTPUT
|
|
OUTPUT_STRIP_TRAILING_WHITESPACE)
|
|
string(REPLACE "\n" ";" intelgpu_arch_list "${LIBOMPTARGET_INTELGPU_ARCH_OUTPUT}")
|
|
if(intelgpu_arch_list)
|
|
set(LIBOMPTARGET_FOUND_INTELGPU_GPU TRUE)
|
|
set(LIBOMPTARGET_INTELGPU_DETECTED_ARCH_LIST "${intelgpu_arch_list}")
|
|
endif()
|
|
endif()
|
|
|
|
set(OFFLOAD_PTHREAD_LIB ${LLVM_PTHREAD_LIB})
|