Use root device index when accessing graphics allocation from buffer

Related-To: NEO-4672
Change-Id: I31ed0aa567276b606f4b09733ca2a8d678f9786f
Signed-off-by: Mateusz Jablonski <mateusz.jablonski@intel.com>
This commit is contained in:
Mateusz Jablonski
2020-06-08 19:17:23 +02:00
committed by sys_ocldev
parent 9e8945ca83
commit 87596d2387
27 changed files with 253 additions and 227 deletions

View File

@@ -113,8 +113,8 @@ TEST(ZeroCopyBufferTestWithSharedContext, GivenContextThatIsSharedWhenAskedForBu
EXPECT_EQ(CL_SUCCESS, retVal);
EXPECT_TRUE(buffer->isMemObjZeroCopy()) << "Zero Copy not handled properly";
if (buffer->getGraphicsAllocation()->is32BitAllocation() == false) {
EXPECT_EQ(host_ptr, buffer->getGraphicsAllocation()->getUnderlyingBuffer());
if (buffer->getGraphicsAllocation(context.getDevice(0)->getRootDeviceIndex())->is32BitAllocation() == false) {
EXPECT_EQ(host_ptr, buffer->getGraphicsAllocation(context.getDevice(0)->getRootDeviceIndex())->getUnderlyingBuffer());
}
}
@@ -173,7 +173,7 @@ TEST(ZeroCopyWithDebugFlag, GivenBufferInputsThatWouldResultInZeroCopyAndDisable
EXPECT_FALSE(buffer->mappingOnCpuAllowed());
EXPECT_EQ(nullptr, buffer->getHostPtr());
EXPECT_EQ(nullptr, buffer->getAllocatedMapPtr());
auto bufferAllocation = buffer->getGraphicsAllocation()->getUnderlyingBuffer();
auto bufferAllocation = buffer->getGraphicsAllocation(context.getDevice(0)->getRootDeviceIndex())->getUnderlyingBuffer();
auto mapAllocation = buffer->getBasePtrForMap(0);
EXPECT_EQ(mapAllocation, buffer->getAllocatedMapPtr());
@@ -193,7 +193,7 @@ TEST(ZeroCopyBufferWith32BitAddressing, GivenDeviceSupporting32BitAddressingWhen
EXPECT_TRUE(buffer->isMemObjZeroCopy());
if (is64bit) {
EXPECT_TRUE(buffer->getGraphicsAllocation()->is32BitAllocation());
EXPECT_TRUE(buffer->getGraphicsAllocation(context.getDevice(0)->getRootDeviceIndex())->is32BitAllocation());
}
alignedFree(host_ptr);
}