Refactor MemoryAllocation memoryPool overriding

Change-Id: I4fc2293fac6bc47a0139fedb81c2a879b610101f
This commit is contained in:
Hoppe, Mateusz 2018-09-25 13:03:50 -07:00 committed by sys_ocldev
parent dfd4e767e0
commit 26154ae21a
2 changed files with 6 additions and 4 deletions

View File

@ -24,12 +24,10 @@ class MemoryAllocation : public GraphicsAllocation {
MemoryAllocation(bool cpuPtrAllocated, void *pMem, uint64_t gpuAddress, size_t memSize, uint64_t count, MemoryPool::Type pool) : GraphicsAllocation(pMem, gpuAddress, 0u, memSize), MemoryAllocation(bool cpuPtrAllocated, void *pMem, uint64_t gpuAddress, size_t memSize, uint64_t count, MemoryPool::Type pool) : GraphicsAllocation(pMem, gpuAddress, 0u, memSize),
id(count) { id(count) {
this->cpuPtrAllocated = cpuPtrAllocated; this->cpuPtrAllocated = cpuPtrAllocated;
this->memoryPool = pool; overrideMemoryPool(pool);
} }
void overrideMemoryPool(MemoryPool::Type pool) { void overrideMemoryPool(MemoryPool::Type pool);
memoryPool = pool;
}
}; };
typedef std::map<void *, MemoryAllocation *> PointerMap; typedef std::map<void *, MemoryAllocation *> PointerMap;

View File

@ -11,4 +11,8 @@ namespace OCLRT {
GraphicsAllocation *OsAgnosticMemoryManager::allocateGraphicsMemoryInDevicePool(const AllocationData &allocationData, AllocationStatus &status) { GraphicsAllocation *OsAgnosticMemoryManager::allocateGraphicsMemoryInDevicePool(const AllocationData &allocationData, AllocationStatus &status) {
return MemoryManager::allocateGraphicsMemoryInDevicePool(allocationData, status); return MemoryManager::allocateGraphicsMemoryInDevicePool(allocationData, status);
} }
void MemoryAllocation::overrideMemoryPool(MemoryPool::Type pool) {
this->memoryPool = pool;
}
} // namespace OCLRT } // namespace OCLRT