Skip to content

Commit

Permalink
Revert "fix: add fallback in setting hw ip version for MTL"
Browse files Browse the repository at this point in the history
This reverts commit 869f1f3.

Signed-off-by: Compute-Runtime-Validation <[email protected]>
  • Loading branch information
Compute-Runtime-Validation authored and Compute-Runtime-Automation committed Dec 23, 2023
1 parent 2f32fe8 commit 3c72253
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 110 deletions.
45 changes: 0 additions & 45 deletions shared/source/xe_hpg_core/enable_compiler_product_helper_mtl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -11,49 +11,4 @@ constexpr auto gfxProduct = IGFX_METEORLAKE;

#include "shared/source/xe_hpg_core/xe_lpg/compiler_product_helper_xe_lpg.inl"

namespace NEO {
template <>
uint32_t CompilerProductHelperHw<gfxProduct>::getProductConfigFromHwInfo(const HardwareInfo &hwInfo) const {
if (hwInfo.ipVersion.value) {
return hwInfo.ipVersion.value;
}
switch (hwInfo.platform.usDeviceID) {
case 0x7D40:
case 0x7D45: {
switch (hwInfo.platform.usRevId) {
case 0x0:
case 0x2:
return AOT::MTL_M_A0;
case 0x3:
case 0x8:
return AOT::MTL_M_B0;
}
break;
}
case 0x7D55:
case 0X7DD5: {
switch (hwInfo.platform.usRevId) {
case 0x0:
case 0x2:
return AOT::MTL_P_A0;
case 0x3:
case 0x8:
return AOT::MTL_P_B0;
}
break;
}
case 0x7D60: {
switch (hwInfo.platform.usRevId) {
case 0x0:
return AOT::MTL_M_A0;
case 0x2:
return AOT::MTL_M_B0;
}
break;
}
}
return getDefaultHwIpVersion();
}
} // namespace NEO

static NEO::EnableCompilerProductHelper<gfxProduct> enableCompilerProductHelperMTL;
Original file line number Diff line number Diff line change
Expand Up @@ -5,18 +5,14 @@
*
*/

#include "shared/source/helpers/compiler_product_helper.h"
#include "shared/source/memory_manager/allocation_properties.h"
#include "shared/source/memory_manager/allocation_type.h"
#include "shared/source/os_interface/product_helper.h"
#include "shared/source/xe_hpg_core/hw_cmds_mtl.h"
#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/product_helper_tests.h"

#include "platforms.h"

using namespace NEO;

using MtlProductHelper = ProductHelperTest;
Expand All @@ -25,71 +21,11 @@ MTLTEST_F(MtlProductHelper, givenProductHelperWhenCheckDirectSubmissionSupported
EXPECT_TRUE(productHelper->isDirectSubmissionSupported(releaseHelper));
}

MTLTEST_F(MtlProductHelper, givenMtlWithoutHwIpVersionInHwInfoWhenGettingIpVersionThenCorrectValueIsReturnedBasedOnDeviceIdAndRevId) {
auto hwInfo = *defaultHwInfo;
hwInfo.ipVersion = {};

auto mtlMDeviceIds = {0x7D40, 0x7D45};
auto mtlPDeviceIds = {0x7D55, 0X7DD5};

hwInfo.platform.usDeviceID = 0x7D60;
hwInfo.platform.usRevId = 0;

EXPECT_EQ(AOT::MTL_M_A0, compilerProductHelper->getHwIpVersion(hwInfo));

hwInfo.platform.usRevId = 2;

EXPECT_EQ(AOT::MTL_M_B0, compilerProductHelper->getHwIpVersion(hwInfo));

hwInfo.platform.usRevId = 0xdead;

EXPECT_EQ(compilerProductHelper->getDefaultHwIpVersion(), compilerProductHelper->getHwIpVersion(hwInfo));

for (auto &deviceId : mtlMDeviceIds) {
hwInfo.platform.usDeviceID = deviceId;
for (auto &revision : {0, 2}) {
hwInfo.platform.usRevId = revision;

EXPECT_EQ(AOT::MTL_M_A0, compilerProductHelper->getHwIpVersion(hwInfo));
}
for (auto &revision : {3, 8}) {
hwInfo.platform.usRevId = revision;

EXPECT_EQ(AOT::MTL_M_B0, compilerProductHelper->getHwIpVersion(hwInfo));
}
hwInfo.platform.usRevId = 0xdead;

EXPECT_EQ(compilerProductHelper->getDefaultHwIpVersion(), compilerProductHelper->getHwIpVersion(hwInfo));
}

for (auto &deviceId : mtlPDeviceIds) {
hwInfo.platform.usDeviceID = deviceId;
for (auto &revision : {0, 2}) {
hwInfo.platform.usRevId = revision;

EXPECT_EQ(AOT::MTL_P_A0, compilerProductHelper->getHwIpVersion(hwInfo));
}
for (auto &revision : {3, 8}) {
hwInfo.platform.usRevId = revision;

EXPECT_EQ(AOT::MTL_P_B0, compilerProductHelper->getHwIpVersion(hwInfo));
}
hwInfo.platform.usRevId = 0xdead;

EXPECT_EQ(compilerProductHelper->getDefaultHwIpVersion(), compilerProductHelper->getHwIpVersion(hwInfo));
}

hwInfo.platform.usDeviceID = 0;
hwInfo.platform.usRevId = 0xdead;

EXPECT_EQ(compilerProductHelper->getDefaultHwIpVersion(), compilerProductHelper->getHwIpVersion(hwInfo));
}

MTLTEST_F(MtlProductHelper, givenProductHelperWhenCheckOverrideAllocationCacheableThenTrueIsReturnedForCommandBuffer) {
AllocationData allocationData{};
allocationData.type = AllocationType::commandBuffer;
EXPECT_TRUE(productHelper->overrideAllocationCacheable(allocationData));

allocationData.type = AllocationType::buffer;
EXPECT_FALSE(productHelper->overrideAllocationCacheable(allocationData));
}
}

0 comments on commit 3c72253

Please sign in to comment.