mirror of
https://github.com/intel/compute-runtime.git
synced 2026-01-03 06:49:52 +08:00
Create map for deviceBitfields per rootDeviceIndex
Pass rootDeviceIndex to getDeviceBitfieldForAllocation Related-To: NEO-4589 Change-Id: Ib325a8bf822351ba36b225d94d4173fd725e8766 Signed-off-by: Krzysztof Gibala <krzysztof.gibala@intel.com>
This commit is contained in:
committed by
sys_ocldev
parent
e28f937683
commit
214342f405
@@ -540,28 +540,28 @@ TEST_F(MemObjMultiRootDeviceTests, WhenMemObjIsCreatedWithMultiGraphicsAllocatio
|
||||
}
|
||||
|
||||
TEST_F(MemObjMultiRootDeviceTests, WhenMemObjMapAreCreatedThenAllAllocationAreDestroyedProperly) {
|
||||
auto allocation0 = mockMemoryManager->allocateGraphicsMemoryWithProperties(MockAllocationProperties{0, MemoryConstants::pageSize});
|
||||
auto allocation0 = mockMemoryManager->allocateGraphicsMemoryWithProperties(MockAllocationProperties{2, MemoryConstants::pageSize});
|
||||
auto allocation1 = mockMemoryManager->allocateGraphicsMemoryWithProperties(MockAllocationProperties{1, MemoryConstants::pageSize});
|
||||
|
||||
auto multiGraphicsAllocation = MultiGraphicsAllocation(1);
|
||||
auto multiGraphicsAllocation = MultiGraphicsAllocation(2);
|
||||
multiGraphicsAllocation.addAllocation(allocation0);
|
||||
multiGraphicsAllocation.addAllocation(allocation1);
|
||||
|
||||
auto memoryProperties = MemoryPropertiesHelper::createMemoryProperties(CL_MEM_READ_WRITE, 0, 0, &context->getDevice(0)->getDevice());
|
||||
auto memoryProperties = MemoryPropertiesHelper::createMemoryProperties(CL_MEM_READ_WRITE, 0, 0, &context->getDevice(1)->getDevice());
|
||||
std::unique_ptr<MemObj> memObj(
|
||||
new MemObj(context.get(), CL_MEM_OBJECT_BUFFER, memoryProperties, CL_MEM_READ_WRITE, 0,
|
||||
1, nullptr, nullptr, multiGraphicsAllocation, true, false, false));
|
||||
|
||||
auto mapAllocation0 = memObj->getMapAllocation(0);
|
||||
auto mapAllocation0 = memObj->getMapAllocation(2);
|
||||
auto mapAllocation1 = memObj->getMapAllocation(1);
|
||||
|
||||
EXPECT_EQ(nullptr, mapAllocation0);
|
||||
EXPECT_EQ(nullptr, mapAllocation1);
|
||||
|
||||
EXPECT_NE(nullptr, memObj->getBasePtrForMap(0));
|
||||
EXPECT_EQ(memObj->getBasePtrForMap(0), memObj->getBasePtrForMap(1));
|
||||
EXPECT_NE(nullptr, memObj->getBasePtrForMap(2));
|
||||
EXPECT_EQ(memObj->getBasePtrForMap(2), memObj->getBasePtrForMap(1));
|
||||
|
||||
mapAllocation0 = memObj->getMapAllocation(0);
|
||||
mapAllocation0 = memObj->getMapAllocation(2);
|
||||
mapAllocation1 = memObj->getMapAllocation(1);
|
||||
|
||||
ASSERT_NE(nullptr, mapAllocation0);
|
||||
|
||||
Reference in New Issue
Block a user