mirror of
https://github.com/intel/compute-runtime.git
synced 2025-12-24 12:23:05 +08:00
Correct tests: pass device bitfield to allocation properties [2/n]
Related-To: NEO-4722 Change-Id: I435eed19491babdd95ff9d0e860bf3008a544e9e Signed-off-by: Andrzej Swierczynski <andrzej.swierczynski@intel.com>
This commit is contained in:
committed by
sys_ocldev
parent
a661f4b878
commit
dd8c712563
@@ -132,7 +132,7 @@ HWTEST_F(AubAllocDumpTests, givenNonWritableBufferWhenDumpAllocationIsCalledAndD
|
||||
DebugManager.flags.AUBDumpBufferFormat.set("BIN");
|
||||
|
||||
auto memoryManager = pDevice->getMemoryManager();
|
||||
auto gfxAllocation = memoryManager->allocateGraphicsMemoryWithProperties({pDevice->getRootDeviceIndex(), MemoryConstants::pageSize, GraphicsAllocation::AllocationType::BUFFER});
|
||||
auto gfxAllocation = memoryManager->allocateGraphicsMemoryWithProperties({pDevice->getRootDeviceIndex(), MemoryConstants::pageSize, GraphicsAllocation::AllocationType::BUFFER, pDevice->getDeviceBitfield()});
|
||||
|
||||
std::unique_ptr<AubFileStreamMock> mockAubFileStream(new AubFileStreamMock());
|
||||
auto format = AubAllocDump::getDumpFormat(*gfxAllocation);
|
||||
|
||||
@@ -886,7 +886,7 @@ HWTEST_F(AubCommandStreamReceiverTests, givenGraphicsAllocationWritableWhenDumpA
|
||||
auto mockHardwareContext = static_cast<MockHardwareContext *>(aubCsr.hardwareContextController->hardwareContexts[0].get());
|
||||
|
||||
auto memoryManager = pDevice->getMemoryManager();
|
||||
auto gfxAllocation = memoryManager->allocateGraphicsMemoryWithProperties({pDevice->getRootDeviceIndex(), MemoryConstants::pageSize, GraphicsAllocation::AllocationType::BUFFER});
|
||||
auto gfxAllocation = memoryManager->allocateGraphicsMemoryWithProperties({pDevice->getRootDeviceIndex(), MemoryConstants::pageSize, GraphicsAllocation::AllocationType::BUFFER, pDevice->getDeviceBitfield()});
|
||||
gfxAllocation->setMemObjectsAllocationWithWritableFlags(true);
|
||||
EXPECT_TRUE(AubAllocDump::isWritableBuffer(*gfxAllocation));
|
||||
|
||||
@@ -909,7 +909,7 @@ HWTEST_F(AubCommandStreamReceiverTests, givenBcsEngineWhenDumpAllocationCalledTh
|
||||
auto mockHardwareContext = static_cast<MockHardwareContext *>(aubCsr.hardwareContextController->hardwareContexts[0].get());
|
||||
|
||||
auto memoryManager = pDevice->getMemoryManager();
|
||||
auto gfxAllocation = memoryManager->allocateGraphicsMemoryWithProperties({pDevice->getRootDeviceIndex(), MemoryConstants::pageSize, GraphicsAllocation::AllocationType::BUFFER});
|
||||
auto gfxAllocation = memoryManager->allocateGraphicsMemoryWithProperties({pDevice->getRootDeviceIndex(), MemoryConstants::pageSize, GraphicsAllocation::AllocationType::BUFFER, pDevice->getDeviceBitfield()});
|
||||
gfxAllocation->setMemObjectsAllocationWithWritableFlags(true);
|
||||
EXPECT_TRUE(AubAllocDump::isWritableBuffer(*gfxAllocation));
|
||||
|
||||
@@ -937,7 +937,7 @@ HWTEST_F(AubCommandStreamReceiverTests, givenCompressedGraphicsAllocationWritabl
|
||||
auto mockHardwareContext = static_cast<MockHardwareContext *>(aubCsr.hardwareContextController->hardwareContexts[0].get());
|
||||
|
||||
auto memoryManager = pDevice->getMemoryManager();
|
||||
auto gfxAllocation = memoryManager->allocateGraphicsMemoryWithProperties({pDevice->getRootDeviceIndex(), MemoryConstants::pageSize, GraphicsAllocation::AllocationType::BUFFER_COMPRESSED});
|
||||
auto gfxAllocation = memoryManager->allocateGraphicsMemoryWithProperties({pDevice->getRootDeviceIndex(), MemoryConstants::pageSize, GraphicsAllocation::AllocationType::BUFFER_COMPRESSED, pDevice->getDeviceBitfield()});
|
||||
gfxAllocation->setMemObjectsAllocationWithWritableFlags(true);
|
||||
EXPECT_TRUE(AubAllocDump::isWritableBuffer(*gfxAllocation));
|
||||
|
||||
@@ -959,7 +959,7 @@ HWTEST_F(AubCommandStreamReceiverTests, givenGraphicsAllocationWritableWhenDumpA
|
||||
auto mockHardwareContext = static_cast<MockHardwareContext *>(aubCsr.hardwareContextController->hardwareContexts[0].get());
|
||||
|
||||
auto memoryManager = pDevice->getMemoryManager();
|
||||
auto gfxAllocation = memoryManager->allocateGraphicsMemoryWithProperties({pDevice->getRootDeviceIndex(), MemoryConstants::pageSize, GraphicsAllocation::AllocationType::BUFFER});
|
||||
auto gfxAllocation = memoryManager->allocateGraphicsMemoryWithProperties({pDevice->getRootDeviceIndex(), MemoryConstants::pageSize, GraphicsAllocation::AllocationType::BUFFER, pDevice->getDeviceBitfield()});
|
||||
|
||||
gfxAllocation->setMemObjectsAllocationWithWritableFlags(true);
|
||||
EXPECT_TRUE(AubAllocDump::isWritableBuffer(*gfxAllocation));
|
||||
@@ -983,7 +983,7 @@ HWTEST_F(AubCommandStreamReceiverTests, givenGraphicsAllocationNonWritableWhenDu
|
||||
auto mockHardwareContext = static_cast<MockHardwareContext *>(aubCsr.hardwareContextController->hardwareContexts[0].get());
|
||||
|
||||
auto memoryManager = pDevice->getMemoryManager();
|
||||
auto gfxAllocation = memoryManager->allocateGraphicsMemoryWithProperties({pDevice->getRootDeviceIndex(), MemoryConstants::pageSize, GraphicsAllocation::AllocationType::BUFFER});
|
||||
auto gfxAllocation = memoryManager->allocateGraphicsMemoryWithProperties({pDevice->getRootDeviceIndex(), MemoryConstants::pageSize, GraphicsAllocation::AllocationType::BUFFER, pDevice->getDeviceBitfield()});
|
||||
|
||||
gfxAllocation->setMemObjectsAllocationWithWritableFlags(false);
|
||||
EXPECT_FALSE(AubAllocDump::isWritableBuffer(*gfxAllocation));
|
||||
@@ -1008,7 +1008,7 @@ HWTEST_F(AubCommandStreamReceiverTests, givenGraphicsAllocationNotDumpableWhenDu
|
||||
auto mockHardwareContext = static_cast<MockHardwareContext *>(aubCsr.hardwareContextController->hardwareContexts[0].get());
|
||||
|
||||
auto memoryManager = pDevice->getMemoryManager();
|
||||
auto gfxAllocation = memoryManager->allocateGraphicsMemoryWithProperties({pDevice->getRootDeviceIndex(), MemoryConstants::pageSize, GraphicsAllocation::AllocationType::BUFFER});
|
||||
auto gfxAllocation = memoryManager->allocateGraphicsMemoryWithProperties({pDevice->getRootDeviceIndex(), MemoryConstants::pageSize, GraphicsAllocation::AllocationType::BUFFER, pDevice->getDeviceBitfield()});
|
||||
|
||||
gfxAllocation->setMemObjectsAllocationWithWritableFlags(true);
|
||||
gfxAllocation->setAllocDumpable(false);
|
||||
@@ -1034,7 +1034,7 @@ HWTEST_F(AubCommandStreamReceiverTests, givenGraphicsAllocationDumpableWhenDumpA
|
||||
auto mockHardwareContext = static_cast<MockHardwareContext *>(aubCsr.hardwareContextController->hardwareContexts[0].get());
|
||||
|
||||
auto memoryManager = pDevice->getMemoryManager();
|
||||
auto gfxAllocation = memoryManager->allocateGraphicsMemoryWithProperties({pDevice->getRootDeviceIndex(), MemoryConstants::pageSize, GraphicsAllocation::AllocationType::BUFFER});
|
||||
auto gfxAllocation = memoryManager->allocateGraphicsMemoryWithProperties({pDevice->getRootDeviceIndex(), MemoryConstants::pageSize, GraphicsAllocation::AllocationType::BUFFER, pDevice->getDeviceBitfield()});
|
||||
|
||||
gfxAllocation->setMemObjectsAllocationWithWritableFlags(true);
|
||||
gfxAllocation->setAllocDumpable(true);
|
||||
@@ -1060,7 +1060,7 @@ HWTEST_F(AubCommandStreamReceiverTests, givenGraphicsAllocationWritableWhenDumpA
|
||||
auto mockHardwareContext = static_cast<MockHardwareContext *>(aubCsr.hardwareContextController->hardwareContexts[0].get());
|
||||
|
||||
auto memoryManager = pDevice->getMemoryManager();
|
||||
auto gfxAllocation = memoryManager->allocateGraphicsMemoryWithProperties({pDevice->getRootDeviceIndex(), MemoryConstants::pageSize, GraphicsAllocation::AllocationType::BUFFER});
|
||||
auto gfxAllocation = memoryManager->allocateGraphicsMemoryWithProperties({pDevice->getRootDeviceIndex(), MemoryConstants::pageSize, GraphicsAllocation::AllocationType::BUFFER, pDevice->getDeviceBitfield()});
|
||||
gfxAllocation->setMemObjectsAllocationWithWritableFlags(true);
|
||||
EXPECT_TRUE(AubAllocDump::isWritableBuffer(*gfxAllocation));
|
||||
|
||||
|
||||
@@ -820,7 +820,7 @@ HWTEST_F(TbxCommandStreamTests, givenTbxCsrWhenProcessResidencyIsCalledWithDumpT
|
||||
memoryManager.reset(new OsAgnosticMemoryManager(*pDevice->executionEnvironment));
|
||||
tbxCsr->setupContext(*pDevice->getDefaultEngine().osContext);
|
||||
|
||||
auto gfxAllocation = memoryManager->allocateGraphicsMemoryWithProperties({pDevice->getRootDeviceIndex(), MemoryConstants::pageSize, GraphicsAllocation::AllocationType::BUFFER});
|
||||
auto gfxAllocation = memoryManager->allocateGraphicsMemoryWithProperties({pDevice->getRootDeviceIndex(), MemoryConstants::pageSize, GraphicsAllocation::AllocationType::BUFFER, pDevice->getDeviceBitfield()});
|
||||
tbxCsr->setTbxWritable(false, *gfxAllocation);
|
||||
|
||||
tbxCsr->dumpTbxNonWritable = true;
|
||||
@@ -840,7 +840,7 @@ HWTEST_F(TbxCommandStreamTests, givenTbxCsrWhenProcessResidencyIsCalledWithoutDu
|
||||
memoryManager.reset(new OsAgnosticMemoryManager(*pDevice->executionEnvironment));
|
||||
tbxCsr->setupContext(*pDevice->getDefaultEngine().osContext);
|
||||
|
||||
auto gfxAllocation = memoryManager->allocateGraphicsMemoryWithProperties({pDevice->getRootDeviceIndex(), MemoryConstants::pageSize, GraphicsAllocation::AllocationType::BUFFER});
|
||||
auto gfxAllocation = memoryManager->allocateGraphicsMemoryWithProperties({pDevice->getRootDeviceIndex(), MemoryConstants::pageSize, GraphicsAllocation::AllocationType::BUFFER, pDevice->getDeviceBitfield()});
|
||||
tbxCsr->setTbxWritable(false, *gfxAllocation);
|
||||
|
||||
EXPECT_FALSE(tbxCsr->dumpTbxNonWritable);
|
||||
@@ -978,7 +978,7 @@ HWTEST_F(TbxCommandStreamTests, givenGraphicsAllocationWhenDumpAllocationIsCalle
|
||||
auto mockHardwareContext = static_cast<MockHardwareContext *>(tbxCsr.hardwareContextController->hardwareContexts[0].get());
|
||||
|
||||
auto memoryManager = pDevice->getMemoryManager();
|
||||
auto gfxAllocation = memoryManager->allocateGraphicsMemoryWithProperties({pDevice->getRootDeviceIndex(), MemoryConstants::pageSize, GraphicsAllocation::AllocationType::BUFFER});
|
||||
auto gfxAllocation = memoryManager->allocateGraphicsMemoryWithProperties({pDevice->getRootDeviceIndex(), MemoryConstants::pageSize, GraphicsAllocation::AllocationType::BUFFER, pDevice->getDeviceBitfield()});
|
||||
|
||||
tbxCsr.dumpAllocation(*gfxAllocation);
|
||||
EXPECT_FALSE(mockHardwareContext->dumpSurfaceCalled);
|
||||
@@ -994,7 +994,7 @@ HWTEST_F(TbxCommandStreamTests, givenGraphicsAllocationWritableWhenDumpAllocatio
|
||||
auto mockHardwareContext = static_cast<MockHardwareContext *>(tbxCsr.hardwareContextController->hardwareContexts[0].get());
|
||||
|
||||
auto memoryManager = pDevice->getMemoryManager();
|
||||
auto gfxAllocation = memoryManager->allocateGraphicsMemoryWithProperties({pDevice->getRootDeviceIndex(), MemoryConstants::pageSize, GraphicsAllocation::AllocationType::BUFFER});
|
||||
auto gfxAllocation = memoryManager->allocateGraphicsMemoryWithProperties({pDevice->getRootDeviceIndex(), MemoryConstants::pageSize, GraphicsAllocation::AllocationType::BUFFER, pDevice->getDeviceBitfield()});
|
||||
|
||||
gfxAllocation->setMemObjectsAllocationWithWritableFlags(true);
|
||||
EXPECT_TRUE(AubAllocDump::isWritableBuffer(*gfxAllocation));
|
||||
@@ -1016,7 +1016,7 @@ HWTEST_F(TbxCommandStreamTests, givenGraphicsAllocationWritableWhenDumpAllocatio
|
||||
auto mockHardwareContext = static_cast<MockHardwareContext *>(tbxCsr.hardwareContextController->hardwareContexts[0].get());
|
||||
|
||||
auto memoryManager = pDevice->getMemoryManager();
|
||||
auto gfxAllocation = memoryManager->allocateGraphicsMemoryWithProperties({pDevice->getRootDeviceIndex(), MemoryConstants::pageSize, GraphicsAllocation::AllocationType::BUFFER});
|
||||
auto gfxAllocation = memoryManager->allocateGraphicsMemoryWithProperties({pDevice->getRootDeviceIndex(), MemoryConstants::pageSize, GraphicsAllocation::AllocationType::BUFFER, pDevice->getDeviceBitfield()});
|
||||
gfxAllocation->setMemObjectsAllocationWithWritableFlags(true);
|
||||
EXPECT_TRUE(AubAllocDump::isWritableBuffer(*gfxAllocation));
|
||||
|
||||
@@ -1038,7 +1038,7 @@ HWTEST_F(TbxCommandStreamTests, givenGraphicsAllocationWhenDumpAllocationIsCalle
|
||||
auto mockHardwareContext = static_cast<MockHardwareContext *>(tbxCsr.hardwareContextController->hardwareContexts[0].get());
|
||||
|
||||
auto memoryManager = pDevice->getMemoryManager();
|
||||
auto gfxAllocation = memoryManager->allocateGraphicsMemoryWithProperties({pDevice->getRootDeviceIndex(), MemoryConstants::pageSize, GraphicsAllocation::AllocationType::BUFFER});
|
||||
auto gfxAllocation = memoryManager->allocateGraphicsMemoryWithProperties({pDevice->getRootDeviceIndex(), MemoryConstants::pageSize, GraphicsAllocation::AllocationType::BUFFER, pDevice->getDeviceBitfield()});
|
||||
|
||||
for (bool dumpable : {false, true}) {
|
||||
gfxAllocation->setMemObjectsAllocationWithWritableFlags(true);
|
||||
@@ -1064,7 +1064,7 @@ HWTEST_F(TbxCommandStreamTests, givenGraphicsAllocationWhenDumpAllocationIsCalle
|
||||
EXPECT_EQ(nullptr, executionEnvironment.rootDeviceEnvironments[0]->aubCenter->getAubManager());
|
||||
|
||||
auto memoryManager = pDevice->getMemoryManager();
|
||||
auto gfxAllocation = memoryManager->allocateGraphicsMemoryWithProperties({pDevice->getRootDeviceIndex(), MemoryConstants::pageSize, GraphicsAllocation::AllocationType::BUFFER});
|
||||
auto gfxAllocation = memoryManager->allocateGraphicsMemoryWithProperties({pDevice->getRootDeviceIndex(), MemoryConstants::pageSize, GraphicsAllocation::AllocationType::BUFFER, pDevice->getDeviceBitfield()});
|
||||
|
||||
tbxCsr.dumpAllocation(*gfxAllocation);
|
||||
EXPECT_TRUE(tbxCsr.dumpAllocationCalled);
|
||||
|
||||
@@ -99,7 +99,7 @@ HWCMDTEST_F(IGFX_GEN8_CORE, ParentKernelCommandQueueFixture, givenLockedEMcritca
|
||||
|
||||
size_t minSizeSSHForEM = HardwareCommandsHelper<FamilyType>::getSshSizeForExecutionModel(*parentKernel);
|
||||
|
||||
auto cmdStreamAllocation = device->getMemoryManager()->allocateGraphicsMemoryWithProperties({device->getRootDeviceIndex(), 4096, GraphicsAllocation::AllocationType::COMMAND_BUFFER});
|
||||
auto cmdStreamAllocation = device->getMemoryManager()->allocateGraphicsMemoryWithProperties({device->getRootDeviceIndex(), 4096, GraphicsAllocation::AllocationType::COMMAND_BUFFER, device->getDeviceBitfield()});
|
||||
auto blockedCommandData = std::make_unique<KernelOperation>(new LinearStream(cmdStreamAllocation),
|
||||
*pCmdQ->getGpgpuCommandStreamReceiver().getInternalAllocationStorage());
|
||||
blockedCommandData->setHeaps(dsh, ioh, ssh);
|
||||
@@ -157,7 +157,7 @@ HWCMDTEST_F(IGFX_GEN8_CORE, ParentKernelCommandQueueFixture, givenParentKernelWh
|
||||
uint32_t colorCalcSizeDevQueue = DeviceQueue::colorCalcStateSize;
|
||||
EXPECT_EQ(colorCalcSizeDevQueue, usedDSHBeforeSubmit);
|
||||
|
||||
auto cmdStreamAllocation = device->getMemoryManager()->allocateGraphicsMemoryWithProperties({device->getRootDeviceIndex(), 4096, GraphicsAllocation::AllocationType::COMMAND_BUFFER});
|
||||
auto cmdStreamAllocation = device->getMemoryManager()->allocateGraphicsMemoryWithProperties({device->getRootDeviceIndex(), 4096, GraphicsAllocation::AllocationType::COMMAND_BUFFER, device->getDeviceBitfield()});
|
||||
auto blockedCommandData = std::make_unique<KernelOperation>(new LinearStream(cmdStreamAllocation),
|
||||
*pCmdQ->getGpgpuCommandStreamReceiver().getInternalAllocationStorage());
|
||||
blockedCommandData->setHeaps(dsh, ioh, ssh);
|
||||
@@ -198,7 +198,7 @@ HWCMDTEST_F(IGFX_GEN8_CORE, ParentKernelCommandQueueFixture, givenParentKernelWh
|
||||
|
||||
dsh->getSpace(mockDevQueue.getDshOffset());
|
||||
|
||||
auto cmdStreamAllocation = device->getMemoryManager()->allocateGraphicsMemoryWithProperties({device->getRootDeviceIndex(), 4096, GraphicsAllocation::AllocationType::COMMAND_BUFFER});
|
||||
auto cmdStreamAllocation = device->getMemoryManager()->allocateGraphicsMemoryWithProperties({device->getRootDeviceIndex(), 4096, GraphicsAllocation::AllocationType::COMMAND_BUFFER, device->getDeviceBitfield()});
|
||||
auto blockedCommandData = std::make_unique<KernelOperation>(new LinearStream(cmdStreamAllocation),
|
||||
*pCmdQ->getGpgpuCommandStreamReceiver().getInternalAllocationStorage());
|
||||
blockedCommandData->setHeaps(dsh, ioh, ssh);
|
||||
@@ -236,7 +236,7 @@ HWCMDTEST_F(IGFX_GEN8_CORE, ParentKernelCommandQueueFixture, givenBlockedParentK
|
||||
pCmdQ->allocateHeapMemory(IndirectHeap::SURFACE_STATE, heapSize, ssh);
|
||||
dsh->getSpace(mockDevQueue.getDshOffset());
|
||||
|
||||
auto cmdStreamAllocation = device->getMemoryManager()->allocateGraphicsMemoryWithProperties({device->getRootDeviceIndex(), 4096, GraphicsAllocation::AllocationType::COMMAND_BUFFER});
|
||||
auto cmdStreamAllocation = device->getMemoryManager()->allocateGraphicsMemoryWithProperties({device->getRootDeviceIndex(), 4096, GraphicsAllocation::AllocationType::COMMAND_BUFFER, device->getDeviceBitfield()});
|
||||
auto blockedCommandData = std::make_unique<KernelOperation>(new LinearStream(cmdStreamAllocation),
|
||||
*pCmdQ->getGpgpuCommandStreamReceiver().getInternalAllocationStorage());
|
||||
blockedCommandData->setHeaps(dsh, ioh, ssh);
|
||||
@@ -277,7 +277,7 @@ HWCMDTEST_F(IGFX_GEN8_CORE, ParentKernelCommandQueueFixture, givenParentKernelWh
|
||||
pCmdQ->allocateHeapMemory(IndirectHeap::SURFACE_STATE, heapSize, ssh);
|
||||
dsh->getSpace(mockDevQueue.getDshOffset());
|
||||
|
||||
auto cmdStreamAllocation = device->getMemoryManager()->allocateGraphicsMemoryWithProperties({device->getRootDeviceIndex(), 4096, GraphicsAllocation::AllocationType::COMMAND_BUFFER});
|
||||
auto cmdStreamAllocation = device->getMemoryManager()->allocateGraphicsMemoryWithProperties({device->getRootDeviceIndex(), 4096, GraphicsAllocation::AllocationType::COMMAND_BUFFER, device->getDeviceBitfield()});
|
||||
auto blockedCommandData = std::make_unique<KernelOperation>(new LinearStream(cmdStreamAllocation),
|
||||
*pCmdQ->getGpgpuCommandStreamReceiver().getInternalAllocationStorage());
|
||||
blockedCommandData->setHeaps(dsh, ioh, ssh);
|
||||
@@ -330,7 +330,7 @@ HWCMDTEST_F(IGFX_GEN8_CORE, ParentKernelCommandQueueFixture, givenUsedCommandQue
|
||||
queueDsh.getSpace(usedSize);
|
||||
queueIoh.getSpace(usedSize);
|
||||
|
||||
auto cmdStreamAllocation = device->getMemoryManager()->allocateGraphicsMemoryWithProperties({device->getRootDeviceIndex(), 4096, GraphicsAllocation::AllocationType::COMMAND_BUFFER});
|
||||
auto cmdStreamAllocation = device->getMemoryManager()->allocateGraphicsMemoryWithProperties({device->getRootDeviceIndex(), 4096, GraphicsAllocation::AllocationType::COMMAND_BUFFER, device->getDeviceBitfield()});
|
||||
auto blockedCommandData = std::make_unique<KernelOperation>(new LinearStream(cmdStreamAllocation),
|
||||
*pCmdQ->getGpgpuCommandStreamReceiver().getInternalAllocationStorage());
|
||||
blockedCommandData->setHeaps(dsh, ioh, ssh);
|
||||
@@ -378,7 +378,7 @@ HWCMDTEST_F(IGFX_GEN8_CORE, ParentKernelCommandQueueFixture, givenNotUsedSSHWhen
|
||||
|
||||
void *sshBuffer = pCmdQ->getIndirectHeap(IndirectHeap::SURFACE_STATE, 0u).getCpuBase();
|
||||
|
||||
auto cmdStreamAllocation = device->getMemoryManager()->allocateGraphicsMemoryWithProperties({device->getRootDeviceIndex(), 4096, GraphicsAllocation::AllocationType::COMMAND_BUFFER});
|
||||
auto cmdStreamAllocation = device->getMemoryManager()->allocateGraphicsMemoryWithProperties({device->getRootDeviceIndex(), 4096, GraphicsAllocation::AllocationType::COMMAND_BUFFER, device->getDeviceBitfield()});
|
||||
auto blockedCommandData = std::make_unique<KernelOperation>(new LinearStream(cmdStreamAllocation),
|
||||
*pCmdQ->getGpgpuCommandStreamReceiver().getInternalAllocationStorage());
|
||||
blockedCommandData->setHeaps(dsh, ioh, ssh);
|
||||
|
||||
@@ -461,7 +461,7 @@ TEST_F(MemoryAllocatorTest, givenMemoryManagerWhenAskedFor32bitAllocationWithPtr
|
||||
TEST_F(MemoryAllocatorTest, givenAllocationWithFragmentsWhenCallingFreeGraphicsMemoryThenDoNotCallHandleFenceCompletion) {
|
||||
auto size = 3u * MemoryConstants::pageSize;
|
||||
auto *ptr = reinterpret_cast<void *>(0xbeef1);
|
||||
AllocationProperties properties{mockRootDeviceIndex, false, size, GraphicsAllocation::AllocationType::BUFFER, false, mockDeviceBitfield};
|
||||
AllocationProperties properties{device->getRootDeviceIndex(), false, size, GraphicsAllocation::AllocationType::BUFFER, false, device->getDeviceBitfield()};
|
||||
|
||||
auto allocation = memoryManager->allocateGraphicsMemoryWithProperties(properties, ptr);
|
||||
EXPECT_EQ(3u, allocation->fragmentsStorage.fragmentCount);
|
||||
@@ -488,7 +488,7 @@ TEST_F(MemoryAllocatorTest, GivenShareableEnabledAndDisabledWhenAskedToCreateGra
|
||||
}
|
||||
|
||||
TEST_F(MemoryAllocatorTest, givenAllocationWithoutFragmentsWhenCallingFreeGraphicsMemoryThenCallHandleFenceCompletion) {
|
||||
auto allocation = memoryManager->allocateGraphicsMemoryWithProperties({0, MemoryConstants::pageSize, GraphicsAllocation::AllocationType::BUFFER});
|
||||
auto allocation = memoryManager->allocateGraphicsMemoryWithProperties({device->getRootDeviceIndex(), MemoryConstants::pageSize, GraphicsAllocation::AllocationType::BUFFER, device->getDeviceBitfield()});
|
||||
EXPECT_EQ(0u, allocation->fragmentsStorage.fragmentCount);
|
||||
|
||||
EXPECT_EQ(0u, memoryManager->handleFenceCompletionCalled);
|
||||
@@ -645,7 +645,7 @@ TEST(OsAgnosticMemoryManager, givenMemoryManagerWhenAskedFor32BitAllocationWhenL
|
||||
memoryManager.forceLimitedRangeAllocator(0, 0xFFFFFFFFF);
|
||||
|
||||
AllocationData allocationData;
|
||||
memoryManager.getAllocationData(allocationData, {0, MemoryConstants::pageSize, GraphicsAllocation::AllocationType::BUFFER}, nullptr, StorageInfo{});
|
||||
memoryManager.getAllocationData(allocationData, {mockRootDeviceIndex, MemoryConstants::pageSize, GraphicsAllocation::AllocationType::BUFFER, mockDeviceBitfield}, nullptr, StorageInfo{});
|
||||
auto gfxAllocation = memoryManager.allocateGraphicsMemoryWithAlignment(allocationData);
|
||||
ASSERT_NE(gfxAllocation, nullptr);
|
||||
EXPECT_NE(gfxAllocation->getGpuBaseAddress(), 0ull);
|
||||
@@ -663,7 +663,7 @@ TEST(OsAgnosticMemoryManager, givenMemoryManagerWhenAskedForNon32BitAllocationWh
|
||||
memoryManager.forceLimitedRangeAllocator(0, 0xFFFFFFFFF);
|
||||
|
||||
AllocationData allocationData;
|
||||
memoryManager.getAllocationData(allocationData, {0, MemoryConstants::pageSize, GraphicsAllocation::AllocationType::BUFFER}, nullptr, StorageInfo{});
|
||||
memoryManager.getAllocationData(allocationData, {mockRootDeviceIndex, MemoryConstants::pageSize, GraphicsAllocation::AllocationType::BUFFER, mockDeviceBitfield}, nullptr, StorageInfo{});
|
||||
auto gfxAllocation = memoryManager.allocateGraphicsMemoryWithAlignment(allocationData);
|
||||
ASSERT_NE(gfxAllocation, nullptr);
|
||||
EXPECT_EQ(gfxAllocation->getGpuBaseAddress(), 0ull);
|
||||
@@ -887,7 +887,7 @@ TEST(OsAgnosticMemoryManager, givenMemoryManagerWhenAllocate32BitGraphicsMemoryW
|
||||
TEST(OsAgnosticMemoryManager, givenMemoryManagerWith64KBPagesEnabledWhenAllocateGraphicsMemoryThenMemoryPoolIsSystem64KBPages) {
|
||||
MockExecutionEnvironment executionEnvironment(defaultHwInfo.get());
|
||||
MemoryManagerCreate<OsAgnosticMemoryManager> memoryManager(true, false, executionEnvironment);
|
||||
auto svmAllocation = memoryManager.allocateGraphicsMemoryWithProperties({0, MemoryConstants::pageSize, GraphicsAllocation::AllocationType::SVM_ZERO_COPY});
|
||||
auto svmAllocation = memoryManager.allocateGraphicsMemoryWithProperties({mockRootDeviceIndex, MemoryConstants::pageSize, GraphicsAllocation::AllocationType::SVM_ZERO_COPY, mockDeviceBitfield});
|
||||
EXPECT_NE(nullptr, svmAllocation);
|
||||
EXPECT_EQ(MemoryPool::System64KBPages, svmAllocation->getMemoryPool());
|
||||
memoryManager.freeGraphicsMemory(svmAllocation);
|
||||
@@ -896,7 +896,7 @@ TEST(OsAgnosticMemoryManager, givenMemoryManagerWith64KBPagesEnabledWhenAllocate
|
||||
TEST(OsAgnosticMemoryManager, givenMemoryManagerWith64KBPagesDisabledWhenAllocateGraphicsMemoryThen4KBGraphicsAllocationIsReturned) {
|
||||
MockExecutionEnvironment executionEnvironment(defaultHwInfo.get());
|
||||
MemoryManagerCreate<OsAgnosticMemoryManager> memoryManager(false, false, executionEnvironment);
|
||||
auto svmAllocation = memoryManager.allocateGraphicsMemoryWithProperties({0, MemoryConstants::pageSize, GraphicsAllocation::AllocationType::SVM_ZERO_COPY});
|
||||
auto svmAllocation = memoryManager.allocateGraphicsMemoryWithProperties({mockRootDeviceIndex, MemoryConstants::pageSize, GraphicsAllocation::AllocationType::SVM_ZERO_COPY, mockDeviceBitfield});
|
||||
EXPECT_EQ(MemoryPool::System4KBPages, svmAllocation->getMemoryPool());
|
||||
memoryManager.freeGraphicsMemory(svmAllocation);
|
||||
}
|
||||
@@ -1143,11 +1143,11 @@ TEST(OsAgnosticMemoryManager, GivenEnabled64kbPagesWhenHostMemoryAllocationIsCre
|
||||
MockExecutionEnvironment executionEnvironment(defaultHwInfo.get());
|
||||
MemoryManagerCreate<OsAgnosticMemoryManager> memoryManager(true, false, executionEnvironment);
|
||||
|
||||
GraphicsAllocation *galloc = memoryManager.allocateGraphicsMemoryWithProperties({0, MemoryConstants::pageSize64k, GraphicsAllocation::AllocationType::BUFFER_HOST_MEMORY});
|
||||
GraphicsAllocation *galloc = memoryManager.allocateGraphicsMemoryWithProperties({mockRootDeviceIndex, MemoryConstants::pageSize64k, GraphicsAllocation::AllocationType::BUFFER_HOST_MEMORY, mockDeviceBitfield});
|
||||
EXPECT_NE(nullptr, galloc);
|
||||
memoryManager.freeGraphicsMemory(galloc);
|
||||
|
||||
galloc = memoryManager.allocateGraphicsMemoryWithProperties({0, MemoryConstants::pageSize64k, GraphicsAllocation::AllocationType::BUFFER_HOST_MEMORY});
|
||||
galloc = memoryManager.allocateGraphicsMemoryWithProperties({mockRootDeviceIndex, MemoryConstants::pageSize64k, GraphicsAllocation::AllocationType::BUFFER_HOST_MEMORY, mockDeviceBitfield});
|
||||
EXPECT_NE(nullptr, galloc);
|
||||
EXPECT_NE(nullptr, galloc->getUnderlyingBuffer());
|
||||
EXPECT_EQ(0u, (uintptr_t)galloc->getUnderlyingBuffer() % MemoryConstants::pageSize64k);
|
||||
|
||||
@@ -88,7 +88,7 @@ TEST_F(SVMMemoryAllocatorTest, whenSVMAllocationIsFreedThenCannotBeGotAgain) {
|
||||
TEST_F(SVMMemoryAllocatorTest, givenSvmManagerWhenOperatedOnThenCorrectAllocationIsInsertedReturnedAndRemoved) {
|
||||
int data;
|
||||
size_t size = sizeof(data);
|
||||
auto allocation = memoryManager->allocateGraphicsMemoryWithProperties({0, size, GraphicsAllocation::AllocationType::BUFFER_HOST_MEMORY});
|
||||
auto allocation = memoryManager->allocateGraphicsMemoryWithProperties({mockRootDeviceIndex, size, GraphicsAllocation::AllocationType::BUFFER_HOST_MEMORY, mockDeviceBitfield});
|
||||
|
||||
NEO::SvmAllocationData svmData;
|
||||
svmData.gpuAllocation = allocation;
|
||||
|
||||
@@ -438,7 +438,7 @@ TEST_F(WddmCommandStreamTest, givenWddmWithKmDafDisabledWhenFlushIsCalledWithAll
|
||||
LinearStream cs(commandBuffer);
|
||||
BatchBuffer batchBuffer{cs.getGraphicsAllocation(), 0, 0, nullptr, false, false, QueueThrottle::MEDIUM, QueueSliceCount::defaultSliceCount, cs.getUsed(), &cs, nullptr};
|
||||
|
||||
auto linearStreamAllocation = memoryManager->allocateGraphicsMemoryWithProperties({csr->getRootDeviceIndex(), MemoryConstants::pageSize, GraphicsAllocation::AllocationType::LINEAR_STREAM});
|
||||
auto linearStreamAllocation = memoryManager->allocateGraphicsMemoryWithProperties({csr->getRootDeviceIndex(), MemoryConstants::pageSize, GraphicsAllocation::AllocationType::LINEAR_STREAM, device->getDeviceBitfield()});
|
||||
ASSERT_NE(nullptr, linearStreamAllocation);
|
||||
ResidencyContainer allocationsForResidency = {linearStreamAllocation};
|
||||
|
||||
@@ -473,7 +473,7 @@ TEST_F(WddmCommandStreamTest, givenWddmWithKmDafEnabledWhenFlushIsCalledWithResi
|
||||
LinearStream cs(commandBuffer);
|
||||
BatchBuffer batchBuffer{cs.getGraphicsAllocation(), 0, 0, nullptr, false, false, QueueThrottle::MEDIUM, QueueSliceCount::defaultSliceCount, cs.getUsed(), &cs, nullptr};
|
||||
|
||||
auto linearStreamAllocation = static_cast<WddmAllocation *>(memoryManager->allocateGraphicsMemoryWithProperties({csr->getRootDeviceIndex(), MemoryConstants::pageSize, GraphicsAllocation::AllocationType::LINEAR_STREAM}));
|
||||
auto linearStreamAllocation = static_cast<WddmAllocation *>(memoryManager->allocateGraphicsMemoryWithProperties({csr->getRootDeviceIndex(), MemoryConstants::pageSize, GraphicsAllocation::AllocationType::LINEAR_STREAM, device->getDeviceBitfield()}));
|
||||
ASSERT_NE(nullptr, linearStreamAllocation);
|
||||
|
||||
csr->makeResident(*linearStreamAllocation);
|
||||
@@ -497,7 +497,7 @@ TEST_F(WddmCommandStreamTest, givenWddmWithKmDafEnabledWhenFlushIsCalledWithAllo
|
||||
LinearStream cs(commandBuffer);
|
||||
BatchBuffer batchBuffer{cs.getGraphicsAllocation(), 0, 0, nullptr, false, false, QueueThrottle::MEDIUM, QueueSliceCount::defaultSliceCount, cs.getUsed(), &cs, nullptr};
|
||||
|
||||
auto linearStreamAllocation = static_cast<WddmAllocation *>(memoryManager->allocateGraphicsMemoryWithProperties({csr->getRootDeviceIndex(), MemoryConstants::pageSize, GraphicsAllocation::AllocationType::LINEAR_STREAM}));
|
||||
auto linearStreamAllocation = static_cast<WddmAllocation *>(memoryManager->allocateGraphicsMemoryWithProperties({csr->getRootDeviceIndex(), MemoryConstants::pageSize, GraphicsAllocation::AllocationType::LINEAR_STREAM, device->getDeviceBitfield()}));
|
||||
ASSERT_NE(nullptr, linearStreamAllocation);
|
||||
ResidencyContainer allocationsForResidency = {linearStreamAllocation};
|
||||
|
||||
@@ -518,7 +518,7 @@ TEST_F(WddmCommandStreamTest, givenWddmWithKmDafEnabledWhenFlushIsCalledWithAllo
|
||||
LinearStream cs(commandBuffer);
|
||||
BatchBuffer batchBuffer{cs.getGraphicsAllocation(), 0, 0, nullptr, false, false, QueueThrottle::MEDIUM, QueueSliceCount::defaultSliceCount, cs.getUsed(), &cs, nullptr};
|
||||
|
||||
auto fillPatternAllocation = static_cast<WddmAllocation *>(memoryManager->allocateGraphicsMemoryWithProperties({csr->getRootDeviceIndex(), MemoryConstants::pageSize, GraphicsAllocation::AllocationType::FILL_PATTERN}));
|
||||
auto fillPatternAllocation = static_cast<WddmAllocation *>(memoryManager->allocateGraphicsMemoryWithProperties({csr->getRootDeviceIndex(), MemoryConstants::pageSize, GraphicsAllocation::AllocationType::FILL_PATTERN, device->getDeviceBitfield()}));
|
||||
ASSERT_NE(nullptr, fillPatternAllocation);
|
||||
ResidencyContainer allocationsForResidency = {fillPatternAllocation};
|
||||
|
||||
@@ -539,7 +539,7 @@ TEST_F(WddmCommandStreamTest, givenWddmWithKmDafEnabledWhenFlushIsCalledWithAllo
|
||||
LinearStream cs(commandBuffer);
|
||||
BatchBuffer batchBuffer{cs.getGraphicsAllocation(), 0, 0, nullptr, false, false, QueueThrottle::MEDIUM, QueueSliceCount::defaultSliceCount, cs.getUsed(), &cs, nullptr};
|
||||
|
||||
auto commandBufferAllocation = static_cast<WddmAllocation *>(memoryManager->allocateGraphicsMemoryWithProperties({csr->getRootDeviceIndex(), MemoryConstants::pageSize, GraphicsAllocation::AllocationType::COMMAND_BUFFER}));
|
||||
auto commandBufferAllocation = static_cast<WddmAllocation *>(memoryManager->allocateGraphicsMemoryWithProperties({csr->getRootDeviceIndex(), MemoryConstants::pageSize, GraphicsAllocation::AllocationType::COMMAND_BUFFER, device->getDeviceBitfield()}));
|
||||
ASSERT_NE(nullptr, commandBufferAllocation);
|
||||
ResidencyContainer allocationsForResidency = {commandBufferAllocation};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user