Add canonized gpuAddress to GraphicsAllocation constructor

Related-To: NEO-6523
Signed-off-by: Krzysztof Gibala <krzysztof.gibala@intel.com>
This commit is contained in:
Krzysztof Gibala
2022-06-03 11:48:45 +00:00
committed by Compute-Runtime-Automation
parent 1a7c11e4f1
commit 81899c4477
22 changed files with 289 additions and 152 deletions

View File

@ -845,8 +845,9 @@ TEST_F(KernelGlobalSurfaceTest, givenNDRangeKernelWhenKernelIsCreatedThenGlobalS
pKernelInfo->kernelDescriptor.kernelAttributes.simdSize = 32;
char buffer[16];
GraphicsAllocation gfxAlloc(0, AllocationType::UNKNOWN, buffer, (uint64_t)buffer - 8u, 8, MemoryPool::MemoryNull, 0u);
auto gmmHelper = pDevice->getGmmHelper();
auto canonizedGpuAddress = gmmHelper->canonize(castToUint64(buffer));
GraphicsAllocation gfxAlloc(0, AllocationType::UNKNOWN, buffer, (uint64_t)buffer - 8u, 8, MemoryPool::MemoryNull, 0u, canonizedGpuAddress);
uint64_t bufferAddress = gfxAlloc.getGpuAddress();
// create kernel
@ -964,8 +965,9 @@ TEST_F(KernelConstantSurfaceTest, givenNDRangeKernelWhenKernelIsCreatedThenConst
pKernelInfo->kernelDescriptor.kernelAttributes.simdSize = 32;
char buffer[16];
GraphicsAllocation gfxAlloc(0, AllocationType::UNKNOWN, buffer, (uint64_t)buffer - 8u, 8, MemoryPool::MemoryNull, 0u);
auto gmmHelper = pDevice->getGmmHelper();
auto canonizedGpuAddress = gmmHelper->canonize(castToUint64(buffer));
GraphicsAllocation gfxAlloc(0, AllocationType::UNKNOWN, buffer, (uint64_t)buffer - 8u, 8, MemoryPool::MemoryNull, 0u, canonizedGpuAddress);
uint64_t bufferAddress = gfxAlloc.getGpuAddress();
// create kernel
@ -2952,8 +2954,10 @@ HWTEST2_F(KernelConstantSurfaceTest, givenKernelWithConstantSurfaceWhenKernelIsC
pKernelInfo->setGlobalConstantsSurface(8, 0, 0);
char buffer[MemoryConstants::pageSize64k];
GraphicsAllocation gfxAlloc(0, AllocationType::CONSTANT_SURFACE, buffer,
MemoryConstants::pageSize64k, static_cast<osHandle>(8), MemoryPool::MemoryNull, MemoryManager::maxOsContextCount);
auto gmmHelper = pDevice->getGmmHelper();
auto canonizedGpuAddress = gmmHelper->canonize(castToUint64(buffer));
GraphicsAllocation gfxAlloc(0, AllocationType::CONSTANT_SURFACE, buffer, MemoryConstants::pageSize64k,
static_cast<osHandle>(8), MemoryPool::MemoryNull, MemoryManager::maxOsContextCount, canonizedGpuAddress);
MockContext context(pClDevice);
MockProgram program(&context, false, toClDeviceVector(*pClDevice));