Define run_*_mt_tests in separated folders

Change-Id: I7844f7b2b63c100f1c03e7867043d746ef3793f8
Signed-off-by: Mateusz Jablonski <mateusz.jablonski@intel.com>
This commit is contained in:
Mateusz Jablonski
2020-03-04 12:26:54 +01:00
committed by sys_ocldev
parent 128db17670
commit 816eb19cce
12 changed files with 120 additions and 79 deletions

View File

@@ -1,5 +1,5 @@
#
# Copyright (C) 2018-2019 Intel Corporation
# Copyright (C) 2018-2020 Intel Corporation
#
# SPDX-License-Identifier: MIT
#
@@ -78,17 +78,6 @@ macro(apply_macro_for_each_platform)
endforeach()
endmacro()
macro(apply_macro_for_each_test_config type)
GET_TEST_CONFIGURATIONS_FOR_PLATFORM(${type} ${GEN_TYPE} ${PLATFORM_IT} PLATFORM_CONFIGURATIONS)
foreach(PLATFORM_CONFIGURATION ${PLATFORM_CONFIGURATIONS})
string(REPLACE "/" ";" CONFIGURATION_PARAMS ${PLATFORM_CONFIGURATION})
list(GET CONFIGURATION_PARAMS 1 SLICES)
list(GET CONFIGURATION_PARAMS 2 SUBSLICES)
list(GET CONFIGURATION_PARAMS 3 EU_PER_SS)
macro_for_each_test_config()
endforeach()
endmacro()
macro(get_family_name_with_type gen_type platform_type)
string(REPLACE "GEN" "Gen" gen_type_capitalized ${gen_type})
string(TOLOWER ${platform_type} platform_type_lower)

View File

@@ -6,6 +6,15 @@
project(igdrcl_mt_tests)
set(OPENCL_MT_TEST_DIR ${CMAKE_CURRENT_SOURCE_DIR})
option(SHOW_VERBOSE_UTESTS_RESULTS "Use the default/verbose test output" ON)
if(NOT SHOW_VERBOSE_UTESTS_RESULTS)
set(igdrcl_mt_tests_LISTENER_OPTION "--disable_default_listener")
endif()
add_custom_target(run_mt_unit_tests)
add_executable(igdrcl_mt_tests EXCLUDE_FROM_ALL
${CMAKE_CURRENT_SOURCE_DIR}/CMakeLists.txt
${NEO_SOURCE_DIR}/opencl/test/unit_test/libult/os_interface.cpp
@@ -19,7 +28,11 @@ add_executable(igdrcl_mt_tests EXCLUDE_FROM_ALL
$<TARGET_OBJECTS:${BUILTINS_SOURCES_LIB_NAME}>
)
target_include_directories(igdrcl_mt_tests PRIVATE ${CMAKE_CURRENT_SOURCE_DIR})
target_include_directories(igdrcl_mt_tests PRIVATE
${CMAKE_CURRENT_SOURCE_DIR}
${NEO_CORE_TEST_DIRECTORY}/unit_test/test_macros${BRANCH_DIR_SUFFIX}
${NEO_SOURCE_DIR}/opencl/source/gen_common
)
add_subdirectories()
@@ -38,17 +51,10 @@ else()
)
endif()
option(SHOW_VERBOSE_UTESTS_RESULTS "Use the default/verbose test output" ON)
if(NOT SHOW_VERBOSE_UTESTS_RESULTS)
set(igdrcl_mt_tests_LISTENER_OPTION "--disable_default_listener")
endif()
if(WIN32)
add_dependencies(igdrcl_mt_tests mock_gdi igdrcl_tests)
endif()
add_custom_target(run_mt_unit_tests)
add_dependencies(igdrcl_mt_tests test_dynamic_lib)
@@ -62,43 +68,3 @@ endif()
set_target_properties(run_mt_unit_tests PROPERTIES FOLDER ${OPENCL_TEST_PROJECTS_FOLDER})
function(run_mt_tests target slices subslices eu_per_ss)
add_custom_target(run_${target}_mt_unit_tests DEPENDS igdrcl_mt_tests)
if(NOT WIN32)
add_dependencies(run_${target}_mt_unit_tests copy_test_files_${target})
endif()
add_dependencies(run_mt_unit_tests run_${target}_mt_unit_tests)
set_target_properties(run_${target}_mt_unit_tests PROPERTIES FOLDER "${OPENCL_PLATFORM_SPECIFIC_TEST_TARGETS_FOLDER}/${target}")
add_custom_command(
TARGET run_${target}_mt_unit_tests
POST_BUILD
COMMAND WORKING_DIRECTORY ${TargetDir}
COMMAND echo "Running igdrcl_mt_tests ${target} ${slices}x${subslices}x${eu_per_ss}"
COMMAND igdrcl_mt_tests --product ${target} --slices ${slices} --subslices ${subslices} --eu_per_ss ${eu_per_ss} --gtest_repeat=${GTEST_REPEAT} ${igdrcl_mt_tests_LISTENER_OPTION}
)
endfunction()
target_include_directories(igdrcl_mt_tests BEFORE PRIVATE ${NEO_CORE_TEST_DIRECTORY}/unit_test/test_macros${BRANCH_DIR_SUFFIX} ${NEO_SOURCE_DIR}/opencl/source/gen_common)
macro(macro_for_each_test_config)
run_mt_tests(${PLATFORM_IT_LOWER} ${SLICES} ${SUBSLICES} ${EU_PER_SS})
if(MSVC OR CMAKE_SIZEOF_VOID_P EQUAL 8)
foreach(PLATFORM_TYPE ${PLATFORM_TYPES})
if(${PLATFORM_IT}_IS_${PLATFORM_TYPE})
get_family_name_with_type(${GEN_TYPE} ${PLATFORM_TYPE})
add_dependencies(run_${PLATFORM_IT_LOWER}_mt_unit_tests prepare_test_kernels_${family_name_with_type})
endif()
endforeach()
endif()
endmacro()
macro(macro_for_each_platform)
apply_macro_for_each_test_config("MT_TESTS")
endmacro()
macro(macro_for_each_gen)
apply_macro_for_each_platform()
endmacro()
apply_macro_for_each_gen("TESTED")

View File

@@ -0,0 +1,29 @@
#
# Copyright (C) 2020 Intel Corporation
#
# SPDX-License-Identifier: MIT
#
string(REPLACE "/" ";" mt_test_config ${mt_test_config})
list(GET mt_test_config 0 product)
list(GET mt_test_config 1 slices)
list(GET mt_test_config 2 subslices)
list(GET mt_test_config 3 eu_per_ss)
add_custom_target(run_${product}_mt_unit_tests DEPENDS igdrcl_mt_tests)
if(NOT WIN32)
add_dependencies(run_${product}_mt_unit_tests copy_test_files_${product})
endif()
add_dependencies(run_mt_unit_tests run_${product}_mt_unit_tests)
set_target_properties(run_${product}_mt_unit_tests PROPERTIES FOLDER "${OPENCL_PLATFORM_SPECIFIC_TEST_TARGETS_FOLDER}/${product}")
add_custom_command(
TARGET run_${product}_mt_unit_tests
POST_BUILD
COMMAND WORKING_DIRECTORY ${TargetDir}
COMMAND echo "Running igdrcl_mt_tests ${product} ${slices}x${subslices}x${eu_per_ss}"
COMMAND igdrcl_mt_tests --product ${product} --slices ${slices} --subslices ${subslices} --eu_per_ss ${eu_per_ss} --gtest_repeat=${GTEST_REPEAT} ${igdrcl_mt_tests_LISTENER_OPTION}
)
add_dependencies(run_${product}_mt_unit_tests prepare_test_kernels)

View File

@@ -0,0 +1,9 @@
#
# Copyright (C) 2020 Intel Corporation
#
# SPDX-License-Identifier: MIT
#
if(TESTS_GEN11)
add_subdirectories()
endif()

View File

@@ -0,0 +1,10 @@
#
# Copyright (C) 2020 Intel Corporation
#
# SPDX-License-Identifier: MIT
#
if(TESTS_ICLLP)
set(mt_test_config "icllp/1/8/8")
include(${OPENCL_MT_TEST_DIR}/cmake/run_mt_test_target.cmake)
endif()

View File

@@ -0,0 +1,9 @@
#
# Copyright (C) 2020 Intel Corporation
#
# SPDX-License-Identifier: MIT
#
if(TESTS_GEN12LP)
add_subdirectories()
endif()

View File

@@ -0,0 +1,10 @@
#
# Copyright (C) 2020 Intel Corporation
#
# SPDX-License-Identifier: MIT
#
if(TESTS_TGLLP)
set(mt_test_config "tgllp/1/6/16")
include(${OPENCL_MT_TEST_DIR}/cmake/run_mt_test_target.cmake)
endif()

View File

@@ -0,0 +1,9 @@
#
# Copyright (C) 2020 Intel Corporation
#
# SPDX-License-Identifier: MIT
#
if(TESTS_GEN8)
add_subdirectories()
endif()

View File

@@ -0,0 +1,10 @@
#
# Copyright (C) 2020 Intel Corporation
#
# SPDX-License-Identifier: MIT
#
if(TESTS_BDW)
set(mt_test_config "bdw/1/3/8")
include(${OPENCL_MT_TEST_DIR}/cmake/run_mt_test_target.cmake)
endif()

View File

@@ -0,0 +1,9 @@
#
# Copyright (C) 2020 Intel Corporation
#
# SPDX-License-Identifier: MIT
#
if(TESTS_GEN9)
add_subdirectories()
endif()

View File

@@ -0,0 +1,10 @@
#
# Copyright (C) 2020 Intel Corporation
#
# SPDX-License-Identifier: MIT
#
if(TESTS_SKL)
set(mt_test_config "skl/1/3/8")
include(${OPENCL_MT_TEST_DIR}/cmake/run_mt_test_target.cmake)
endif()

View File

@@ -118,20 +118,6 @@ macro(GET_PLATFORMS_FOR_GEN TYPE GEN_TYPE OUT_LIST)
GET_LIST_FOR_GEN("PLATFORMS" ${TYPE} ${GEN_IDX} ${OUT_LIST})
endmacro()
macro(GET_TEST_CONFIGURATIONS_FOR_PLATFORM TYPE GEN_TYPE PLATFORM OUT_LIST)
FIND_IDX_FOR_GEN_TYPE(${GEN_TYPE} GEN_IDX)
set(${OUT_LIST})
string(TOLOWER ${PLATFORM} PLATFORM_LOWER)
GET_LIST_FOR_GEN("CONFIGURATIONS" ${TYPE} ${GEN_IDX} ALL_CONFIGURATIONS_FOR_GEN)
foreach(CONFIGURATION ${ALL_CONFIGURATIONS_FOR_GEN})
string(REPLACE "/" ";" CONFIGURATION_PARAMS ${CONFIGURATION})
list(GET CONFIGURATION_PARAMS 0 CONFIGURATION_PLATFORM)
if(${CONFIGURATION_PLATFORM} STREQUAL ${PLATFORM_LOWER})
list(APPEND ${OUT_LIST} ${CONFIGURATION})
endif()
endforeach()
endmacro()
macro(PLATFORM_HAS_2_0 GEN_TYPE PLATFORM_NAME OUT_FLAG)
FIND_IDX_FOR_GEN_TYPE(${GEN_TYPE} GEN_IDX)
GET_LIST_FOR_GEN("PLATFORMS" "SUPPORTED_2_0" ${GEN_IDX} GEN_X_PLATFORMS)
@@ -202,7 +188,6 @@ INIT_LIST("PLATFORMS" "SUPPORTED")
INIT_LIST("PLATFORMS" "SUPPORTED_2_0")
INIT_LIST("PLATFORMS" "SUPPORTED_VME")
INIT_LIST("PLATFORMS" "TESTED")
INIT_LIST("CONFIGURATIONS" "MT_TESTS")
INIT_PRODUCTS_LIST("TESTED")
INIT_PRODUCTS_LIST("SUPPORTED")
@@ -217,7 +202,6 @@ if(SUPPORT_GEN8)
ADD_PLATFORM_FOR_GEN("SUPPORTED_2_0" "GEN8" "BDW" "CORE")
if(TESTS_BDW)
ADD_ITEM_FOR_GEN("PLATFORMS" "TESTED" "GEN8" "BDW")
ADD_ITEM_FOR_GEN("CONFIGURATIONS" "MT_TESTS" "GEN8" "bdw/1/3/8")
ADD_PRODUCT("TESTED" "BDW" "IGFX_BROADWELL")
endif()
endif()
@@ -236,7 +220,6 @@ if(SUPPORT_GEN9)
if(TESTS_SKL)
set(PREFERRED_FAMILY_NAME "SKLFamily")
ADD_ITEM_FOR_GEN("PLATFORMS" "TESTED" "GEN9" "SKL")
ADD_ITEM_FOR_GEN("CONFIGURATIONS" "MT_TESTS" "GEN9" "skl/1/3/8")
ADD_PRODUCT("TESTED" "SKL" "IGFX_SKYLAKE")
endif()
endif()
@@ -296,7 +279,6 @@ if(SUPPORT_GEN11)
ADD_PLATFORM_FOR_GEN("SUPPORTED_VME" "GEN11" "ICLLP" "LP")
if(TESTS_ICLLP)
ADD_ITEM_FOR_GEN("PLATFORMS" "TESTED" "GEN11" "ICLLP")
ADD_ITEM_FOR_GEN("CONFIGURATIONS" "MT_TESTS" "GEN11" "icllp/1/8/8")
ADD_PRODUCT("TESTED" "ICLLP" "IGFX_ICELAKE_LP")
endif()
endif()
@@ -330,7 +312,6 @@ if(SUPPORT_GEN12LP)
ADD_PLATFORM_FOR_GEN("SUPPORTED_2_0" "GEN12LP" "TGLLP" "LP")
if(TESTS_TGLLP)
ADD_ITEM_FOR_GEN("PLATFORMS" "TESTED" "GEN12LP" "TGLLP")
ADD_ITEM_FOR_GEN("CONFIGURATIONS" "MT_TESTS" "GEN12LP" "tgllp/1/6/16")
ADD_PRODUCT("TESTED" "TGLLP" "IGFX_TIGERLAKE_LP")
endif()
endif()