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
74 lines
2.7 KiB
CMake
74 lines
2.7 KiB
CMake
# Find Level Zero headers and libraries
|
|
find_path(LIBOMPTARGET_DEP_LEVEL_ZERO_INCLUDE_DIR NAMES level_zero/ze_api.h)
|
|
if(LIBOMPTARGET_DEP_LEVEL_ZERO_INCLUDE_DIR)
|
|
find_library(LIBOMPTARGET_DEP_LEVEL_ZERO_LIBRARY NAMES ze_loader)
|
|
endif()
|
|
|
|
|
|
# Create the library and add the default arguments.
|
|
add_target_library(omptarget.rtl.level_zero LEVEL_ZERO)
|
|
|
|
set(LEVEL_ZERO_SRC_FILES
|
|
src/L0Context.cpp
|
|
src/L0Device.cpp
|
|
src/L0Kernel.cpp
|
|
src/L0Memory.cpp
|
|
src/L0Program.cpp
|
|
src/L0Plugin.cpp
|
|
src/L0Program.cpp
|
|
src/L0Options.cpp
|
|
src/L0Queue.cpp
|
|
)
|
|
|
|
target_sources(omptarget.rtl.level_zero PRIVATE
|
|
${LEVEL_ZERO_SRC_FILES}
|
|
)
|
|
|
|
target_include_directories(omptarget.rtl.level_zero PRIVATE
|
|
${CMAKE_CURRENT_SOURCE_DIR}/include
|
|
)
|
|
|
|
target_include_directories(omptarget.rtl.level_zero PRIVATE
|
|
${LIBOMPTARGET_INCLUDE_DIR}
|
|
${LIBOMPTARGET_LLVM_INCLUDE_DIRS}
|
|
)
|
|
|
|
if (LIBOMPTARGET_DEP_LEVEL_ZERO_LIBRARY AND NOT "level_zero" IN_LIST LIBOMPTARGET_DLOPEN_PLUGINS)
|
|
message(STATUS "Building Level Zero NG plugin linked against level_zero library")
|
|
target_include_directories(omptarget.rtl.level_zero PRIVATE
|
|
${LIBOMPTARGET_DEP_LEVEL_ZERO_INCLUDE_DIR}
|
|
)
|
|
if(UNIX)
|
|
target_link_libraries(omptarget.rtl.level_zero PRIVATE
|
|
${LIBOMPTARGET_DEP_LEVEL_ZERO_LIBRARY})
|
|
elseif(WIN32)
|
|
# Full path to the Level Zero library is recognized as a linker option, so we
|
|
# separate directory and file name
|
|
cmake_path(GET LIBOMPTARGET_DEP_LEVEL_ZERO_LIBRARY FILENAME LEVEL_ZERO_LIBRARY_NAME)
|
|
cmake_path(GET LIBOMPTARGET_DEP_LEVEL_ZERO_LIBRARY PARENT_PATH LEVEL_ZERO_LIBRARY_PATH)
|
|
target_link_libraries(omptarget.rtl.level_zero PRIVATE ${LEVEL_ZERO_LIBRARY_NAME}
|
|
${LIBOMP_LIB_FILE})
|
|
target_link_directories(omptarget.rtl.level_zero PRIVATE ${LEVEL_ZERO_LIBRARY_PATH})
|
|
else()
|
|
message(FATAL_ERROR "Missing platform support")
|
|
endif()
|
|
else()
|
|
message(STATUS "Building Level Zero NG plugin for dlopened level_zero")
|
|
target_include_directories(omptarget.rtl.level_zero PRIVATE
|
|
${CMAKE_CURRENT_SOURCE_DIR}/dynamic_l0
|
|
)
|
|
target_sources(omptarget.rtl.level_zero PRIVATE dynamic_l0/L0DynWrapper.cpp)
|
|
endif()
|
|
|
|
option(LIBOMPTARGET_FORCE_LEVELZERO_TESTS "Build Level Zero libomptarget tests" OFF)
|
|
if (LIBOMPTARGET_FOUND_INTELGPU_GPU OR LIBOMPTARGET_FORCE_LEVELZERO_TESTS)
|
|
# Report to the parent scope that we are building a plugin for intelgpu
|
|
set(LIBOMPTARGET_SYSTEM_TARGETS
|
|
"${LIBOMPTARGET_SYSTEM_TARGETS} spirv64-intel" PARENT_SCOPE)
|
|
list(APPEND LIBOMPTARGET_TESTED_PLUGINS "omptarget.rtl.level_zero")
|
|
set(LIBOMPTARGET_TESTED_PLUGINS "${LIBOMPTARGET_TESTED_PLUGINS}" PARENT_SCOPE)
|
|
else()
|
|
message(STATUS "Not generating Level Zero tests, no supported devices detected."
|
|
" Use 'LIBOMPTARGET_FORCE_INTELGPU_TESTS' to override.")
|
|
endif()
|