mirror of
https://github.com/intel/compute-runtime.git
synced 2025-12-21 01:04:57 +08:00
Refactor allocateGraphicsMemoryInPreferredPool
- extend AllocationType to code necessary flags - remove redundant args - refactor Buffer::create() Change-Id: Ic4b2e0931fad8198ad1cf4f79de210d815048ccf
This commit is contained in:
committed by
sys_ocldev
parent
c2454d5aa2
commit
4441387969
@@ -1223,16 +1223,16 @@ TEST(OsAgnosticMemoryManager, givenDisabledAsyncDeleterFlagWhenMemoryManagerIsCr
|
||||
DebugManager.flags.EnableDeferredDeleter.set(defaultEnableDeferredDeleterFlag);
|
||||
}
|
||||
|
||||
TEST(OsAgnosticMemoryManager, GivenEnabled64kbPagesWhenAllocationIsCreatedThenAlignedto64KbAllocationIsReturned) {
|
||||
TEST(OsAgnosticMemoryManager, GivenEnabled64kbPagesWhenHostMemoryAllocationIsCreatedThenAlignedto64KbAllocationIsReturned) {
|
||||
DebugManagerStateRestore dbgRestore;
|
||||
DebugManager.flags.Enable64kbpages.set(true);
|
||||
OsAgnosticMemoryManager memoryManager(true);
|
||||
|
||||
GraphicsAllocation *galloc = memoryManager.allocateGraphicsMemoryInPreferredPool(true, true, false, false, nullptr, 64 * 1024, GraphicsAllocation::AllocationType::BUFFER);
|
||||
GraphicsAllocation *galloc = memoryManager.allocateGraphicsMemoryInPreferredPool(true, nullptr, 64 * 1024, GraphicsAllocation::AllocationType::BUFFER_HOST_MEMORY);
|
||||
EXPECT_NE(nullptr, galloc);
|
||||
memoryManager.freeGraphicsMemory(galloc);
|
||||
|
||||
galloc = memoryManager.allocateGraphicsMemoryInPreferredPool(true, true, true, false, nullptr, 64 * 1024, GraphicsAllocation::AllocationType::BUFFER);
|
||||
galloc = memoryManager.allocateGraphicsMemoryInPreferredPool(true, nullptr, 64 * 1024, GraphicsAllocation::AllocationType::BUFFER_HOST_MEMORY);
|
||||
EXPECT_NE(nullptr, galloc);
|
||||
EXPECT_NE(nullptr, galloc->getUnderlyingBuffer());
|
||||
EXPECT_EQ(0u, (uintptr_t)galloc->getUnderlyingBuffer() % MemoryConstants::pageSize64k);
|
||||
|
||||
Reference in New Issue
Block a user