[30/n] Internal 4GB allocator.

- Add support for patching indirect state with internal heaps.

Change-Id: Ib5748beb462be1786134a0a81bb649dd279816ec
This commit is contained in:
Mrozek, Michal
2018-04-17 07:34:53 +02:00
committed by sys_ocldev
parent 8583c68c8c
commit 6299388b71
2 changed files with 26 additions and 1 deletions

View File

@@ -204,6 +204,31 @@ HWTEST_F(KernelCommandsTest, givenSendCrossThreadDataWhenWhenAddPatchInfoComment
EXPECT_EQ(PatchInfoAllocationType::IndirectObjectHeap, kernel->getPatchInfoDataList()[0].targetType);
}
HWTEST_F(KernelCommandsTest, givenIndirectHeapNotAllocatedFromInternalPoolWhenSendCrossThreadDataIsCalledThenOffsetZeroIsReturned) {
CommandQueueHw<FamilyType> cmdQ(pContext, pDevice, 0);
auto &indirectHeap = cmdQ.getIndirectHeap(IndirectHeap::INDIRECT_OBJECT, 8192);
MockKernelWithInternals mockKernelWithInternal(*pDevice);
auto offset = KernelCommandsHelper<FamilyType>::sendCrossThreadData(
indirectHeap,
*mockKernelWithInternal.mockKernel);
EXPECT_EQ(0u, offset);
}
HWTEST_F(KernelCommandsTest, givenIndirectHeapAllocatedFromInternalPoolWhenSendCrossThreadDataIsCalledThenHeapBaseOffsetIsReturned) {
auto internalAllocation = pDevice->getMemoryManager()->createInternalGraphicsAllocation(nullptr, 4096);
IndirectHeap indirectHeap(internalAllocation, true);
auto expectedOffset = internalAllocation->getGpuAddressToPatch();
MockKernelWithInternals mockKernelWithInternal(*pDevice);
auto offset = KernelCommandsHelper<FamilyType>::sendCrossThreadData(
indirectHeap,
*mockKernelWithInternal.mockKernel);
EXPECT_EQ(expectedOffset, offset);
pDevice->getMemoryManager()->freeGraphicsMemory(internalAllocation);
}
HWTEST_F(KernelCommandsTest, givenSendCrossThreadDataWhenWhenAddPatchInfoCommentsForAUBDumpIsSetThenAddPatchInfoDataOffsetsAreMoved) {
DebugManagerStateRestore dbgRestore;
DebugManager.flags.AddPatchInfoCommentsForAUBDump.set(true);