mirror of
https://github.com/intel/compute-runtime.git
synced 2025-12-22 10:17:01 +08:00
Cleaned up files: level_zero/core/source/driver/driver.h level_zero/tools/source/sysman/fabric_port/windows/os_fabric_port_imp.h level_zero/tools/source/sysman/pci/os_pci.h shared/source/debug_settings/debug_settings_manager.h shared/source/gmm_helper/page_table_mngr.h shared/source/gmm_helper/windows/gmm_memory_base.h shared/source/kernel/kernel_arg_metadata.h shared/test/common/libult/linux/drm_mock.h shared/test/unit_test/fixtures/command_container_fixture.h shared/test/unit_test/fixtures/product_config_fixture.h shared/test/unit_test/helpers/simd_helper_tests_pvc_and_later.inl shared/test/unit_test/os_interface/hw_info_config_tests.h Related-To: NEO-5548 Signed-off-by: Warchulski, Jaroslaw <jaroslaw.warchulski@intel.com>
71 lines
3.1 KiB
C++
71 lines
3.1 KiB
C++
/*
|
|
* Copyright (C) 2022-2023 Intel Corporation
|
|
*
|
|
* SPDX-License-Identifier: MIT
|
|
*
|
|
*/
|
|
|
|
#include "shared/source/helpers/compiler_product_helper.h"
|
|
#include "shared/test/common/mocks/mock_execution_environment.h"
|
|
#include "shared/test/common/test_macros/hw_test.h"
|
|
#include "shared/test/unit_test/fixtures/product_config_fixture.h"
|
|
|
|
using namespace NEO;
|
|
|
|
HWTEST2_P(ProductConfigHwInfoBadArchTests, givenAotConfigWithIncorrectArchWhenGetProductConfigThenUnknownIsaIsReturned, IsAtLeastMtl) {
|
|
HardwareIpVersion aotConfig = {0};
|
|
aotConfig.value = productConfig;
|
|
hwInfo.ipVersion.architecture = invalidConfig.architecture;
|
|
hwInfo.ipVersion.release = aotConfig.release;
|
|
hwInfo.ipVersion.revision = aotConfig.revision;
|
|
auto ret = productHelper->getProductConfigFromHwInfo(hwInfo);
|
|
EXPECT_EQ(ret, AOT::UNKNOWN_ISA);
|
|
}
|
|
|
|
HWTEST2_P(ProductConfigHwInfoBadRevisionTests, givenAotConfigWithIncorrectRevisionIdWhenGetProductConfigThenUnknownIsaIsReturned, IsAtLeastMtl) {
|
|
HardwareIpVersion aotConfig = {0};
|
|
aotConfig.value = productConfig;
|
|
hwInfo.ipVersion.architecture = aotConfig.architecture;
|
|
hwInfo.ipVersion.release = aotConfig.release;
|
|
hwInfo.ipVersion.revision = invalidConfig.revision;
|
|
auto ret = productHelper->getProductConfigFromHwInfo(hwInfo);
|
|
EXPECT_EQ(ret, AOT::UNKNOWN_ISA);
|
|
}
|
|
|
|
HWTEST2_P(ProductConfigHwInfoTests, givenAotConfigWhenSetHwInfoGmdIdThenCorrectValueIsSet, IsAtLeastMtl) {
|
|
HardwareIpVersion aotConfig = {0};
|
|
aotConfig.value = productConfig;
|
|
MockExecutionEnvironment mockExecutionEnvironment{};
|
|
auto &compilerProductHelper = mockExecutionEnvironment.rootDeviceEnvironments[0]->getHelper<CompilerProductHelper>();
|
|
compilerProductHelper.setProductConfigForHwInfo(hwInfo, aotConfig);
|
|
EXPECT_EQ(hwInfo.ipVersion.architecture, aotConfig.architecture);
|
|
EXPECT_EQ(hwInfo.ipVersion.release, aotConfig.release);
|
|
EXPECT_EQ(hwInfo.ipVersion.revision, aotConfig.revision);
|
|
}
|
|
|
|
HWTEST2_P(ProductConfigHwInfoTests, givenAotConfigWithIncorrectReleaseWhenGetProductConfigThenUnknownIsaIsReturned, IsAtLeastMtl) {
|
|
HardwareIpVersion aotConfig = {0};
|
|
aotConfig.value = productConfig;
|
|
hwInfo.ipVersion.architecture = aotConfig.architecture;
|
|
hwInfo.ipVersion.release = invalidConfig.release;
|
|
hwInfo.ipVersion.revision = aotConfig.revision;
|
|
|
|
auto ret = productHelper->getProductConfigFromHwInfo(hwInfo);
|
|
EXPECT_EQ(ret, AOT::UNKNOWN_ISA);
|
|
}
|
|
|
|
HWTEST2_P(ProductConfigHwInfoTests, givenUnknownAotConfigWhenGetProductConfigThenUnknownIsaIsReturned, IsAtLeastMtl) {
|
|
hwInfo.ipVersion = {};
|
|
auto ret = productHelper->getProductConfigFromHwInfo(hwInfo);
|
|
EXPECT_EQ(ret, AOT::UNKNOWN_ISA);
|
|
}
|
|
|
|
HWTEST2_P(ProductConfigHwInfoTests, givenAotConfigWhenGetProductConfigThenCorrectValueIsReturned, IsAtLeastMtl) {
|
|
HardwareIpVersion aotConfig = {0};
|
|
aotConfig.value = productConfig;
|
|
hwInfo.ipVersion.architecture = aotConfig.architecture;
|
|
hwInfo.ipVersion.release = aotConfig.release;
|
|
hwInfo.ipVersion.revision = aotConfig.revision;
|
|
auto ret = productHelper->getProductConfigFromHwInfo(hwInfo);
|
|
EXPECT_EQ(ret, productConfig);
|
|
} |