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

@ -1804,10 +1804,10 @@ TEST_F(GTPinTests, givenInitializedGTPinInterfaceWhenKernelIsCreatedThenAllKerne
// Verify that correct GT-Pin resource is made resident
cl_mem gtpinBuffer0 = kernelExecQueue[0].gtpinResource;
auto pBuffer0 = castToObject<Buffer>(gtpinBuffer0);
GraphicsAllocation *pGfxAlloc0 = pBuffer0->getGraphicsAllocation();
GraphicsAllocation *pGfxAlloc0 = pBuffer0->getGraphicsAllocation(pDevice->getRootDeviceIndex());
cl_mem gtpinBuffer1 = kernelExecQueue[1].gtpinResource;
auto pBuffer1 = castToObject<Buffer>(gtpinBuffer1);
GraphicsAllocation *pGfxAlloc1 = pBuffer1->getGraphicsAllocation();
GraphicsAllocation *pGfxAlloc1 = pBuffer1->getGraphicsAllocation(pDevice->getRootDeviceIndex());
CommandStreamReceiver &csr = pCmdQueue->getGpgpuCommandStreamReceiver();
EXPECT_FALSE(pGfxAlloc0->isResident(csr.getOsContext().getContextId()));
EXPECT_FALSE(pGfxAlloc1->isResident(csr.getOsContext().getContextId()));
@ -1974,10 +1974,10 @@ TEST_F(GTPinTests, givenInitializedGTPinInterfaceWhenOneKernelIsSubmittedSeveral
// This simulates enqueuing non-blocked kernels
cl_mem gtpinBuffer0 = kernelExecQueue[0].gtpinResource;
auto pBuffer0 = castToObject<Buffer>(gtpinBuffer0);
GraphicsAllocation *pGfxAlloc0 = pBuffer0->getGraphicsAllocation();
GraphicsAllocation *pGfxAlloc0 = pBuffer0->getGraphicsAllocation(pDevice->getRootDeviceIndex());
cl_mem gtpinBuffer1 = kernelExecQueue[1].gtpinResource;
auto pBuffer1 = castToObject<Buffer>(gtpinBuffer1);
GraphicsAllocation *pGfxAlloc1 = pBuffer1->getGraphicsAllocation();
GraphicsAllocation *pGfxAlloc1 = pBuffer1->getGraphicsAllocation(pDevice->getRootDeviceIndex());
CommandStreamReceiver &csr = pCmdQueue->getGpgpuCommandStreamReceiver();
// Make resident resource of first submitted kernel
EXPECT_FALSE(pGfxAlloc0->isResident(csr.getOsContext().getContextId()));