mirror of
https://github.com/intel/compute-runtime.git
synced 2026-01-03 14:55:24 +08:00
Revert "Ocloc: New AOT approach implementation"
This reverts commit a44f1b43aa.
Signed-off-by: Compute-Runtime-Validation <compute-runtime-validation@intel.com>
This commit is contained in:
committed by
Compute-Runtime-Automation
parent
51726dc32c
commit
cca1dbecbc
@@ -7,39 +7,20 @@
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "shared/source/helpers/constants.h"
|
||||
#include "shared/source/helpers/product_config_helper.h"
|
||||
#include "shared/source/os_interface/hw_info_config.h"
|
||||
#include "shared/source/xe_hpc_core/hw_cmds_base.h"
|
||||
#include "shared/test/common/helpers/default_hw_info.h"
|
||||
#include "shared/test/common/test_macros/test.h"
|
||||
|
||||
using namespace NEO;
|
||||
|
||||
template <typename T>
|
||||
struct ProductConfigTest : public T {
|
||||
struct ProductConfigTests : public ::testing::Test {
|
||||
void SetUp() override {
|
||||
T::SetUp();
|
||||
hwInfo = *NEO::defaultHwInfo;
|
||||
hwInfoConfig = NEO::HwInfoConfig::get(productFamily);
|
||||
}
|
||||
|
||||
NEO::HwInfoConfig *hwInfoConfig = nullptr;
|
||||
NEO::HardwareInfo hwInfo = {};
|
||||
AOT::PRODUCT_CONFIG productConfig = AOT::UNKNOWN_ISA;
|
||||
};
|
||||
|
||||
struct ProductConfigHwInfoTests : public ProductConfigTest<::testing::TestWithParam<std::tuple<AOT::PRODUCT_CONFIG, PRODUCT_FAMILY>>> {
|
||||
void SetUp() override {
|
||||
ProductConfigTest::SetUp();
|
||||
std::tie(productConfig, prod) = GetParam();
|
||||
if (prod != productFamily) {
|
||||
GTEST_SKIP();
|
||||
}
|
||||
}
|
||||
PRODUCT_FAMILY prod = IGFX_UNKNOWN;
|
||||
const AheadOfTimeConfig invalidConfig = {CommonConstants::invalidRevisionID};
|
||||
};
|
||||
|
||||
using ProductConfigTests = ProductConfigTest<::testing::Test>;
|
||||
using ProductConfigHwInfoBadRevisionTests = ProductConfigHwInfoTests;
|
||||
using ProductConfigHwInfoBadArchTests = ProductConfigHwInfoTests;
|
||||
PRODUCT_CONFIG productConfig = UNKNOWN_ISA;
|
||||
};
|
||||
@@ -107,8 +107,8 @@ uint32_t HwInfoConfigHw<IGFX_UNKNOWN>::getHwRevIdFromStepping(uint32_t stepping,
|
||||
}
|
||||
|
||||
template <>
|
||||
AOT::PRODUCT_CONFIG HwInfoConfigHw<IGFX_UNKNOWN>::getProductConfigFromHwInfo(const HardwareInfo &hwInfo) const {
|
||||
return AOT::UNKNOWN_ISA;
|
||||
PRODUCT_CONFIG HwInfoConfigHw<IGFX_UNKNOWN>::getProductConfigFromHwInfo(const HardwareInfo &hwInfo) const {
|
||||
return UNKNOWN_ISA;
|
||||
}
|
||||
|
||||
template <>
|
||||
|
||||
@@ -1,15 +0,0 @@
|
||||
#
|
||||
# Copyright (C) 2022 Intel Corporation
|
||||
#
|
||||
# SPDX-License-Identifier: MIT
|
||||
#
|
||||
|
||||
if(TESTS_PVC)
|
||||
set(NEO_CORE_TESTS_PVC
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/CMakeLists.txt
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/product_configs_pvc.h
|
||||
)
|
||||
set_property(GLOBAL PROPERTY NEO_CORE_TESTS_PVC ${NEO_CORE_TESTS_PVC})
|
||||
target_sources(${TARGET_NAME} PRIVATE ${NEO_CORE_TESTS_PVC})
|
||||
|
||||
endif()
|
||||
@@ -1,19 +0,0 @@
|
||||
/*
|
||||
* Copyright (C) 2022 Intel Corporation
|
||||
*
|
||||
* SPDX-License-Identifier: MIT
|
||||
*
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
#include "platforms.h"
|
||||
|
||||
namespace AOT_PVC {
|
||||
constexpr AOT::PRODUCT_CONFIG productConfigs[] = {
|
||||
AOT::PVC_XL_A0,
|
||||
AOT::PVC_XL_A0P,
|
||||
AOT::PVC_XT_A0,
|
||||
AOT::PVC_XT_B0,
|
||||
AOT::PVC_XT_B1,
|
||||
AOT::PVC_XT_C0};
|
||||
}
|
||||
@@ -13,7 +13,6 @@ if(TESTS_DG2)
|
||||
set(NEO_CORE_TESTS_XE_HPG_CORE_DG2
|
||||
${IGDRCL_SRCS_tests_xe_hpg_core_dg2_excludes}
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/CMakeLists.txt
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/product_configs_dg2.h
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/test_encode_dispatch_kernel_dg2.cpp
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/test_hw_info_config_dg2.cpp
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/test_hw_helper_dg2.cpp
|
||||
@@ -22,5 +21,4 @@ if(TESTS_DG2)
|
||||
)
|
||||
|
||||
target_sources(${TARGET_NAME} PRIVATE ${NEO_CORE_TESTS_XE_HPG_CORE_DG2})
|
||||
add_subdirectories()
|
||||
endif()
|
||||
|
||||
@@ -1,20 +0,0 @@
|
||||
/*
|
||||
* Copyright (C) 2022 Intel Corporation
|
||||
*
|
||||
* SPDX-License-Identifier: MIT
|
||||
*
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
#include "platforms.h"
|
||||
|
||||
namespace AOT_DG2 {
|
||||
constexpr AOT::PRODUCT_CONFIG productConfigs[] = {
|
||||
AOT::DG2_G10_A0,
|
||||
AOT::DG2_G10_A1,
|
||||
AOT::DG2_G10_B0,
|
||||
AOT::DG2_G10_C0,
|
||||
AOT::DG2_G11_A0,
|
||||
AOT::DG2_G11_B0,
|
||||
AOT::DG2_G11_B1};
|
||||
}
|
||||
@@ -59,12 +59,11 @@ TEST(UnpackSingleDeviceBinaryAr, WhenBinaryWithProductConfigIsFoundThenChooseItA
|
||||
PatchTokensTestData::ValidEmptyProgram programTokens;
|
||||
const auto &hwInfoConfig = *NEO::HwInfoConfig::get(productFamily);
|
||||
NEO::HardwareInfo hwInfo = *NEO::defaultHwInfo;
|
||||
AheadOfTimeConfig aotConfig = {0};
|
||||
aotConfig.ProductConfig = hwInfoConfig.getProductConfigFromHwInfo(hwInfo);
|
||||
auto productConfig = hwInfoConfig.getProductConfigFromHwInfo(hwInfo);
|
||||
|
||||
NEO::Ar::ArEncoder encoder;
|
||||
std::string requiredProduct = NEO::hardwarePrefix[productFamily];
|
||||
std::string requiredProductConfig = ProductConfigHelper::parseMajorMinorRevisionValue(aotConfig);
|
||||
std::string requiredProductConfig = NEO::ProductConfigHelper::parseMajorMinorRevisionValue(productConfig);
|
||||
std::string requiredStepping = std::to_string(programTokens.header->SteppingId);
|
||||
std::string requiredPointerSize = (programTokens.header->GPUPointerSizeInBytes == 4) ? "32" : "64";
|
||||
|
||||
@@ -75,7 +74,7 @@ TEST(UnpackSingleDeviceBinaryAr, WhenBinaryWithProductConfigIsFoundThenChooseItA
|
||||
|
||||
NEO::TargetDevice target;
|
||||
target.coreFamily = static_cast<GFXCORE_FAMILY>(programTokens.header->Device);
|
||||
target.aotConfig = aotConfig;
|
||||
target.productConfig = productConfig;
|
||||
target.stepping = programTokens.header->SteppingId;
|
||||
target.maxPointerSizeInBytes = programTokens.header->GPUPointerSizeInBytes;
|
||||
|
||||
@@ -100,12 +99,11 @@ TEST(UnpackSingleDeviceBinaryAr, WhenBinaryWithProductConfigIsFoundThenPackedTar
|
||||
PatchTokensTestData::ValidEmptyProgram programTokens;
|
||||
const auto &hwInfoConfig = *NEO::HwInfoConfig::get(productFamily);
|
||||
NEO::HardwareInfo hwInfo = *NEO::defaultHwInfo;
|
||||
AheadOfTimeConfig aotConfig = {0};
|
||||
aotConfig.ProductConfig = hwInfoConfig.getProductConfigFromHwInfo(hwInfo);
|
||||
auto productConfig = hwInfoConfig.getProductConfigFromHwInfo(hwInfo);
|
||||
|
||||
NEO::Ar::ArEncoder encoder;
|
||||
std::string requiredProduct = NEO::hardwarePrefix[productFamily];
|
||||
std::string requiredProductConfig = ProductConfigHelper::parseMajorMinorRevisionValue(aotConfig);
|
||||
std::string requiredProductConfig = NEO::ProductConfigHelper::parseMajorMinorRevisionValue(productConfig);
|
||||
std::string requiredStepping = std::to_string(programTokens.header->SteppingId);
|
||||
std::string requiredPointerSize = (programTokens.header->GPUPointerSizeInBytes == 4) ? "32" : "64";
|
||||
|
||||
@@ -116,7 +114,7 @@ TEST(UnpackSingleDeviceBinaryAr, WhenBinaryWithProductConfigIsFoundThenPackedTar
|
||||
|
||||
NEO::TargetDevice target;
|
||||
target.coreFamily = static_cast<GFXCORE_FAMILY>(programTokens.header->Device);
|
||||
target.aotConfig = aotConfig;
|
||||
target.productConfig = productConfig;
|
||||
target.stepping = programTokens.header->SteppingId;
|
||||
target.maxPointerSizeInBytes = programTokens.header->GPUPointerSizeInBytes;
|
||||
|
||||
@@ -131,14 +129,13 @@ TEST(UnpackSingleDeviceBinaryAr, WhenMultipleBinariesMatchedThenChooseBestMatch)
|
||||
PatchTokensTestData::ValidEmptyProgram programTokens;
|
||||
const auto &hwInfoConfig = *NEO::HwInfoConfig::get(productFamily);
|
||||
NEO::HardwareInfo hwInfo = *NEO::defaultHwInfo;
|
||||
AheadOfTimeConfig aotConfig = {0};
|
||||
aotConfig.ProductConfig = hwInfoConfig.getProductConfigFromHwInfo(hwInfo);
|
||||
auto productConfig = hwInfoConfig.getProductConfigFromHwInfo(hwInfo);
|
||||
|
||||
NEO::Ar::ArEncoder encoder;
|
||||
std::string requiredProduct = NEO::hardwarePrefix[productFamily];
|
||||
std::string requiredStepping = std::to_string(programTokens.header->SteppingId);
|
||||
std::string requiredPointerSize = (programTokens.header->GPUPointerSizeInBytes == 4) ? "32" : "64";
|
||||
std::string requiredProductConfig = ProductConfigHelper::parseMajorMinorRevisionValue(aotConfig);
|
||||
std::string requiredProductConfig = NEO::ProductConfigHelper::parseMajorMinorRevisionValue(productConfig);
|
||||
|
||||
ASSERT_TRUE(encoder.appendFileEntry(requiredPointerSize, programTokens.storage));
|
||||
ASSERT_TRUE(encoder.appendFileEntry(requiredPointerSize + "." + requiredProduct, programTokens.storage));
|
||||
@@ -147,7 +144,7 @@ TEST(UnpackSingleDeviceBinaryAr, WhenMultipleBinariesMatchedThenChooseBestMatch)
|
||||
|
||||
NEO::TargetDevice target;
|
||||
target.coreFamily = static_cast<GFXCORE_FAMILY>(programTokens.header->Device);
|
||||
target.aotConfig.ProductConfig = hwInfoConfig.getProductConfigFromHwInfo(hwInfo);
|
||||
target.productConfig = hwInfoConfig.getProductConfigFromHwInfo(hwInfo);
|
||||
target.stepping = programTokens.header->SteppingId;
|
||||
target.maxPointerSizeInBytes = programTokens.header->GPUPointerSizeInBytes;
|
||||
|
||||
@@ -240,10 +237,9 @@ TEST(UnpackSingleDeviceBinaryAr, WhenFailedToUnpackMatchWithProductConfigThenTry
|
||||
|
||||
const auto &hwInfoConfig = *NEO::HwInfoConfig::get(productFamily);
|
||||
NEO::HardwareInfo hwInfo = *NEO::defaultHwInfo;
|
||||
AheadOfTimeConfig aotConfig = {0};
|
||||
aotConfig.ProductConfig = hwInfoConfig.getProductConfigFromHwInfo(hwInfo);
|
||||
auto productConfig = hwInfoConfig.getProductConfigFromHwInfo(hwInfo);
|
||||
|
||||
std::string requiredProductConfig = ProductConfigHelper::parseMajorMinorRevisionValue(aotConfig);
|
||||
std::string requiredProductConfig = NEO::ProductConfigHelper::parseMajorMinorRevisionValue(productConfig);
|
||||
|
||||
programTokensWrongTokenVersion.headerMutable->Version -= 1;
|
||||
NEO::Ar::ArEncoder encoder;
|
||||
@@ -258,7 +254,7 @@ TEST(UnpackSingleDeviceBinaryAr, WhenFailedToUnpackMatchWithProductConfigThenTry
|
||||
|
||||
NEO::TargetDevice target;
|
||||
target.coreFamily = static_cast<GFXCORE_FAMILY>(programTokens.header->Device);
|
||||
target.aotConfig.ProductConfig = hwInfoConfig.getProductConfigFromHwInfo(hwInfo);
|
||||
target.productConfig = hwInfoConfig.getProductConfigFromHwInfo(hwInfo);
|
||||
target.stepping = programTokens.header->SteppingId;
|
||||
target.maxPointerSizeInBytes = programTokens.header->GPUPointerSizeInBytes;
|
||||
|
||||
@@ -348,10 +344,9 @@ TEST(UnpackSingleDeviceBinaryAr, WhenDeviceBinaryNotMatchedButIrWithProductConfi
|
||||
PatchTokensTestData::ValidEmptyProgram programTokens;
|
||||
const auto &hwInfoConfig = *NEO::HwInfoConfig::get(productFamily);
|
||||
NEO::HardwareInfo hwInfo = *NEO::defaultHwInfo;
|
||||
AheadOfTimeConfig aotConfig = {0};
|
||||
aotConfig.ProductConfig = hwInfoConfig.getProductConfigFromHwInfo(hwInfo);
|
||||
auto productConfig = hwInfoConfig.getProductConfigFromHwInfo(hwInfo);
|
||||
|
||||
std::string requiredProductConfig = ProductConfigHelper::parseMajorMinorRevisionValue(aotConfig);
|
||||
std::string requiredProductConfig = NEO::ProductConfigHelper::parseMajorMinorRevisionValue(productConfig);
|
||||
std::string requiredProduct = NEO::hardwarePrefix[productFamily];
|
||||
std::string requiredStepping = std::to_string(programTokens.header->SteppingId);
|
||||
std::string requiredPointerSize = (programTokens.header->GPUPointerSizeInBytes == 4) ? "32" : "64";
|
||||
@@ -368,7 +363,7 @@ TEST(UnpackSingleDeviceBinaryAr, WhenDeviceBinaryNotMatchedButIrWithProductConfi
|
||||
target.coreFamily = static_cast<GFXCORE_FAMILY>(programTokens.header->Device);
|
||||
target.stepping = programTokens.header->SteppingId;
|
||||
target.maxPointerSizeInBytes = programTokens.header->GPUPointerSizeInBytes;
|
||||
target.aotConfig.ProductConfig = hwInfoConfig.getProductConfigFromHwInfo(hwInfo);
|
||||
target.productConfig = hwInfoConfig.getProductConfigFromHwInfo(hwInfo);
|
||||
|
||||
auto arData = encoder.encode();
|
||||
std::string unpackErrors;
|
||||
@@ -572,10 +567,9 @@ TEST(UnpackSingleDeviceBinaryAr, WhenCouldNotFindBinaryWithRightPointerSizeThenU
|
||||
|
||||
const auto &hwInfoConfig = *NEO::HwInfoConfig::get(productFamily);
|
||||
NEO::HardwareInfo hwInfo = *NEO::defaultHwInfo;
|
||||
AheadOfTimeConfig aotConfig = {0};
|
||||
aotConfig.ProductConfig = hwInfoConfig.getProductConfigFromHwInfo(hwInfo);
|
||||
auto productConfig = hwInfoConfig.getProductConfigFromHwInfo(hwInfo);
|
||||
|
||||
std::string requiredProductConfig = ProductConfigHelper::parseMajorMinorRevisionValue(aotConfig);
|
||||
std::string requiredProductConfig = NEO::ProductConfigHelper::parseMajorMinorRevisionValue(productConfig);
|
||||
std::string requiredProduct = NEO::hardwarePrefix[productFamily];
|
||||
std::string requiredStepping = std::to_string(programTokens.header->SteppingId);
|
||||
std::string requiredPointerSize = (programTokens.header->GPUPointerSizeInBytes == 4) ? "32" : "64";
|
||||
@@ -591,7 +585,7 @@ TEST(UnpackSingleDeviceBinaryAr, WhenCouldNotFindBinaryWithRightPointerSizeThenU
|
||||
target.coreFamily = static_cast<GFXCORE_FAMILY>(programTokens.header->Device);
|
||||
target.stepping = programTokens.header->SteppingId;
|
||||
target.maxPointerSizeInBytes = programTokens.header->GPUPointerSizeInBytes;
|
||||
target.aotConfig = aotConfig;
|
||||
target.productConfig = productConfig;
|
||||
|
||||
auto arData = encoder.encode();
|
||||
std::string unpackErrors;
|
||||
|
||||
@@ -23,7 +23,6 @@ set(IGDRCL_SRCS_tests_helpers
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/gtest_helpers.h
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/l3_range_tests.cpp
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/memory_management_tests.cpp
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/product_config_helper_tests.cpp
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/ptr_math_tests.cpp
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/raii_hw_helper.h
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/static_size3.h
|
||||
|
||||
@@ -1,51 +0,0 @@
|
||||
/*
|
||||
* Copyright (C) 2022 Intel Corporation
|
||||
*
|
||||
* SPDX-License-Identifier: MIT
|
||||
*
|
||||
*/
|
||||
|
||||
#include "shared/source/helpers/product_config_helper.h"
|
||||
#include "shared/test/common/test_macros/test.h"
|
||||
|
||||
using ProductConfigHelperTests = ::testing::Test;
|
||||
|
||||
TEST_F(ProductConfigHelperTests, givenProductAcronymWhenHelperSearchForAMatchThenCorrespondingValueIsReturned) {
|
||||
for (const auto &product : AOT::productConfigAcronyms) {
|
||||
EXPECT_EQ(ProductConfigHelper::returnProductConfigForAcronym(product.first), product.second);
|
||||
}
|
||||
}
|
||||
|
||||
TEST_F(ProductConfigHelperTests, givenReleaseAcronymWhenHelperSearchForAMatchThenCorrespondingValueIsReturned) {
|
||||
for (const auto &release : AOT::releaseAcronyms) {
|
||||
EXPECT_EQ(ProductConfigHelper::returnReleaseForAcronym(release.first), release.second);
|
||||
}
|
||||
}
|
||||
|
||||
TEST_F(ProductConfigHelperTests, givenFamilyAcronymWhenHelperSearchForAMatchThenCorrespondingValueIsReturned) {
|
||||
for (const auto &family : AOT::familyAcronyms) {
|
||||
EXPECT_EQ(ProductConfigHelper::returnFamilyForAcronym(family.first), family.second);
|
||||
}
|
||||
}
|
||||
|
||||
TEST_F(ProductConfigHelperTests, givenUnknownAcronymWhenHelperSearchForAMatchThenUnknownEnumValueIsReturned) {
|
||||
EXPECT_EQ(ProductConfigHelper::returnProductConfigForAcronym("unk"), AOT::UNKNOWN_ISA);
|
||||
EXPECT_EQ(ProductConfigHelper::returnReleaseForAcronym("unk"), AOT::UNKNOWN_RELEASE);
|
||||
EXPECT_EQ(ProductConfigHelper::returnFamilyForAcronym("unk"), AOT::UNKNOWN_FAMILY);
|
||||
}
|
||||
|
||||
TEST_F(ProductConfigHelperTests, givenFamilyEnumWhenHelperSearchForAMatchThenCorrespondingAcronymIsReturned) {
|
||||
for (const auto &family : AOT::familyAcronyms) {
|
||||
EXPECT_EQ(ProductConfigHelper::getAcronymForAFamily(family.second), family.first);
|
||||
}
|
||||
}
|
||||
|
||||
TEST_F(ProductConfigHelperTests, givenUnknownFamilyEnumWhenHelperSearchForAMatchThenEmptyAcronymIsReturned) {
|
||||
auto acronym = ProductConfigHelper::getAcronymForAFamily(AOT::UNKNOWN_FAMILY);
|
||||
EXPECT_TRUE(acronym.empty());
|
||||
}
|
||||
|
||||
TEST_F(ProductConfigHelperTests, givenUnknownIsaEnumWhenParseMajorMinorRevisionValueThenCorrectStringIsReturned) {
|
||||
auto unknownIsa = ProductConfigHelper::parseMajorMinorRevisionValue(AOT::UNKNOWN_ISA);
|
||||
EXPECT_STREQ(unknownIsa.c_str(), "0.0.0");
|
||||
}
|
||||
@@ -5,7 +5,6 @@
|
||||
*
|
||||
*/
|
||||
|
||||
#include "shared/source/helpers/compiler_hw_info_config.h"
|
||||
#include "shared/source/os_interface/hw_info_config.h"
|
||||
#include "shared/test/common/helpers/debug_manager_state_restore.h"
|
||||
#include "shared/test/common/test_macros/test.h"
|
||||
@@ -48,6 +47,11 @@ HWTEST_F(HwInfoConfigTest, givenHwInfoConfigWhenGetThreadEuRatioForScratchThen8I
|
||||
EXPECT_EQ(8u, hwInfoConfig.getThreadEuRatioForScratch(*defaultHwInfo));
|
||||
}
|
||||
|
||||
HWTEST_F(HwInfoConfigTest, givenHwInfoConfigWhenGetProductConfigThenCorrectMatchIsFound) {
|
||||
const auto &hwInfoConfig = *HwInfoConfig::get(defaultHwInfo->platform.eProductFamily);
|
||||
EXPECT_NE(hwInfoConfig.getProductConfigFromHwInfo(*defaultHwInfo), UNKNOWN_ISA);
|
||||
}
|
||||
|
||||
HWTEST_F(HwInfoConfigTest, whenIsGrfNumReportedWithScmIsQueriedThenTrueIsReturned) {
|
||||
const auto &hwInfoConfig = *HwInfoConfig::get(defaultHwInfo->platform.eProductFamily);
|
||||
EXPECT_TRUE(hwInfoConfig.isGrfNumReportedWithScm());
|
||||
@@ -84,17 +88,3 @@ HWTEST2_F(HwInfoConfigTest, givenHwInfoConfigWhenIsImplicitScalingSupportedThenE
|
||||
const auto &hwInfoConfig = *HwInfoConfig::get(defaultHwInfo->platform.eProductFamily);
|
||||
EXPECT_FALSE(hwInfoConfig.isImplicitScalingSupported(*defaultHwInfo));
|
||||
}
|
||||
|
||||
HWTEST2_F(HwInfoConfigTest, givenHwInfoConfigWhenGetProductConfigThenCorrectMatchIsFound, IsAtMostXeHpCore) {
|
||||
const auto &hwInfoConfig = *HwInfoConfig::get(defaultHwInfo->platform.eProductFamily);
|
||||
EXPECT_NE(hwInfoConfig.getProductConfigFromHwInfo(*defaultHwInfo), AOT::UNKNOWN_ISA);
|
||||
}
|
||||
|
||||
HWTEST2_F(HwInfoConfigTest, givenAotConfigWhenSetHwInfoRevisionIdThenCorrectValueIsSet, IsAtMostXeHpCore) {
|
||||
const auto &hwInfoConfig = *HwInfoConfig::get(defaultHwInfo->platform.eProductFamily);
|
||||
auto productConfig = hwInfoConfig.getProductConfigFromHwInfo(*defaultHwInfo);
|
||||
AheadOfTimeConfig aotConfig = {0};
|
||||
aotConfig.ProductConfig = productConfig;
|
||||
CompilerHwInfoConfig::get(defaultHwInfo->platform.eProductFamily)->setProductConfigForHwInfo(*defaultHwInfo, aotConfig);
|
||||
EXPECT_EQ(defaultHwInfo->platform.usRevId, aotConfig.ProductConfigID.Revision);
|
||||
}
|
||||
@@ -24,12 +24,8 @@ PVCTEST_F(PvcUnpackSingleDeviceBinaryAr, WhenFailedToUnpackMatchWithPvcProductCo
|
||||
PatchTokensTestData::ValidEmptyProgram programTokens;
|
||||
PatchTokensTestData::ValidEmptyProgram programTokensWrongTokenVersion;
|
||||
|
||||
AheadOfTimeConfig aotConfig0{}, aotConfig1{};
|
||||
aotConfig0.ProductConfig = AOT::PVC_XL_A0;
|
||||
aotConfig1.ProductConfig = AOT::PVC_XL_A0P;
|
||||
|
||||
std::string requiredProductConfig = ProductConfigHelper::parseMajorMinorRevisionValue(aotConfig0);
|
||||
std::string anotherProductConfig = ProductConfigHelper::parseMajorMinorRevisionValue(aotConfig1);
|
||||
std::string requiredProductConfig = NEO::ProductConfigHelper::parseMajorMinorRevisionValue(PVC_XL_A0);
|
||||
std::string anotherProductConfig = NEO::ProductConfigHelper::parseMajorMinorRevisionValue(PVC_XL_A0P);
|
||||
|
||||
programTokensWrongTokenVersion.headerMutable->Version -= 1;
|
||||
NEO::Ar::ArEncoder encoder;
|
||||
@@ -45,7 +41,7 @@ PVCTEST_F(PvcUnpackSingleDeviceBinaryAr, WhenFailedToUnpackMatchWithPvcProductCo
|
||||
|
||||
NEO::TargetDevice target;
|
||||
target.coreFamily = static_cast<GFXCORE_FAMILY>(programTokens.header->Device);
|
||||
target.aotConfig = aotConfig0;
|
||||
target.productConfig = PVC_XL_A0;
|
||||
target.stepping = programTokens.header->SteppingId;
|
||||
target.maxPointerSizeInBytes = programTokens.header->GPUPointerSizeInBytes;
|
||||
|
||||
|
||||
@@ -5,12 +5,9 @@
|
||||
*
|
||||
*/
|
||||
|
||||
#include "shared/source/helpers/compiler_hw_info_config.h"
|
||||
#include "shared/source/os_interface/os_interface.h"
|
||||
#include "shared/test/common/fixtures/product_config_fixture.h"
|
||||
#include "shared/test/common/helpers/default_hw_info.h"
|
||||
#include "shared/test/common/libult/linux/drm_mock.h"
|
||||
#include "shared/test/common/xe_hpc_core/pvc/product_configs_pvc.h"
|
||||
#include "shared/test/unit_test/helpers/gtest_helpers.h"
|
||||
#include "shared/test/unit_test/os_interface/linux/hw_info_config_linux_tests.h"
|
||||
|
||||
@@ -65,12 +62,3 @@ PVCTEST_F(HwInfoConfigTestLinuxPvc, givenHwInfoConfigWhenAskedIfPatIndexProgramm
|
||||
const auto &hwInfoConfig = *HwInfoConfig::get(pInHwInfo.platform.eProductFamily);
|
||||
EXPECT_TRUE(hwInfoConfig.isVmBindPatIndexProgrammingSupported());
|
||||
}
|
||||
|
||||
PVCTEST_F(ProductConfigTests, givenAotConfigWhenSetHwInfoRevisionIdForPvcThenCorrectValueIsSet) {
|
||||
for (const auto &config : AOT_PVC::productConfigs) {
|
||||
AheadOfTimeConfig aotConfig = {0};
|
||||
aotConfig.ProductConfig = config;
|
||||
CompilerHwInfoConfig::get(hwInfo.platform.eProductFamily)->setProductConfigForHwInfo(hwInfo, aotConfig);
|
||||
EXPECT_EQ(hwInfo.platform.usRevId, aotConfig.ProductConfigID.Revision);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -21,15 +21,15 @@ PVCTEST_F(ProductConfigTests, givenPvcXlDeviceIdWhenDifferentRevisionIsPassedThe
|
||||
|
||||
hwInfo.platform.usRevId = 0x0;
|
||||
productConfig = hwInfoConfig->getProductConfigFromHwInfo(hwInfo);
|
||||
EXPECT_EQ(productConfig, AOT::PVC_XL_A0);
|
||||
EXPECT_EQ(productConfig, PVC_XL_A0);
|
||||
|
||||
hwInfo.platform.usRevId = 0x1;
|
||||
productConfig = hwInfoConfig->getProductConfigFromHwInfo(hwInfo);
|
||||
EXPECT_EQ(productConfig, AOT::PVC_XL_A0P);
|
||||
EXPECT_EQ(productConfig, PVC_XL_A0P);
|
||||
|
||||
hwInfo.platform.usRevId = 0x6;
|
||||
productConfig = hwInfoConfig->getProductConfigFromHwInfo(hwInfo);
|
||||
EXPECT_EQ(productConfig, AOT::PVC_XL_A0P);
|
||||
EXPECT_EQ(productConfig, PVC_XL_A0P);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -39,19 +39,19 @@ PVCTEST_F(ProductConfigTests, givenPvcXtDeviceIdWhenDifferentRevisionIsPassedThe
|
||||
|
||||
hwInfo.platform.usRevId = 0x3;
|
||||
productConfig = hwInfoConfig->getProductConfigFromHwInfo(hwInfo);
|
||||
EXPECT_EQ(productConfig, AOT::PVC_XT_A0);
|
||||
EXPECT_EQ(productConfig, PVC_XT_A0);
|
||||
|
||||
hwInfo.platform.usRevId = 0x5;
|
||||
productConfig = hwInfoConfig->getProductConfigFromHwInfo(hwInfo);
|
||||
EXPECT_EQ(productConfig, AOT::PVC_XT_B0);
|
||||
EXPECT_EQ(productConfig, PVC_XT_B0);
|
||||
|
||||
hwInfo.platform.usRevId = 0x6;
|
||||
productConfig = hwInfoConfig->getProductConfigFromHwInfo(hwInfo);
|
||||
EXPECT_EQ(productConfig, AOT::PVC_XT_B1);
|
||||
EXPECT_EQ(productConfig, PVC_XT_B1);
|
||||
|
||||
hwInfo.platform.usRevId = 0x7;
|
||||
productConfig = hwInfoConfig->getProductConfigFromHwInfo(hwInfo);
|
||||
EXPECT_EQ(productConfig, AOT::PVC_XT_C0);
|
||||
EXPECT_EQ(productConfig, PVC_XT_C0);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -60,15 +60,15 @@ PVCTEST_F(ProductConfigTests, givenDefaultDeviceAndRevisionIdWhenGetProductConfi
|
||||
hwInfo.platform.usDeviceID = 0x0;
|
||||
|
||||
productConfig = hwInfoConfig->getProductConfigFromHwInfo(hwInfo);
|
||||
EXPECT_EQ(productConfig, AOT::PVC_XT_C0);
|
||||
EXPECT_EQ(productConfig, PVC_XT_C0);
|
||||
}
|
||||
|
||||
PVCTEST_F(ProductConfigTests, givenInvalidRevisionIdWhenGetProductConfigThenUnknownIsaIsReturned) {
|
||||
hwInfo.platform.usRevId = 0x2;
|
||||
productConfig = hwInfoConfig->getProductConfigFromHwInfo(hwInfo);
|
||||
EXPECT_EQ(productConfig, AOT::UNKNOWN_ISA);
|
||||
EXPECT_EQ(productConfig, UNKNOWN_ISA);
|
||||
|
||||
hwInfo.platform.usRevId = 0x4;
|
||||
productConfig = hwInfoConfig->getProductConfigFromHwInfo(hwInfo);
|
||||
EXPECT_EQ(productConfig, AOT::UNKNOWN_ISA);
|
||||
}
|
||||
EXPECT_EQ(productConfig, UNKNOWN_ISA);
|
||||
}
|
||||
@@ -24,12 +24,8 @@ DG2TEST_F(Dg2UnpackSingleDeviceBinaryAr, WhenFailedToUnpackMatchWithDg2ProductCo
|
||||
PatchTokensTestData::ValidEmptyProgram programTokens;
|
||||
PatchTokensTestData::ValidEmptyProgram programTokensWrongTokenVersion;
|
||||
|
||||
AheadOfTimeConfig aotConfig0{}, aotConfig1{};
|
||||
aotConfig0.ProductConfig = AOT::DG2_G10_A0;
|
||||
aotConfig1.ProductConfig = AOT::DG2_G10_B0;
|
||||
|
||||
std::string requiredProductConfig = ProductConfigHelper::parseMajorMinorRevisionValue(aotConfig0);
|
||||
std::string anotherProductConfig = ProductConfigHelper::parseMajorMinorRevisionValue(aotConfig1);
|
||||
std::string requiredProductConfig = NEO::ProductConfigHelper::parseMajorMinorRevisionValue(DG2_G10_A0);
|
||||
std::string anotherProductConfig = NEO::ProductConfigHelper::parseMajorMinorRevisionValue(DG2_G10_B0);
|
||||
|
||||
programTokensWrongTokenVersion.headerMutable->Version -= 1;
|
||||
NEO::Ar::ArEncoder encoder;
|
||||
@@ -45,7 +41,7 @@ DG2TEST_F(Dg2UnpackSingleDeviceBinaryAr, WhenFailedToUnpackMatchWithDg2ProductCo
|
||||
|
||||
NEO::TargetDevice target;
|
||||
target.coreFamily = static_cast<GFXCORE_FAMILY>(programTokens.header->Device);
|
||||
target.aotConfig = aotConfig0;
|
||||
target.productConfig = DG2_G10_A0;
|
||||
target.stepping = programTokens.header->SteppingId;
|
||||
target.maxPointerSizeInBytes = programTokens.header->GPUPointerSizeInBytes;
|
||||
|
||||
|
||||
@@ -6,7 +6,6 @@
|
||||
*/
|
||||
|
||||
#include "shared/source/command_stream/stream_properties.h"
|
||||
#include "shared/source/helpers/compiler_hw_info_config.h"
|
||||
#include "shared/source/helpers/constants.h"
|
||||
#include "shared/source/helpers/hw_helper.h"
|
||||
#include "shared/source/os_interface/hw_info_config.h"
|
||||
@@ -14,7 +13,6 @@
|
||||
#include "shared/test/common/helpers/debug_manager_state_restore.h"
|
||||
#include "shared/test/common/helpers/default_hw_info.h"
|
||||
#include "shared/test/common/test_macros/test.h"
|
||||
#include "shared/test/common/xe_hpg_core/dg2/product_configs_dg2.h"
|
||||
|
||||
using namespace NEO;
|
||||
|
||||
@@ -411,10 +409,10 @@ DG2TEST_F(ProductConfigTests, givenDg2G11DeviceIdsWhenConfigIsCheckedThenCorrect
|
||||
|
||||
DG2TEST_F(ProductConfigTests, givenInvalidRevisionIdWhenDeviceIdIsDefaultThenUnknownIsaIsReturned) {
|
||||
hwInfo.platform.usDeviceID = 0;
|
||||
hwInfo.platform.usRevId = CommonConstants::invalidRevisionID;
|
||||
hwInfo.platform.usRevId = 0xffff;
|
||||
|
||||
productConfig = hwInfoConfig->getProductConfigFromHwInfo(hwInfo);
|
||||
EXPECT_EQ(productConfig, AOT::UNKNOWN_ISA);
|
||||
EXPECT_EQ(productConfig, UNKNOWN_ISA);
|
||||
}
|
||||
|
||||
DG2TEST_F(ProductConfigTests, givenDg2G10DeviceIdWhenDifferentRevisionIsPassedThenCorrectProductConfigIsReturned) {
|
||||
@@ -423,30 +421,19 @@ DG2TEST_F(ProductConfigTests, givenDg2G10DeviceIdWhenDifferentRevisionIsPassedTh
|
||||
|
||||
hwInfo.platform.usRevId = 0x0;
|
||||
productConfig = hwInfoConfig->getProductConfigFromHwInfo(hwInfo);
|
||||
EXPECT_EQ(productConfig, AOT::DG2_G10_A0);
|
||||
EXPECT_EQ(productConfig, DG2_G10_A0);
|
||||
|
||||
hwInfo.platform.usRevId = 0x1;
|
||||
productConfig = hwInfoConfig->getProductConfigFromHwInfo(hwInfo);
|
||||
EXPECT_EQ(productConfig, AOT::DG2_G10_A1);
|
||||
EXPECT_EQ(productConfig, DG2_G10_A0);
|
||||
|
||||
hwInfo.platform.usRevId = 0x4;
|
||||
productConfig = hwInfoConfig->getProductConfigFromHwInfo(hwInfo);
|
||||
EXPECT_EQ(productConfig, AOT::DG2_G10_B0);
|
||||
EXPECT_EQ(productConfig, DG2_G10_B0);
|
||||
|
||||
hwInfo.platform.usRevId = 0x8;
|
||||
productConfig = hwInfoConfig->getProductConfigFromHwInfo(hwInfo);
|
||||
EXPECT_EQ(productConfig, AOT::DG2_G10_C0);
|
||||
}
|
||||
}
|
||||
|
||||
DG2TEST_F(ProductConfigTests, givenDg2DeviceIdWhenIncorrectRevisionIsPassedThenCorrectProductConfigIsReturned) {
|
||||
for (const auto &dg2 : {DG2_G10_IDS, DG2_G11_IDS}) {
|
||||
for (const auto &deviceId : dg2) {
|
||||
hwInfo.platform.usDeviceID = deviceId;
|
||||
hwInfo.platform.usRevId = CommonConstants::invalidRevisionID;
|
||||
productConfig = hwInfoConfig->getProductConfigFromHwInfo(hwInfo);
|
||||
EXPECT_EQ(productConfig, AOT::UNKNOWN_ISA);
|
||||
}
|
||||
EXPECT_EQ(productConfig, DG2_G10_B0);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -456,23 +443,10 @@ DG2TEST_F(ProductConfigTests, givenDg2G11DeviceIdWhenDifferentRevisionIsPassedTh
|
||||
|
||||
hwInfo.platform.usRevId = 0x0;
|
||||
productConfig = hwInfoConfig->getProductConfigFromHwInfo(hwInfo);
|
||||
EXPECT_EQ(productConfig, AOT::DG2_G11_A0);
|
||||
EXPECT_EQ(productConfig, DG2_G11);
|
||||
|
||||
hwInfo.platform.usRevId = 0x4;
|
||||
productConfig = hwInfoConfig->getProductConfigFromHwInfo(hwInfo);
|
||||
EXPECT_EQ(productConfig, AOT::DG2_G11_B0);
|
||||
|
||||
hwInfo.platform.usRevId = 0x5;
|
||||
productConfig = hwInfoConfig->getProductConfigFromHwInfo(hwInfo);
|
||||
EXPECT_EQ(productConfig, AOT::DG2_G11_B1);
|
||||
}
|
||||
}
|
||||
|
||||
DG2TEST_F(ProductConfigTests, givenAotConfigWhenSetHwInfoRevisionIdForDg2ThenCorrectValueIsSet) {
|
||||
for (const auto &config : AOT_DG2::productConfigs) {
|
||||
AheadOfTimeConfig aotConfig = {0};
|
||||
aotConfig.ProductConfig = config;
|
||||
CompilerHwInfoConfig::get(hwInfo.platform.eProductFamily)->setProductConfigForHwInfo(hwInfo, aotConfig);
|
||||
EXPECT_EQ(hwInfo.platform.usRevId, aotConfig.ProductConfigID.Revision);
|
||||
EXPECT_EQ(productConfig, DG2_G11);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -15,10 +15,10 @@
|
||||
|
||||
using namespace NEO;
|
||||
|
||||
DG2TEST_F(ProductConfigTests, givenDefaultDeviceAndRevisionIdWhenGetProductConfigThenDg2G11A0ConfigIsReturned) {
|
||||
DG2TEST_F(ProductConfigTests, givenDefaultDeviceAndRevisionIdWhenGetProductConfigThenLastKnownDg2ConfigIsReturned) {
|
||||
hwInfo.platform.usRevId = 0x0;
|
||||
hwInfo.platform.usDeviceID = 0x0;
|
||||
|
||||
productConfig = hwInfoConfig->getProductConfigFromHwInfo(hwInfo);
|
||||
EXPECT_EQ(productConfig, AOT::DG2_G11_A0);
|
||||
EXPECT_EQ(productConfig, DG2_G11);
|
||||
}
|
||||
Reference in New Issue
Block a user