performance: allocate cmd buffer by umd on mtl

Default allocation by kmd is slower, this improves enqueue times.

Related-To: NEO-8152

Signed-off-by: Dominik Dabek <dominik.dabek@intel.com>
This commit is contained in:
Dominik Dabek
2023-09-28 18:20:42 +00:00
committed by Compute-Runtime-Automation
parent 0f2a04fef4
commit b2a8fa6e57
5 changed files with 27 additions and 2 deletions

View File

@@ -21,6 +21,8 @@ std::optional<GfxMemoryAllocationMethod> ReleaseHelperHw<release>::getPreferredA
case AllocationType::TAG_BUFFER:
case AllocationType::TIMESTAMP_PACKET_TAG_BUFFER:
return {};
case AllocationType::COMMAND_BUFFER:
return GfxMemoryAllocationMethod::UseUmdSystemPtr;
default:
return GfxMemoryAllocationMethod::AllocateByKmd;
}

View File

@@ -65,5 +65,5 @@ TEST_F(ReleaseHelper1270Tests, whenGettingMediaFrequencyTileIndexThenOneIsReturn
}
TEST_F(ReleaseHelper1270Tests, whenCheckPreferredAllocationMethodThenAllocateByKmdIsReturnedExceptTagBufferAndTimestapPacketTagBuffer) {
whenCheckPreferredAllocationMethodThenAllocateByKmdIsReturnedExceptTagBufferAndTimestapPacketTagBuffer();
whenCheckPreferredAllocationMethodThenAllocateByKmdIsReturnedExceptTagBufferAndTimestampPacketTagBufferAndCommandBuffer();
}

View File

@@ -66,5 +66,5 @@ TEST_F(ReleaseHelper1271Tests, whenGettingMediaFrequencyTileIndexThenOneIsReturn
}
TEST_F(ReleaseHelper1271Tests, whenCheckPreferredAllocationMethodThenAllocateByKmdIsReturnedExceptTagBufferAndTimestapPacketTagBuffer) {
whenCheckPreferredAllocationMethodThenAllocateByKmdIsReturnedExceptTagBufferAndTimestapPacketTagBuffer();
whenCheckPreferredAllocationMethodThenAllocateByKmdIsReturnedExceptTagBufferAndTimestampPacketTagBufferAndCommandBuffer();
}

View File

@@ -87,6 +87,28 @@ void ReleaseHelperTestsBase::whenCheckPreferredAllocationMethodThenAllocateByKmd
}
}
void ReleaseHelperTestsBase::whenCheckPreferredAllocationMethodThenAllocateByKmdIsReturnedExceptTagBufferAndTimestampPacketTagBufferAndCommandBuffer() {
for (auto &revision : getRevisions()) {
ipVersion.revision = revision;
releaseHelper = ReleaseHelper::create(ipVersion);
ASSERT_NE(nullptr, releaseHelper);
for (auto i = 0; i < static_cast<int>(AllocationType::COUNT); i++) {
auto allocationType = static_cast<AllocationType>(i);
auto preferredAllocationMethod = releaseHelper->getPreferredAllocationMethod(allocationType);
if (allocationType == AllocationType::TAG_BUFFER ||
allocationType == AllocationType::TIMESTAMP_PACKET_TAG_BUFFER) {
EXPECT_FALSE(preferredAllocationMethod.has_value());
} else if (allocationType == AllocationType::COMMAND_BUFFER) {
EXPECT_TRUE(preferredAllocationMethod.has_value());
EXPECT_EQ(GfxMemoryAllocationMethod::UseUmdSystemPtr, preferredAllocationMethod.value());
} else {
EXPECT_TRUE(preferredAllocationMethod.has_value());
EXPECT_EQ(GfxMemoryAllocationMethod::AllocateByKmd, preferredAllocationMethod.value());
}
}
}
}
void ReleaseHelperTestsBase::whenShouldAdjustCalledThenTrueReturned() {
for (auto &revision : getRevisions()) {
ipVersion.revision = revision;

View File

@@ -26,6 +26,7 @@ struct ReleaseHelperTestsBase : public ::testing::Test {
void whenGettingMaxPreferredSlmSizeThenSizeIsNotModified();
void whenGettingMediaFrequencyTileIndexThenOneIsReturned();
void whenCheckPreferredAllocationMethodThenAllocateByKmdIsReturnedExceptTagBufferAndTimestapPacketTagBuffer();
void whenCheckPreferredAllocationMethodThenAllocateByKmdIsReturnedExceptTagBufferAndTimestampPacketTagBufferAndCommandBuffer();
void whenShouldAdjustCalledThenTrueReturned();
void whenShouldAdjustCalledThenFalseReturned();