|
| 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() |
0 commit comments