Define run_*_aub_tests targets in separared folders

Change-Id: I4794f2e9c5cf6bf3e618ea9f88ee6b7dba095e18
Signed-off-by: Mateusz Jablonski <mateusz.jablonski@intel.com>
This commit is contained in:
Mateusz Jablonski
2020-03-04 11:31:05 +01:00
committed by sys_ocldev
parent ad4925aef9
commit e6b6f6d85d
9 changed files with 105 additions and 97 deletions

View File

@ -6,7 +6,7 @@
project(igdrcl_aub_tests)
include(${CMAKE_CURRENT_SOURCE_DIR}/common.cmake)
set(OPENCL_AUB_TEST_DIR ${CMAKE_CURRENT_SOURCE_DIR})
list(APPEND IGDRCL_AUB_TESTS__TARGET_OBJECTS
${CMAKE_CURRENT_SOURCE_DIR}/aub_tests_configuration.cpp
@ -82,53 +82,4 @@ else()
endif()
target_include_directories(igdrcl_aub_tests BEFORE PRIVATE ${NEO_CORE_TEST_DIRECTORY}/unit_test/test_macros${BRANCH_DIR_SUFFIX})
macro(macro_for_each_test_config)
if(NOT TARGET ${PLATFORM_IT_LOWER}_aub_tests)
add_custom_target(${PLATFORM_IT_LOWER}_aub_tests
DEPENDS igdrcl_aub_tests
DEPENDS copy_test_files_${PLATFORM_IT_LOWER}
)
foreach(PLATFORM_TYPE ${PLATFORM_TYPES})
if(${PLATFORM_IT}_IS_${PLATFORM_TYPE})
get_family_name_with_type(${GEN_TYPE} ${PLATFORM_TYPE})
add_dependencies(${PLATFORM_IT_LOWER}_aub_tests prepare_test_kernels_${family_name_with_type})
endif()
endforeach()
add_custom_target(run_${PLATFORM_IT_LOWER}_aub_tests ALL DEPENDS ${PLATFORM_IT_LOWER}_aub_tests)
add_dependencies(run_aub_tests run_${PLATFORM_IT_LOWER}_aub_tests)
set_target_properties(${PLATFORM_IT_LOWER}_aub_tests PROPERTIES FOLDER "${OPENCL_PLATFORM_SPECIFIC_TEST_TARGETS_FOLDER}/${PLATFORM_IT_LOWER}")
set_target_properties(run_${PLATFORM_IT_LOWER}_aub_tests PROPERTIES FOLDER "${OPENCL_PLATFORM_SPECIFIC_TEST_TARGETS_FOLDER}/${PLATFORM_IT_LOWER}")
add_custom_command(
TARGET ${PLATFORM_IT_LOWER}_aub_tests
POST_BUILD
COMMAND WORKING_DIRECTORY ${TargetDir}
COMMAND echo Creating output directory for ${PLATFORM_IT_LOWER} AUBs generation...
COMMAND ${CMAKE_COMMAND} -E make_directory "${TargetDir}/${PLATFORM_IT_LOWER}_aub/aub_out"
)
if(WIN32)
add_dependencies(${PLATFORM_IT_LOWER}_aub_tests mock_gdi)
endif()
endif()
set(AUB_TESTS_OPTIONS "")
if (NOT ${AUB_DUMP_BUFFER_FORMAT} STREQUAL "")
list(APPEND AUB_TESTS_OPTIONS --dump_buffer_format)
list(APPEND AUB_TESTS_OPTIONS ${AUB_DUMP_BUFFER_FORMAT})
endif()
if (NOT ${AUB_DUMP_IMAGE_FORMAT} STREQUAL "")
list(APPEND AUB_TESTS_OPTIONS --dump_image_format)
list(APPEND AUB_TESTS_OPTIONS ${AUB_DUMP_IMAGE_FORMAT})
endif()
neo_run_aub_target(${PLATFORM_IT_LOWER} "${PLATFORM_IT} ${SLICES}x${SUBSLICES}x${EU_PER_SS}" ${PLATFORM_IT_LOWER} ${SLICES} ${SUBSLICES} ${EU_PER_SS} "${AUB_TESTS_OPTIONS}")
endmacro()
macro(macro_for_each_platform)
apply_macro_for_each_test_config("AUB_TESTS")
endmacro()
macro(macro_for_each_gen)
apply_macro_for_each_platform()
endmacro()
apply_macro_for_each_gen("TESTED")
create_project_source_tree(igdrcl_aub_tests ${NEO_SOURCE_DIR}/runtime ${NEO_SOURCE_DIR}/unit_tests)
create_project_source_tree(igdrcl_aub_tests)

View File

@ -0,0 +1,61 @@
#
# Copyright (C) 2020 Intel Corporation
#
# SPDX-License-Identifier: MIT
#
string(REPLACE "/" ";" aub_test_config ${aub_test_config})
list(GET aub_test_config 0 product)
list(GET aub_test_config 1 slices)
list(GET aub_test_config 2 subslices)
list(GET aub_test_config 3 eu_per_ss)
add_custom_target(run_${product}_aub_tests ALL DEPENDS copy_test_files_${product} prepare_test_kernels)
add_dependencies(run_aub_tests run_${product}_aub_tests)
set_target_properties(run_${product}_aub_tests PROPERTIES FOLDER "${OPENCL_PLATFORM_SPECIFIC_TEST_TARGETS_FOLDER}/${product}")
if(WIN32)
add_dependencies(run_${product}_aub_tests mock_gdi)
endif()
set(aub_tests_options "")
if (NOT ${AUB_DUMP_BUFFER_FORMAT} STREQUAL "")
list(APPEND aub_tests_options --dump_buffer_format)
list(APPEND aub_tests_options ${AUB_DUMP_BUFFER_FORMAT})
endif()
if (NOT ${AUB_DUMP_IMAGE_FORMAT} STREQUAL "")
list(APPEND aub_tests_options --dump_image_format)
list(APPEND aub_tests_options ${AUB_DUMP_IMAGE_FORMAT})
endif()
add_custom_command(
TARGET run_${product}_aub_tests
POST_BUILD
COMMAND WORKING_DIRECTORY ${TargetDir}
COMMAND echo re-creating working directory for ${product} AUBs generation...
COMMAND ${CMAKE_COMMAND} -E remove_directory ${TargetDir}/${product}_aub
COMMAND ${CMAKE_COMMAND} -E make_directory ${TargetDir}/${product}_aub
COMMAND ${CMAKE_COMMAND} -E make_directory ${TargetDir}/${product}_aub/aub_out
COMMAND ${CMAKE_COMMAND} -E make_directory ${TargetDir}/${product}_aub/cl_cache
)
if(WIN32 OR NOT DEFINED NEO__GMM_LIBRARY_PATH)
set(aub_test_cmd_prefix $<TARGET_FILE:igdrcl_aub_tests>)
else()
set(aub_test_cmd_prefix LD_LIBRARY_PATH=${NEO__GMM_LIBRARY_PATH} IGDRCL_TEST_SELF_EXEC=off $<TARGET_FILE:igdrcl_aub_tests>)
endif()
add_custom_command(
TARGET run_${product}_aub_tests
POST_BUILD
COMMAND WORKING_DIRECTORY ${TargetDir}
COMMAND echo Running AUB generation for ${product} in ${TargetDir}/${product}_aub
COMMAND ${aub_test_cmd_prefix} --product ${product} --slices ${slices} --subslices ${subslices} --eu_per_ss ${eu_per_ss} --gtest_repeat=1 ${aub_tests_options} ${IGDRCL_TESTS_LISTENER_OPTION}
)
if(DO_NOT_RUN_AUB_TESTS)
set_target_properties(run_${product}_aub_tests PROPERTIES
EXCLUDE_FROM_DEFAULT_BUILD TRUE
EXCLUDE_FROM_ALL TRUE
)
endif()

View File

@ -1,39 +0,0 @@
#
# Copyright (C) 2017-2020 Intel Corporation
#
# SPDX-License-Identifier: MIT
#
function(neo_run_aub_target gen gen_name product slices subslices eu_per_ss options)
add_custom_command(
TARGET run_${gen}_aub_tests
POST_BUILD
COMMAND WORKING_DIRECTORY ${TargetDir}
COMMAND echo re-creating working directory for ${gen_name} AUBs generation...
COMMAND ${CMAKE_COMMAND} -E remove_directory ${TargetDir}/${gen}_aub
COMMAND ${CMAKE_COMMAND} -E make_directory ${TargetDir}/${gen}_aub
COMMAND ${CMAKE_COMMAND} -E make_directory ${TargetDir}/${gen}_aub/aub_out
COMMAND ${CMAKE_COMMAND} -E make_directory ${TargetDir}/${gen}_aub/cl_cache
)
if(WIN32 OR NOT DEFINED NEO__GMM_LIBRARY_PATH)
set(aub_cmd_prefix $<TARGET_FILE:igdrcl_aub_tests>)
else()
set(aub_cmd_prefix LD_LIBRARY_PATH=${NEO__GMM_LIBRARY_PATH} IGDRCL_TEST_SELF_EXEC=off $<TARGET_FILE:igdrcl_aub_tests>)
endif()
add_custom_command(
TARGET run_${gen}_aub_tests
POST_BUILD
COMMAND WORKING_DIRECTORY ${TargetDir}
COMMAND echo Running AUB generation for ${gen_name} in ${TargetDir}/${gen}_aub
COMMAND ${CMAKE_COMMAND} -E env GTEST_OUTPUT=xml:${GTEST_XML_OUTPUT_DIR}/aub_test_details_${product}_${slices}_${subslices}_${eu_per_ss}.xml ${aub_cmd_prefix} --product ${product} --slices ${slices} --subslices ${subslices} --eu_per_ss ${eu_per_ss} --gtest_repeat=1 ${options} ${IGDRCL_TESTS_LISTENER_OPTION}
)
if(DO_NOT_RUN_AUB_TESTS)
set_target_properties(run_${gen}_aub_tests PROPERTIES
EXCLUDE_FROM_DEFAULT_BUILD TRUE
EXCLUDE_FROM_ALL TRUE
)
endif()
endfunction()

View File

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

View File

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

View File

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

View File

@ -0,0 +1,10 @@
#
# Copyright (C) 2020 Intel Corporation
#
# SPDX-License-Identifier: MIT
#
if(TESTS_BXT)
set(aub_test_config "bxt/1/3/6")
include(${OPENCL_AUB_TEST_DIR}/cmake/run_aub_test_target.cmake)
endif()

View File

@ -6,4 +6,6 @@
if(TESTS_SKL)
add_subdirectories()
set(aub_test_config "skl/1/3/8")
include(${OPENCL_AUB_TEST_DIR}/cmake/run_aub_test_target.cmake)
endif()

View File

@ -202,8 +202,6 @@ INIT_LIST("PLATFORMS" "SUPPORTED")
INIT_LIST("PLATFORMS" "SUPPORTED_2_0")
INIT_LIST("PLATFORMS" "SUPPORTED_VME")
INIT_LIST("PLATFORMS" "TESTED")
INIT_LIST("CONFIGURATIONS" "UNIT_TESTS")
INIT_LIST("CONFIGURATIONS" "AUB_TESTS")
INIT_LIST("CONFIGURATIONS" "MT_TESTS")
INIT_PRODUCTS_LIST("TESTED")
INIT_PRODUCTS_LIST("SUPPORTED")
@ -219,7 +217,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" "AUB_TESTS" "GEN8" "bdw/1/3/8")
ADD_ITEM_FOR_GEN("CONFIGURATIONS" "MT_TESTS" "GEN8" "bdw/1/3/8")
ADD_PRODUCT("TESTED" "BDW" "IGFX_BROADWELL")
endif()
@ -239,7 +236,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" "AUB_TESTS" "GEN9" "skl/1/3/8")
ADD_ITEM_FOR_GEN("CONFIGURATIONS" "MT_TESTS" "GEN9" "skl/1/3/8")
ADD_PRODUCT("TESTED" "SKL" "IGFX_SKYLAKE")
endif()
@ -283,7 +279,6 @@ if(SUPPORT_GEN9)
ADD_PLATFORM_FOR_GEN("SUPPORTED_VME" "GEN9" "BXT" "LP")
if(TESTS_BXT)
ADD_ITEM_FOR_GEN("PLATFORMS" "TESTED" "GEN9" "BXT")
ADD_ITEM_FOR_GEN("CONFIGURATIONS" "AUB_TESTS" "GEN9" "bxt/1/3/6")
ADD_PRODUCT("TESTED" "BXT" "IGFX_BROXTON")
endif()
endif()
@ -301,7 +296,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" "AUB_TESTS" "GEN11" "icllp/1/8/8")
ADD_ITEM_FOR_GEN("CONFIGURATIONS" "MT_TESTS" "GEN11" "icllp/1/8/8")
ADD_PRODUCT("TESTED" "ICLLP" "IGFX_ICELAKE_LP")
endif()
@ -336,7 +330,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" "AUB_TESTS" "GEN12LP" "tgllp/1/6/16")
ADD_ITEM_FOR_GEN("CONFIGURATIONS" "MT_TESTS" "GEN12LP" "tgllp/1/6/16")
ADD_PRODUCT("TESTED" "TGLLP" "IGFX_TIGERLAKE_LP")
endif()