Update aubstream interface: use product family from aubstream

don't build aub tests when aubstream is not available
use only mock aub manager in ULTs

Related-To: NEO-4446
Signed-off-by: Mateusz Jablonski <mateusz.jablonski@intel.com>
This commit is contained in:
Mateusz Jablonski
2022-11-16 11:03:40 +00:00
committed by Compute-Runtime-Automation
parent 4995bddb89
commit 0b3582a93b
54 changed files with 533 additions and 244 deletions

View File

@ -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}

View File

@ -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 $<TARGET_OBJECTS:${AUB_STREAM_PROJECT_NAME}_all_hw>)
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
$<TARGET_OBJECTS:${L0_MOCKABLE_LIB_NAME}>
$<TARGET_OBJECTS:${TARGET_NAME_L0}_fixtures>
$<TARGET_OBJECTS:${TARGET_NAME_L0}_mocks>
$<TARGET_OBJECTS:neo_libult_common>
$<TARGET_OBJECTS:neo_libult_cs>
$<TARGET_OBJECTS:neo_libult>
$<TARGET_OBJECTS:neo_shared_mocks>
$<TARGET_OBJECTS:${BUILTINS_BINARIES_STATELESS_LIB_NAME}>
$<TARGET_OBJECTS:${BUILTINS_BINARIES_BINDFUL_LIB_NAME}>
$<TARGET_OBJECTS:${BUILTINS_BINARIES_BINDLESS_LIB_NAME}>
$<TARGET_OBJECTS:neo_aub_tests_config>
)
if(TARGET ${BUILTINS_SPIRV_LIB_NAME})
target_sources(${TARGET_NAME} PRIVATE
$<TARGET_OBJECTS:${BUILTINS_SPIRV_LIB_NAME}>
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 $<TARGET_OBJECTS:${AUB_STREAM_PROJECT_NAME}_all_hw>)
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
$<TARGET_OBJECTS:${L0_MOCKABLE_LIB_NAME}>
$<TARGET_OBJECTS:${TARGET_NAME_L0}_fixtures>
$<TARGET_OBJECTS:${TARGET_NAME_L0}_mocks>
$<TARGET_OBJECTS:neo_libult_common>
$<TARGET_OBJECTS:neo_libult_cs>
$<TARGET_OBJECTS:neo_libult>
$<TARGET_OBJECTS:neo_shared_mocks>
$<TARGET_OBJECTS:${BUILTINS_BINARIES_STATELESS_LIB_NAME}>
$<TARGET_OBJECTS:${BUILTINS_BINARIES_BINDFUL_LIB_NAME}>
$<TARGET_OBJECTS:${BUILTINS_BINARIES_BINDLESS_LIB_NAME}>
$<TARGET_OBJECTS:neo_aub_tests_config>
)
if(TARGET ${BUILTINS_SPIRV_LIB_NAME})
target_sources(${TARGET_NAME} PRIVATE
$<TARGET_OBJECTS:${BUILTINS_SPIRV_LIB_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})
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})

View File

@ -112,14 +112,22 @@ if(${GENERATE_EXECUTABLE})
$<TARGET_OBJECTS:${BUILTINS_BINARIES_BINDFUL_LIB_NAME}>
)
if(DEFINED AUB_STREAM_PROJECT_NAME)
list(APPEND NEO_DYNAMIC_LIB__TARGET_OBJECTS $<TARGET_OBJECTS:${AUB_STREAM_PROJECT_NAME}_all_hw>)
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
$<TARGET_OBJECTS:${AUB_STREAM_PROJECT_NAME}_all_hw>
${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)

View File

@ -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
$<TARGET_OBJECTS:${BUILTINS_SOURCES_LIB_NAME}>
$<TARGET_OBJECTS:igdrcl_libult>
$<TARGET_OBJECTS:neo_libult_common>
$<TARGET_OBJECTS:neo_libult_cs>
$<TARGET_OBJECTS:neo_libult>
$<TARGET_OBJECTS:igdrcl_libult_env>
$<TARGET_OBJECTS:neo_shared_mocks>
$<TARGET_OBJECTS:neo_aub_tests_config>
)
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
$<TARGET_OBJECTS:${BUILTINS_SOURCES_LIB_NAME}>
$<TARGET_OBJECTS:igdrcl_libult>
$<TARGET_OBJECTS:neo_libult_common>
$<TARGET_OBJECTS:neo_libult_cs>
$<TARGET_OBJECTS:neo_libult>
$<TARGET_OBJECTS:igdrcl_libult_env>
$<TARGET_OBJECTS:neo_shared_mocks>
$<TARGET_OBJECTS:neo_aub_tests_config>
)
list(APPEND IGDRCL_AUB_TESTS__TARGET_OBJECTS $<TARGET_OBJECTS:${AUB_STREAM_PROJECT_NAME}_all_hw>)
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)

View File

@ -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<uint32_t>(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<AddressMapper>();
streamProvider = std::make_unique<AubFileStreamProvider>();

View File

@ -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

View File

@ -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

View File

@ -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; };

View File

@ -5,6 +5,8 @@
*
*/
#include "product_family.h"
namespace NEO {
template <>
bool HwInfoConfigHw<gfxProduct>::isAdditionalMediaSamplerProgrammingRequired() const {
@ -25,4 +27,10 @@ template <>
AOT::PRODUCT_CONFIG HwInfoConfigHw<gfxProduct>::getProductConfigFromHwInfo(const HardwareInfo &hwInfo) const {
return AOT::ICL;
}
template <>
std::optional<aub_stream::ProductFamily> HwInfoConfigHw<gfxProduct>::getAubStreamProductFamily() const {
return aub_stream::ProductFamily::Icllp;
};
} // namespace NEO

View File

@ -5,6 +5,8 @@
*
*/
#include "product_family.h"
namespace NEO {
template <>
uint32_t HwInfoConfigHw<gfxProduct>::getHwRevIdFromStepping(uint32_t stepping, const HardwareInfo &hwInfo) const {
@ -28,4 +30,10 @@ uint32_t HwInfoConfigHw<gfxProduct>::getSteppingFromHwRevId(const HardwareInfo &
}
return CommonConstants::invalidStepping;
}
template <>
std::optional<aub_stream::ProductFamily> HwInfoConfigHw<gfxProduct>::getAubStreamProductFamily() const {
return aub_stream::ProductFamily::Adln;
};
} // namespace NEO

View File

@ -5,6 +5,8 @@
*
*/
#include "product_family.h"
namespace NEO {
template <>
uint32_t HwInfoConfigHw<gfxProduct>::getHwRevIdFromStepping(uint32_t stepping, const HardwareInfo &hwInfo) const {
@ -32,4 +34,10 @@ uint32_t HwInfoConfigHw<gfxProduct>::getSteppingFromHwRevId(const HardwareInfo &
}
return CommonConstants::invalidStepping;
}
template <>
std::optional<aub_stream::ProductFamily> HwInfoConfigHw<gfxProduct>::getAubStreamProductFamily() const {
return aub_stream::ProductFamily::Adlp;
};
} // namespace NEO

View File

@ -5,6 +5,8 @@
*
*/
#include "product_family.h"
namespace NEO {
template <>
uint32_t HwInfoConfigHw<gfxProduct>::getHwRevIdFromStepping(uint32_t stepping, const HardwareInfo &hwInfo) const {
@ -32,4 +34,10 @@ uint32_t HwInfoConfigHw<gfxProduct>::getSteppingFromHwRevId(const HardwareInfo &
}
return CommonConstants::invalidStepping;
}
template <>
std::optional<aub_stream::ProductFamily> HwInfoConfigHw<gfxProduct>::getAubStreamProductFamily() const {
return aub_stream::ProductFamily::Adls;
};
} // namespace NEO

View File

@ -5,6 +5,8 @@
*
*/
#include "product_family.h"
namespace NEO {
template <>
uint32_t HwInfoConfigHw<gfxProduct>::getHwRevIdFromStepping(uint32_t stepping, const HardwareInfo &hwInfo) const {
@ -67,4 +69,10 @@ template <>
bool HwInfoConfigHw<gfxProduct>::overrideGfxPartitionLayoutForWsl() const {
return true;
}
template <>
std::optional<aub_stream::ProductFamily> HwInfoConfigHw<gfxProduct>::getAubStreamProductFamily() const {
return aub_stream::ProductFamily::Dg1;
};
} // namespace NEO

View File

@ -5,6 +5,8 @@
*
*/
#include "product_family.h"
namespace NEO {
template <>
uint32_t HwInfoConfigHw<gfxProduct>::getHwRevIdFromStepping(uint32_t stepping, const HardwareInfo &hwInfo) const {
@ -56,4 +58,10 @@ template <>
bool HwInfoConfigHw<gfxProduct>::is3DPipelineSelectWARequired() const {
return true;
}
template <>
std::optional<aub_stream::ProductFamily> HwInfoConfigHw<gfxProduct>::getAubStreamProductFamily() const {
return aub_stream::ProductFamily::Tgllp;
};
} // namespace NEO

View File

@ -5,9 +5,17 @@
*
*/
#include "product_family.h"
namespace NEO {
template <>
AOT::PRODUCT_CONFIG HwInfoConfigHw<gfxProduct>::getProductConfigFromHwInfo(const HardwareInfo &hwInfo) const {
return AOT::BDW;
}
template <>
std::optional<aub_stream::ProductFamily> HwInfoConfigHw<gfxProduct>::getAubStreamProductFamily() const {
return aub_stream::ProductFamily::Bdw;
};
} // namespace NEO

View File

@ -5,9 +5,17 @@
*
*/
#include "product_family.h"
namespace NEO {
template <>
AOT::PRODUCT_CONFIG HwInfoConfigHw<gfxProduct>::getProductConfigFromHwInfo(const HardwareInfo &hwInfo) const {
return AOT::APL;
}
template <>
std::optional<aub_stream::ProductFamily> HwInfoConfigHw<gfxProduct>::getAubStreamProductFamily() const {
return aub_stream::ProductFamily::Bxt;
};
} // namespace NEO

View File

@ -8,6 +8,7 @@
#include "shared/source/gen9/cfl/device_ids_configs_cfl.h"
#include "platforms.h"
#include "product_family.h"
#include <algorithm>
@ -28,4 +29,10 @@ AOT::PRODUCT_CONFIG HwInfoConfigHw<gfxProduct>::getProductConfigFromHwInfo(const
}
return AOT::UNKNOWN_ISA;
}
} // namespace NEO
template <>
std::optional<aub_stream::ProductFamily> HwInfoConfigHw<gfxProduct>::getAubStreamProductFamily() const {
return aub_stream::ProductFamily::Cfl;
};
} // namespace NEO

View File

@ -5,9 +5,17 @@
*
*/
#include "product_family.h"
namespace NEO {
template <>
AOT::PRODUCT_CONFIG HwInfoConfigHw<gfxProduct>::getProductConfigFromHwInfo(const HardwareInfo &hwInfo) const {
return AOT::GLK;
}
template <>
std::optional<aub_stream::ProductFamily> HwInfoConfigHw<gfxProduct>::getAubStreamProductFamily() const {
return aub_stream::ProductFamily::Glk;
};
} // namespace NEO

View File

@ -8,6 +8,7 @@
#include "shared/source/gen9/kbl/device_ids_configs_kbl.h"
#include "platforms.h"
#include "product_family.h"
#include <algorithm>
@ -25,4 +26,10 @@ AOT::PRODUCT_CONFIG HwInfoConfigHw<gfxProduct>::getProductConfigFromHwInfo(const
}
return AOT::UNKNOWN_ISA;
}
} // namespace NEO
template <>
std::optional<aub_stream::ProductFamily> HwInfoConfigHw<gfxProduct>::getAubStreamProductFamily() const {
return aub_stream::ProductFamily::Kbl;
};
} // namespace NEO

View File

@ -5,9 +5,17 @@
*
*/
#include "product_family.h"
namespace NEO {
template <>
AOT::PRODUCT_CONFIG HwInfoConfigHw<gfxProduct>::getProductConfigFromHwInfo(const HardwareInfo &hwInfo) const {
return AOT::SKL;
}
template <>
std::optional<aub_stream::ProductFamily> HwInfoConfigHw<gfxProduct>::getAubStreamProductFamily() const {
return aub_stream::ProductFamily::Skl;
};
} // namespace NEO

View File

@ -13,10 +13,16 @@
#include "igfxfmid.h"
#include <optional>
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<aub_stream::ProductFamily> 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<aub_stream::ProductFamily> getAubStreamProductFamily() const override;
bool isDefaultEngineTypeAdjustmentRequired(const HardwareInfo &hwInfo) const override;
std::string getDeviceMemoryName() const override;
bool isDisableOverdispatchAvailable(const HardwareInfo &hwInfo) const override;

View File

@ -211,6 +211,11 @@ uint32_t HwInfoConfigHw<gfxProduct>::getAubStreamSteppingFromHwRevId(const Hardw
}
}
template <PRODUCT_FAMILY gfxProduct>
std::optional<aub_stream::ProductFamily> HwInfoConfigHw<gfxProduct>::getAubStreamProductFamily() const {
return std::nullopt;
};
template <PRODUCT_FAMILY gfxProduct>
bool HwInfoConfigHw<gfxProduct>::isDefaultEngineTypeAdjustmentRequired(const HardwareInfo &hwInfo) const {
return false;

View File

@ -5,6 +5,8 @@
*
*/
#include "product_family.h"
namespace NEO {
template <>
uint32_t HwInfoConfigHw<gfxProduct>::getHwRevIdFromStepping(uint32_t stepping, const HardwareInfo &hwInfo) const {
@ -138,4 +140,10 @@ template <>
bool HwInfoConfigHw<gfxProduct>::isImplicitScalingSupported(const HardwareInfo &hwInfo) const {
return true;
}
template <>
std::optional<aub_stream::ProductFamily> HwInfoConfigHw<gfxProduct>::getAubStreamProductFamily() const {
return aub_stream::ProductFamily::XeHpSdv;
};
} // namespace NEO

View File

@ -5,6 +5,8 @@
*
*/
#include "product_family.h"
namespace NEO {
template <>
bool HwInfoConfigHw<gfxProduct>::isMaxThreadsForWorkgroupWARequired(const HardwareInfo &hwInfo) const {
@ -210,4 +212,10 @@ template <>
bool HwInfoConfigHw<gfxProduct>::isStatefulAddressingModeSupported() const {
return false;
}
template <>
std::optional<aub_stream::ProductFamily> HwInfoConfigHw<gfxProduct>::getAubStreamProductFamily() const {
return aub_stream::ProductFamily::Pvc;
};
} // namespace NEO

View File

@ -7,6 +7,8 @@
#include "shared/source/memory_manager/memory_manager.h"
#include "product_family.h"
namespace NEO {
template <>
void HwInfoConfigHw<gfxProduct>::adjustSamplerState(void *sampler, const HardwareInfo &hwInfo) {
@ -205,4 +207,10 @@ bool HwInfoConfigHw<gfxProduct>::isStorageInfoAdjustmentRequired() const {
return false;
}
}
template <>
std::optional<aub_stream::ProductFamily> HwInfoConfigHw<gfxProduct>::getAubStreamProductFamily() const {
return aub_stream::ProductFamily::Dg2;
};
} // namespace NEO

View File

@ -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

View File

@ -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<MockAubCenter>(defaultHwInfo.get(), *rootDeviceEnvironment.getGmmHelper(), false, "", commandStreamReceiverType);
mockAubCenter->aubManager = std::make_unique<MockAubManager>();
auto mockAubCenter = std::make_unique<MockAubCenter>(rootDeviceEnvironment.getHardwareInfo(), *rootDeviceEnvironment.getGmmHelper(), false, "", commandStreamReceiverType);
if (!mockAubCenter->aubManager) {
mockAubCenter->aubManager = std::make_unique<MockAubManager>();
}
rootDeviceEnvironment.aubCenter.reset(mockAubCenter.release());
}
}

View File

@ -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;

View File

@ -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)

View File

@ -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>(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<ProductHelper>();
auto aubStreamProductFamily = productHelper.getAubStreamProductFamily();
ASSERT_TRUE(aubStreamProductFamily.has_value());
MockAubCenter aubCenter(rootDeviceEnvironment.getHardwareInfo(), *rootDeviceEnvironment.getGmmHelper(), true, "", CommandStreamReceiverType::CSR_AUB);
auto aubManager = static_cast<MockAubManager *>(aubCenter.aubManager.get());
ASSERT_NE(nullptr, aubManager);
EXPECT_EQ(static_cast<uint32_t>(*aubStreamProductFamily), aubManager->options.productFamily);
}
TEST_F(AubCenterTests, GivenCsrTypeWhenGettingAubStreamModeThenCorrectModeIsReturned) {
DebugManager.flags.UseAubStream.set(true);

View File

@ -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);

View File

@ -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()

View File

@ -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);

View File

@ -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[] = {

View File

@ -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()

View File

@ -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);

View File

@ -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[]{

View File

@ -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[]{

View File

@ -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[]{

View File

@ -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<DeviceFixture>;
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};

View File

@ -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);

View File

@ -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<DeviceFixture>;
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<MockRootDeviceEnvironment *>(executionEnvironment.rootDeviceEnvironments[0].get());
auto mockAubManager = static_cast<MockAubManager *>(rootDeviceEnvironment->aubCenter->getAubManager());
EXPECT_EQ(MemoryConstants::max48BitAddress, mockAubManager->mockAubManagerParams.gpuAddressSpace);
EXPECT_EQ(MemoryConstants::max48BitAddress, mockAubManager->options.gpuAddressSpace);
}
TGLLPTEST_F(TgllpHwInfo, givenSetCommandStreamReceiverInAubModeWhenPrepareDeviceEnvironmentsForProductFamilyOverrideIsCalledThenAllRootDeviceEnvironmentMembersAreInitialized) {

View File

@ -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);

View File

@ -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[] = {

View File

@ -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[] = {

View File

@ -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[] = {

View File

@ -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[] = {

View File

@ -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);

View File

@ -24,6 +24,16 @@
using namespace NEO;
using ProductHelperTest = Test<DeviceFixture>;
HwInfoConfigTest::HwInfoConfigTest() {
executionEnvironment = std::make_unique<MockExecutionEnvironment>();
productHelper = &executionEnvironment->rootDeviceEnvironments[0]->getHelper<ProductHelper>();
}
HwInfoConfigTest::~HwInfoConfigTest() = default;
void HwInfoConfigTest::SetUp() {
pInHwInfo = *defaultHwInfo;
testPlatform = &pInHwInfo.platform;
}
HWTEST_F(HwInfoConfigTest, givenDebugFlagSetWhenAskingForHostMemCapabilitesThenReturnCorrectValue) {
DebugManagerStateRestore restore;

View File

@ -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> executionEnvironment;
HardwareInfo pInHwInfo{};
HardwareInfo outHwInfo{};
HwInfoConfig *productHelper = nullptr;
PLATFORM *testPlatform = nullptr;
};

View File

@ -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) {

View File

@ -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<DeviceFixture>;
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);

View File

@ -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<DeviceFixture>;
using ProductHelperTestDg2 = Test<DeviceFixture>;
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 &gtSystemInfo = hwInfo.gtSystemInfo;

View File

@ -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()