Skip to content

Commit 232640a

Browse files
Move AUB tests runner to neo_core/cmake directory
Signed-off-by: Kacper Nowak <kacper.nowak@intel.com>
1 parent 6c6a9b2 commit 232640a

File tree

19 files changed

+167
-107
lines changed

19 files changed

+167
-107
lines changed

CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1084,6 +1084,7 @@ if(BUILD_WITH_L0)
10841084
endif()
10851085

10861086
add_subdirectory_unique(target_unit_tests)
1087+
add_subdirectory_unique(target_aub_tests)
10871088
add_subdirectory_unique(shared${BRANCH_DIR_SUFFIX})
10881089

10891090
add_subdirectories()

cmake/run_aub_test_target.cmake

Lines changed: 70 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,70 @@
1+
#
2+
# Copyright (C) 2020-2021 Intel Corporation
3+
#
4+
# SPDX-License-Identifier: MIT
5+
#
6+
7+
string(REPLACE "/" ";" aub_test_config ${aub_test_config})
8+
list(GET aub_test_config 0 product)
9+
list(GET aub_test_config 1 slices)
10+
list(GET aub_test_config 2 subslices)
11+
list(GET aub_test_config 3 eu_per_ss)
12+
list(GET aub_test_config 4 revision_id)
13+
14+
add_custom_target(run_${product}_${revision_id}_aub_tests ALL)
15+
16+
if(NOT SKIP_NEO_UNIT_TESTS)
17+
add_dependencies(run_${product}_${revision_id}_aub_tests copy_test_files_per_product)
18+
add_dependencies(run_${product}_${revision_id}_aub_tests prepare_test_kernels)
19+
add_dependencies(run_${product}_${revision_id}_aub_tests prepare_test_kernel_for_shared)
20+
endif()
21+
22+
add_dependencies(run_aub_tests run_${product}_${revision_id}_aub_tests)
23+
set_target_properties(run_${product}_${revision_id}_aub_tests PROPERTIES FOLDER "${PLATFORM_SPECIFIC_TEST_TARGETS_FOLDER}/${product}/${revision_id}")
24+
if(NOT SKIP_NEO_UNIT_TESTS)
25+
if(WIN32)
26+
add_dependencies(run_${product}_${revision_id}_aub_tests mock_gdi)
27+
endif()
28+
29+
set(aub_tests_options "")
30+
if(NOT ${AUB_DUMP_BUFFER_FORMAT} STREQUAL "")
31+
list(APPEND aub_tests_options --dump_buffer_format)
32+
list(APPEND aub_tests_options ${AUB_DUMP_BUFFER_FORMAT})
33+
endif()
34+
if(NOT ${AUB_DUMP_IMAGE_FORMAT} STREQUAL "")
35+
list(APPEND aub_tests_options --dump_image_format)
36+
list(APPEND aub_tests_options ${AUB_DUMP_IMAGE_FORMAT})
37+
endif()
38+
39+
add_custom_command(
40+
TARGET run_${product}_${revision_id}_aub_tests
41+
POST_BUILD
42+
COMMAND WORKING_DIRECTORY ${TargetDir}
43+
COMMAND echo re-creating working directory for ${product}/${revision_id} AUBs generation...
44+
COMMAND ${CMAKE_COMMAND} -E remove_directory ${TargetDir}/${product}_aub/${revision_id}
45+
COMMAND ${CMAKE_COMMAND} -E make_directory ${TargetDir}/${product}_aub/${revision_id}
46+
COMMAND ${CMAKE_COMMAND} -E make_directory ${TargetDir}/${product}_aub/${revision_id}/aub_out
47+
COMMAND ${CMAKE_COMMAND} -E make_directory ${TargetDir}/${product}_aub/${revision_id}/cl_cache
48+
)
49+
50+
if(WIN32 OR NOT DEFINED NEO__GMM_LIBRARY_PATH)
51+
set(aub_test_cmd_prefix $<TARGET_FILE:igdrcl_aub_tests>)
52+
else()
53+
set(aub_test_cmd_prefix LD_LIBRARY_PATH=${NEO__GMM_LIBRARY_PATH} IGDRCL_TEST_SELF_EXEC=off $<TARGET_FILE:igdrcl_aub_tests>)
54+
endif()
55+
56+
add_custom_command(
57+
TARGET run_${product}_${revision_id}_aub_tests
58+
POST_BUILD
59+
COMMAND WORKING_DIRECTORY ${TargetDir}
60+
COMMAND echo Running AUB generation for ${product} in ${TargetDir}/${product}_aub
61+
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} --rev_id ${revision_id}
62+
)
63+
64+
if(DO_NOT_RUN_AUB_TESTS)
65+
set_target_properties(run_${product}_${revision_id}_aub_tests PROPERTIES
66+
EXCLUDE_FROM_DEFAULT_BUILD TRUE
67+
EXCLUDE_FROM_ALL TRUE
68+
)
69+
endif()
70+
endif()

opencl/test/unit_test/aub_tests/CMakeLists.txt

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -41,9 +41,6 @@ if(WIN32)
4141
)
4242
endif()
4343

44-
add_custom_target(run_aub_tests)
45-
set_target_properties(run_aub_tests PROPERTIES FOLDER ${OPENCL_TEST_PROJECTS_FOLDER})
46-
4744
if(WIN32)
4845
target_include_directories(igdrcl_aub_tests PRIVATE
4946
${NEO_SOURCE_DIR}/opencl/test/unit_test/mocks${BRANCH_DIR_SUFFIX}

opencl/test/unit_test/aub_tests/cmake/run_aub_test_target.cmake

Lines changed: 0 additions & 62 deletions
This file was deleted.

opencl/test/unit_test/aub_tests/gen11/icllp/CMakeLists.txt

Lines changed: 0 additions & 10 deletions
This file was deleted.

opencl/test/unit_test/aub_tests/gen12lp/tgllp/CMakeLists.txt

Lines changed: 0 additions & 10 deletions
This file was deleted.

opencl/test/unit_test/aub_tests/gen8/bdw/CMakeLists.txt

Lines changed: 0 additions & 10 deletions
This file was deleted.

opencl/test/unit_test/aub_tests/gen9/bxt/CMakeLists.txt

Lines changed: 0 additions & 10 deletions
This file was deleted.

opencl/test/unit_test/aub_tests/gen9/skl/CMakeLists.txt

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,4 @@
66

77
if(TESTS_SKL)
88
add_subdirectories()
9-
set(aub_test_config "skl/1/3/8/9")
10-
include(${OPENCL_AUB_TEST_DIR}/cmake/run_aub_test_target.cmake)
119
endif()

target_aub_tests/CMakeLists.txt

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
#
2+
# Copyright (C) 2020-2021 Intel Corporation
3+
#
4+
# SPDX-License-Identifier: MIT
5+
#
6+
7+
add_custom_target(run_aub_tests ALL)
8+
set_target_properties(run_aub_tests PROPERTIES FOLDER aub_product_targets)
9+
10+
add_subdirectories()

0 commit comments

Comments
 (0)