diff --git a/level_zero/CMakeLists.txt b/level_zero/CMakeLists.txt index bc0c5ccac1..772c773cbf 100644 --- a/level_zero/CMakeLists.txt +++ b/level_zero/CMakeLists.txt @@ -223,7 +223,6 @@ if(BUILD_WITH_L0) target_sources(${TARGET_NAME_L0} PRIVATE - ${NEO_SHARED_DIRECTORY}/aub/aub_stream_interface.cpp ${NEO_SHARED_DIRECTORY}/built_ins/sip_init.cpp ${NEO_SHARED_DIRECTORY}/dll/create_deferred_deleter.cpp ${NEO_SHARED_DIRECTORY}/dll/create_memory_manager_${DRIVER_MODEL}.cpp @@ -231,6 +230,18 @@ if(BUILD_WITH_L0) ${NEO_SHARED_DIRECTORY}/dll/get_devices.cpp ${NEO_SHARED_DIRECTORY}/dll/source_level_debugger_dll.cpp ) + if(DEFINED AUB_STREAM_PROJECT_NAME) + target_sources(${TARGET_NAME_L0} + PRIVATE + ${NEO_SHARED_DIRECTORY}/aub/aub_stream_interface.cpp + ) + else() + target_sources(${TARGET_NAME_L0} + PRIVATE + ${NEO_SHARED_DIRECTORY}/aub/aub_stream_interface_stub.cpp + ) + + endif() if(WIN32) target_sources(${TARGET_NAME_L0} diff --git a/level_zero/core/test/aub_tests/CMakeLists.txt b/level_zero/core/test/aub_tests/CMakeLists.txt index 26fdc3b8ca..8accb91546 100644 --- a/level_zero/core/test/aub_tests/CMakeLists.txt +++ b/level_zero/core/test/aub_tests/CMakeLists.txt @@ -4,91 +4,91 @@ # SPDX-License-Identifier: MIT # -link_libraries(${ASAN_LIBS} ${TSAN_LIBS}) - -set(TARGET_NAME ${TARGET_NAME_L0}_aub_tests) -set(L0_AUB_TEST_DIR ${CMAKE_CURRENT_SOURCE_DIR}) - -list(APPEND L0_AUB_TESTS__TARGET_OBJECTS - ${CMAKE_CURRENT_SOURCE_DIR}/aub_hello_world_test.cpp - ${NEO_SOURCE_DIR}/level_zero/core/test/unit_tests/main.cpp - ${NEO_SHARED_TEST_DIRECTORY}/common/tests_configuration.h -) - -function(ADD_SUPPORTED_TEST_PRODUCT_FAMILIES_DEFINITION) - set(L0_TESTED_PRODUCT_FAMILIES ${ALL_TESTED_PRODUCT_FAMILY}) - string(REPLACE ";" "," L0_TESTED_PRODUCT_FAMILIES "${L0_TESTED_PRODUCT_FAMILIES}") - add_definitions(-DSUPPORTED_TEST_PRODUCT_FAMILIES=${L0_TESTED_PRODUCT_FAMILIES}) -endfunction() - -ADD_SUPPORTED_TEST_PRODUCT_FAMILIES_DEFINITION() - if(DEFINED AUB_STREAM_PROJECT_NAME) - list(APPEND L0_AUB_TESTS__TARGET_OBJECTS $) -endif() + link_libraries(${ASAN_LIBS} ${TSAN_LIBS}) -add_executable(${TARGET_NAME} - ${L0_AUB_TESTS__TARGET_OBJECTS} -) + set(TARGET_NAME ${TARGET_NAME_L0}_aub_tests) + set(L0_AUB_TEST_DIR ${CMAKE_CURRENT_SOURCE_DIR}) -set_target_properties(${TARGET_NAME} PROPERTIES FOLDER ${TARGET_NAME_L0}) - -target_sources(${TARGET_NAME} PRIVATE - ${CMAKE_CURRENT_SOURCE_DIR}/CMakeLists.txt - ${L0_CORE_ENABLERS} - ${NEO_SOURCE_DIR}/level_zero/core/test/unit_tests/main.cpp - ${NEO_SOURCE_DIR}/level_zero/core/test/unit_tests/mock.h - ${NEO_SOURCE_DIR}/level_zero/core/test/unit_tests/white_box.h - ${NEO_SOURCE_DIR}/level_zero/tools/test/unit_tests/sources/debug/debug_session_helper.cpp - ${NEO_SOURCE_DIR}/level_zero/core/source/dll/create_builtin_functions_lib.cpp - ${NEO_SOURCE_DIR}/level_zero/core/source/dll/disallow_deferred_deleter.cpp -) - -target_sources(${TARGET_NAME} PRIVATE - $ - $ - $ - $ - $ - $ - $ - $ - $ - $ - $ -) -if(TARGET ${BUILTINS_SPIRV_LIB_NAME}) - target_sources(${TARGET_NAME} PRIVATE - $ + list(APPEND L0_AUB_TESTS__TARGET_OBJECTS + ${CMAKE_CURRENT_SOURCE_DIR}/aub_hello_world_test.cpp + ${NEO_SOURCE_DIR}/level_zero/core/test/unit_tests/main.cpp + ${NEO_SHARED_TEST_DIRECTORY}/common/tests_configuration.h ) + + function(ADD_SUPPORTED_TEST_PRODUCT_FAMILIES_DEFINITION) + set(L0_TESTED_PRODUCT_FAMILIES ${ALL_TESTED_PRODUCT_FAMILY}) + string(REPLACE ";" "," L0_TESTED_PRODUCT_FAMILIES "${L0_TESTED_PRODUCT_FAMILIES}") + add_definitions(-DSUPPORTED_TEST_PRODUCT_FAMILIES=${L0_TESTED_PRODUCT_FAMILIES}) + endfunction() + + ADD_SUPPORTED_TEST_PRODUCT_FAMILIES_DEFINITION() + + list(APPEND L0_AUB_TESTS__TARGET_OBJECTS $) + + add_executable(${TARGET_NAME} + ${L0_AUB_TESTS__TARGET_OBJECTS} + ) + + set_target_properties(${TARGET_NAME} PROPERTIES FOLDER ${TARGET_NAME_L0}) + + target_sources(${TARGET_NAME} PRIVATE + ${CMAKE_CURRENT_SOURCE_DIR}/CMakeLists.txt + ${L0_CORE_ENABLERS} + ${NEO_SOURCE_DIR}/level_zero/core/test/unit_tests/main.cpp + ${NEO_SOURCE_DIR}/level_zero/core/test/unit_tests/mock.h + ${NEO_SOURCE_DIR}/level_zero/core/test/unit_tests/white_box.h + ${NEO_SOURCE_DIR}/level_zero/tools/test/unit_tests/sources/debug/debug_session_helper.cpp + ${NEO_SOURCE_DIR}/level_zero/core/source/dll/create_builtin_functions_lib.cpp + ${NEO_SOURCE_DIR}/level_zero/core/source/dll/disallow_deferred_deleter.cpp + ) + + target_sources(${TARGET_NAME} PRIVATE + $ + $ + $ + $ + $ + $ + $ + $ + $ + $ + $ + ) + if(TARGET ${BUILTINS_SPIRV_LIB_NAME}) + target_sources(${TARGET_NAME} PRIVATE + $ + ) + endif() + + copy_gmm_dll_for(${TARGET_NAME}) + add_subdirectories() + + target_link_libraries(${TARGET_NAME} ${NEO_SHARED_MOCKABLE_LIB_NAME}) + target_link_libraries(${TARGET_NAME} ${HW_LIBS_ULT}) + target_link_libraries(${TARGET_NAME} gmock-gtest) + target_link_libraries(${TARGET_NAME} ${NEO_EXTRA_LIBS}) + + if(UNIX) + target_link_libraries(${TARGET_NAME} rt) + target_link_libraries(${TARGET_NAME} ${GMM_LINK_NAME}) + else() + target_link_libraries(${TARGET_NAME} dbghelp) + add_dependencies(${TARGET_NAME} ${GMM_TARGET_NAME}) + endif() + + target_include_directories(${TARGET_NAME} PRIVATE + ${NEO_SHARED_TEST_DIRECTORY}/common/test_configuration/aub_tests + ${NEO_SOURCE_DIR}/shared/test/common/helpers/includes${BRANCH_DIR_SUFFIX} + ${NEO_SHARED_TEST_DIRECTORY}/common/test_macros/header${BRANCH_DIR_SUFFIX} + ${NEO_SOURCE_DIR}/level_zero/core/test/unit_tests + ${ENGINE_NODE_DIR} + ${CIF_BASE_DIR} + ${NEO__GMM_INCLUDE_DIR} + ${THIRD_PARTY_DIR} + ${WDK_DIR} + ) + + create_project_source_tree(${TARGET_NAME}) endif() - -copy_gmm_dll_for(${TARGET_NAME}) -add_subdirectories() - -target_link_libraries(${TARGET_NAME} ${NEO_SHARED_MOCKABLE_LIB_NAME}) -target_link_libraries(${TARGET_NAME} ${HW_LIBS_ULT}) -target_link_libraries(${TARGET_NAME} gmock-gtest) -target_link_libraries(${TARGET_NAME} ${NEO_EXTRA_LIBS}) - -if(UNIX) - target_link_libraries(${TARGET_NAME} rt) - target_link_libraries(${TARGET_NAME} ${GMM_LINK_NAME}) -else() - target_link_libraries(${TARGET_NAME} dbghelp) - add_dependencies(${TARGET_NAME} ${GMM_TARGET_NAME}) -endif() - -target_include_directories(${TARGET_NAME} PRIVATE - ${NEO_SHARED_TEST_DIRECTORY}/common/test_configuration/aub_tests - ${NEO_SOURCE_DIR}/shared/test/common/helpers/includes${BRANCH_DIR_SUFFIX} - ${NEO_SHARED_TEST_DIRECTORY}/common/test_macros/header${BRANCH_DIR_SUFFIX} - ${NEO_SOURCE_DIR}/level_zero/core/test/unit_tests - ${ENGINE_NODE_DIR} - ${CIF_BASE_DIR} - ${NEO__GMM_INCLUDE_DIR} - ${THIRD_PARTY_DIR} - ${WDK_DIR} -) - -create_project_source_tree(${TARGET_NAME}) diff --git a/opencl/source/CMakeLists.txt b/opencl/source/CMakeLists.txt index 633999c130..beb9be2415 100644 --- a/opencl/source/CMakeLists.txt +++ b/opencl/source/CMakeLists.txt @@ -112,14 +112,22 @@ if(${GENERATE_EXECUTABLE}) $ ) - if(DEFINED AUB_STREAM_PROJECT_NAME) - list(APPEND NEO_DYNAMIC_LIB__TARGET_OBJECTS $) - endif() - add_library(${NEO_DYNAMIC_LIB_NAME} SHARED ${NEO_DYNAMIC_LIB__TARGET_OBJECTS} - ${NEO_SOURCE_DIR}/shared/source/aub/aub_stream_interface.cpp ) + if(DEFINED AUB_STREAM_PROJECT_NAME) + target_sources(${NEO_DYNAMIC_LIB_NAME} + PRIVATE + $ + ${NEO_SOURCE_DIR}/shared/source/aub/aub_stream_interface.cpp + ) + else() + target_sources(${NEO_DYNAMIC_LIB_NAME} + PRIVATE + ${NEO_SOURCE_DIR}/shared/source/aub/aub_stream_interface_stub.cpp + ) + + endif() if(UNIX) if(NEO_BUILD_DEBUG_SYMBOLS_PACKAGE) diff --git a/opencl/test/unit_test/aub_tests/CMakeLists.txt b/opencl/test/unit_test/aub_tests/CMakeLists.txt index 3f101c9ebb..229c9d27b1 100644 --- a/opencl/test/unit_test/aub_tests/CMakeLists.txt +++ b/opencl/test/unit_test/aub_tests/CMakeLists.txt @@ -4,62 +4,62 @@ # SPDX-License-Identifier: MIT # -project(igdrcl_aub_tests) - -set(OPENCL_AUB_TEST_DIR ${CMAKE_CURRENT_SOURCE_DIR}) - -list(APPEND IGDRCL_AUB_TESTS__TARGET_OBJECTS - ${NEO_SOURCE_DIR}/opencl/test/unit_test/test_macros/test_checks_ocl.cpp - ${NEO_SOURCE_DIR}/shared/test/common/test_macros/test_checks_shared.cpp - $ - $ - $ - $ - $ - $ - $ - $ -) - if(DEFINED AUB_STREAM_PROJECT_NAME) + project(igdrcl_aub_tests) + + set(OPENCL_AUB_TEST_DIR ${CMAKE_CURRENT_SOURCE_DIR}) + + list(APPEND IGDRCL_AUB_TESTS__TARGET_OBJECTS + ${NEO_SOURCE_DIR}/opencl/test/unit_test/test_macros/test_checks_ocl.cpp + ${NEO_SOURCE_DIR}/shared/test/common/test_macros/test_checks_shared.cpp + $ + $ + $ + $ + $ + $ + $ + $ + ) + list(APPEND IGDRCL_AUB_TESTS__TARGET_OBJECTS $) -endif() -add_executable(igdrcl_aub_tests - ${IGDRCL_AUB_TESTS__TARGET_OBJECTS} -) - -set_target_properties(igdrcl_aub_tests PROPERTIES FOLDER ${OPENCL_TEST_PROJECTS_FOLDER}) - -if(WIN32) - set_target_properties(igdrcl_aub_tests PROPERTIES - VS_DEBUGGER_WORKING_DIRECTORY ${TargetDir} - VS_DEBUGGER_COMMAND_ARGUMENTS " --disable_pagefaulting_tests" + add_executable(igdrcl_aub_tests + ${IGDRCL_AUB_TESTS__TARGET_OBJECTS} ) -endif() -if(WIN32) + set_target_properties(igdrcl_aub_tests PROPERTIES FOLDER ${OPENCL_TEST_PROJECTS_FOLDER}) + + if(WIN32) + set_target_properties(igdrcl_aub_tests PROPERTIES + VS_DEBUGGER_WORKING_DIRECTORY ${TargetDir} + VS_DEBUGGER_COMMAND_ARGUMENTS " --disable_pagefaulting_tests" + ) + endif() + + if(WIN32) + target_include_directories(igdrcl_aub_tests PRIVATE + ${NEO_SOURCE_DIR}/opencl/test/unit_test/mocks${BRANCH_DIR_SUFFIX} + ) + endif() + target_include_directories(igdrcl_aub_tests PRIVATE - ${NEO_SOURCE_DIR}/opencl/test/unit_test/mocks${BRANCH_DIR_SUFFIX} + ${NEO_SHARED_TEST_DIRECTORY}/common/test_configuration/aub_tests + ${NEO_SOURCE_DIR}/shared/test/common/helpers/includes${BRANCH_DIR_SUFFIX} ) + + copy_gmm_dll_for(igdrcl_aub_tests) + add_subdirectories() + + target_link_libraries(igdrcl_aub_tests ${NEO_MOCKABLE_LIB_NAME} ${NEO_SHARED_MOCKABLE_LIB_NAME}) + target_link_libraries(igdrcl_aub_tests igdrcl_mocks) + target_link_libraries(igdrcl_aub_tests gmock-gtest ${NEO_EXTRA_LIBS}) + if(UNIX) + target_link_libraries(igdrcl_aub_tests ${GMM_LINK_NAME}) + else() + add_dependencies(igdrcl_aub_tests ${GMM_TARGET_NAME}) + endif() + target_include_directories(igdrcl_aub_tests BEFORE PRIVATE ${NEO_SHARED_TEST_DIRECTORY}/common/test_macros/header${BRANCH_DIR_SUFFIX}) + + create_project_source_tree(igdrcl_aub_tests) endif() - -target_include_directories(igdrcl_aub_tests PRIVATE - ${NEO_SHARED_TEST_DIRECTORY}/common/test_configuration/aub_tests - ${NEO_SOURCE_DIR}/shared/test/common/helpers/includes${BRANCH_DIR_SUFFIX} -) - -copy_gmm_dll_for(igdrcl_aub_tests) -add_subdirectories() - -target_link_libraries(igdrcl_aub_tests ${NEO_MOCKABLE_LIB_NAME} ${NEO_SHARED_MOCKABLE_LIB_NAME}) -target_link_libraries(igdrcl_aub_tests igdrcl_mocks) -target_link_libraries(igdrcl_aub_tests gmock-gtest ${NEO_EXTRA_LIBS}) -if(UNIX) - target_link_libraries(igdrcl_aub_tests ${GMM_LINK_NAME}) -else() - add_dependencies(igdrcl_aub_tests ${GMM_TARGET_NAME}) -endif() -target_include_directories(igdrcl_aub_tests BEFORE PRIVATE ${NEO_SHARED_TEST_DIRECTORY}/common/test_macros/header${BRANCH_DIR_SUFFIX}) - -create_project_source_tree(igdrcl_aub_tests) diff --git a/shared/source/aub/aub_center.cpp b/shared/source/aub/aub_center.cpp index 1426fd3174..2f91f563b7 100644 --- a/shared/source/aub/aub_center.cpp +++ b/shared/source/aub/aub_center.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2018-2021 Intel Corporation + * Copyright (C) 2018-2022 Intel Corporation * * SPDX-License-Identifier: MIT * @@ -15,9 +15,10 @@ #include "third_party/aub_stream/headers/aub_manager.h" #include "third_party/aub_stream/headers/aubstream.h" +#include "third_party/aub_stream/headers/product_family.h" namespace NEO { -extern aub_stream::AubManager *createAubManager(uint32_t productFamily, uint32_t devicesCount, uint64_t memoryBankSize, uint32_t stepping, bool localMemorySupported, uint32_t streamMode, uint64_t gpuAddressSpace); +extern aub_stream::AubManager *createAubManager(const aub_stream::AubManagerOptions &options); AubCenter::AubCenter(const HardwareInfo *pHwInfo, const GmmHelper &gmmHelper, bool localMemoryEnabled, const std::string &aubFileName, CommandStreamReceiverType csrType) { if (DebugManager.flags.UseAubStream.get()) { @@ -32,6 +33,9 @@ AubCenter::AubCenter(const HardwareInfo *pHwInfo, const GmmHelper &gmmHelper, bo auto &hwHelper = HwHelper::get(pHwInfo->platform.eRenderCoreFamily); const auto &hwInfoConfig = *HwInfoConfig::get(pHwInfo->platform.eProductFamily); + + auto aubStreamProductFamily = hwInfoConfig.getAubStreamProductFamily(); + stepping = hwInfoConfig.getAubStreamSteppingFromHwRevId(*pHwInfo); aub_stream::MMIOList extraMmioList = hwHelper.getExtraMmioList(*pHwInfo, gmmHelper); @@ -43,8 +47,17 @@ AubCenter::AubCenter(const HardwareInfo *pHwInfo, const GmmHelper &gmmHelper, bo AubHelper::setTbxConfiguration(); - aubManager.reset(createAubManager(pHwInfo->platform.eProductFamily, devicesCount, memoryBankSize, stepping, localMemoryEnabled, - aubStreamMode, pHwInfo->capabilityTable.gpuAddressSpace)); + aub_stream::AubManagerOptions options{}; + options.version = 1u; + options.productFamily = static_cast(aubStreamProductFamily.value_or(aub_stream::ProductFamily::MaxProduct)); + options.devicesCount = devicesCount; + options.memoryBankSize = memoryBankSize; + options.stepping = stepping; + options.localMemorySupported = localMemoryEnabled; + options.mode = aubStreamMode; + options.gpuAddressSpace = pHwInfo->capabilityTable.gpuAddressSpace; + + aubManager.reset(createAubManager(options)); } addressMapper = std::make_unique(); streamProvider = std::make_unique(); diff --git a/shared/source/aub/aub_stream_interface.cpp b/shared/source/aub/aub_stream_interface.cpp index 80fbb971cf..1003fa8729 100644 --- a/shared/source/aub/aub_stream_interface.cpp +++ b/shared/source/aub/aub_stream_interface.cpp @@ -1,14 +1,14 @@ /* - * Copyright (C) 2018-2020 Intel Corporation + * Copyright (C) 2018-2022 Intel Corporation * * SPDX-License-Identifier: MIT * */ #include "shared/source/aub/aub_center.h" -using namespace aub_stream; + namespace NEO { -AubManager *createAubManager(uint32_t gfxFamily, uint32_t devicesCount, uint64_t memoryBankSize, uint32_t stepping, bool localMemorySupported, uint32_t streamMode, uint64_t gpuAddressSpace) { - return AubManager::create(gfxFamily, devicesCount, memoryBankSize, stepping, localMemorySupported, streamMode, gpuAddressSpace); +aub_stream::AubManager *createAubManager(const aub_stream::AubManagerOptions &options) { + return aub_stream::AubManager::create(options); } } // namespace NEO diff --git a/shared/source/aub/aub_stream_interface_stub.cpp b/shared/source/aub/aub_stream_interface_stub.cpp new file mode 100644 index 0000000000..27c1e52d45 --- /dev/null +++ b/shared/source/aub/aub_stream_interface_stub.cpp @@ -0,0 +1,14 @@ +/* + * Copyright (C) 2022 Intel Corporation + * + * SPDX-License-Identifier: MIT + * + */ + +#include "shared/source/aub/aub_center.h" + +namespace NEO { +aub_stream::AubManager *createAubManager(const aub_stream::AubManagerOptions &options) { + return nullptr; +} +} // namespace NEO diff --git a/shared/source/aub_mem_dump/aub_stream_stubs.cpp b/shared/source/aub_mem_dump/aub_stream_stubs.cpp index df0b9df659..e61ca5187c 100644 --- a/shared/source/aub_mem_dump/aub_stream_stubs.cpp +++ b/shared/source/aub_mem_dump/aub_stream_stubs.cpp @@ -1,11 +1,10 @@ /* - * Copyright (C) 2018-2020 Intel Corporation + * Copyright (C) 2018-2022 Intel Corporation * * SPDX-License-Identifier: MIT * */ -#include "third_party/aub_stream/headers/aub_manager.h" #include "third_party/aub_stream/headers/aubstream.h" namespace aub_stream_stubs { @@ -16,10 +15,6 @@ bool tbxFrontdoorMode = false; namespace aub_stream { -AubManager *AubManager::create(uint32_t productFamily, uint32_t devicesCount, uint64_t memoryBankSizeInGB, uint32_t stepping, bool localMemorySupported, uint32_t streamMode, uint64_t gpuAddressSpace) { - return nullptr; -} - extern "C" { void injectMMIOList(MMIOList mmioList){}; void setTbxServerPort(uint16_t port) { aub_stream_stubs::tbxServerPort = port; }; diff --git a/shared/source/gen11/icllp/os_agnostic_hw_info_config_icllp.inl b/shared/source/gen11/icllp/os_agnostic_hw_info_config_icllp.inl index 432a1c6532..0e8cf77e80 100644 --- a/shared/source/gen11/icllp/os_agnostic_hw_info_config_icllp.inl +++ b/shared/source/gen11/icllp/os_agnostic_hw_info_config_icllp.inl @@ -5,6 +5,8 @@ * */ +#include "product_family.h" + namespace NEO { template <> bool HwInfoConfigHw::isAdditionalMediaSamplerProgrammingRequired() const { @@ -25,4 +27,10 @@ template <> AOT::PRODUCT_CONFIG HwInfoConfigHw::getProductConfigFromHwInfo(const HardwareInfo &hwInfo) const { return AOT::ICL; } + +template <> +std::optional HwInfoConfigHw::getAubStreamProductFamily() const { + return aub_stream::ProductFamily::Icllp; +}; + } // namespace NEO diff --git a/shared/source/gen12lp/adln/os_agnostic_hw_info_config_adln.inl b/shared/source/gen12lp/adln/os_agnostic_hw_info_config_adln.inl index cecc8e0f84..4994298842 100644 --- a/shared/source/gen12lp/adln/os_agnostic_hw_info_config_adln.inl +++ b/shared/source/gen12lp/adln/os_agnostic_hw_info_config_adln.inl @@ -5,6 +5,8 @@ * */ +#include "product_family.h" + namespace NEO { template <> uint32_t HwInfoConfigHw::getHwRevIdFromStepping(uint32_t stepping, const HardwareInfo &hwInfo) const { @@ -28,4 +30,10 @@ uint32_t HwInfoConfigHw::getSteppingFromHwRevId(const HardwareInfo & } return CommonConstants::invalidStepping; } + +template <> +std::optional HwInfoConfigHw::getAubStreamProductFamily() const { + return aub_stream::ProductFamily::Adln; +}; + } // namespace NEO diff --git a/shared/source/gen12lp/adlp/os_agnostic_hw_info_config_adlp.inl b/shared/source/gen12lp/adlp/os_agnostic_hw_info_config_adlp.inl index 3897b78b8c..0601b4adb6 100644 --- a/shared/source/gen12lp/adlp/os_agnostic_hw_info_config_adlp.inl +++ b/shared/source/gen12lp/adlp/os_agnostic_hw_info_config_adlp.inl @@ -5,6 +5,8 @@ * */ +#include "product_family.h" + namespace NEO { template <> uint32_t HwInfoConfigHw::getHwRevIdFromStepping(uint32_t stepping, const HardwareInfo &hwInfo) const { @@ -32,4 +34,10 @@ uint32_t HwInfoConfigHw::getSteppingFromHwRevId(const HardwareInfo & } return CommonConstants::invalidStepping; } + +template <> +std::optional HwInfoConfigHw::getAubStreamProductFamily() const { + return aub_stream::ProductFamily::Adlp; +}; + } // namespace NEO diff --git a/shared/source/gen12lp/adls/os_agnostic_hw_info_config_adls.inl b/shared/source/gen12lp/adls/os_agnostic_hw_info_config_adls.inl index 6857fb793f..beb3af3b2a 100644 --- a/shared/source/gen12lp/adls/os_agnostic_hw_info_config_adls.inl +++ b/shared/source/gen12lp/adls/os_agnostic_hw_info_config_adls.inl @@ -5,6 +5,8 @@ * */ +#include "product_family.h" + namespace NEO { template <> uint32_t HwInfoConfigHw::getHwRevIdFromStepping(uint32_t stepping, const HardwareInfo &hwInfo) const { @@ -32,4 +34,10 @@ uint32_t HwInfoConfigHw::getSteppingFromHwRevId(const HardwareInfo & } return CommonConstants::invalidStepping; } + +template <> +std::optional HwInfoConfigHw::getAubStreamProductFamily() const { + return aub_stream::ProductFamily::Adls; +}; + } // namespace NEO diff --git a/shared/source/gen12lp/dg1/os_agnostic_hw_info_config_dg1.inl b/shared/source/gen12lp/dg1/os_agnostic_hw_info_config_dg1.inl index aa3e622d01..0cfa048d7a 100644 --- a/shared/source/gen12lp/dg1/os_agnostic_hw_info_config_dg1.inl +++ b/shared/source/gen12lp/dg1/os_agnostic_hw_info_config_dg1.inl @@ -5,6 +5,8 @@ * */ +#include "product_family.h" + namespace NEO { template <> uint32_t HwInfoConfigHw::getHwRevIdFromStepping(uint32_t stepping, const HardwareInfo &hwInfo) const { @@ -67,4 +69,10 @@ template <> bool HwInfoConfigHw::overrideGfxPartitionLayoutForWsl() const { return true; } + +template <> +std::optional HwInfoConfigHw::getAubStreamProductFamily() const { + return aub_stream::ProductFamily::Dg1; +}; + } // namespace NEO diff --git a/shared/source/gen12lp/tgllp/os_agnostic_hw_info_config_tgllp.inl b/shared/source/gen12lp/tgllp/os_agnostic_hw_info_config_tgllp.inl index baaf8c4417..26c9ad7435 100644 --- a/shared/source/gen12lp/tgllp/os_agnostic_hw_info_config_tgllp.inl +++ b/shared/source/gen12lp/tgllp/os_agnostic_hw_info_config_tgllp.inl @@ -5,6 +5,8 @@ * */ +#include "product_family.h" + namespace NEO { template <> uint32_t HwInfoConfigHw::getHwRevIdFromStepping(uint32_t stepping, const HardwareInfo &hwInfo) const { @@ -56,4 +58,10 @@ template <> bool HwInfoConfigHw::is3DPipelineSelectWARequired() const { return true; } + +template <> +std::optional HwInfoConfigHw::getAubStreamProductFamily() const { + return aub_stream::ProductFamily::Tgllp; +}; + } // namespace NEO diff --git a/shared/source/gen8/bdw/os_agnostic_hw_info_config_bdw.inl b/shared/source/gen8/bdw/os_agnostic_hw_info_config_bdw.inl index ae9d1bad39..9d9f0fa315 100644 --- a/shared/source/gen8/bdw/os_agnostic_hw_info_config_bdw.inl +++ b/shared/source/gen8/bdw/os_agnostic_hw_info_config_bdw.inl @@ -5,9 +5,17 @@ * */ +#include "product_family.h" + namespace NEO { template <> AOT::PRODUCT_CONFIG HwInfoConfigHw::getProductConfigFromHwInfo(const HardwareInfo &hwInfo) const { return AOT::BDW; } + +template <> +std::optional HwInfoConfigHw::getAubStreamProductFamily() const { + return aub_stream::ProductFamily::Bdw; +}; + } // namespace NEO diff --git a/shared/source/gen9/bxt/os_agnostic_hw_info_config_bxt.inl b/shared/source/gen9/bxt/os_agnostic_hw_info_config_bxt.inl index 8019fe93b1..45848818f4 100644 --- a/shared/source/gen9/bxt/os_agnostic_hw_info_config_bxt.inl +++ b/shared/source/gen9/bxt/os_agnostic_hw_info_config_bxt.inl @@ -5,9 +5,17 @@ * */ +#include "product_family.h" + namespace NEO { template <> AOT::PRODUCT_CONFIG HwInfoConfigHw::getProductConfigFromHwInfo(const HardwareInfo &hwInfo) const { return AOT::APL; } + +template <> +std::optional HwInfoConfigHw::getAubStreamProductFamily() const { + return aub_stream::ProductFamily::Bxt; +}; + } // namespace NEO diff --git a/shared/source/gen9/cfl/os_agnostic_hw_info_config_cfl.inl b/shared/source/gen9/cfl/os_agnostic_hw_info_config_cfl.inl index 0ab4edded9..a4146f11bf 100644 --- a/shared/source/gen9/cfl/os_agnostic_hw_info_config_cfl.inl +++ b/shared/source/gen9/cfl/os_agnostic_hw_info_config_cfl.inl @@ -8,6 +8,7 @@ #include "shared/source/gen9/cfl/device_ids_configs_cfl.h" #include "platforms.h" +#include "product_family.h" #include @@ -28,4 +29,10 @@ AOT::PRODUCT_CONFIG HwInfoConfigHw::getProductConfigFromHwInfo(const } return AOT::UNKNOWN_ISA; } -} // namespace NEO \ No newline at end of file + +template <> +std::optional HwInfoConfigHw::getAubStreamProductFamily() const { + return aub_stream::ProductFamily::Cfl; +}; + +} // namespace NEO diff --git a/shared/source/gen9/glk/os_agnostic_hw_info_config_glk.inl b/shared/source/gen9/glk/os_agnostic_hw_info_config_glk.inl index 515b89a35c..0745c63c47 100644 --- a/shared/source/gen9/glk/os_agnostic_hw_info_config_glk.inl +++ b/shared/source/gen9/glk/os_agnostic_hw_info_config_glk.inl @@ -5,9 +5,17 @@ * */ +#include "product_family.h" + namespace NEO { template <> AOT::PRODUCT_CONFIG HwInfoConfigHw::getProductConfigFromHwInfo(const HardwareInfo &hwInfo) const { return AOT::GLK; } + +template <> +std::optional HwInfoConfigHw::getAubStreamProductFamily() const { + return aub_stream::ProductFamily::Glk; +}; + } // namespace NEO diff --git a/shared/source/gen9/kbl/os_agnostic_hw_info_config_kbl.inl b/shared/source/gen9/kbl/os_agnostic_hw_info_config_kbl.inl index 13ec60b71a..06576bd71c 100644 --- a/shared/source/gen9/kbl/os_agnostic_hw_info_config_kbl.inl +++ b/shared/source/gen9/kbl/os_agnostic_hw_info_config_kbl.inl @@ -8,6 +8,7 @@ #include "shared/source/gen9/kbl/device_ids_configs_kbl.h" #include "platforms.h" +#include "product_family.h" #include @@ -25,4 +26,10 @@ AOT::PRODUCT_CONFIG HwInfoConfigHw::getProductConfigFromHwInfo(const } return AOT::UNKNOWN_ISA; } -} // namespace NEO \ No newline at end of file + +template <> +std::optional HwInfoConfigHw::getAubStreamProductFamily() const { + return aub_stream::ProductFamily::Kbl; +}; + +} // namespace NEO diff --git a/shared/source/gen9/skl/os_agnostic_hw_info_config_skl.inl b/shared/source/gen9/skl/os_agnostic_hw_info_config_skl.inl index d588eba3a5..c955dc9746 100644 --- a/shared/source/gen9/skl/os_agnostic_hw_info_config_skl.inl +++ b/shared/source/gen9/skl/os_agnostic_hw_info_config_skl.inl @@ -5,9 +5,17 @@ * */ +#include "product_family.h" + namespace NEO { template <> AOT::PRODUCT_CONFIG HwInfoConfigHw::getProductConfigFromHwInfo(const HardwareInfo &hwInfo) const { return AOT::SKL; } + +template <> +std::optional HwInfoConfigHw::getAubStreamProductFamily() const { + return aub_stream::ProductFamily::Skl; +}; + } // namespace NEO diff --git a/shared/source/os_interface/hw_info_config.h b/shared/source/os_interface/hw_info_config.h index c2c79afdbe..507c3803e7 100644 --- a/shared/source/os_interface/hw_info_config.h +++ b/shared/source/os_interface/hw_info_config.h @@ -13,10 +13,16 @@ #include "igfxfmid.h" +#include + namespace AOT { enum PRODUCT_CONFIG : uint32_t; } +namespace aub_stream { +enum class ProductFamily : uint32_t; +} + namespace NEO { struct FrontEndPropertiesSupport; @@ -79,6 +85,7 @@ class HwInfoConfig { virtual uint32_t getHwRevIdFromStepping(uint32_t stepping, const HardwareInfo &hwInfo) const = 0; virtual uint32_t getSteppingFromHwRevId(const HardwareInfo &hwInfo) const = 0; virtual uint32_t getAubStreamSteppingFromHwRevId(const HardwareInfo &hwInfo) const = 0; + virtual std::optional getAubStreamProductFamily() const = 0; virtual bool isDefaultEngineTypeAdjustmentRequired(const HardwareInfo &hwInfo) const = 0; virtual bool overrideGfxPartitionLayoutForWsl() const = 0; virtual std::string getDeviceMemoryName() const = 0; @@ -217,6 +224,7 @@ class HwInfoConfigHw : public HwInfoConfig { AOT::PRODUCT_CONFIG getProductConfigFromHwInfo(const HardwareInfo &hwInfo) const override; uint32_t getSteppingFromHwRevId(const HardwareInfo &hwInfo) const override; uint32_t getAubStreamSteppingFromHwRevId(const HardwareInfo &hwInfo) const override; + std::optional getAubStreamProductFamily() const override; bool isDefaultEngineTypeAdjustmentRequired(const HardwareInfo &hwInfo) const override; std::string getDeviceMemoryName() const override; bool isDisableOverdispatchAvailable(const HardwareInfo &hwInfo) const override; diff --git a/shared/source/os_interface/hw_info_config.inl b/shared/source/os_interface/hw_info_config.inl index 445f185afb..c3a16cda86 100644 --- a/shared/source/os_interface/hw_info_config.inl +++ b/shared/source/os_interface/hw_info_config.inl @@ -211,6 +211,11 @@ uint32_t HwInfoConfigHw::getAubStreamSteppingFromHwRevId(const Hardw } } +template +std::optional HwInfoConfigHw::getAubStreamProductFamily() const { + return std::nullopt; +}; + template bool HwInfoConfigHw::isDefaultEngineTypeAdjustmentRequired(const HardwareInfo &hwInfo) const { return false; diff --git a/shared/source/xe_hp_core/os_agnostic_hw_info_config_xe_hp_core.inl b/shared/source/xe_hp_core/os_agnostic_hw_info_config_xe_hp_core.inl index 411c241a9c..6cb83d9a12 100644 --- a/shared/source/xe_hp_core/os_agnostic_hw_info_config_xe_hp_core.inl +++ b/shared/source/xe_hp_core/os_agnostic_hw_info_config_xe_hp_core.inl @@ -5,6 +5,8 @@ * */ +#include "product_family.h" + namespace NEO { template <> uint32_t HwInfoConfigHw::getHwRevIdFromStepping(uint32_t stepping, const HardwareInfo &hwInfo) const { @@ -138,4 +140,10 @@ template <> bool HwInfoConfigHw::isImplicitScalingSupported(const HardwareInfo &hwInfo) const { return true; } + +template <> +std::optional HwInfoConfigHw::getAubStreamProductFamily() const { + return aub_stream::ProductFamily::XeHpSdv; +}; + } // namespace NEO diff --git a/shared/source/xe_hpc_core/pvc/os_agnostic_hw_info_config_pvc.inl b/shared/source/xe_hpc_core/pvc/os_agnostic_hw_info_config_pvc.inl index 459112d2da..bff9d3a078 100644 --- a/shared/source/xe_hpc_core/pvc/os_agnostic_hw_info_config_pvc.inl +++ b/shared/source/xe_hpc_core/pvc/os_agnostic_hw_info_config_pvc.inl @@ -5,6 +5,8 @@ * */ +#include "product_family.h" + namespace NEO { template <> bool HwInfoConfigHw::isMaxThreadsForWorkgroupWARequired(const HardwareInfo &hwInfo) const { @@ -210,4 +212,10 @@ template <> bool HwInfoConfigHw::isStatefulAddressingModeSupported() const { return false; } + +template <> +std::optional HwInfoConfigHw::getAubStreamProductFamily() const { + return aub_stream::ProductFamily::Pvc; +}; + } // namespace NEO diff --git a/shared/source/xe_hpg_core/dg2/os_agnostic_hw_info_config_dg2.inl b/shared/source/xe_hpg_core/dg2/os_agnostic_hw_info_config_dg2.inl index 5632034c12..992b51db73 100644 --- a/shared/source/xe_hpg_core/dg2/os_agnostic_hw_info_config_dg2.inl +++ b/shared/source/xe_hpg_core/dg2/os_agnostic_hw_info_config_dg2.inl @@ -7,6 +7,8 @@ #include "shared/source/memory_manager/memory_manager.h" +#include "product_family.h" + namespace NEO { template <> void HwInfoConfigHw::adjustSamplerState(void *sampler, const HardwareInfo &hwInfo) { @@ -205,4 +207,10 @@ bool HwInfoConfigHw::isStorageInfoAdjustmentRequired() const { return false; } } + +template <> +std::optional HwInfoConfigHw::getAubStreamProductFamily() const { + return aub_stream::ProductFamily::Dg2; +}; + } // namespace NEO diff --git a/shared/test/common/aub_stream_mocks/aub_stream_interface_mock.cpp b/shared/test/common/aub_stream_mocks/aub_stream_interface_mock.cpp index d8577f3dc2..587e5fe8e8 100644 --- a/shared/test/common/aub_stream_mocks/aub_stream_interface_mock.cpp +++ b/shared/test/common/aub_stream_mocks/aub_stream_interface_mock.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2018-2021 Intel Corporation + * Copyright (C) 2018-2022 Intel Corporation * * SPDX-License-Identifier: MIT * @@ -8,7 +8,7 @@ #include "shared/test/common/mocks/mock_aub_manager.h" namespace NEO { -aub_stream::AubManager *createAubManager(uint32_t productFamily, uint32_t devicesCount, uint64_t memoryBankSize, uint32_t stepping, bool localMemorySupported, uint32_t streamMode, uint64_t gpuAddressSpace) { - return new MockAubManager(productFamily, devicesCount, memoryBankSize, stepping, localMemorySupported, streamMode, gpuAddressSpace); +aub_stream::AubManager *createAubManager(const aub_stream::AubManagerOptions &options) { + return new MockAubManager(options); } } // namespace NEO diff --git a/shared/test/common/fixtures/mock_aub_center_fixture.cpp b/shared/test/common/fixtures/mock_aub_center_fixture.cpp index b3e08f8520..bbf99b9958 100644 --- a/shared/test/common/fixtures/mock_aub_center_fixture.cpp +++ b/shared/test/common/fixtures/mock_aub_center_fixture.cpp @@ -23,8 +23,10 @@ void MockAubCenterFixture::setMockAubCenter(RootDeviceEnvironment &rootDeviceEnv void MockAubCenterFixture::setMockAubCenter(RootDeviceEnvironment &rootDeviceEnvironment, CommandStreamReceiverType commandStreamReceiverType) { if (testMode != TestMode::AubTests && testMode != TestMode::AubTestsWithTbx) { rootDeviceEnvironment.initGmm(); - auto mockAubCenter = std::make_unique(defaultHwInfo.get(), *rootDeviceEnvironment.getGmmHelper(), false, "", commandStreamReceiverType); - mockAubCenter->aubManager = std::make_unique(); + auto mockAubCenter = std::make_unique(rootDeviceEnvironment.getHardwareInfo(), *rootDeviceEnvironment.getGmmHelper(), false, "", commandStreamReceiverType); + if (!mockAubCenter->aubManager) { + mockAubCenter->aubManager = std::make_unique(); + } rootDeviceEnvironment.aubCenter.reset(mockAubCenter.release()); } } diff --git a/shared/test/common/mocks/mock_aub_manager.h b/shared/test/common/mocks/mock_aub_manager.h index a90db354a3..0aed5c59f8 100644 --- a/shared/test/common/mocks/mock_aub_manager.h +++ b/shared/test/common/mocks/mock_aub_manager.h @@ -70,14 +70,7 @@ class MockAubManager : public aub_stream::AubManager { public: MockAubManager(){}; - MockAubManager(uint32_t productFamily, uint32_t devicesCount, uint64_t memoryBankSize, uint32_t stepping, bool localMemorySupported, uint32_t streamMode, uint64_t gpuAddressSpace) { - mockAubManagerParams.productFamily = productFamily; - mockAubManagerParams.devicesCount = devicesCount; - mockAubManagerParams.memoryBankSize = memoryBankSize; - mockAubManagerParams.stepping = stepping; - mockAubManagerParams.localMemorySupported = localMemorySupported; - mockAubManagerParams.streamMode = streamMode; - mockAubManagerParams.gpuAddressSpace = gpuAddressSpace; + MockAubManager(const aub_stream::AubManagerOptions &inputOptions) : options(inputOptions) { } ~MockAubManager() override {} @@ -160,15 +153,7 @@ class MockAubManager : public aub_stream::AubManager { int hintToWriteMemory = 0; size_t writeMemoryPageSizePassed = 0; - struct MockAubManagerParams { - uint32_t productFamily = 0; - int32_t devicesCount = 0; - uint64_t memoryBankSize = 0; - uint32_t stepping = 0; - bool localMemorySupported = false; - uint32_t streamMode = 0xFFFFFFFF; - uint64_t gpuAddressSpace = 0xFFFFFFFFFFFF; - } mockAubManagerParams; + aub_stream::AubManagerOptions options{}; protected: HardwareContext *hardwareContext = nullptr; diff --git a/shared/test/common/test_configuration/unit_tests/CMakeLists.txt b/shared/test/common/test_configuration/unit_tests/CMakeLists.txt index 9b479fb49f..29f989367c 100644 --- a/shared/test/common/test_configuration/unit_tests/CMakeLists.txt +++ b/shared/test/common/test_configuration/unit_tests/CMakeLists.txt @@ -1,5 +1,5 @@ # -# Copyright (C) 2021 Intel Corporation +# Copyright (C) 2021-2022 Intel Corporation # # SPDX-License-Identifier: MIT # @@ -22,15 +22,9 @@ elseif(UNIX AND NOT DISABLE_WDDM_LINUX) ${NEO_SHARED_DIRECTORY}/gmm_helper/windows/gmm_memory.cpp ) endif() -if(DEFINED AUB_STREAM_PROJECT_NAME) - list(APPEND NEO_SHARED_unit_tests_configurations - ${NEO_SHARED_TEST_DIRECTORY}/common/aub_stream_mocks/aub_stream_interface_mock.cpp - ) -else() - list(APPEND NEO_SHARED_unit_tests_configurations - ${NEO_SOURCE_DIR}/shared/source/aub/aub_stream_interface.cpp - ) -endif() +list(APPEND NEO_SHARED_unit_tests_configurations + ${NEO_SHARED_TEST_DIRECTORY}/common/aub_stream_mocks/aub_stream_interface_mock.cpp +) add_library(neo_unit_tests_config OBJECT EXCLUDE_FROM_ALL ${NEO_SHARED_unit_tests_configurations}) set_target_properties(neo_unit_tests_config PROPERTIES POSITION_INDEPENDENT_CODE ON) diff --git a/shared/test/unit_test/aub/aub_center_tests.cpp b/shared/test/unit_test/aub/aub_center_tests.cpp index f430b36c5a..3fec720500 100644 --- a/shared/test/unit_test/aub/aub_center_tests.cpp +++ b/shared/test/unit_test/aub/aub_center_tests.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2018-2021 Intel Corporation + * Copyright (C) 2018-2022 Intel Corporation * * SPDX-License-Identifier: MIT * @@ -16,6 +16,8 @@ #include "shared/test/common/helpers/hw_helper_tests.h" #include "shared/test/common/mocks/mock_aub_center.h" #include "shared/test/common/mocks/mock_aub_manager.h" +#include "shared/test/common/mocks/mock_execution_environment.h" +#include "shared/test/common/test_macros/hw_test.h" #include "gtest/gtest.h" #include "third_party/aub_stream/headers/aubstream.h" @@ -34,22 +36,6 @@ TEST_F(AubCenterTests, GivenUseAubStreamDebugVariableNotSetWhenAubCenterIsCreate EXPECT_EQ(nullptr, aubCenter.aubManager.get()); } -TEST_F(AubCenterTests, GivenUseAubStreamDebugVariableSetWhenAubCenterIsCreatedThenCreateAubManagerWithCorrectParameters) { - DebugManager.flags.UseAubStream.set(false); - - MockAubManager *mockAubManager = new MockAubManager(defaultHwInfo->platform.eProductFamily, 4, 8 * MB, defaultHwInfo->platform.usRevId, true, aub_stream::mode::aubFile, defaultHwInfo->capabilityTable.gpuAddressSpace); - MockAubCenter mockAubCenter(defaultHwInfo.get(), gmmHelper, false, "", CommandStreamReceiverType::CSR_AUB); - mockAubCenter.aubManager = std::unique_ptr(mockAubManager); - - EXPECT_EQ(defaultHwInfo->platform.eProductFamily, mockAubManager->mockAubManagerParams.productFamily); - EXPECT_EQ(4, mockAubManager->mockAubManagerParams.devicesCount); - EXPECT_EQ(8 * MB, mockAubManager->mockAubManagerParams.memoryBankSize); - EXPECT_EQ(defaultHwInfo->platform.usRevId, mockAubManager->mockAubManagerParams.stepping); - EXPECT_EQ(true, mockAubManager->mockAubManagerParams.localMemorySupported); - EXPECT_EQ(aub_stream::mode::aubFile, mockAubManager->mockAubManagerParams.streamMode); - EXPECT_EQ(defaultHwInfo->capabilityTable.gpuAddressSpace, mockAubManager->mockAubManagerParams.gpuAddressSpace); -} - TEST_F(AubCenterTests, GivenDefaultSetCommandStreamReceiverFlagAndAubFileNameWhenGettingAubStreamModeThenModeAubFileIsReturned) { DebugManager.flags.UseAubStream.set(true); @@ -106,6 +92,29 @@ TEST_F(AubCenterTests, WhenAubManagerIsCreatedThenCorrectSteppingIsSet) { } } +HWTEST_F(AubCenterTests, whenCreatingAubManagerThenCorrectProductFamilyIsPassed) { + DebugManager.flags.UseAubStream.set(true); + + DebugManager.flags.SetCommandStreamReceiver.set(CommandStreamReceiverType::CSR_TBX); + + MockExecutionEnvironment executionEnviroonment{}; + + const auto &rootDeviceEnvironment = *executionEnviroonment.rootDeviceEnvironments[0]; + + const auto &productHelper = rootDeviceEnvironment.getHelper(); + + auto aubStreamProductFamily = productHelper.getAubStreamProductFamily(); + + ASSERT_TRUE(aubStreamProductFamily.has_value()); + + MockAubCenter aubCenter(rootDeviceEnvironment.getHardwareInfo(), *rootDeviceEnvironment.getGmmHelper(), true, "", CommandStreamReceiverType::CSR_AUB); + + auto aubManager = static_cast(aubCenter.aubManager.get()); + ASSERT_NE(nullptr, aubManager); + + EXPECT_EQ(static_cast(*aubStreamProductFamily), aubManager->options.productFamily); +} + TEST_F(AubCenterTests, GivenCsrTypeWhenGettingAubStreamModeThenCorrectModeIsReturned) { DebugManager.flags.UseAubStream.set(true); diff --git a/shared/test/unit_test/aub/aub_center_using_aubstream_stubs_tests.cpp b/shared/test/unit_test/aub/aub_center_using_aubstream_stubs_tests.cpp index 66946951b2..198cc91ef2 100644 --- a/shared/test/unit_test/aub/aub_center_using_aubstream_stubs_tests.cpp +++ b/shared/test/unit_test/aub/aub_center_using_aubstream_stubs_tests.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2018-2021 Intel Corporation + * Copyright (C) 2018-2022 Intel Corporation * * SPDX-License-Identifier: MIT * @@ -25,17 +25,6 @@ extern std::string tbxServerIp; extern bool tbxFrontdoorMode; } // namespace aub_stream_stubs -TEST(AubCenter, GivenUseAubStreamDebugVariableSetWhenAubCenterIsCreatedThenAubManagerIsNotCreated) { - DebugManagerStateRestore restorer; - DebugManager.flags.UseAubStream.set(true); - - GmmHelper gmmHelper(nullptr, defaultHwInfo.get()); - - MockAubCenter aubCenter(defaultHwInfo.get(), gmmHelper, false, "test", CommandStreamReceiverType::CSR_AUB); - - EXPECT_EQ(nullptr, aubCenter.aubManager.get()); -} - TEST(AubCenter, GivenUseAubStreamAndTbxServerIpDebugVariableSetWhenAubCenterIsCreatedThenServerIpIsModified) { DebugManagerStateRestore restorer; DebugManager.flags.UseAubStream.set(true); diff --git a/shared/test/unit_test/gen11/ehl/CMakeLists.txt b/shared/test/unit_test/gen11/ehl/CMakeLists.txt index 8ab0172883..60578d2d81 100644 --- a/shared/test/unit_test/gen11/ehl/CMakeLists.txt +++ b/shared/test/unit_test/gen11/ehl/CMakeLists.txt @@ -6,6 +6,7 @@ if(TESTS_EHL) target_sources(neo_shared_tests PRIVATE + ${CMAKE_CURRENT_SOURCE_DIR}/excludes_gen11_ehl.cpp ${CMAKE_CURRENT_SOURCE_DIR}/test_hw_info_config_ehl.cpp ) add_subdirectories() diff --git a/shared/test/unit_test/gen11/ehl/excludes_gen11_ehl.cpp b/shared/test/unit_test/gen11/ehl/excludes_gen11_ehl.cpp new file mode 100644 index 0000000000..005369b04d --- /dev/null +++ b/shared/test/unit_test/gen11/ehl/excludes_gen11_ehl.cpp @@ -0,0 +1,10 @@ +/* + * Copyright (C) 2022 Intel Corporation + * + * SPDX-License-Identifier: MIT + * + */ + +#include "shared/test/common/test_macros/hw_test_base.h" + +HWTEST_EXCLUDE_PRODUCT(AubCenterTests, whenCreatingAubManagerThenCorrectProductFamilyIsPassed, IGFX_ELKHARTLAKE); diff --git a/shared/test/unit_test/gen11/icllp/test_hw_info_config_icllp.cpp b/shared/test/unit_test/gen11/icllp/test_hw_info_config_icllp.cpp index 64caffc107..9d75cb4a2e 100644 --- a/shared/test/unit_test/gen11/icllp/test_hw_info_config_icllp.cpp +++ b/shared/test/unit_test/gen11/icllp/test_hw_info_config_icllp.cpp @@ -10,8 +10,10 @@ #include "shared/test/common/helpers/default_hw_info.h" #include "shared/test/common/test_macros/header/per_product_test_definitions.h" #include "shared/test/common/test_macros/test.h" +#include "shared/test/unit_test/os_interface/hw_info_config_tests.h" #include "platforms.h" +#include "product_family.h" using namespace NEO; @@ -45,7 +47,11 @@ ICLLPTEST_F(IcllpHwInfoConfig, givenHwInfoConfigWhenAskedIfReturnedCmdSizeForMed EXPECT_TRUE(hwInfoConfig.isReturnedCmdSizeForMediaSamplerAdjustmentRequired()); } -using IcllpHwInfo = ::testing::Test; +using IcllpHwInfo = HwInfoConfigTest; + +ICLLPTEST_F(IcllpHwInfo, whenGettingAubstreamProductFamilyThenProperEnumValueIsReturned) { + EXPECT_EQ(aub_stream::ProductFamily::Icllp, productHelper->getAubStreamProductFamily()); +} ICLLPTEST_F(IcllpHwInfo, givenBoolWhenCallIcllpHardwareInfoSetupThenFeatureTableAndWorkaroundTableAreSetCorrect) { uint64_t configs[] = { diff --git a/shared/test/unit_test/gen11/lkf/CMakeLists.txt b/shared/test/unit_test/gen11/lkf/CMakeLists.txt index cbd7908023..e96ce749c3 100644 --- a/shared/test/unit_test/gen11/lkf/CMakeLists.txt +++ b/shared/test/unit_test/gen11/lkf/CMakeLists.txt @@ -6,6 +6,7 @@ if(TESTS_LKF) target_sources(neo_shared_tests PRIVATE + ${CMAKE_CURRENT_SOURCE_DIR}/excludes_gen11_lkf.cpp ${CMAKE_CURRENT_SOURCE_DIR}/test_hw_info_config_lkf.cpp ) add_subdirectories() diff --git a/shared/test/unit_test/gen11/lkf/excludes_gen11_lkf.cpp b/shared/test/unit_test/gen11/lkf/excludes_gen11_lkf.cpp new file mode 100644 index 0000000000..b361bdffd2 --- /dev/null +++ b/shared/test/unit_test/gen11/lkf/excludes_gen11_lkf.cpp @@ -0,0 +1,10 @@ +/* + * Copyright (C) 2022 Intel Corporation + * + * SPDX-License-Identifier: MIT + * + */ + +#include "shared/test/common/test_macros/hw_test_base.h" + +HWTEST_EXCLUDE_PRODUCT(AubCenterTests, whenCreatingAubManagerThenCorrectProductFamilyIsPassed, IGFX_LAKEFIELD); diff --git a/shared/test/unit_test/gen12lp/adln/test_hw_info_config_adln.cpp b/shared/test/unit_test/gen12lp/adln/test_hw_info_config_adln.cpp index 1982c28c51..58e2c3c7ee 100644 --- a/shared/test/unit_test/gen12lp/adln/test_hw_info_config_adln.cpp +++ b/shared/test/unit_test/gen12lp/adln/test_hw_info_config_adln.cpp @@ -11,12 +11,18 @@ #include "shared/test/common/helpers/default_hw_info.h" #include "shared/test/common/test_macros/header/per_product_test_definitions.h" #include "shared/test/common/test_macros/test.h" +#include "shared/test/unit_test/os_interface/hw_info_config_tests.h" #include "platforms.h" +#include "product_family.h" using namespace NEO; -using AdlnHwInfo = ::testing::Test; +using AdlnHwInfo = HwInfoConfigTest; + +ADLNTEST_F(AdlnHwInfo, whenGettingAubstreamProductFamilyThenProperEnumValueIsReturned) { + EXPECT_EQ(aub_stream::ProductFamily::Adln, productHelper->getAubStreamProductFamily()); +} ADLNTEST_F(AdlnHwInfo, givenBoolWhenCallAdlnHardwareInfoSetupThenFeatureTableAndWorkaroundTableAreSetCorrect) { static bool boolValue[]{ diff --git a/shared/test/unit_test/gen12lp/adlp/test_hw_info_config_adlp.cpp b/shared/test/unit_test/gen12lp/adlp/test_hw_info_config_adlp.cpp index 36b1f10cba..07d5efdd1b 100644 --- a/shared/test/unit_test/gen12lp/adlp/test_hw_info_config_adlp.cpp +++ b/shared/test/unit_test/gen12lp/adlp/test_hw_info_config_adlp.cpp @@ -11,12 +11,18 @@ #include "shared/test/common/helpers/default_hw_info.h" #include "shared/test/common/test_macros/header/per_product_test_definitions.h" #include "shared/test/common/test_macros/test.h" +#include "shared/test/unit_test/os_interface/hw_info_config_tests.h" #include "platforms.h" +#include "product_family.h" using namespace NEO; -using AdlpHwInfo = ::testing::Test; +using AdlpHwInfo = HwInfoConfigTest; + +ADLPTEST_F(AdlpHwInfo, whenGettingAubstreamProductFamilyThenProperEnumValueIsReturned) { + EXPECT_EQ(aub_stream::ProductFamily::Adlp, productHelper->getAubStreamProductFamily()); +} ADLPTEST_F(AdlpHwInfo, givenBoolWhenCallAdlpHardwareInfoSetupThenFeatureTableAndWorkaroundTableAreSetCorrect) { static bool boolValue[]{ diff --git a/shared/test/unit_test/gen12lp/adls/test_hw_info_config_adls.cpp b/shared/test/unit_test/gen12lp/adls/test_hw_info_config_adls.cpp index 16211982ee..624b244b52 100644 --- a/shared/test/unit_test/gen12lp/adls/test_hw_info_config_adls.cpp +++ b/shared/test/unit_test/gen12lp/adls/test_hw_info_config_adls.cpp @@ -11,12 +11,18 @@ #include "shared/test/common/helpers/default_hw_info.h" #include "shared/test/common/test_macros/header/per_product_test_definitions.h" #include "shared/test/common/test_macros/test.h" +#include "shared/test/unit_test/os_interface/hw_info_config_tests.h" #include "platforms.h" +#include "product_family.h" using namespace NEO; -using AdlsHwInfo = ::testing::Test; +using AdlsHwInfo = HwInfoConfigTest; + +ADLSTEST_F(AdlsHwInfo, whenGettingAubstreamProductFamilyThenProperEnumValueIsReturned) { + EXPECT_EQ(aub_stream::ProductFamily::Adls, productHelper->getAubStreamProductFamily()); +} ADLSTEST_F(AdlsHwInfo, givenBoolWhenCallAdlsHardwareInfoSetupThenFeatureTableAndWorkaroundTableAreSetCorrect) { static bool boolValue[]{ diff --git a/shared/test/unit_test/gen12lp/dg1/test_hw_info_config_dg1.cpp b/shared/test/unit_test/gen12lp/dg1/test_hw_info_config_dg1.cpp index 9a9a704f60..1cef87d45b 100644 --- a/shared/test/unit_test/gen12lp/dg1/test_hw_info_config_dg1.cpp +++ b/shared/test/unit_test/gen12lp/dg1/test_hw_info_config_dg1.cpp @@ -12,11 +12,19 @@ #include "shared/test/common/helpers/default_hw_info.h" #include "shared/test/common/test_macros/header/per_product_test_definitions.h" #include "shared/test/common/test_macros/test.h" +#include "shared/test/unit_test/os_interface/hw_info_config_tests.h" #include "platforms.h" +#include "product_family.h" using namespace NEO; +using Dg1HwInfo = HwInfoConfigTest; + +DG1TEST_F(Dg1HwInfo, whenGettingAubstreamProductFamilyThenProperEnumValueIsReturned) { + EXPECT_EQ(aub_stream::ProductFamily::Dg1, productHelper->getAubStreamProductFamily()); +} + using Dg1HwInfoConfig = Test; DG1TEST_F(Dg1HwInfoConfig, givenInvalidSystemInfoWhenSettingHardwareInfoThenExpectThrow) { @@ -60,8 +68,6 @@ DG1TEST_F(Dg1HwInfoConfig, givenHwInfoConfigWhenAskedIf3DPipelineSelectWAIsRequi EXPECT_TRUE(hwInfoConfig.is3DPipelineSelectWARequired()); } -using Dg1HwInfo = ::testing::Test; - DG1TEST_F(Dg1HwInfo, givenBoolWhenCallDg1HardwareInfoSetupThenFeatureTableAndWorkaroundTableAreSetCorrect) { bool boolValue[]{ true, false}; diff --git a/shared/test/unit_test/gen12lp/rkl/excludes_gen12lp_rkl.cpp b/shared/test/unit_test/gen12lp/rkl/excludes_gen12lp_rkl.cpp index 15298396e1..3d0d6a6c5b 100644 --- a/shared/test/unit_test/gen12lp/rkl/excludes_gen12lp_rkl.cpp +++ b/shared/test/unit_test/gen12lp/rkl/excludes_gen12lp_rkl.cpp @@ -9,3 +9,4 @@ HWTEST_EXCLUDE_PRODUCT(HwInfoConfigTest, givenHwInfoConfigWhenAskedIfForceEmuInt32DivRemSPWAIsRequiredThenFalseIsReturned, IGFX_ROCKETLAKE); HWTEST_EXCLUDE_PRODUCT(HwInfoConfigTest, givenHwInfoConfigWhenAskedIf3DPipelineSelectWAIsRequiredThenFalseIsReturned, IGFX_ROCKETLAKE); +HWTEST_EXCLUDE_PRODUCT(AubCenterTests, whenCreatingAubManagerThenCorrectProductFamilyIsPassed, IGFX_ROCKETLAKE); diff --git a/shared/test/unit_test/gen12lp/tgllp/hw_info_config_tests_tgllp.cpp b/shared/test/unit_test/gen12lp/tgllp/hw_info_config_tests_tgllp.cpp index 25e3040c14..8c200c0a82 100644 --- a/shared/test/unit_test/gen12lp/tgllp/hw_info_config_tests_tgllp.cpp +++ b/shared/test/unit_test/gen12lp/tgllp/hw_info_config_tests_tgllp.cpp @@ -16,11 +16,19 @@ #include "shared/test/common/mocks/mock_execution_environment.h" #include "shared/test/common/test_macros/header/per_product_test_definitions.h" #include "shared/test/common/test_macros/test.h" +#include "shared/test/unit_test/os_interface/hw_info_config_tests.h" #include "platforms.h" +#include "product_family.h" using namespace NEO; +using TgllpHwInfo = HwInfoConfigTest; + +TGLLPTEST_F(TgllpHwInfo, whenGettingAubstreamProductFamilyThenProperEnumValueIsReturned) { + EXPECT_EQ(aub_stream::ProductFamily::Tgllp, productHelper->getAubStreamProductFamily()); +} + using HwInfoConfigTestTgllp = Test; TGLLPTEST_F(HwInfoConfigTestTgllp, givenHwInfoConfigWhenGettingEvictIfNecessaryFlagSupportedThenExpectTrue) { @@ -115,8 +123,6 @@ TGLLPTEST_F(HwInfoConfigTestTgllp, givenHwInfoConfigWhenAskedIf3DPipelineSelectW EXPECT_TRUE(hwInfoConfig.is3DPipelineSelectWARequired()); } -using TgllpHwInfo = ::testing::Test; - TGLLPTEST_F(TgllpHwInfo, givenBoolWhenCallTgllpHardwareInfoSetupThenFeatureTableAndWorkaroundTableAreSetCorrect) { static bool boolValue[]{ true, false}; @@ -186,6 +192,7 @@ TGLLPTEST_F(TgllpHwInfo, givenSetCommandStreamReceiverInAubModeForTgllpProductFa TGLLPTEST_F(TgllpHwInfo, givenSetCommandStreamReceiverInAubModeWithOverrideGpuAddressSpaceWhenPrepareDeviceEnvironmentsForProductFamilyOverrideIsCalledThenAubManagerIsInitializedWithCorrectGpuAddressSpace) { DebugManagerStateRestore stateRestore; + DebugManager.flags.UseAubStream.set(1); DebugManager.flags.SetCommandStreamReceiver.set(1); DebugManager.flags.ProductFamilyOverride.set("tgllp"); DebugManager.flags.OverrideGpuAddressSpace.set(48); @@ -198,7 +205,7 @@ TGLLPTEST_F(TgllpHwInfo, givenSetCommandStreamReceiverInAubModeWithOverrideGpuAd auto rootDeviceEnvironment = static_cast(executionEnvironment.rootDeviceEnvironments[0].get()); auto mockAubManager = static_cast(rootDeviceEnvironment->aubCenter->getAubManager()); - EXPECT_EQ(MemoryConstants::max48BitAddress, mockAubManager->mockAubManagerParams.gpuAddressSpace); + EXPECT_EQ(MemoryConstants::max48BitAddress, mockAubManager->options.gpuAddressSpace); } TGLLPTEST_F(TgllpHwInfo, givenSetCommandStreamReceiverInAubModeWhenPrepareDeviceEnvironmentsForProductFamilyOverrideIsCalledThenAllRootDeviceEnvironmentMembersAreInitialized) { diff --git a/shared/test/unit_test/gen8/bdw/test_hw_info_config_bdw.cpp b/shared/test/unit_test/gen8/bdw/test_hw_info_config_bdw.cpp index 229c059820..bd6d3f1e2e 100644 --- a/shared/test/unit_test/gen8/bdw/test_hw_info_config_bdw.cpp +++ b/shared/test/unit_test/gen8/bdw/test_hw_info_config_bdw.cpp @@ -11,10 +11,13 @@ #include "shared/test/common/helpers/default_hw_info.h" #include "shared/test/common/test_macros/header/per_product_test_definitions.h" #include "shared/test/common/test_macros/test.h" +#include "shared/test/unit_test/os_interface/hw_info_config_tests.h" #include "platforms.h" +#include "product_family.h" using namespace NEO; +using BdwHwInfo = HwInfoConfigTest; TEST(BdwHwInfoConfig, givenInvalidSystemInfoWhenSettingHardwareInfoThenExpectThrow) { if (IGFX_BROADWELL != productFamily) { @@ -32,8 +35,6 @@ TEST(BdwHwInfoConfig, givenInvalidSystemInfoWhenSettingHardwareInfoThenExpectThr EXPECT_EQ(0u, gtSystemInfo.EUCount); } -using BdwHwInfo = ::testing::Test; - BDWTEST_F(BdwHwInfo, givenBoolWhenCallBdwHardwareInfoSetupThenFeatureTableAndWorkaroundTableAreSetCorrect) { uint64_t configs[] = { 0x100030008, @@ -97,6 +98,10 @@ BDWTEST_F(CompilerHwInfoConfigHelperTestsBdw, givenBdwWhenIsStatelessToStatefulB EXPECT_FALSE(CompilerHwInfoConfig::get(productFamily)->isStatelessToStatefulBufferOffsetSupported()); } +BDWTEST_F(BdwHwInfo, whenGettingAubstreamProductFamilyThenProperEnumValueIsReturned) { + EXPECT_EQ(aub_stream::ProductFamily::Bdw, productHelper->getAubStreamProductFamily()); +} + BDWTEST_F(BdwHwInfo, givenHwInfoConfigWhenGetCommandsStreamPropertiesSupportThenExpectCorrectValues) { HardwareInfo hwInfo = *defaultHwInfo; const auto &hwInfoConfig = *HwInfoConfig::get(hwInfo.platform.eProductFamily); diff --git a/shared/test/unit_test/gen9/bxt/test_hw_info_config_bxt.cpp b/shared/test/unit_test/gen9/bxt/test_hw_info_config_bxt.cpp index b6ae496d51..9321dd2135 100644 --- a/shared/test/unit_test/gen9/bxt/test_hw_info_config_bxt.cpp +++ b/shared/test/unit_test/gen9/bxt/test_hw_info_config_bxt.cpp @@ -10,8 +10,10 @@ #include "shared/test/common/helpers/default_hw_info.h" #include "shared/test/common/test_macros/header/per_product_test_definitions.h" #include "shared/test/common/test_macros/test.h" +#include "shared/test/unit_test/os_interface/hw_info_config_tests.h" #include "platforms.h" +#include "product_family.h" using namespace NEO; @@ -31,7 +33,11 @@ TEST(BxtHwInfoConfig, givenInvalidSystemInfoWhenSettingHardwareInfoThenExpectThr EXPECT_EQ(0u, gtSystemInfo.EUCount); } -using BxtHwInfo = ::testing::Test; +using BxtHwInfo = HwInfoConfigTest; + +BXTTEST_F(BxtHwInfo, whenGettingAubstreamProductFamilyThenProperEnumValueIsReturned) { + EXPECT_EQ(aub_stream::ProductFamily::Bxt, productHelper->getAubStreamProductFamily()); +} BXTTEST_F(BxtHwInfo, givenBoolWhenCallBxtHardwareInfoSetupThenFeatureTableAndWorkaroundTableAreSetCorrect) { uint64_t configs[] = { diff --git a/shared/test/unit_test/gen9/cfl/test_hw_info_config_cfl.cpp b/shared/test/unit_test/gen9/cfl/test_hw_info_config_cfl.cpp index 7817eaf31f..a0f06966a2 100644 --- a/shared/test/unit_test/gen9/cfl/test_hw_info_config_cfl.cpp +++ b/shared/test/unit_test/gen9/cfl/test_hw_info_config_cfl.cpp @@ -11,8 +11,10 @@ #include "shared/test/common/helpers/default_hw_info.h" #include "shared/test/common/test_macros/header/per_product_test_definitions.h" #include "shared/test/common/test_macros/test.h" +#include "shared/test/unit_test/os_interface/hw_info_config_tests.h" #include "platforms.h" +#include "product_family.h" using namespace NEO; @@ -32,7 +34,11 @@ TEST(CflHwInfoConfig, GivenIncorrectDataWhenConfiguringHwInfoThenErrorIsReturned EXPECT_EQ(0u, gtSystemInfo.EUCount); } -using CflHwInfo = ::testing::Test; +using CflHwInfo = HwInfoConfigTest; + +CFLTEST_F(CflHwInfo, whenGettingAubstreamProductFamilyThenProperEnumValueIsReturned) { + EXPECT_EQ(aub_stream::ProductFamily::Cfl, productHelper->getAubStreamProductFamily()); +} CFLTEST_F(CflHwInfo, givenBoolWhenCallCflHardwareInfoSetupThenFeatureTableAndWorkaroundTableAreSetCorrect) { uint64_t configs[] = { diff --git a/shared/test/unit_test/gen9/glk/test_hw_info_config_glk.cpp b/shared/test/unit_test/gen9/glk/test_hw_info_config_glk.cpp index 257ad7454d..0e9e8f1995 100644 --- a/shared/test/unit_test/gen9/glk/test_hw_info_config_glk.cpp +++ b/shared/test/unit_test/gen9/glk/test_hw_info_config_glk.cpp @@ -10,8 +10,10 @@ #include "shared/test/common/helpers/default_hw_info.h" #include "shared/test/common/test_macros/header/per_product_test_definitions.h" #include "shared/test/common/test_macros/test.h" +#include "shared/test/unit_test/os_interface/hw_info_config_tests.h" #include "platforms.h" +#include "product_family.h" using namespace NEO; @@ -32,7 +34,11 @@ TEST(GlkHwInfoConfig, GivenIncorrectDataWhenConfiguringHwInfoThenErrorIsReturned EXPECT_EQ(0u, gtSystemInfo.EUCount); } -using GlkHwInfo = ::testing::Test; +using GlkHwInfo = HwInfoConfigTest; + +GLKTEST_F(GlkHwInfo, whenGettingAubstreamProductFamilyThenProperEnumValueIsReturned) { + EXPECT_EQ(aub_stream::ProductFamily::Glk, productHelper->getAubStreamProductFamily()); +} GLKTEST_F(GlkHwInfo, givenBoolWhenCallGlkHardwareInfoSetupThenFeatureTableAndWorkaroundTableAreSetCorrect) { uint64_t configs[] = { diff --git a/shared/test/unit_test/gen9/kbl/test_hw_info_config_kbl.cpp b/shared/test/unit_test/gen9/kbl/test_hw_info_config_kbl.cpp index 983f8adfc7..1d592b734a 100644 --- a/shared/test/unit_test/gen9/kbl/test_hw_info_config_kbl.cpp +++ b/shared/test/unit_test/gen9/kbl/test_hw_info_config_kbl.cpp @@ -9,8 +9,10 @@ #include "shared/source/os_interface/hw_info_config.h" #include "shared/test/common/helpers/default_hw_info.h" #include "shared/test/common/test_macros/hw_test.h" +#include "shared/test/unit_test/os_interface/hw_info_config_tests.h" #include "platforms.h" +#include "product_family.h" using namespace NEO; @@ -30,7 +32,11 @@ TEST(KblHwInfoConfig, GivenIncorrectDataWhenConfiguringHwInfoThenErrorIsReturned EXPECT_EQ(0u, gtSystemInfo.EUCount); } -using KblHwInfo = ::testing::Test; +using KblHwInfo = HwInfoConfigTest; + +KBLTEST_F(KblHwInfo, whenGettingAubstreamProductFamilyThenProperEnumValueIsReturned) { + EXPECT_EQ(aub_stream::ProductFamily::Kbl, productHelper->getAubStreamProductFamily()); +} KBLTEST_F(KblHwInfo, givenBoolWhenCallKblHardwareInfoSetupThenFeatureTableAndWorkaroundTableAreSetCorrect) { uint64_t configs[] = { diff --git a/shared/test/unit_test/gen9/skl/test_hw_info_config_skl.cpp b/shared/test/unit_test/gen9/skl/test_hw_info_config_skl.cpp index 11899b3aff..34f8307531 100644 --- a/shared/test/unit_test/gen9/skl/test_hw_info_config_skl.cpp +++ b/shared/test/unit_test/gen9/skl/test_hw_info_config_skl.cpp @@ -10,8 +10,10 @@ #include "shared/test/common/helpers/default_hw_info.h" #include "shared/test/common/test_macros/header/per_product_test_definitions.h" #include "shared/test/common/test_macros/test.h" +#include "shared/test/unit_test/os_interface/hw_info_config_tests.h" #include "platforms.h" +#include "product_family.h" using namespace NEO; @@ -31,7 +33,7 @@ TEST(SklHwInfoConfig, GivenIncorrectDataWhenConfiguringHwInfoThenErrorIsReturned EXPECT_EQ(0u, gtSystemInfo.EUCount); } -using SklHwInfo = ::testing::Test; +using SklHwInfo = HwInfoConfigTest; SKLTEST_F(SklHwInfo, givenBoolWhenCallSklHardwareInfoSetupThenFeatureTableAndWorkaroundTableAreSetCorrect) { uint64_t configs[] = { @@ -111,6 +113,10 @@ SKLTEST_F(SklHwInfo, givenHwInfoConfigWhenGettingEvictIfNecessaryFlagSupportedTh EXPECT_TRUE(hwInfoConfig.isEvictionIfNecessaryFlagSupported()); } +SKLTEST_F(SklHwInfo, whenGettingAubstreamProductFamilyThenProperEnumValueIsReturned) { + EXPECT_EQ(aub_stream::ProductFamily::Skl, productHelper->getAubStreamProductFamily()); +} + SKLTEST_F(SklHwInfo, givenHwInfoConfigWhenGetCommandsStreamPropertiesSupportThenExpectCorrectValues) { HardwareInfo hwInfo = *defaultHwInfo; const auto &hwInfoConfig = *HwInfoConfig::get(hwInfo.platform.eProductFamily); diff --git a/shared/test/unit_test/os_interface/hw_info_config_tests.cpp b/shared/test/unit_test/os_interface/hw_info_config_tests.cpp index 95203f1e2e..e2ab7ec978 100644 --- a/shared/test/unit_test/os_interface/hw_info_config_tests.cpp +++ b/shared/test/unit_test/os_interface/hw_info_config_tests.cpp @@ -24,6 +24,16 @@ using namespace NEO; using ProductHelperTest = Test; +HwInfoConfigTest::HwInfoConfigTest() { + executionEnvironment = std::make_unique(); + productHelper = &executionEnvironment->rootDeviceEnvironments[0]->getHelper(); +} +HwInfoConfigTest::~HwInfoConfigTest() = default; +void HwInfoConfigTest::SetUp() { + pInHwInfo = *defaultHwInfo; + testPlatform = &pInHwInfo.platform; +} + HWTEST_F(HwInfoConfigTest, givenDebugFlagSetWhenAskingForHostMemCapabilitesThenReturnCorrectValue) { DebugManagerStateRestore restore; diff --git a/shared/test/unit_test/os_interface/hw_info_config_tests.h b/shared/test/unit_test/os_interface/hw_info_config_tests.h index cf62a8e028..5c07733203 100644 --- a/shared/test/unit_test/os_interface/hw_info_config_tests.h +++ b/shared/test/unit_test/os_interface/hw_info_config_tests.h @@ -10,16 +10,21 @@ #include "shared/test/common/helpers/default_hw_info.h" #include "shared/test/common/test_macros/hw_test.h" +namespace NEO { +class HwInfoConfig; +class ExecutionEnvironment; +} // namespace NEO + using namespace NEO; struct HwInfoConfigTest : public ::testing::Test { - void SetUp() override { - pInHwInfo = *defaultHwInfo; - testPlatform = &pInHwInfo.platform; - } + HwInfoConfigTest(); + ~HwInfoConfigTest() override; + void SetUp() override; - HardwareInfo pInHwInfo; + std::unique_ptr executionEnvironment; + HardwareInfo pInHwInfo{}; HardwareInfo outHwInfo{}; - + HwInfoConfig *productHelper = nullptr; PLATFORM *testPlatform = nullptr; }; diff --git a/shared/test/unit_test/xe_hp_core/xe_hp_sdv/hw_info_config_tests_xe_hp_sdv.cpp b/shared/test/unit_test/xe_hp_core/xe_hp_sdv/hw_info_config_tests_xe_hp_sdv.cpp index cb11771643..63680365ba 100644 --- a/shared/test/unit_test/xe_hp_core/xe_hp_sdv/hw_info_config_tests_xe_hp_sdv.cpp +++ b/shared/test/unit_test/xe_hp_core/xe_hp_sdv/hw_info_config_tests_xe_hp_sdv.cpp @@ -10,9 +10,18 @@ #include "shared/test/common/helpers/default_hw_info.h" #include "shared/test/common/test_macros/header/per_product_test_definitions.h" #include "shared/test/common/test_macros/test.h" +#include "shared/test/unit_test/os_interface/hw_info_config_tests.h" + +#include "product_family.h" using namespace NEO; +using XeHpSdvHwInfo = HwInfoConfigTest; + +XEHPTEST_F(XeHpSdvHwInfo, whenGettingAubstreamProductFamilyThenProperEnumValueIsReturned) { + EXPECT_EQ(aub_stream::ProductFamily::XeHpSdv, productHelper->getAubStreamProductFamily()); +} + using HwInfoConfigTestXeHpSdv = ::testing::Test; XEHPTEST_F(HwInfoConfigTestXeHpSdv, givenHwInfoConfigWhenGettingEvictIfNecessaryFlagSupportedThenExpectTrue) { diff --git a/shared/test/unit_test/xe_hpc_core/pvc/test_hw_info_config_pvc.cpp b/shared/test/unit_test/xe_hpc_core/pvc/test_hw_info_config_pvc.cpp index 3f8d4972d7..8ac85ce6be 100644 --- a/shared/test/unit_test/xe_hpc_core/pvc/test_hw_info_config_pvc.cpp +++ b/shared/test/unit_test/xe_hpc_core/pvc/test_hw_info_config_pvc.cpp @@ -16,10 +16,18 @@ #include "shared/test/common/test_macros/header/per_product_test_definitions.h" #include "shared/test/common/test_macros/test.h" #include "shared/test/common/xe_hpc_core/pvc/product_configs_pvc.h" +#include "shared/test/unit_test/os_interface/hw_info_config_tests.h" + +#include "product_family.h" using namespace NEO; using PvcHwInfoConfig = Test; +using PvcHwInfo = HwInfoConfigTest; + +PVCTEST_F(PvcHwInfo, whenGettingAubstreamProductFamilyThenProperEnumValueIsReturned) { + EXPECT_EQ(aub_stream::ProductFamily::Pvc, productHelper->getAubStreamProductFamily()); +} PVCTEST_F(PvcHwInfoConfig, givenPVCRevId3AndAboveWhenGettingThreadEuRatioForScratchThen16IsReturned) { const auto &hwInfoConfig = *HwInfoConfig::get(productFamily); diff --git a/shared/test/unit_test/xe_hpg_core/dg2/hw_info_config_tests_dg2.cpp b/shared/test/unit_test/xe_hpg_core/dg2/hw_info_config_tests_dg2.cpp index 3b2e125553..6e212b6fb5 100644 --- a/shared/test/unit_test/xe_hpg_core/dg2/hw_info_config_tests_dg2.cpp +++ b/shared/test/unit_test/xe_hpg_core/dg2/hw_info_config_tests_dg2.cpp @@ -15,12 +15,21 @@ #include "shared/test/common/test_macros/test.h" #include "shared/test/common/xe_hpg_core/dg2/product_configs_dg2.h" #include "shared/test/unit_test/fixtures/product_config_fixture.h" +#include "shared/test/unit_test/os_interface/hw_info_config_tests.h" + +#include "product_family.h" using namespace NEO; using HwInfoConfigTestDg2 = Test; using ProductHelperTestDg2 = Test; +using Dg2HwInfo = HwInfoConfigTest; + +DG2TEST_F(Dg2HwInfo, whenGettingAubstreamProductFamilyThenProperEnumValueIsReturned) { + EXPECT_EQ(aub_stream::ProductFamily::Dg2, productHelper->getAubStreamProductFamily()); +} + DG2TEST_F(HwInfoConfigTestDg2, givenDg2ConfigWhenSetupHardwareInfoBaseThenGtSystemInfoIsCorrect) { HardwareInfo hwInfo = *defaultHwInfo; GT_SYSTEM_INFO >SystemInfo = hwInfo.gtSystemInfo; diff --git a/target_aub_tests/CMakeLists.txt b/target_aub_tests/CMakeLists.txt index 5719049d0d..eea97a1209 100644 --- a/target_aub_tests/CMakeLists.txt +++ b/target_aub_tests/CMakeLists.txt @@ -1,11 +1,13 @@ # -# Copyright (C) 2020-2021 Intel Corporation +# Copyright (C) 2020-2022 Intel Corporation # # SPDX-License-Identifier: MIT # -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}) +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}) -add_subdirectories() + add_subdirectories() +endif()