mirror of
https://github.com/intel/compute-runtime.git
synced 2026-01-05 09:09:04 +08:00
feature: track InOrder allocation ownership
CmdList can be released before Event. In this case, GfxAllocation destruction must be deferred. Related-To: NEO-7966 Signed-off-by: Dunajski, Bartosz <bartosz.dunajski@intel.com>
This commit is contained in:
committed by
Compute-Runtime-Automation
parent
e16220dc9f
commit
202a33ffac
@@ -72,6 +72,23 @@ TEST(MemoryManagerTest, givenDefaultMemoryManagerWhenGraphicsAllocationContainsE
|
||||
memoryManager.freeGraphicsMemory(graphicsAllocation);
|
||||
}
|
||||
|
||||
TEST(MemoryManagerTest, givenMultipleOwnersWhenReleasingAllocationThenFreeOnlyWhenNoActiveOwners) {
|
||||
MockExecutionEnvironment executionEnvironment(defaultHwInfo.get());
|
||||
OsAgnosticMemoryManager memoryManager(executionEnvironment);
|
||||
|
||||
auto graphicsAllocation = memoryManager.allocateGraphicsMemoryWithProperties(MockAllocationProperties{0, MemoryConstants::pageSize});
|
||||
|
||||
graphicsAllocation->incNumOwners();
|
||||
graphicsAllocation->incNumOwners();
|
||||
EXPECT_EQ(3u, graphicsAllocation->fetchDecNumOwners());
|
||||
|
||||
graphicsAllocation->incNumOwners();
|
||||
memoryManager.freeGraphicsMemory(graphicsAllocation);
|
||||
EXPECT_EQ(2u, graphicsAllocation->fetchDecNumOwners());
|
||||
|
||||
memoryManager.freeGraphicsMemory(graphicsAllocation);
|
||||
}
|
||||
|
||||
TEST(MemoryManagerTest, whenGettingPreferredAllocationMethodThenNotDefinedIsReturned) {
|
||||
MockMemoryManager memoryManager;
|
||||
for (auto i = 0; i < static_cast<int>(AllocationType::COUNT); i++) {
|
||||
|
||||
Reference in New Issue
Block a user