Create graphicsAllocation for all devices in buffer

Related-To: NEO-4589
Change-Id: Ic9625eb3c9c359fd4cc5afe3519e7acf4efb0081
Signed-off-by: Krzysztof Gibala <krzysztof.gibala@intel.com>
This commit is contained in:
Krzysztof Gibala
2020-09-03 13:36:38 +02:00
committed by sys_ocldev
parent 43b47b48bf
commit 3ac197e400
4 changed files with 331 additions and 155 deletions

View File

@@ -1809,6 +1809,18 @@ TEST_F(BufferTransferTests, givenBufferWhenTransferFromHostPtrCalledThenCopyRequ
using MultiRootDeviceBufferTest = MultiRootDeviceFixture;
TEST_F(MultiRootDeviceBufferTest, WhenCleanAllGraphicsAllocationsCalledThenGraphicsAllocationsAreProperlyRemoved) {
std::map<uint32_t, NEO::CreateBuffer::AllocationInfo> allocationInfo;
for (auto rootDeviceIndex = 1u; rootDeviceIndex < 2u; rootDeviceIndex++) {
allocationInfo.insert({rootDeviceIndex, {}});
}
allocationInfo[1u].memory = mockMemoryManager->allocateGraphicsMemoryWithProperties(MockAllocationProperties{1u, MemoryConstants::pageSize});
Buffer::cleanAllGraphicsAllocations(*context, *context->getMemoryManager(), allocationInfo);
}
TEST_F(MultiRootDeviceBufferTest, WhenBufferIsCreatedThenBufferGraphicsAllocationHasCorrectRootDeviceIndex) {
cl_int retVal = 0;
cl_mem_flags flags = CL_MEM_READ_WRITE;