Command stream receiver: use memory manager from execution environment

Change-Id: I236218a73bd7dac6e5744e3596f146b77b5ca1c8
Signed-off-by: Mateusz Jablonski <mateusz.jablonski@intel.com>
This commit is contained in:
Mateusz Jablonski
2018-10-11 11:19:49 +02:00
committed by sys_ocldev
parent 97c56b9de0
commit 4f028d13a1
47 changed files with 158 additions and 256 deletions

View File

@@ -160,26 +160,6 @@ HWTEST_F(MockExperimentalCommandBufferTest, givenEnabledExperimentalCmdBufferWhe
EXPECT_EQ(expectedExOffset, mockExCmdBuffer->experimentalAllocationOffset);
}
HWTEST_F(MockExperimentalCommandBufferTest, givenEnabledExperimentalCmdBufferWhenMemoryManagerIsNotAvailableThenExperimentalBufferAllocationsRemainAllocated) {
auto &commandStreamReceiver = pDevice->getUltCommandStreamReceiver<FamilyType>();
MockExperimentalCommandBuffer *mockExCmdBuffer = static_cast<MockExperimentalCommandBuffer *>(commandStreamReceiver.experimentalCmdBuffer.get());
EXPECT_NE(nullptr, mockExCmdBuffer->experimentalAllocation);
EXPECT_NE(nullptr, mockExCmdBuffer->timestamps);
auto experimentalAllocation = mockExCmdBuffer->experimentalAllocation;
auto timestamps = mockExCmdBuffer->timestamps;
auto memoryManager = commandStreamReceiver.getMemoryManager();
//null memManager
commandStreamReceiver.setMemoryManager(nullptr);
//delete experimental cmd buffer and verify its allocations remain intact
commandStreamReceiver.setExperimentalCmdBuffer(std::move(std::unique_ptr<ExperimentalCommandBuffer>(nullptr)));
memoryManager->freeGraphicsMemory(experimentalAllocation);
memoryManager->freeGraphicsMemory(timestamps);
commandStreamReceiver.setMemoryManager(memoryManager);
}
HWTEST_F(MockExperimentalCommandBufferTest, givenEnabledExperimentalCmdBufferWhenCsrIsFlushedTwiceThenExpectProperlyFilledExperimentalCmdBufferAndTimestampOffset) {
using MI_BATCH_BUFFER_START = typename FamilyType::MI_BATCH_BUFFER_START;
using MI_BATCH_BUFFER_END = typename FamilyType::MI_BATCH_BUFFER_END;