Move allocateGraphicsMemoryInDevicePool to Os Agnostic memory manager.

Change-Id: Ica179986f401b99e61c3485d549790489cbb1fd5
Signed-off-by: Mrozek, Michal <michal.mrozek@intel.com>
This commit is contained in:
Mrozek, Michal
2019-05-25 01:55:40 +02:00
parent 7989a68f6f
commit edb78834cb
5 changed files with 33 additions and 62 deletions

View File

@ -1677,22 +1677,6 @@ TEST(MemoryManagerTest, givenAllocationTypesThatMayNeedL3FlushWhenCallingGetAllo
}
}
TEST(MemoryManagerTest, givenSpecializedMemoryManagerWhenCallingConstructGraphicsAllocationThenNullptrIsReturned) {
struct MemoryManagerConstructAllocation : public MockMemoryManager {
GraphicsAllocation *constructGraphicsAllocation(GraphicsAllocation::AllocationType allocationType, void *cpuPtrIn, uint64_t gpuAddress,
size_t sizeIn, MemoryPool::Type pool, bool multiOsContextCapable) override {
return MemoryManager::constructGraphicsAllocation(allocationType, cpuPtrIn, gpuAddress,
sizeIn, pool, multiOsContextCapable);
}
MemoryManagerConstructAllocation(ExecutionEnvironment &executionEnvironment) : MockMemoryManager(false, executionEnvironment) {}
};
MockExecutionEnvironment executionEnvironment(*platformDevices);
MemoryManagerConstructAllocation memoryManager(executionEnvironment);
auto allocation = memoryManager.constructGraphicsAllocation(GraphicsAllocation::AllocationType::UNKNOWN, nullptr, 0, 0, MemoryPool::MemoryNull, false);
EXPECT_EQ(nullptr, allocation);
}
TEST(HeapSelectorTest, given32bitInternalAllocationWhenSelectingHeapThenInternalHeapIsUsed) {
GraphicsAllocation allocation{GraphicsAllocation::AllocationType::KERNEL_ISA, nullptr, 0, 0, 0, MemoryPool::MemoryNull, false};
allocation.set32BitAllocation(true);