Remove cleaning allocation lists methods from memory manager

Change-Id: I4a58a5373e7dc4cf8dc5d90390e84c4f23689139
Signed-off-by: Mateusz Jablonski <mateusz.jablonski@intel.com>
This commit is contained in:
Mateusz Jablonski
2018-10-26 11:05:31 +00:00
committed by sys_ocldev
parent 7b1d19eaec
commit a30c70d84b
16 changed files with 263 additions and 288 deletions

View File

@@ -5,6 +5,7 @@
*
*/
#include "runtime/memory_manager/internal_allocation_storage.h"
#include "unit_tests/fixtures/device_fixture.h"
#include "unit_tests/mocks/mock_kernel.h"
#include "test.h"
@@ -108,6 +109,7 @@ TEST_F(KernelSubstituteTest, givenKernelWithUsedKernelAllocationWhenSubstituteKe
MockKernelWithInternals kernel(*pDevice);
auto pHeader = const_cast<SKernelBinaryHeaderCommon *>(kernel.kernelInfo.heapInfo.pKernelHeader);
auto memoryManager = pDevice->getMemoryManager();
auto &commandStreamReceiver = pDevice->getCommandStreamReceiver();
const size_t initialHeapSize = 0x40;
pHeader->KernelHeapSize = initialHeapSize;
@@ -120,13 +122,13 @@ TEST_F(KernelSubstituteTest, givenKernelWithUsedKernelAllocationWhenSubstituteKe
const size_t newHeapSize = initialHeapSize + 1;
char newHeap[newHeapSize];
EXPECT_TRUE(memoryManager->getCommandStreamReceiver(0)->getTemporaryAllocations().peekIsEmpty());
EXPECT_TRUE(commandStreamReceiver.getTemporaryAllocations().peekIsEmpty());
kernel.mockKernel->substituteKernelHeap(newHeap, newHeapSize);
auto secondAllocation = kernel.kernelInfo.kernelAllocation;
EXPECT_FALSE(memoryManager->getCommandStreamReceiver(0)->getTemporaryAllocations().peekIsEmpty());
EXPECT_EQ(memoryManager->getCommandStreamReceiver(0)->getTemporaryAllocations().peekHead(), firstAllocation);
EXPECT_FALSE(commandStreamReceiver.getTemporaryAllocations().peekIsEmpty());
EXPECT_EQ(commandStreamReceiver.getTemporaryAllocations().peekHead(), firstAllocation);
memoryManager->checkGpuUsageAndDestroyGraphicsAllocations(secondAllocation);
memoryManager->cleanAllocationList(firstAllocation->taskCount, TEMPORARY_ALLOCATION);
commandStreamReceiver.getInternalAllocationStorage()->cleanAllocationList(firstAllocation->taskCount, TEMPORARY_ALLOCATION);
}