mirror of
https://github.com/intel/compute-runtime.git
synced 2026-01-04 07:14:10 +08:00
Simplify Memory Manager API [3/4]
- remove method allocateGraphicsMemory(size_t size) - pass allocation type in allocation properties - set allocation type in allocateGraphicsMemoryInPreferredPool Change-Id: Ia9296d0ab2f711b7d78aff615cb56b3a246b60ec Signed-off-by: Mateusz Jablonski <mateusz.jablonski@intel.com>
This commit is contained in:
committed by
sys_ocldev
parent
686785ce5d
commit
8ec072d39c
@@ -184,7 +184,7 @@ HWTEST_F(KernelImageArgTest, givenImgWithMcsAllocWhenMakeResidentThenMakeMcsAllo
|
||||
auto surfaceFormat = Image::getSurfaceFormatFromTable(0, &imgFormat);
|
||||
auto img = Image::create(context.get(), 0, surfaceFormat, &imgDesc, nullptr, retVal);
|
||||
EXPECT_EQ(CL_SUCCESS, retVal);
|
||||
auto mcsAlloc = context->getMemoryManager()->allocateGraphicsMemory(4096);
|
||||
auto mcsAlloc = context->getMemoryManager()->allocateGraphicsMemoryWithProperties(MockAllocationProperties{MemoryConstants::pageSize});
|
||||
img->setMcsAllocation(mcsAlloc);
|
||||
cl_mem memObj = img;
|
||||
pKernel->setArg(0, sizeof(memObj), &memObj);
|
||||
|
||||
@@ -1965,12 +1965,12 @@ TEST_F(ReflectionSurfaceConstantValuesPatchingTest, GivenBlockWithGlobalMemoryWh
|
||||
MockParentKernel *parentKernel = MockParentKernel::create(context, false, true, false);
|
||||
|
||||
// graphicsMemory is released by Program
|
||||
GraphicsAllocation *globalMemory = pDevice->getMemoryManager()->allocateGraphicsMemory(4096);
|
||||
GraphicsAllocation *globalMemory = pDevice->getMemoryManager()->allocateGraphicsMemoryWithProperties(MockAllocationProperties{MemoryConstants::pageSize});
|
||||
|
||||
parentKernel->mockProgram->setGlobalSurface(globalMemory);
|
||||
|
||||
// Allocte reflectionSurface, 2 * 4096 should be enough
|
||||
GraphicsAllocation *reflectionSurface = pDevice->getMemoryManager()->allocateGraphicsMemory(2 * 4096);
|
||||
GraphicsAllocation *reflectionSurface = pDevice->getMemoryManager()->allocateGraphicsMemoryWithProperties(MockAllocationProperties{2 * MemoryConstants::pageSize});
|
||||
parentKernel->setReflectionSurface(reflectionSurface);
|
||||
|
||||
memset(reflectionSurface->getUnderlyingBuffer(), 0, reflectionSurface->getUnderlyingBufferSize());
|
||||
@@ -2004,7 +2004,7 @@ TEST_F(ReflectionSurfaceConstantValuesPatchingTest, GivenBlockWithGlobalMemoryAn
|
||||
}
|
||||
|
||||
// Allocte reflectionSurface, 2 * 4096 should be enough
|
||||
GraphicsAllocation *reflectionSurface = pDevice->getMemoryManager()->allocateGraphicsMemory(2 * 4096);
|
||||
GraphicsAllocation *reflectionSurface = pDevice->getMemoryManager()->allocateGraphicsMemoryWithProperties(MockAllocationProperties{2 * MemoryConstants::pageSize});
|
||||
parentKernel->setReflectionSurface(reflectionSurface);
|
||||
|
||||
memset(reflectionSurface->getUnderlyingBuffer(), 0, reflectionSurface->getUnderlyingBufferSize());
|
||||
@@ -2032,12 +2032,12 @@ TEST_F(ReflectionSurfaceConstantValuesPatchingTest, GivenBlockWithConstantMemory
|
||||
MockParentKernel *parentKernel = MockParentKernel::create(context, false, false, true);
|
||||
|
||||
// graphicsMemory is released by Program
|
||||
GraphicsAllocation *constantMemory = pDevice->getMemoryManager()->allocateGraphicsMemory(4096);
|
||||
GraphicsAllocation *constantMemory = pDevice->getMemoryManager()->allocateGraphicsMemoryWithProperties(MockAllocationProperties{MemoryConstants::pageSize});
|
||||
|
||||
parentKernel->mockProgram->setConstantSurface(constantMemory);
|
||||
|
||||
// Allocte reflectionSurface, 2 * 4096 should be enough
|
||||
GraphicsAllocation *reflectionSurface = pDevice->getMemoryManager()->allocateGraphicsMemory(2 * 4096);
|
||||
GraphicsAllocation *reflectionSurface = pDevice->getMemoryManager()->allocateGraphicsMemoryWithProperties(MockAllocationProperties{2 * MemoryConstants::pageSize});
|
||||
parentKernel->setReflectionSurface(reflectionSurface);
|
||||
|
||||
memset(reflectionSurface->getUnderlyingBuffer(), 0, reflectionSurface->getUnderlyingBufferSize());
|
||||
@@ -2080,7 +2080,7 @@ TEST_F(ReflectionSurfaceConstantValuesPatchingTest, GivenBlockWithConstantMemory
|
||||
}
|
||||
|
||||
// Allocte reflectionSurface, 2 * 4096 should be enough
|
||||
GraphicsAllocation *reflectionSurface = pDevice->getMemoryManager()->allocateGraphicsMemory(2 * 4096);
|
||||
GraphicsAllocation *reflectionSurface = pDevice->getMemoryManager()->allocateGraphicsMemoryWithProperties(MockAllocationProperties{2 * MemoryConstants::pageSize});
|
||||
parentKernel->setReflectionSurface(reflectionSurface);
|
||||
|
||||
memset(reflectionSurface->getUnderlyingBuffer(), 0, reflectionSurface->getUnderlyingBufferSize());
|
||||
|
||||
@@ -1656,7 +1656,7 @@ HWTEST_F(KernelResidencyTest, givenKernelWhenMakeResidentIsCalledThenKernelIsaIs
|
||||
commandStreamReceiver.storeMakeResidentAllocations = true;
|
||||
|
||||
auto memoryManager = commandStreamReceiver.getMemoryManager();
|
||||
pKernelInfo->kernelAllocation = memoryManager->allocateGraphicsMemory(MemoryConstants::pageSize);
|
||||
pKernelInfo->kernelAllocation = memoryManager->allocateGraphicsMemoryWithProperties(MockAllocationProperties{MemoryConstants::pageSize});
|
||||
|
||||
// setup kernel arg offsets
|
||||
KernelArgPatchInfo kernelArgPatchInfo;
|
||||
|
||||
Reference in New Issue
Block a user