Use fw declaration of IndirectHeap in CommandContainer

Signed-off-by: Maciej Plewka <maciej.plewka@intel.com>
This commit is contained in:
Maciej Plewka
2022-01-26 10:59:30 +00:00
committed by Compute-Runtime-Automation
parent 7dc89fea78
commit f8c104feaa
62 changed files with 347 additions and 317 deletions

View File

@ -576,7 +576,7 @@ HWTEST_P(CommandQueueIndirectHeapTest, givenIndirectObjectHeapWhenItIsQueriedFor
auto &commandStreamReceiver = pClDevice->getUltCommandStreamReceiver<FamilyType>();
auto &indirectHeap = cmdQ.getIndirectHeap(this->GetParam(), 8192);
if (this->GetParam() == IndirectHeap::INDIRECT_OBJECT && commandStreamReceiver.canUse4GbHeaps) {
if (this->GetParam() == IndirectHeap::Type::INDIRECT_OBJECT && commandStreamReceiver.canUse4GbHeaps) {
EXPECT_TRUE(indirectHeap.getGraphicsAllocation()->is32BitAllocation());
} else {
EXPECT_FALSE(indirectHeap.getGraphicsAllocation()->is32BitAllocation());
@ -588,7 +588,7 @@ HWTEST_P(CommandQueueIndirectHeapTest, GivenIndirectHeapWhenGettingAvailableSpac
MockCommandQueue cmdQ(context.get(), pClDevice, props, false);
auto &indirectHeap = cmdQ.getIndirectHeap(this->GetParam(), sizeof(uint32_t));
if (this->GetParam() == IndirectHeap::SURFACE_STATE) {
if (this->GetParam() == IndirectHeap::Type::SURFACE_STATE) {
size_t expectedSshUse = cmdQ.getGpgpuCommandStreamReceiver().defaultSshSize - MemoryConstants::pageSize - UnitTestHelper<FamilyType>::getDefaultSshUsage();
EXPECT_EQ(expectedSshUse, indirectHeap.getAvailableSpace());
} else {
@ -615,7 +615,7 @@ TEST_P(CommandQueueIndirectHeapTest, WhenGettingIndirectHeapWithNewSizeThenMaxAv
const auto &indirectHeap = cmdQ.getIndirectHeap(this->GetParam(), requiredSize);
ASSERT_NE(nullptr, &indirectHeap);
if (this->GetParam() == IndirectHeap::SURFACE_STATE) {
if (this->GetParam() == IndirectHeap::Type::SURFACE_STATE) {
//no matter what SSH is always capped
EXPECT_EQ(cmdQ.getGpgpuCommandStreamReceiver().defaultSshSize - MemoryConstants::pageSize,
indirectHeap.getMaxAvailableSpace());
@ -653,11 +653,11 @@ HWTEST_P(CommandQueueIndirectHeapTest, givenCommandStreamReceiverWithReusableAll
auto &commandStreamReceiver = pClDevice->getUltCommandStreamReceiver<FamilyType>();
auto allocationType = GraphicsAllocation::AllocationType::LINEAR_STREAM;
if (this->GetParam() == IndirectHeap::INDIRECT_OBJECT && commandStreamReceiver.canUse4GbHeaps) {
if (this->GetParam() == IndirectHeap::Type::INDIRECT_OBJECT && commandStreamReceiver.canUse4GbHeaps) {
allocationType = GraphicsAllocation::AllocationType::INTERNAL_HEAP;
}
allocation = memoryManager->allocateGraphicsMemoryWithProperties({pDevice->getRootDeviceIndex(), allocationSize, allocationType, pDevice->getDeviceBitfield()});
if (this->GetParam() == IndirectHeap::SURFACE_STATE) {
if (this->GetParam() == IndirectHeap::Type::SURFACE_STATE) {
allocation->setSize(commandStreamReceiver.defaultSshSize * 2);
}
@ -672,7 +672,7 @@ HWTEST_P(CommandQueueIndirectHeapTest, givenCommandStreamReceiverWithReusableAll
// if we obtain heap from reusable pool, we need to keep the size of allocation
// surface state heap is an exception, it is capped at (max_ssh_size_for_HW - page_size)
if (this->GetParam() == IndirectHeap::SURFACE_STATE) {
if (this->GetParam() == IndirectHeap::Type::SURFACE_STATE) {
EXPECT_EQ(commandStreamReceiver.defaultSshSize - MemoryConstants::pageSize, indirectHeap.getMaxAvailableSpace());
} else {
EXPECT_EQ(allocationSize, indirectHeap.getMaxAvailableSpace());
@ -797,7 +797,7 @@ HWTEST_P(CommandQueueIndirectHeapTest, givenCommandQueueWhenGetIndirectHeapIsCal
auto heapType = this->GetParam();
bool requireInternalHeap = IndirectHeap::INDIRECT_OBJECT == heapType && commandStreamReceiver.canUse4GbHeaps;
bool requireInternalHeap = IndirectHeap::Type::INDIRECT_OBJECT == heapType && commandStreamReceiver.canUse4GbHeaps;
const auto &indirectHeap = cmdQ.getIndirectHeap(heapType, 100);
auto indirectHeapAllocation = indirectHeap.getGraphicsAllocation();
ASSERT_NE(nullptr, indirectHeapAllocation);
@ -839,9 +839,9 @@ INSTANTIATE_TEST_CASE_P(
Device,
CommandQueueIndirectHeapTest,
testing::Values(
IndirectHeap::DYNAMIC_STATE,
IndirectHeap::INDIRECT_OBJECT,
IndirectHeap::SURFACE_STATE));
IndirectHeap::Type::DYNAMIC_STATE,
IndirectHeap::Type::INDIRECT_OBJECT,
IndirectHeap::Type::SURFACE_STATE));
using CommandQueueTests = ::testing::Test;
HWTEST_F(CommandQueueTests, givenMultipleCommandQueuesWhenMarkerIsEmittedThenGraphicsAllocationIsReused) {