mirror of
https://github.com/intel/compute-runtime.git
synced 2025-12-24 21:18:24 +08:00
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:
committed by
Compute-Runtime-Automation
parent
0f2a04fef4
commit
b2a8fa6e57
@@ -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;
|
||||
}
|
||||
|
||||
@@ -65,5 +65,5 @@ TEST_F(ReleaseHelper1270Tests, whenGettingMediaFrequencyTileIndexThenOneIsReturn
|
||||
}
|
||||
|
||||
TEST_F(ReleaseHelper1270Tests, whenCheckPreferredAllocationMethodThenAllocateByKmdIsReturnedExceptTagBufferAndTimestapPacketTagBuffer) {
|
||||
whenCheckPreferredAllocationMethodThenAllocateByKmdIsReturnedExceptTagBufferAndTimestapPacketTagBuffer();
|
||||
whenCheckPreferredAllocationMethodThenAllocateByKmdIsReturnedExceptTagBufferAndTimestampPacketTagBufferAndCommandBuffer();
|
||||
}
|
||||
|
||||
@@ -66,5 +66,5 @@ TEST_F(ReleaseHelper1271Tests, whenGettingMediaFrequencyTileIndexThenOneIsReturn
|
||||
}
|
||||
|
||||
TEST_F(ReleaseHelper1271Tests, whenCheckPreferredAllocationMethodThenAllocateByKmdIsReturnedExceptTagBufferAndTimestapPacketTagBuffer) {
|
||||
whenCheckPreferredAllocationMethodThenAllocateByKmdIsReturnedExceptTagBufferAndTimestapPacketTagBuffer();
|
||||
whenCheckPreferredAllocationMethodThenAllocateByKmdIsReturnedExceptTagBufferAndTimestampPacketTagBufferAndCommandBuffer();
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -26,6 +26,7 @@ struct ReleaseHelperTestsBase : public ::testing::Test {
|
||||
void whenGettingMaxPreferredSlmSizeThenSizeIsNotModified();
|
||||
void whenGettingMediaFrequencyTileIndexThenOneIsReturned();
|
||||
void whenCheckPreferredAllocationMethodThenAllocateByKmdIsReturnedExceptTagBufferAndTimestapPacketTagBuffer();
|
||||
void whenCheckPreferredAllocationMethodThenAllocateByKmdIsReturnedExceptTagBufferAndTimestampPacketTagBufferAndCommandBuffer();
|
||||
void whenShouldAdjustCalledThenTrueReturned();
|
||||
void whenShouldAdjustCalledThenFalseReturned();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user