55 *
66 */
77
8+ #include " runtime/memory_manager/internal_allocation_storage.h"
89#include " unit_tests/fixtures/device_fixture.h"
910#include " unit_tests/mocks/mock_kernel.h"
1011#include " test.h"
@@ -108,6 +109,7 @@ TEST_F(KernelSubstituteTest, givenKernelWithUsedKernelAllocationWhenSubstituteKe
108109 MockKernelWithInternals kernel (*pDevice);
109110 auto pHeader = const_cast <SKernelBinaryHeaderCommon *>(kernel.kernelInfo .heapInfo .pKernelHeader );
110111 auto memoryManager = pDevice->getMemoryManager ();
112+ auto &commandStreamReceiver = pDevice->getCommandStreamReceiver ();
111113
112114 const size_t initialHeapSize = 0x40 ;
113115 pHeader->KernelHeapSize = initialHeapSize;
@@ -120,13 +122,13 @@ TEST_F(KernelSubstituteTest, givenKernelWithUsedKernelAllocationWhenSubstituteKe
120122 const size_t newHeapSize = initialHeapSize + 1 ;
121123 char newHeap[newHeapSize];
122124
123- EXPECT_TRUE (memoryManager-> getCommandStreamReceiver ( 0 )-> getTemporaryAllocations ().peekIsEmpty ());
125+ EXPECT_TRUE (commandStreamReceiver. getTemporaryAllocations ().peekIsEmpty ());
124126
125127 kernel.mockKernel ->substituteKernelHeap (newHeap, newHeapSize);
126128 auto secondAllocation = kernel.kernelInfo .kernelAllocation ;
127129
128- EXPECT_FALSE (memoryManager-> getCommandStreamReceiver ( 0 )-> getTemporaryAllocations ().peekIsEmpty ());
129- EXPECT_EQ (memoryManager-> getCommandStreamReceiver ( 0 )-> getTemporaryAllocations ().peekHead (), firstAllocation);
130+ EXPECT_FALSE (commandStreamReceiver. getTemporaryAllocations ().peekIsEmpty ());
131+ EXPECT_EQ (commandStreamReceiver. getTemporaryAllocations ().peekHead (), firstAllocation);
130132 memoryManager->checkGpuUsageAndDestroyGraphicsAllocations (secondAllocation);
131- memoryManager ->cleanAllocationList (firstAllocation->taskCount , TEMPORARY_ALLOCATION);
133+ commandStreamReceiver. getInternalAllocationStorage () ->cleanAllocationList (firstAllocation->taskCount , TEMPORARY_ALLOCATION);
132134}
0 commit comments