diff --git a/CMakeLists.txt b/CMakeLists.txt index c8eada7502..b3dd4836e5 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -256,6 +256,13 @@ if(NEO_SKIP_UNIT_TESTS) set(NEO_SKIP_L0_BLACK_BOX_TESTS TRUE) endif() +if(DEFINED NEO_GENERATE_AUBS_FOR) + if(DEFINED NEO_SKIP_AUB_TESTS_RUN AND NEO_SKIP_AUB_TESTS_RUN) + message(FATAL_ERROR "Invalid cmake flags combination, NEO_GENERATE_AUBS_FOR assumes aub tests execution is not skipped") + endif() + set(NEO_SKIP_AUB_TESTS_RUN FALSE) +endif() + if(NOT DEFINED NEO_SKIP_AUB_TESTS_RUN) set(NEO_SKIP_AUB_TESTS_RUN TRUE) endif() diff --git a/cmake/run_aub_test_target.cmake b/cmake/run_aub_test_target.cmake index c4b08f1e31..3d0c0e18e2 100644 --- a/cmake/run_aub_test_target.cmake +++ b/cmake/run_aub_test_target.cmake @@ -34,6 +34,24 @@ if(NOT NEO_SKIP_OCL_UNIT_TESTS OR NOT NEO_SKIP_L0_UNIT_TESTS) list(APPEND aub_tests_options ${AUB_DUMP_IMAGE_FORMAT}) endif() + set(aubstream_mode_flag "") + if(DEFINED NEO_GENERATE_AUBS_FOR) + set(aubstream_mode_flag "--null_aubstream") + foreach(product_with_aubs ${NEO_GENERATE_AUBS_FOR}) + string(TOLOWER ${product_with_aubs} product_with_aubs_lower) + if(${product_with_aubs_lower} STREQUAL ${product}) + set(aubstream_mode_flag "") + string(TOUPPER ${product} product_upper) + set_property(GLOBAL APPEND PROPERTY NEO_PLATFORMS_FOR_AUB_GENERATION "${product_upper} ") + break() + endif() + + endforeach() + endif() + if(NOT ${aubstream_mode_flag} STREQUAL "") + list(APPEND aub_tests_options ${aubstream_mode_flag}) + endif() + add_custom_command( TARGET run_${product}_${revision_id}_aub_tests POST_BUILD diff --git a/opencl/test/unit_test/aub_tests/xe_hpc_core/aub_mem_dump_tests_xe_hpc_core.cpp b/opencl/test/unit_test/aub_tests/xe_hpc_core/aub_mem_dump_tests_xe_hpc_core.cpp index 57ebc43ab8..187e8cee06 100644 --- a/opencl/test/unit_test/aub_tests/xe_hpc_core/aub_mem_dump_tests_xe_hpc_core.cpp +++ b/opencl/test/unit_test/aub_tests/xe_hpc_core/aub_mem_dump_tests_xe_hpc_core.cpp @@ -24,7 +24,6 @@ XE_HPC_CORETEST_F(XeHpcCoreAubMemDumpTests, whenAubCsrIsCreatedThenCreateHardwar DebugManagerStateRestore restore; VariableBackup backup(&ultHwConfig); ultHwConfig.useHwCsr = true; - debugManager.flags.SetCommandStreamReceiver.set(static_cast(CommandStreamReceiverType::aub)); std::unique_ptr device(MockDevice::createWithNewExecutionEnvironment(defaultHwInfo.get())); diff --git a/opencl/test/unit_test/aub_tests/xe_hpg_core/aub_mem_dump_tests_xe_hpg_core.cpp b/opencl/test/unit_test/aub_tests/xe_hpg_core/aub_mem_dump_tests_xe_hpg_core.cpp index f074fed211..33be4f4477 100644 --- a/opencl/test/unit_test/aub_tests/xe_hpg_core/aub_mem_dump_tests_xe_hpg_core.cpp +++ b/opencl/test/unit_test/aub_tests/xe_hpg_core/aub_mem_dump_tests_xe_hpg_core.cpp @@ -26,7 +26,6 @@ XE_HPG_CORETEST_F(XeHpgCoreAubMemDumpTests, whenAubCsrIsCreatedThenCreateHardwar DebugManagerStateRestore restore; VariableBackup backup(&ultHwConfig); ultHwConfig.useHwCsr = true; - debugManager.flags.SetCommandStreamReceiver.set(static_cast(CommandStreamReceiverType::aub)); std::unique_ptr device(MockDevice::createWithNewExecutionEnvironment(defaultHwInfo.get())); diff --git a/shared/test/common/tests_configuration.cpp b/shared/test/common/tests_configuration.cpp index fda89757e2..2e341b1d0a 100644 --- a/shared/test/common/tests_configuration.cpp +++ b/shared/test/common/tests_configuration.cpp @@ -27,7 +27,7 @@ void adjustHwInfoForTests(HardwareInfo &hwInfoForTests, uint32_t euPerSubSlice, uint32_t threadsPerEu = releaseHelper ? releaseHelper->getNumThreadsPerEu() : 7u; // set Gt and FeatureTable to initial state - bool setupFeatureTableAndWorkaroundTable = testMode == TestMode::aubTests ? true : false; + bool setupFeatureTableAndWorkaroundTable = isAubTestMode(testMode); hardwareInfoSetup[hwInfoForTests.platform.eProductFamily](&hwInfoForTests, setupFeatureTableAndWorkaroundTable, hwInfoConfig, releaseHelper.get()); GT_SYSTEM_INFO >SystemInfo = hwInfoForTests.gtSystemInfo; diff --git a/target_aub_tests/CMakeLists.txt b/target_aub_tests/CMakeLists.txt index eea97a1209..4b54cfabae 100644 --- a/target_aub_tests/CMakeLists.txt +++ b/target_aub_tests/CMakeLists.txt @@ -1,5 +1,5 @@ # -# Copyright (C) 2020-2022 Intel Corporation +# Copyright (C) 2020-2024 Intel Corporation # # SPDX-License-Identifier: MIT # @@ -8,6 +8,13 @@ if(DEFINED AUB_STREAM_PROJECT_NAME) add_custom_target(run_aub_tests) set(AUB_TESTS_TARGETS_FOLDER "aub_product_targets") set_target_properties(run_aub_tests PROPERTIES FOLDER ${AUB_TESTS_TARGETS_FOLDER}) + set_property(GLOBAL PROPERTY NEO_PLATFORMS_FOR_AUB_GENERATION) add_subdirectories() + + if(DEFINED NEO_GENERATE_AUBS_FOR) + get_property(NEO_PLATFORMS_FOR_AUB_GENERATION GLOBAL PROPERTY NEO_PLATFORMS_FOR_AUB_GENERATION) + message(STATUS "Aub generation scope restricted by NEO_GENERATE_AUBS_FOR flag") + message(STATUS "All tested platforms with aub generation: " ${NEO_PLATFORMS_FOR_AUB_GENERATION}) + endif() endif()