Support for new names in Aub/Tbx mode
New acronyms that distinguish between configurations are supported. This commit adds support for these names by reusing ProductFamilyOverride flag. Signed-off-by: Daria Hinz <daria.hinz@intel.com> Related-To: NEO-7112
This commit is contained in:
parent
9683d23e2f
commit
8afcc87dc5
|
@ -5,247 +5,16 @@
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "shared/source/command_stream/command_stream_receiver.h"
|
|
||||||
#include "shared/source/execution_environment/execution_environment.h"
|
|
||||||
#include "shared/source/memory_manager/os_agnostic_memory_manager.h"
|
|
||||||
#include "shared/source/os_interface/device_factory.h"
|
|
||||||
#include "shared/source/os_interface/hw_info_config.h"
|
|
||||||
#include "shared/test/common/helpers/debug_manager_state_restore.h"
|
#include "shared/test/common/helpers/debug_manager_state_restore.h"
|
||||||
#include "shared/test/common/helpers/default_hw_info.h"
|
|
||||||
#include "shared/test/common/helpers/ult_hw_config.h"
|
#include "shared/test/common/helpers/ult_hw_config.h"
|
||||||
#include "shared/test/common/helpers/variable_backup.h"
|
#include "shared/test/common/helpers/variable_backup.h"
|
||||||
#include "shared/test/common/libult/create_command_stream.h"
|
|
||||||
#include "shared/test/common/test_macros/hw_test.h"
|
|
||||||
|
|
||||||
#include "opencl/source/platform/platform.h"
|
#include "opencl/source/platform/platform.h"
|
||||||
#include "opencl/test/unit_test/mocks/mock_platform.h"
|
#include "opencl/test/unit_test/mocks/mock_platform.h"
|
||||||
|
|
||||||
|
#include "gtest/gtest.h"
|
||||||
|
|
||||||
namespace NEO {
|
namespace NEO {
|
||||||
bool operator==(const HardwareInfo &hwInfoIn, const HardwareInfo &hwInfoOut) {
|
|
||||||
bool result = (0 == memcmp(&hwInfoIn.platform, &hwInfoOut.platform, sizeof(PLATFORM)));
|
|
||||||
result &= (hwInfoIn.featureTable.asHash() == hwInfoOut.featureTable.asHash());
|
|
||||||
result &= (hwInfoIn.workaroundTable.asHash() == hwInfoOut.workaroundTable.asHash());
|
|
||||||
result &= (hwInfoIn.capabilityTable == hwInfoOut.capabilityTable);
|
|
||||||
return result;
|
|
||||||
}
|
|
||||||
|
|
||||||
TEST(PrepareDeviceEnvironmentTest, givenPrepareDeviceEnvironmentWhenCsrIsSetToVariousTypesThenFunctionReturnsExpectedValueOfHardwareInfo) {
|
|
||||||
const HardwareInfo *hwInfo = nullptr;
|
|
||||||
VariableBackup<UltHwConfig> backup{&ultHwConfig};
|
|
||||||
DebugManagerStateRestore stateRestorer;
|
|
||||||
ultHwConfig.useMockedPrepareDeviceEnvironmentsFunc = false;
|
|
||||||
uint32_t expectedDevices = 1;
|
|
||||||
DebugManager.flags.CreateMultipleRootDevices.set(expectedDevices);
|
|
||||||
for (int productFamilyIndex = 0; productFamilyIndex < IGFX_MAX_PRODUCT; productFamilyIndex++) {
|
|
||||||
const char *hwPrefix = hardwarePrefix[productFamilyIndex];
|
|
||||||
auto hwInfoConfig = hwInfoConfigFactory[productFamilyIndex];
|
|
||||||
if (hwPrefix == nullptr || hwInfoConfig == nullptr) {
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
const std::string productFamily(hwPrefix);
|
|
||||||
|
|
||||||
for (int csrTypes = -1; csrTypes <= CSR_TYPES_NUM; csrTypes++) {
|
|
||||||
CommandStreamReceiverType csrType;
|
|
||||||
if (csrTypes != -1) {
|
|
||||||
csrType = static_cast<CommandStreamReceiverType>(csrTypes);
|
|
||||||
DebugManager.flags.SetCommandStreamReceiver.set(csrType);
|
|
||||||
} else {
|
|
||||||
csrType = CSR_HW;
|
|
||||||
DebugManager.flags.SetCommandStreamReceiver.set(-1);
|
|
||||||
}
|
|
||||||
|
|
||||||
DebugManager.flags.ProductFamilyOverride.set(productFamily);
|
|
||||||
platformsImpl->clear();
|
|
||||||
ExecutionEnvironment *exeEnv = constructPlatform()->peekExecutionEnvironment();
|
|
||||||
|
|
||||||
std::string pciPath = "0000:00:02.0";
|
|
||||||
exeEnv->rootDeviceEnvironments.resize(1u);
|
|
||||||
const auto ret = prepareDeviceEnvironment(*exeEnv, pciPath, 0u);
|
|
||||||
EXPECT_EQ(expectedDevices, exeEnv->rootDeviceEnvironments.size());
|
|
||||||
for (auto i = 0u; i < expectedDevices; i++) {
|
|
||||||
hwInfo = exeEnv->rootDeviceEnvironments[i]->getHardwareInfo();
|
|
||||||
|
|
||||||
switch (csrType) {
|
|
||||||
case CSR_HW:
|
|
||||||
case CSR_HW_WITH_AUB:
|
|
||||||
case CSR_TYPES_NUM:
|
|
||||||
EXPECT_TRUE(ret);
|
|
||||||
EXPECT_NE(nullptr, hwInfo);
|
|
||||||
break;
|
|
||||||
default:
|
|
||||||
EXPECT_FALSE(ret);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
struct PrepareDeviceEnvironmentsTest : ::testing::Test {
|
|
||||||
void SetUp() override {
|
|
||||||
ultHwConfig.useMockedPrepareDeviceEnvironmentsFunc = false;
|
|
||||||
}
|
|
||||||
void TearDown() override {
|
|
||||||
}
|
|
||||||
int i = 0;
|
|
||||||
const HardwareInfo *hwInfo = nullptr;
|
|
||||||
|
|
||||||
VariableBackup<UltHwConfig> backup{&ultHwConfig};
|
|
||||||
DebugManagerStateRestore stateRestorer;
|
|
||||||
};
|
|
||||||
|
|
||||||
HWTEST_F(PrepareDeviceEnvironmentsTest, givenPrepareDeviceEnvironmentsWhenCsrIsSetToVariousTypesThenTheFunctionReturnsTheExpectedValueOfHardwareInfo) {
|
|
||||||
uint32_t expectedDevices = 1;
|
|
||||||
DebugManager.flags.CreateMultipleRootDevices.set(expectedDevices);
|
|
||||||
for (int productFamilyIndex = 0; productFamilyIndex < IGFX_MAX_PRODUCT; productFamilyIndex++) {
|
|
||||||
const char *hwPrefix = hardwarePrefix[productFamilyIndex];
|
|
||||||
auto hwInfoConfig = hwInfoConfigFactory[productFamilyIndex];
|
|
||||||
if (hwPrefix == nullptr || hwInfoConfig == nullptr) {
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
const std::string productFamily(hwPrefix);
|
|
||||||
|
|
||||||
for (int csrTypes = -1; csrTypes <= CSR_TYPES_NUM; csrTypes++) {
|
|
||||||
CommandStreamReceiverType csrType;
|
|
||||||
if (csrTypes != -1) {
|
|
||||||
csrType = static_cast<CommandStreamReceiverType>(csrTypes);
|
|
||||||
DebugManager.flags.SetCommandStreamReceiver.set(csrType);
|
|
||||||
} else {
|
|
||||||
csrType = CSR_HW;
|
|
||||||
DebugManager.flags.SetCommandStreamReceiver.set(-1);
|
|
||||||
}
|
|
||||||
|
|
||||||
DebugManager.flags.ProductFamilyOverride.set(productFamily);
|
|
||||||
platformsImpl->clear();
|
|
||||||
ExecutionEnvironment *exeEnv = constructPlatform()->peekExecutionEnvironment();
|
|
||||||
|
|
||||||
const auto ret = prepareDeviceEnvironments(*exeEnv);
|
|
||||||
EXPECT_EQ(expectedDevices, exeEnv->rootDeviceEnvironments.size());
|
|
||||||
for (auto i = 0u; i < expectedDevices; i++) {
|
|
||||||
hwInfo = exeEnv->rootDeviceEnvironments[i]->getHardwareInfo();
|
|
||||||
|
|
||||||
switch (csrType) {
|
|
||||||
case CSR_HW:
|
|
||||||
case CSR_HW_WITH_AUB:
|
|
||||||
EXPECT_TRUE(ret);
|
|
||||||
EXPECT_NE(nullptr, hwInfo);
|
|
||||||
break;
|
|
||||||
case CSR_AUB:
|
|
||||||
case CSR_TBX:
|
|
||||||
case CSR_TBX_WITH_AUB: {
|
|
||||||
EXPECT_TRUE(ret);
|
|
||||||
EXPECT_NE(nullptr, hwInfo);
|
|
||||||
for (i = 0; i < IGFX_MAX_PRODUCT; i++) {
|
|
||||||
auto hardwareInfo = hardwareInfoTable[i];
|
|
||||||
if (hardwareInfo == nullptr)
|
|
||||||
continue;
|
|
||||||
if (hardwareInfoTable[i]->platform.eProductFamily == hwInfo->platform.eProductFamily)
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
EXPECT_TRUE(i < IGFX_MAX_PRODUCT);
|
|
||||||
ASSERT_NE(nullptr, hardwarePrefix[i]);
|
|
||||||
|
|
||||||
HardwareInfo hwInfoFromTable = *hardwareInfoTable[i];
|
|
||||||
hwInfoFromTable.featureTable = {};
|
|
||||||
hwInfoFromTable.workaroundTable = {};
|
|
||||||
hwInfoFromTable.gtSystemInfo = {};
|
|
||||||
hardwareInfoSetup[hwInfoFromTable.platform.eProductFamily](&hwInfoFromTable, true, 0x0);
|
|
||||||
HwInfoConfig *hwConfig = HwInfoConfig::get(hwInfoFromTable.platform.eProductFamily);
|
|
||||||
hwConfig->configureHardwareCustom(&hwInfoFromTable, nullptr);
|
|
||||||
EXPECT_EQ(0, memcmp(&hwInfoFromTable.platform, &hwInfo->platform, sizeof(PLATFORM)));
|
|
||||||
|
|
||||||
EXPECT_STREQ(hardwarePrefix[i], productFamily.c_str());
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
default:
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
HWTEST_F(PrepareDeviceEnvironmentsTest, givenUpperCaseProductFamilyOverrideFlagSetWhenCreatingDevicesThenFindExpectedPlatform) {
|
|
||||||
std::string hwPrefix;
|
|
||||||
std::string hwPrefixUpperCase;
|
|
||||||
PRODUCT_FAMILY productFamily;
|
|
||||||
|
|
||||||
for (int productFamilyIndex = 0; productFamilyIndex < IGFX_MAX_PRODUCT; productFamilyIndex++) {
|
|
||||||
if (hardwarePrefix[productFamilyIndex] && hwInfoConfigFactory[productFamilyIndex]) {
|
|
||||||
hwPrefix = hardwarePrefix[productFamilyIndex];
|
|
||||||
productFamily = static_cast<PRODUCT_FAMILY>(productFamilyIndex);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
EXPECT_NE(0u, hwPrefix.length());
|
|
||||||
hwPrefixUpperCase.resize(hwPrefix.length());
|
|
||||||
std::transform(hwPrefix.begin(), hwPrefix.end(), hwPrefixUpperCase.begin(), ::toupper);
|
|
||||||
EXPECT_NE(hwPrefix, hwPrefixUpperCase);
|
|
||||||
|
|
||||||
DebugManager.flags.ProductFamilyOverride.set(hwPrefixUpperCase);
|
|
||||||
DebugManager.flags.SetCommandStreamReceiver.set(CommandStreamReceiverType::CSR_AUB);
|
|
||||||
|
|
||||||
ExecutionEnvironment *exeEnv = platform()->peekExecutionEnvironment();
|
|
||||||
bool ret = prepareDeviceEnvironments(*exeEnv);
|
|
||||||
|
|
||||||
EXPECT_TRUE(ret);
|
|
||||||
EXPECT_EQ(productFamily, exeEnv->rootDeviceEnvironments[0]->getHardwareInfo()->platform.eProductFamily);
|
|
||||||
}
|
|
||||||
|
|
||||||
HWTEST_F(PrepareDeviceEnvironmentsTest, givenPrepareDeviceEnvironmentsAndUnknownProductFamilyWhenCsrIsSetToValidTypeThenTheFunctionReturnsTheExpectedValueOfHardwareInfo) {
|
|
||||||
uint32_t expectedDevices = 1;
|
|
||||||
DebugManager.flags.CreateMultipleRootDevices.set(expectedDevices);
|
|
||||||
for (int csrTypes = 0; csrTypes <= CSR_TYPES_NUM; csrTypes++) {
|
|
||||||
CommandStreamReceiverType csrType = static_cast<CommandStreamReceiverType>(csrTypes);
|
|
||||||
std::string productFamily("unk");
|
|
||||||
|
|
||||||
DebugManager.flags.SetCommandStreamReceiver.set(csrType);
|
|
||||||
DebugManager.flags.ProductFamilyOverride.set(productFamily);
|
|
||||||
platformsImpl->clear();
|
|
||||||
ExecutionEnvironment *exeEnv = constructPlatform()->peekExecutionEnvironment();
|
|
||||||
|
|
||||||
auto ret = prepareDeviceEnvironments(*exeEnv);
|
|
||||||
EXPECT_EQ(expectedDevices, exeEnv->rootDeviceEnvironments.size());
|
|
||||||
for (auto i = 0u; i < expectedDevices; i++) {
|
|
||||||
hwInfo = exeEnv->rootDeviceEnvironments[i]->getHardwareInfo();
|
|
||||||
|
|
||||||
switch (csrType) {
|
|
||||||
case CSR_HW:
|
|
||||||
case CSR_HW_WITH_AUB:
|
|
||||||
EXPECT_TRUE(ret);
|
|
||||||
break;
|
|
||||||
case CSR_AUB:
|
|
||||||
case CSR_TBX:
|
|
||||||
case CSR_TBX_WITH_AUB: {
|
|
||||||
EXPECT_TRUE(ret);
|
|
||||||
EXPECT_NE(nullptr, hwInfo);
|
|
||||||
for (i = 0; i < IGFX_MAX_PRODUCT; i++) {
|
|
||||||
auto hardwareInfo = hardwareInfoTable[i];
|
|
||||||
if (hardwareInfo == nullptr)
|
|
||||||
continue;
|
|
||||||
if (hardwareInfoTable[i]->platform.eProductFamily == hwInfo->platform.eProductFamily)
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
EXPECT_TRUE(i < IGFX_MAX_PRODUCT);
|
|
||||||
ASSERT_NE(nullptr, hardwarePrefix[i]);
|
|
||||||
HardwareInfo baseHwInfo = *defaultHwInfo;
|
|
||||||
baseHwInfo.featureTable = {};
|
|
||||||
baseHwInfo.workaroundTable = {};
|
|
||||||
baseHwInfo.gtSystemInfo = {};
|
|
||||||
hardwareInfoSetup[baseHwInfo.platform.eProductFamily](&baseHwInfo, true, 0x0);
|
|
||||||
HwInfoConfig *hwConfig = HwInfoConfig::get(baseHwInfo.platform.eProductFamily);
|
|
||||||
hwConfig->configureHardwareCustom(&baseHwInfo, nullptr);
|
|
||||||
EXPECT_EQ(0, memcmp(&baseHwInfo.platform, &hwInfo->platform, sizeof(PLATFORM)));
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
default:
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
TEST(MultiDeviceTests, givenCreateMultipleRootDevicesAndLimitAmountOfReturnedDevicesFlagWhenClGetDeviceIdsIsCalledThenLowerValueIsReturned) {
|
TEST(MultiDeviceTests, givenCreateMultipleRootDevicesAndLimitAmountOfReturnedDevicesFlagWhenClGetDeviceIdsIsCalledThenLowerValueIsReturned) {
|
||||||
platformsImpl->clear();
|
platformsImpl->clear();
|
||||||
VariableBackup<UltHwConfig> backup(&ultHwConfig);
|
VariableBackup<UltHwConfig> backup(&ultHwConfig);
|
||||||
|
|
|
@ -38,6 +38,16 @@ std::vector<DeviceAotInfo> &ProductConfigHelper::getDeviceAotInfo() {
|
||||||
return deviceAotInfo;
|
return deviceAotInfo;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool ProductConfigHelper::getDeviceAotInfoForProductConfig(AOT::PRODUCT_CONFIG config, DeviceAotInfo &out) const {
|
||||||
|
auto ret = std::find_if(deviceAotInfo.begin(), deviceAotInfo.end(), findProductConfig(config));
|
||||||
|
if (ret == deviceAotInfo.end()) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
out = *ret;
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
void ProductConfigHelper::adjustDeviceName(std::string &device) {
|
void ProductConfigHelper::adjustDeviceName(std::string &device) {
|
||||||
std::transform(device.begin(), device.end(), device.begin(), ::tolower);
|
std::transform(device.begin(), device.end(), device.begin(), ::tolower);
|
||||||
|
|
||||||
|
|
|
@ -45,7 +45,7 @@ struct DeviceAotInfo {
|
||||||
std::vector<NEO::ConstStringRef> acronyms{};
|
std::vector<NEO::ConstStringRef> acronyms{};
|
||||||
|
|
||||||
bool operator==(const DeviceAotInfo &rhs) {
|
bool operator==(const DeviceAotInfo &rhs) {
|
||||||
return aotConfig.ProductConfig == rhs.aotConfig.ProductConfig && family == rhs.family && release == rhs.release;
|
return aotConfig.ProductConfig == rhs.aotConfig.ProductConfig && family == rhs.family && release == rhs.release && hwInfo == rhs.hwInfo;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -105,6 +105,7 @@ struct ProductConfigHelper {
|
||||||
bool isRelease(const std::string &device);
|
bool isRelease(const std::string &device);
|
||||||
bool isProductConfig(const std::string &device);
|
bool isProductConfig(const std::string &device);
|
||||||
|
|
||||||
|
bool getDeviceAotInfoForProductConfig(AOT::PRODUCT_CONFIG config, DeviceAotInfo &out) const;
|
||||||
std::vector<DeviceAotInfo> &getDeviceAotInfo();
|
std::vector<DeviceAotInfo> &getDeviceAotInfo();
|
||||||
std::vector<NEO::ConstStringRef> getRepresentativeProductAcronyms();
|
std::vector<NEO::ConstStringRef> getRepresentativeProductAcronyms();
|
||||||
std::vector<NEO::ConstStringRef> getReleasesAcronyms();
|
std::vector<NEO::ConstStringRef> getReleasesAcronyms();
|
||||||
|
|
|
@ -12,7 +12,9 @@
|
||||||
#include "shared/source/device/device.h"
|
#include "shared/source/device/device.h"
|
||||||
#include "shared/source/device/root_device.h"
|
#include "shared/source/device/root_device.h"
|
||||||
#include "shared/source/execution_environment/root_device_environment.h"
|
#include "shared/source/execution_environment/root_device_environment.h"
|
||||||
|
#include "shared/source/helpers/compiler_hw_info_config.h"
|
||||||
#include "shared/source/helpers/hw_helper.h"
|
#include "shared/source/helpers/hw_helper.h"
|
||||||
|
#include "shared/source/helpers/product_config_helper.h"
|
||||||
#include "shared/source/memory_manager/memory_manager.h"
|
#include "shared/source/memory_manager/memory_manager.h"
|
||||||
#include "shared/source/os_interface/aub_memory_operations_handler.h"
|
#include "shared/source/os_interface/aub_memory_operations_handler.h"
|
||||||
#include "shared/source/os_interface/hw_info_config.h"
|
#include "shared/source/os_interface/hw_info_config.h"
|
||||||
|
@ -30,8 +32,20 @@ bool DeviceFactory::prepareDeviceEnvironmentsForProductFamilyOverride(ExecutionE
|
||||||
executionEnvironment.prepareRootDeviceEnvironments(numRootDevices);
|
executionEnvironment.prepareRootDeviceEnvironments(numRootDevices);
|
||||||
|
|
||||||
auto productFamily = DebugManager.flags.ProductFamilyOverride.get();
|
auto productFamily = DebugManager.flags.ProductFamilyOverride.get();
|
||||||
|
|
||||||
|
auto configStr = productFamily;
|
||||||
|
ProductConfigHelper::adjustDeviceName(configStr);
|
||||||
|
auto productConfig = ProductConfigHelper::getProductConfigForAcronym(configStr);
|
||||||
|
|
||||||
const HardwareInfo *hwInfoConst = getDefaultHwInfo();
|
const HardwareInfo *hwInfoConst = getDefaultHwInfo();
|
||||||
getHwInfoForPlatformString(productFamily, hwInfoConst);
|
auto productConfigHelper = std::make_unique<ProductConfigHelper>();
|
||||||
|
DeviceAotInfo aotInfo{};
|
||||||
|
auto productConfigFound = productConfigHelper->getDeviceAotInfoForProductConfig(productConfig, aotInfo);
|
||||||
|
if (productConfigFound) {
|
||||||
|
hwInfoConst = aotInfo.hwInfo;
|
||||||
|
} else {
|
||||||
|
getHwInfoForPlatformString(productFamily, hwInfoConst);
|
||||||
|
}
|
||||||
std::string hwInfoConfigStr;
|
std::string hwInfoConfigStr;
|
||||||
uint64_t hwInfoConfig = 0x0;
|
uint64_t hwInfoConfig = 0x0;
|
||||||
DebugManager.getHardwareInfoOverride(hwInfoConfigStr);
|
DebugManager.getHardwareInfoOverride(hwInfoConfigStr);
|
||||||
|
@ -52,6 +66,12 @@ bool DeviceFactory::prepareDeviceEnvironmentsForProductFamilyOverride(ExecutionE
|
||||||
HwInfoConfig *hwConfig = HwInfoConfig::get(hardwareInfo->platform.eProductFamily);
|
HwInfoConfig *hwConfig = HwInfoConfig::get(hardwareInfo->platform.eProductFamily);
|
||||||
hwConfig->configureHardwareCustom(hardwareInfo, nullptr);
|
hwConfig->configureHardwareCustom(hardwareInfo, nullptr);
|
||||||
|
|
||||||
|
if (productConfigFound) {
|
||||||
|
const auto &compilerHwInfoConfig = *CompilerHwInfoConfig::get(hardwareInfo->platform.eProductFamily);
|
||||||
|
compilerHwInfoConfig.setProductConfigForHwInfo(*hardwareInfo, aotInfo.aotConfig);
|
||||||
|
hardwareInfo->platform.usDeviceID = aotInfo.deviceIds->front();
|
||||||
|
}
|
||||||
|
|
||||||
if (DebugManager.flags.OverrideGpuAddressSpace.get() != -1) {
|
if (DebugManager.flags.OverrideGpuAddressSpace.get() != -1) {
|
||||||
hardwareInfo->capabilityTable.gpuAddressSpace = maxNBitValue(static_cast<uint64_t>(DebugManager.flags.OverrideGpuAddressSpace.get()));
|
hardwareInfo->capabilityTable.gpuAddressSpace = maxNBitValue(static_cast<uint64_t>(DebugManager.flags.OverrideGpuAddressSpace.get()));
|
||||||
}
|
}
|
||||||
|
|
|
@ -15,6 +15,7 @@ set(NEO_SHARED_tests_command_stream
|
||||||
${CMAKE_CURRENT_SOURCE_DIR}/command_stream_receiver_simulated_tests.cpp
|
${CMAKE_CURRENT_SOURCE_DIR}/command_stream_receiver_simulated_tests.cpp
|
||||||
${CMAKE_CURRENT_SOURCE_DIR}/command_stream_receiver_tests.cpp
|
${CMAKE_CURRENT_SOURCE_DIR}/command_stream_receiver_tests.cpp
|
||||||
${CMAKE_CURRENT_SOURCE_DIR}/compute_mode_tests.h
|
${CMAKE_CURRENT_SOURCE_DIR}/compute_mode_tests.h
|
||||||
|
${CMAKE_CURRENT_SOURCE_DIR}/get_devices_tests.cpp
|
||||||
${CMAKE_CURRENT_SOURCE_DIR}/linear_stream_tests.cpp
|
${CMAKE_CURRENT_SOURCE_DIR}/linear_stream_tests.cpp
|
||||||
${CMAKE_CURRENT_SOURCE_DIR}/stream_properties_tests_common.cpp
|
${CMAKE_CURRENT_SOURCE_DIR}/stream_properties_tests_common.cpp
|
||||||
${CMAKE_CURRENT_SOURCE_DIR}/stream_properties_tests_common.h
|
${CMAKE_CURRENT_SOURCE_DIR}/stream_properties_tests_common.h
|
||||||
|
|
|
@ -0,0 +1,362 @@
|
||||||
|
/*
|
||||||
|
* Copyright (C) 2018-2022 Intel Corporation
|
||||||
|
*
|
||||||
|
* SPDX-License-Identifier: MIT
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
|
||||||
|
#include "shared/source/command_stream/command_stream_receiver.h"
|
||||||
|
#include "shared/source/helpers/compiler_hw_info_config.h"
|
||||||
|
#include "shared/source/helpers/product_config_helper.h"
|
||||||
|
#include "shared/source/os_interface/device_factory.h"
|
||||||
|
#include "shared/source/os_interface/hw_info_config.h"
|
||||||
|
#include "shared/test/common/helpers/debug_manager_state_restore.h"
|
||||||
|
#include "shared/test/common/helpers/ult_hw_config.h"
|
||||||
|
#include "shared/test/common/helpers/variable_backup.h"
|
||||||
|
#include "shared/test/common/libult/create_command_stream.h"
|
||||||
|
#include "shared/test/common/mocks/mock_execution_environment.h"
|
||||||
|
#include "shared/test/common/test_macros/hw_test.h"
|
||||||
|
|
||||||
|
#include "gtest/gtest.h"
|
||||||
|
|
||||||
|
namespace NEO {
|
||||||
|
struct PrepareDeviceEnvironmentsTest : ::testing::Test {
|
||||||
|
void SetUp() override {
|
||||||
|
ultHwConfig.useMockedPrepareDeviceEnvironmentsFunc = false;
|
||||||
|
productConfigHelper = std::make_unique<ProductConfigHelper>();
|
||||||
|
|
||||||
|
auto aotInfos = productConfigHelper->getDeviceAotInfo();
|
||||||
|
for (const auto &aotInfo : aotInfos) {
|
||||||
|
if (aotInfo.hwInfo->platform.eProductFamily == productFamily && !aotInfo.acronyms.empty()) {
|
||||||
|
deviceAot = aotInfo;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
auto deprecatedAcronyms = productConfigHelper->getDeprecatedAcronyms();
|
||||||
|
|
||||||
|
for (const auto &acronym : deprecatedAcronyms) {
|
||||||
|
auto acronymStr = acronym.str();
|
||||||
|
if (0 == strcmp(acronymStr.c_str(), hardwarePrefix[productFamily])) {
|
||||||
|
deprecatedAcronym = acronymStr;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
void TearDown() override {
|
||||||
|
}
|
||||||
|
|
||||||
|
DeviceAotInfo deviceAot;
|
||||||
|
std::string product, deprecatedAcronym;
|
||||||
|
const HardwareInfo *hwInfo = nullptr;
|
||||||
|
VariableBackup<UltHwConfig> backup{&ultHwConfig};
|
||||||
|
DebugManagerStateRestore stateRestorer;
|
||||||
|
std::unique_ptr<ProductConfigHelper> productConfigHelper;
|
||||||
|
};
|
||||||
|
|
||||||
|
TEST_F(PrepareDeviceEnvironmentsTest, givenPrepareDeviceEnvironmentsWithPciPathWhenCsrIsSetToVariousTypesThenExpectedValuesOfHardwareInfoAreSet) {
|
||||||
|
uint32_t expectedDevices = 1;
|
||||||
|
DebugManager.flags.CreateMultipleRootDevices.set(expectedDevices);
|
||||||
|
|
||||||
|
if (deviceAot.acronyms.empty()) {
|
||||||
|
GTEST_SKIP();
|
||||||
|
}
|
||||||
|
auto product = deviceAot.acronyms.front().str();
|
||||||
|
|
||||||
|
for (int csrTypes = -1; csrTypes <= CSR_TYPES_NUM; csrTypes++) {
|
||||||
|
CommandStreamReceiverType csrType;
|
||||||
|
if (csrTypes != -1) {
|
||||||
|
csrType = static_cast<CommandStreamReceiverType>(csrTypes);
|
||||||
|
DebugManager.flags.SetCommandStreamReceiver.set(csrType);
|
||||||
|
} else {
|
||||||
|
csrType = CSR_HW;
|
||||||
|
DebugManager.flags.SetCommandStreamReceiver.set(-1);
|
||||||
|
}
|
||||||
|
|
||||||
|
DebugManager.flags.ProductFamilyOverride.set(product);
|
||||||
|
MockExecutionEnvironment exeEnv;
|
||||||
|
exeEnv.prepareRootDeviceEnvironments(expectedDevices);
|
||||||
|
|
||||||
|
std::string pciPath = "0000:00:02.0";
|
||||||
|
exeEnv.rootDeviceEnvironments.resize(1u);
|
||||||
|
const auto ret = prepareDeviceEnvironment(exeEnv, pciPath, 0u);
|
||||||
|
EXPECT_EQ(expectedDevices, exeEnv.rootDeviceEnvironments.size());
|
||||||
|
for (auto i = 0u; i < expectedDevices; i++) {
|
||||||
|
hwInfo = exeEnv.rootDeviceEnvironments[i]->getHardwareInfo();
|
||||||
|
|
||||||
|
switch (csrType) {
|
||||||
|
case CSR_HW:
|
||||||
|
case CSR_HW_WITH_AUB:
|
||||||
|
case CSR_TYPES_NUM:
|
||||||
|
EXPECT_TRUE(ret);
|
||||||
|
EXPECT_NE(nullptr, hwInfo);
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
EXPECT_FALSE(ret);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
TEST_F(PrepareDeviceEnvironmentsTest, givenPrepareDeviceEnvironmentsWithPciPathForDeprecatedNamesWhenCsrIsSetToVariousTypesThenExpectedValuesOfHardwareInfoAreSet) {
|
||||||
|
uint32_t expectedDevices = 1;
|
||||||
|
DebugManager.flags.CreateMultipleRootDevices.set(expectedDevices);
|
||||||
|
|
||||||
|
if (deprecatedAcronym.empty()) {
|
||||||
|
GTEST_SKIP();
|
||||||
|
}
|
||||||
|
|
||||||
|
for (int csrTypes = -1; csrTypes <= CSR_TYPES_NUM; csrTypes++) {
|
||||||
|
CommandStreamReceiverType csrType;
|
||||||
|
if (csrTypes != -1) {
|
||||||
|
csrType = static_cast<CommandStreamReceiverType>(csrTypes);
|
||||||
|
DebugManager.flags.SetCommandStreamReceiver.set(csrType);
|
||||||
|
} else {
|
||||||
|
csrType = CSR_HW;
|
||||||
|
DebugManager.flags.SetCommandStreamReceiver.set(-1);
|
||||||
|
}
|
||||||
|
|
||||||
|
DebugManager.flags.ProductFamilyOverride.set(deprecatedAcronym);
|
||||||
|
MockExecutionEnvironment exeEnv;
|
||||||
|
exeEnv.prepareRootDeviceEnvironments(expectedDevices);
|
||||||
|
|
||||||
|
std::string pciPath = "0000:00:02.0";
|
||||||
|
exeEnv.rootDeviceEnvironments.resize(1u);
|
||||||
|
const auto ret = prepareDeviceEnvironment(exeEnv, pciPath, 0u);
|
||||||
|
EXPECT_EQ(expectedDevices, exeEnv.rootDeviceEnvironments.size());
|
||||||
|
for (auto i = 0u; i < expectedDevices; i++) {
|
||||||
|
hwInfo = exeEnv.rootDeviceEnvironments[i]->getHardwareInfo();
|
||||||
|
|
||||||
|
switch (csrType) {
|
||||||
|
case CSR_HW:
|
||||||
|
case CSR_HW_WITH_AUB:
|
||||||
|
case CSR_TYPES_NUM:
|
||||||
|
EXPECT_TRUE(ret);
|
||||||
|
EXPECT_NE(nullptr, hwInfo);
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
EXPECT_FALSE(ret);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
HWTEST_F(PrepareDeviceEnvironmentsTest, givenPrepareDeviceEnvironmentsForDeprecatedNamesWhenCsrIsSetToVariousTypesThenExpectedValuesOfHardwareInfoAreSet) {
|
||||||
|
uint32_t expectedDevices = 1;
|
||||||
|
DebugManager.flags.CreateMultipleRootDevices.set(expectedDevices);
|
||||||
|
|
||||||
|
if (deprecatedAcronym.empty()) {
|
||||||
|
GTEST_SKIP();
|
||||||
|
}
|
||||||
|
|
||||||
|
for (int csrTypes = -1; csrTypes <= CSR_TYPES_NUM; csrTypes++) {
|
||||||
|
CommandStreamReceiverType csrType;
|
||||||
|
if (csrTypes != -1) {
|
||||||
|
csrType = static_cast<CommandStreamReceiverType>(csrTypes);
|
||||||
|
DebugManager.flags.SetCommandStreamReceiver.set(csrType);
|
||||||
|
} else {
|
||||||
|
csrType = CSR_HW;
|
||||||
|
DebugManager.flags.SetCommandStreamReceiver.set(-1);
|
||||||
|
}
|
||||||
|
|
||||||
|
DebugManager.flags.ProductFamilyOverride.set(deprecatedAcronym);
|
||||||
|
MockExecutionEnvironment exeEnv;
|
||||||
|
exeEnv.prepareRootDeviceEnvironments(expectedDevices);
|
||||||
|
|
||||||
|
const auto ret = prepareDeviceEnvironments(exeEnv);
|
||||||
|
EXPECT_EQ(expectedDevices, exeEnv.rootDeviceEnvironments.size());
|
||||||
|
for (auto i = 0u; i < expectedDevices; i++) {
|
||||||
|
hwInfo = exeEnv.rootDeviceEnvironments[i]->getHardwareInfo();
|
||||||
|
|
||||||
|
switch (csrType) {
|
||||||
|
case CSR_HW:
|
||||||
|
case CSR_HW_WITH_AUB:
|
||||||
|
EXPECT_TRUE(ret);
|
||||||
|
EXPECT_NE(nullptr, hwInfo);
|
||||||
|
break;
|
||||||
|
case CSR_AUB:
|
||||||
|
case CSR_TBX:
|
||||||
|
case CSR_TBX_WITH_AUB: {
|
||||||
|
EXPECT_TRUE(ret);
|
||||||
|
EXPECT_NE(nullptr, hwInfo);
|
||||||
|
|
||||||
|
for (i = 0; i < IGFX_MAX_PRODUCT; i++) {
|
||||||
|
auto hardwareInfo = hardwareInfoTable[i];
|
||||||
|
if (hardwareInfo == nullptr)
|
||||||
|
continue;
|
||||||
|
if (hardwareInfoTable[i]->platform.eProductFamily == hwInfo->platform.eProductFamily)
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
EXPECT_TRUE(i < IGFX_MAX_PRODUCT);
|
||||||
|
ASSERT_NE(nullptr, hardwarePrefix[i]);
|
||||||
|
|
||||||
|
HardwareInfo hwInfoFromTable = *hardwareInfoTable[i];
|
||||||
|
hwInfoFromTable.featureTable = {};
|
||||||
|
hwInfoFromTable.workaroundTable = {};
|
||||||
|
hwInfoFromTable.gtSystemInfo = {};
|
||||||
|
hardwareInfoSetup[hwInfoFromTable.platform.eProductFamily](&hwInfoFromTable, true, 0x0);
|
||||||
|
HwInfoConfig *hwConfig = HwInfoConfig::get(hwInfoFromTable.platform.eProductFamily);
|
||||||
|
hwConfig->configureHardwareCustom(&hwInfoFromTable, nullptr);
|
||||||
|
EXPECT_EQ(0, memcmp(&hwInfoFromTable.platform, &hwInfo->platform, sizeof(PLATFORM)));
|
||||||
|
|
||||||
|
EXPECT_STREQ(hardwarePrefix[i], deprecatedAcronym.c_str());
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
default:
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
HWTEST_F(PrepareDeviceEnvironmentsTest, givenPrepareDeviceEnvironmentsWhenCsrIsSetToVariousTypesThenExpectedValuesOfHardwareInfoAreSet) {
|
||||||
|
uint32_t expectedDevices = 1;
|
||||||
|
DebugManager.flags.CreateMultipleRootDevices.set(expectedDevices);
|
||||||
|
|
||||||
|
if (deviceAot.acronyms.empty()) {
|
||||||
|
GTEST_SKIP();
|
||||||
|
}
|
||||||
|
auto product = deviceAot.acronyms.front().str();
|
||||||
|
|
||||||
|
for (int csrTypes = -1; csrTypes <= CSR_TYPES_NUM; csrTypes++) {
|
||||||
|
CommandStreamReceiverType csrType;
|
||||||
|
if (csrTypes != -1) {
|
||||||
|
csrType = static_cast<CommandStreamReceiverType>(csrTypes);
|
||||||
|
DebugManager.flags.SetCommandStreamReceiver.set(csrType);
|
||||||
|
} else {
|
||||||
|
csrType = CSR_HW;
|
||||||
|
DebugManager.flags.SetCommandStreamReceiver.set(-1);
|
||||||
|
}
|
||||||
|
|
||||||
|
DebugManager.flags.ProductFamilyOverride.set(product);
|
||||||
|
MockExecutionEnvironment exeEnv;
|
||||||
|
exeEnv.prepareRootDeviceEnvironments(expectedDevices);
|
||||||
|
|
||||||
|
const auto ret = prepareDeviceEnvironments(exeEnv);
|
||||||
|
EXPECT_EQ(expectedDevices, exeEnv.rootDeviceEnvironments.size());
|
||||||
|
for (auto i = 0u; i < expectedDevices; i++) {
|
||||||
|
hwInfo = exeEnv.rootDeviceEnvironments[i]->getHardwareInfo();
|
||||||
|
|
||||||
|
switch (csrType) {
|
||||||
|
case CSR_HW:
|
||||||
|
case CSR_HW_WITH_AUB:
|
||||||
|
EXPECT_TRUE(ret);
|
||||||
|
EXPECT_NE(nullptr, hwInfo);
|
||||||
|
break;
|
||||||
|
case CSR_AUB:
|
||||||
|
case CSR_TBX:
|
||||||
|
case CSR_TBX_WITH_AUB: {
|
||||||
|
EXPECT_TRUE(ret);
|
||||||
|
EXPECT_NE(nullptr, hwInfo);
|
||||||
|
|
||||||
|
HardwareInfo expectedHwInfo = *deviceAot.hwInfo;
|
||||||
|
expectedHwInfo.featureTable = {};
|
||||||
|
expectedHwInfo.workaroundTable = {};
|
||||||
|
expectedHwInfo.gtSystemInfo = {};
|
||||||
|
hardwareInfoSetup[expectedHwInfo.platform.eProductFamily](&expectedHwInfo, true, 0x0);
|
||||||
|
|
||||||
|
HwInfoConfig *hwConfig = HwInfoConfig::get(expectedHwInfo.platform.eProductFamily);
|
||||||
|
hwConfig->configureHardwareCustom(&expectedHwInfo, nullptr);
|
||||||
|
|
||||||
|
const auto &compilerHwInfoConfig = *NEO::CompilerHwInfoConfig::get(expectedHwInfo.platform.eProductFamily);
|
||||||
|
compilerHwInfoConfig.setProductConfigForHwInfo(expectedHwInfo, deviceAot.aotConfig);
|
||||||
|
expectedHwInfo.platform.usDeviceID = deviceAot.deviceIds->front();
|
||||||
|
|
||||||
|
EXPECT_EQ(0, memcmp(&expectedHwInfo.platform, &hwInfo->platform, sizeof(PLATFORM)));
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
default:
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
HWTEST_F(PrepareDeviceEnvironmentsTest, givenUpperCaseDeprecatedAcronymsToProductFamilyOverrideFlagWhenCreatingDevicesThenFindExpectedPlatform) {
|
||||||
|
if (deprecatedAcronym.empty()) {
|
||||||
|
GTEST_SKIP();
|
||||||
|
}
|
||||||
|
|
||||||
|
std::transform(deprecatedAcronym.begin(), deprecatedAcronym.end(), deprecatedAcronym.begin(), ::toupper);
|
||||||
|
DebugManager.flags.ProductFamilyOverride.set(deprecatedAcronym);
|
||||||
|
DebugManager.flags.SetCommandStreamReceiver.set(CommandStreamReceiverType::CSR_AUB);
|
||||||
|
MockExecutionEnvironment exeEnv;
|
||||||
|
bool ret = prepareDeviceEnvironments(exeEnv);
|
||||||
|
|
||||||
|
EXPECT_TRUE(ret);
|
||||||
|
EXPECT_EQ(productFamily, exeEnv.rootDeviceEnvironments[0]->getHardwareInfo()->platform.eProductFamily);
|
||||||
|
}
|
||||||
|
|
||||||
|
HWTEST_F(PrepareDeviceEnvironmentsTest, givenUpperCaseProductFamilyOverrideFlagSetWhenCreatingDevicesThenFindExpectedPlatform) {
|
||||||
|
if (deviceAot.acronyms.empty()) {
|
||||||
|
GTEST_SKIP();
|
||||||
|
}
|
||||||
|
auto product = deviceAot.acronyms.front().str();
|
||||||
|
std::transform(product.begin(), product.end(), product.begin(), ::toupper);
|
||||||
|
|
||||||
|
DebugManager.flags.ProductFamilyOverride.set(product);
|
||||||
|
DebugManager.flags.SetCommandStreamReceiver.set(CommandStreamReceiverType::CSR_AUB);
|
||||||
|
|
||||||
|
MockExecutionEnvironment exeEnv;
|
||||||
|
bool ret = prepareDeviceEnvironments(exeEnv);
|
||||||
|
|
||||||
|
EXPECT_TRUE(ret);
|
||||||
|
EXPECT_EQ(deviceAot.hwInfo->platform.eProductFamily, exeEnv.rootDeviceEnvironments[0]->getHardwareInfo()->platform.eProductFamily);
|
||||||
|
}
|
||||||
|
|
||||||
|
HWTEST_F(PrepareDeviceEnvironmentsTest, givenPrepareDeviceEnvironmentsAndUnknownProductFamilyWhenCsrIsSetToValidTypeThenTheFunctionReturnsTheExpectedValueOfHardwareInfo) {
|
||||||
|
uint32_t expectedDevices = 1;
|
||||||
|
DebugManager.flags.CreateMultipleRootDevices.set(expectedDevices);
|
||||||
|
for (int csrTypes = 0; csrTypes <= CSR_TYPES_NUM; csrTypes++) {
|
||||||
|
CommandStreamReceiverType csrType = static_cast<CommandStreamReceiverType>(csrTypes);
|
||||||
|
std::string productFamily("unk");
|
||||||
|
|
||||||
|
DebugManager.flags.SetCommandStreamReceiver.set(csrType);
|
||||||
|
DebugManager.flags.ProductFamilyOverride.set(productFamily);
|
||||||
|
MockExecutionEnvironment exeEnv;
|
||||||
|
exeEnv.prepareRootDeviceEnvironments(expectedDevices);
|
||||||
|
|
||||||
|
auto ret = prepareDeviceEnvironments(exeEnv);
|
||||||
|
EXPECT_EQ(expectedDevices, exeEnv.rootDeviceEnvironments.size());
|
||||||
|
for (auto i = 0u; i < expectedDevices; i++) {
|
||||||
|
hwInfo = exeEnv.rootDeviceEnvironments[i]->getHardwareInfo();
|
||||||
|
|
||||||
|
switch (csrType) {
|
||||||
|
case CSR_HW:
|
||||||
|
case CSR_HW_WITH_AUB:
|
||||||
|
EXPECT_TRUE(ret);
|
||||||
|
break;
|
||||||
|
case CSR_AUB:
|
||||||
|
case CSR_TBX:
|
||||||
|
case CSR_TBX_WITH_AUB: {
|
||||||
|
EXPECT_TRUE(ret);
|
||||||
|
EXPECT_NE(nullptr, hwInfo);
|
||||||
|
for (i = 0; i < IGFX_MAX_PRODUCT; i++) {
|
||||||
|
auto hardwareInfo = hardwareInfoTable[i];
|
||||||
|
if (hardwareInfo == nullptr)
|
||||||
|
continue;
|
||||||
|
if (hardwareInfoTable[i]->platform.eProductFamily == hwInfo->platform.eProductFamily)
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
EXPECT_TRUE(i < IGFX_MAX_PRODUCT);
|
||||||
|
ASSERT_NE(nullptr, hardwarePrefix[i]);
|
||||||
|
HardwareInfo baseHwInfo = *defaultHwInfo;
|
||||||
|
baseHwInfo.featureTable = {};
|
||||||
|
baseHwInfo.workaroundTable = {};
|
||||||
|
baseHwInfo.gtSystemInfo = {};
|
||||||
|
hardwareInfoSetup[baseHwInfo.platform.eProductFamily](&baseHwInfo, true, 0x0);
|
||||||
|
HwInfoConfig *hwConfig = HwInfoConfig::get(baseHwInfo.platform.eProductFamily);
|
||||||
|
hwConfig->configureHardwareCustom(&baseHwInfo, nullptr);
|
||||||
|
EXPECT_EQ(0, memcmp(&baseHwInfo.platform, &hwInfo->platform, sizeof(PLATFORM)));
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
default:
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
} // namespace NEO
|
|
@ -223,6 +223,17 @@ TEST_F(ProductConfigHelperTests, GivenDifferentReleasesInDeviceAotInfosWhenCompa
|
||||||
EXPECT_FALSE(lhs == rhs);
|
EXPECT_FALSE(lhs == rhs);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
TEST_F(ProductConfigHelperTests, GivenDifferentHwInfoInDeviceAotInfosWhenComparingThemThenFalseIsReturned) {
|
||||||
|
DeviceAotInfo lhs{};
|
||||||
|
DeviceAotInfo rhs{};
|
||||||
|
|
||||||
|
lhs.hwInfo = NEO::defaultHwInfo.get();
|
||||||
|
EXPECT_FALSE(lhs == rhs);
|
||||||
|
|
||||||
|
rhs.hwInfo = NEO::defaultHwInfo.get();
|
||||||
|
ASSERT_TRUE(lhs == rhs);
|
||||||
|
}
|
||||||
|
|
||||||
struct AotDeviceInfoTests : public ::testing::Test {
|
struct AotDeviceInfoTests : public ::testing::Test {
|
||||||
AotDeviceInfoTests() {
|
AotDeviceInfoTests() {
|
||||||
productConfigHelper = std::make_unique<ProductConfigHelper>();
|
productConfigHelper = std::make_unique<ProductConfigHelper>();
|
||||||
|
@ -476,3 +487,21 @@ TEST_F(AotDeviceInfoTests, givenClearedProductAcronymWhenSearchInRepresentativeA
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
TEST_F(AotDeviceInfoTests, givenProductConfigWhenGetDeviceAotInfoThenCorrectValuesAreReturned) {
|
||||||
|
auto &enabledProducts = productConfigHelper->getDeviceAotInfo();
|
||||||
|
DeviceAotInfo aotInfo{};
|
||||||
|
|
||||||
|
for (auto &product : enabledProducts) {
|
||||||
|
auto productConfig = static_cast<AOT::PRODUCT_CONFIG>(product.aotConfig.ProductConfig);
|
||||||
|
EXPECT_TRUE(productConfigHelper->getDeviceAotInfoForProductConfig(productConfig, aotInfo));
|
||||||
|
EXPECT_TRUE(aotInfo == product);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
TEST_F(AotDeviceInfoTests, givenUnknownIsaWhenGetDeviceAotInfoThenFalseIsReturned) {
|
||||||
|
DeviceAotInfo aotInfo{}, emptyInfo{};
|
||||||
|
|
||||||
|
EXPECT_FALSE(productConfigHelper->getDeviceAotInfoForProductConfig(AOT::UNKNOWN_ISA, aotInfo));
|
||||||
|
EXPECT_TRUE(aotInfo == emptyInfo);
|
||||||
|
}
|
||||||
|
|
Loading…
Reference in New Issue