fix: correct matrix multiply capability on xe lpg

Related-To: NEO-7786
Signed-off-by: Kamil Kopryk <kamil.kopryk@intel.com>
This commit is contained in:
Kamil Kopryk
2023-05-08 08:59:02 +00:00
committed by Compute-Runtime-Automation
parent 23c08f4bca
commit a5765a9d8c
4 changed files with 53 additions and 50 deletions

View File

@@ -24,42 +24,6 @@ using namespace NEO;
using GfxCoreHelperTestMtl = GfxCoreHelperTest;
MTLTEST_F(GfxCoreHelperTestMtl, givenVariousMtlReleasesWhenGetExtensionsIsCalledThenMatrixMultiplyAccumulateExtensionsAreCorrectlyReported) {
MockExecutionEnvironment mockExecutionEnvironment{};
auto &rootDeviceEnvironment = *mockExecutionEnvironment.rootDeviceEnvironments[0];
auto &compilerProductHelper = rootDeviceEnvironment.getHelper<CompilerProductHelper>();
auto &hwInfo = *rootDeviceEnvironment.getMutableHardwareInfo();
unsigned int gmdReleases[] = {70, 71, 72, 73};
hwInfo.ipVersion.architecture = 12;
for (auto gmdRelease : gmdReleases) {
hwInfo.ipVersion.release = gmdRelease;
rootDeviceEnvironment.releaseHelper = ReleaseHelper::create(hwInfo.ipVersion);
auto releaseHelper = rootDeviceEnvironment.getReleaseHelper();
auto extensions = compilerProductHelper.getDeviceExtensions(hwInfo, releaseHelper);
EXPECT_EQ(!MTL::isLpg(hwInfo), hasSubstr(extensions, std::string("cl_intel_subgroup_matrix_multiply_accumulate")));
EXPECT_EQ(!MTL::isLpg(hwInfo), hasSubstr(extensions, std::string("cl_intel_subgroup_split_matrix_multiply_accumulate")));
EXPECT_EQ(!MTL::isLpg(hwInfo), compilerProductHelper.isMatrixMultiplyAccumulateSupported(releaseHelper));
EXPECT_EQ(!MTL::isLpg(hwInfo), compilerProductHelper.isSplitMatrixMultiplyAccumulateSupported(hwInfo));
}
}
using ProductHelperTestMtl = Test<DeviceFixture>;
MTLTEST_F(ProductHelperTestMtl, givenPatIndexAndAllocationTypeWhenCallOverridePatIndexThenForTimestampPacketTagBufferReturnTwo) {
auto &helper = getHelper<ProductHelper>();
uint64_t expectedPatIndexWhenTimestampPacketTagBuffer = 2u;
uint64_t patIndex = 1u;
auto allocationType = NEO::AllocationType::TIMESTAMP_PACKET_TAG_BUFFER;
EXPECT_EQ(expectedPatIndexWhenTimestampPacketTagBuffer, helper.overridePatIndex(allocationType, patIndex));
allocationType = NEO::AllocationType::BUFFER;
patIndex = 3u;
EXPECT_EQ(patIndex, helper.overridePatIndex(allocationType, patIndex));
}
MTLTEST_F(GfxCoreHelperTestMtl, givenAllocationThenCheckResourceCompatibilityReturnsTrue) {
auto &gfxCoreHelper = getHelper<GfxCoreHelper>();
auto allocation = std::make_unique<GraphicsAllocation>(0, AllocationType::BUFFER, nullptr, 0u, 0, MemoryPool::MemoryNull, 3u, 0llu);
@@ -115,19 +79,6 @@ MTLTEST_F(GfxCoreHelperTestMtl, givenRevisionEnumAndPlatformFamilyTypeThenProper
}
}
MTLTEST_F(ProductHelperTestMtl, givenMultitileConfigWhenConfiguringHwInfoThenEnableBlitter) {
auto &productHelper = getHelper<ProductHelper>();
HardwareInfo hwInfo = *defaultHwInfo;
for (uint32_t tileCount = 0; tileCount <= 4; tileCount++) {
hwInfo.gtSystemInfo.MultiTileArchInfo.TileCount = tileCount;
productHelper.configureHardwareCustom(&hwInfo, nullptr);
EXPECT_TRUE(hwInfo.capabilityTable.blitterOperationsSupported);
}
}
MTLTEST_F(GfxCoreHelperTestMtl, givenMtlWhenSetForceNonCoherentThenNothingChanged) {
using FORCE_NON_COHERENT = typename FamilyType::STATE_COMPUTE_MODE::FORCE_NON_COHERENT;

View File

@@ -9,6 +9,7 @@
#include "shared/source/execution_environment/execution_environment.h"
#include "shared/source/execution_environment/root_device_environment.h"
#include "shared/source/helpers/compiler_product_helper.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/fixtures/device_fixture.h"
@@ -265,3 +266,44 @@ MTLTEST_F(MtlProductHelper, givenMtlWhenCallIsAdjustWalkOrderAvailableThenReturn
EXPECT_EQ(!MTL::isLpg(*defaultHwInfo), productHelper->isAdjustWalkOrderAvailable(releaseHelper));
}
}
MTLTEST_F(MtlProductHelper, givenMtlAndReleaseHelperNullptrWhengetIsMatrixMultiplyAccumulateSupportedThenReturnsFalse) {
auto &compilerProductHelper = this->executionEnvironment->rootDeviceEnvironments[0]->getHelper<CompilerProductHelper>();
ReleaseHelper *releaseHelper = nullptr;
EXPECT_FALSE(compilerProductHelper.isMatrixMultiplyAccumulateSupported(releaseHelper));
}
MTLTEST_F(MtlProductHelper, givenVariousMtlReleasesWhenGetExtensionsIsCalledThenMatrixMultiplyAccumulateExtensionsAreCorrectlyReported) {
auto &rootDeviceEnvironment = *this->executionEnvironment->rootDeviceEnvironments[0].get();
auto &compilerProductHelper = this->executionEnvironment->rootDeviceEnvironments[0]->getHelper<CompilerProductHelper>();
auto &hwInfo = *rootDeviceEnvironment.getMutableHardwareInfo();
unsigned int gmdReleases[] = {70, 71};
hwInfo.ipVersion.architecture = 12;
for (auto gmdRelease : gmdReleases) {
hwInfo.ipVersion.release = gmdRelease;
refreshReleaseHelper(&hwInfo);
auto releaseHelper = rootDeviceEnvironment.getReleaseHelper();
auto extensions = compilerProductHelper.getDeviceExtensions(hwInfo, releaseHelper);
EXPECT_EQ(!MTL::isLpg(hwInfo), hasSubstr(extensions, std::string("cl_intel_subgroup_matrix_multiply_accumulate")));
EXPECT_EQ(!MTL::isLpg(hwInfo), hasSubstr(extensions, std::string("cl_intel_subgroup_split_matrix_multiply_accumulate")));
EXPECT_EQ(!MTL::isLpg(hwInfo), compilerProductHelper.isMatrixMultiplyAccumulateSupported(releaseHelper));
EXPECT_EQ(!MTL::isLpg(hwInfo), compilerProductHelper.isSplitMatrixMultiplyAccumulateSupported(hwInfo));
}
}
using ProductHelperTestMtl = Test<DeviceFixture>;
MTLTEST_F(ProductHelperTestMtl, givenPatIndexAndAllocationTypeWhenCallOverridePatIndexThenForTimestampPacketTagBufferReturnTwo) {
auto &helper = getHelper<ProductHelper>();
uint64_t expectedPatIndexWhenTimestampPacketTagBuffer = 2u;
uint64_t patIndex = 1u;
auto allocationType = NEO::AllocationType::TIMESTAMP_PACKET_TAG_BUFFER;
EXPECT_EQ(expectedPatIndexWhenTimestampPacketTagBuffer, helper.overridePatIndex(allocationType, patIndex));
allocationType = NEO::AllocationType::BUFFER;
patIndex = 3u;
EXPECT_EQ(patIndex, helper.overridePatIndex(allocationType, patIndex));
}