mirror of
https://github.com/intel/compute-runtime.git
synced 2026-01-08 14:02:58 +08:00
[30/n] Internal 4GB allocator.
- Add support for patching indirect state with internal heaps. Change-Id: Ib5748beb462be1786134a0a81bb649dd279816ec
This commit is contained in:
committed by
sys_ocldev
parent
8583c68c8c
commit
6299388b71
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user