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
82 lines
2.9 KiB
CMake
82 lines
2.9 KiB
CMake
# CMakeLists.txt file for unit testing OpenMP offloading runtime library.
|
|
if(NOT OPENMP_TEST_COMPILER_ID STREQUAL "Clang" OR
|
|
OPENMP_TEST_COMPILER_VERSION VERSION_LESS 6.0.0)
|
|
message(STATUS "Can only test with Clang compiler in version 6.0.0 or later.")
|
|
message(WARNING "The check-offload target will not be available!")
|
|
return()
|
|
endif()
|
|
|
|
if(LIBOMPTARGET_ENABLE_DEBUG)
|
|
set(LIBOMPTARGET_DEBUG True)
|
|
else()
|
|
set(LIBOMPTARGET_DEBUG False)
|
|
endif()
|
|
|
|
if ("compiler-rt" IN_LIST LLVM_ENABLE_RUNTIMES)
|
|
set(LIBOMPTARGET_TEST_GPU_PGO True)
|
|
else()
|
|
set(LIBOMPTARGET_TEST_GPU_PGO False)
|
|
endif()
|
|
|
|
# Replace the space from user's input with ";" in case that CMake add escape
|
|
# char into the lit command.
|
|
string(REPLACE " " ";" LIBOMPTARGET_LIT_ARG_LIST "${LIBOMPTARGET_LIT_ARGS}")
|
|
|
|
find_package(CUDAToolkit QUIET ${OFFLOAD_MIN_CUDA_VERSION})
|
|
if(CUDAToolkit_FOUND)
|
|
get_filename_component(CUDA_ROOT "${CUDAToolkit_BIN_DIR}" DIRECTORY ABSOLUTE)
|
|
get_filename_component(CUDA_LIBDIR "${CUDA_cudart_static_LIBRARY}" DIRECTORY)
|
|
endif()
|
|
|
|
set(OMP_DEPEND)
|
|
if(TARGET omp)
|
|
set(OMP_DEPEND omp)
|
|
endif()
|
|
|
|
string(REGEX MATCHALL "([^\ ]+\ |[^\ ]+$)" SYSTEM_TARGETS "${LIBOMPTARGET_SYSTEM_TARGETS}")
|
|
foreach(CURRENT_TARGET IN LISTS SYSTEM_TARGETS)
|
|
string(STRIP "${CURRENT_TARGET}" CURRENT_TARGET)
|
|
|
|
add_offload_testsuite(check-libomptarget-${CURRENT_TARGET}
|
|
"Running libomptarget tests"
|
|
${CMAKE_CURRENT_BINARY_DIR}/${CURRENT_TARGET}
|
|
DEPENDS omptarget ${OMP_DEPEND} ${LIBOMPTARGET_TESTED_PLUGINS}
|
|
ARGS ${LIBOMPTARGET_LIT_ARG_LIST})
|
|
list(APPEND LIBOMPTARGET_LIT_TESTSUITES ${CMAKE_CURRENT_BINARY_DIR}/${CURRENT_TARGET})
|
|
|
|
# Configure the lit.site.cfg.in file
|
|
set(AUTO_GEN_COMMENT "## Autogenerated by libomptarget configuration.\n# Do not edit!")
|
|
configure_file(lit.site.cfg.in ${CURRENT_TARGET}/lit.site.cfg @ONLY)
|
|
endforeach()
|
|
|
|
|
|
add_offload_testsuite(check-libomptarget
|
|
"Running libomptarget tests"
|
|
${LIBOMPTARGET_LIT_TESTSUITES}
|
|
EXCLUDE_FROM_CHECK_ALL
|
|
DEPENDS llvm-offload-device-info omptarget ${OMP_DEPEND} ${LIBOMPTARGET_TESTED_PLUGINS}
|
|
ARGS ${LIBOMPTARGET_LIT_ARG_LIST})
|
|
|
|
# Add liboffload unit tests - the test binary will run on all available devices
|
|
set(OFFLOAD_UNITTEST_DIR ${CMAKE_CURRENT_BINARY_DIR}/../unittests)
|
|
configure_lit_site_cfg(
|
|
${CMAKE_CURRENT_SOURCE_DIR}/unit/lit.site.cfg.in
|
|
${CMAKE_CURRENT_BINARY_DIR}/unit/lit.site.cfg
|
|
MAIN_CONFIG
|
|
${CMAKE_CURRENT_SOURCE_DIR}/unit/lit.cfg.py)
|
|
|
|
add_offload_testsuite(check-offload
|
|
"Running offload tests"
|
|
${LIBOMPTARGET_LIT_TESTSUITES}
|
|
${CMAKE_CURRENT_BINARY_DIR}/unit
|
|
EXCLUDE_FROM_CHECK_ALL
|
|
DEPENDS llvm-offload-device-info omptarget ${OMP_DEPEND} ${LIBOMPTARGET_TESTED_PLUGINS}
|
|
LLVMOffload OffloadUnitTests
|
|
ARGS ${LIBOMPTARGET_LIT_ARG_LIST})
|
|
|
|
add_lit_testsuite(check-offload-unit "Running offload unittest suites"
|
|
${CMAKE_CURRENT_BINARY_DIR}/unit
|
|
EXCLUDE_FROM_CHECK_ALL
|
|
#DEPENDS LLVMOffload
|
|
OffloadUnitTests)
|