ovni/test/rt/openmp/CMakeLists.txt
Rodrigo Arias 51ea16a85a Check packages and features once
Also move libompv detection to its own cmake module.
2025-04-25 11:47:50 +02:00

59 lines
1.9 KiB
CMake

# Copyright (c) 2022-2025 Barcelona Supercomputing Center (BSC)
# SPDX-License-Identifier: GPL-3.0-or-later
if(NOT LIBOMPV_FOUND)
if(ENABLE_ALL_TESTS)
message(FATAL_ERROR "Compiler doesn't support -fopenmp=libompv flag, cannot enable libompv RT tests")
else()
message(STATUS "Compiler doesn't support -fopenmp=libompv flag, disabling libompv RT tests")
endif()
return()
endif()
if(NOT NOSV_FOUND)
if(ENABLE_ALL_TESTS)
message(FATAL_ERROR "nOS-V not found, cannot enable libompv RT tests")
else()
message(STATUS "nOS-V not found, disabling libompv RT tests")
endif()
return()
endif()
message(STATUS "Enabling libompv RT tests")
function(openmp_rt_test)
ovni_test(${ARGN} SORT)
target_compile_options("${OVNI_TEST_NAME}" PUBLIC "-no-pedantic")
target_link_libraries("${OVNI_TEST_NAME}" PRIVATE "m" Libompv PkgConfig::NOSV)
set_property(TEST "${OVNI_TEST_NAME}" APPEND PROPERTY
ENVIRONMENT "OMP_OVNI=1")
set_property(TEST "${OVNI_TEST_NAME}" APPEND PROPERTY
ENVIRONMENT "NOSV_CONFIG_OVERRIDE=instrumentation.version=ovni,ovni.level=3")
endfunction()
openmp_rt_test(active.c DRIVER active.driver.sh)
openmp_rt_test(barrier-explicit.c)
openmp_rt_test(critical.c)
openmp_rt_test(if0-nested-task.c)
openmp_rt_test(if0.c)
openmp_rt_test(multi-parallels.c)
openmp_rt_test(parallel-for.c)
openmp_rt_test(parallel-loop.c)
openmp_rt_test(parallel-nested.c)
openmp_rt_test(parallel-task.c)
openmp_rt_test(passive.c DRIVER passive.driver.sh)
openmp_rt_test(sections.c)
openmp_rt_test(simple-task.c)
openmp_rt_test(task.c)
openmp_rt_test(taskloop.c)
openmp_rt_test(taskwait.c)
openmp_rt_test(team-distribute.c)
openmp_rt_test(worksharing-and-tasks.c)
openmp_rt_test(worksharing-mix.c BREAKDOWN)
openmp_rt_test(worksharing-task.c)
openmp_rt_test(worksharing.c)
openmp_rt_test(worksharing01.c)
openmp_rt_test(worksharing02.c)
openmp_rt_test(worksharing03.c)
openmp_rt_test(worksharing-active-th.c DRIVER worksharing-active-th.driver.sh)