mirror of
https://github.com/intel/compute-runtime.git
synced 2025-12-22 10:17:01 +08:00
Simplify Memory Manager API [2/n]
- make AllocationData a protected structure - use AllocationProperties instead of AllocationFlags - refactor methods: allocateGraphicsMemory64kb, allocateGraphicsMemoryForSVM - call AllocateGraphicsMemoryInPreferredPool in AllocateGraphicsMemory where there is no host ptr Change-Id: Ie9ca47b1bccacd00f8486e7d1bf6fb3985e5cb12 Signed-off-by: Mateusz Jablonski <mateusz.jablonski@intel.com>
This commit is contained in:
committed by
sys_ocldev
parent
7e397b0132
commit
a6be6533ea
@@ -855,7 +855,7 @@ cl_int Program::parseProgramScopePatchList() {
|
||||
|
||||
surfaceSize = patch.InlineDataSize;
|
||||
headerSize = sizeof(SPatchAllocateConstantMemorySurfaceProgramBinaryInfo);
|
||||
constantSurface = pDevice->getMemoryManager()->allocateGraphicsMemoryInPreferredPool(AllocationFlags(true), 0, nullptr, surfaceSize, GraphicsAllocation::AllocationType::CONSTANT_SURFACE);
|
||||
constantSurface = pDevice->getMemoryManager()->allocateGraphicsMemoryInPreferredPool(AllocationProperties(true, surfaceSize), 0, nullptr, GraphicsAllocation::AllocationType::CONSTANT_SURFACE);
|
||||
|
||||
memcpy_s(constantSurface->getUnderlyingBuffer(), surfaceSize, (cl_char *)pPatch + headerSize, surfaceSize);
|
||||
pCurPatchListPtr = ptrOffset(pCurPatchListPtr, surfaceSize);
|
||||
@@ -877,7 +877,7 @@ cl_int Program::parseProgramScopePatchList() {
|
||||
surfaceSize = patch.InlineDataSize;
|
||||
globalVarTotalSize += (size_t)surfaceSize;
|
||||
headerSize = sizeof(SPatchAllocateGlobalMemorySurfaceProgramBinaryInfo);
|
||||
globalSurface = pDevice->getMemoryManager()->allocateGraphicsMemoryInPreferredPool(AllocationFlags(true), 0, nullptr, surfaceSize, GraphicsAllocation::AllocationType::GLOBAL_SURFACE);
|
||||
globalSurface = pDevice->getMemoryManager()->allocateGraphicsMemoryInPreferredPool(AllocationProperties(true, surfaceSize), 0, nullptr, GraphicsAllocation::AllocationType::GLOBAL_SURFACE);
|
||||
|
||||
memcpy_s(globalSurface->getUnderlyingBuffer(), surfaceSize, (cl_char *)pPatch + headerSize, surfaceSize);
|
||||
pCurPatchListPtr = ptrOffset(pCurPatchListPtr, surfaceSize);
|
||||
|
||||
Reference in New Issue
Block a user