mirror of
https://github.com/intel/compute-runtime.git
synced 2026-01-03 23:03:02 +08:00
Minor renaming in a scope of multi os context allocations:
shareable -> multiOsContextCapable resetTaskCount -> releaseUsageInOsContext resetResidencyTaskCount -> releaseResidencyInOsContext isUsedByContext -> isUsedByOsContext Change-Id: If824246a0e393b962bd12f8c63d429a0fcfcda25 Signed-off-by: Mateusz Jablonski <mateusz.jablonski@intel.com>
This commit is contained in:
committed by
sys_ocldev
parent
b962e721fd
commit
aee69779fa
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (C) 2017-2018 Intel Corporation
|
||||
* Copyright (C) 2017-2019 Intel Corporation
|
||||
*
|
||||
* SPDX-License-Identifier: MIT
|
||||
*
|
||||
@@ -65,7 +65,7 @@ TEST_F(DeferrableAllocationDeletionTest, givenDeferrableAllocationWhenApplyThenW
|
||||
std::this_thread::yield();
|
||||
|
||||
EXPECT_EQ(0u, memoryManager->freeGraphicsMemoryCalled);
|
||||
EXPECT_TRUE(allocation->isUsedByContext(device1ContextId));
|
||||
EXPECT_TRUE(allocation->isUsedByOsContext(device1ContextId));
|
||||
|
||||
// let async thread exit
|
||||
asyncDeleter->allowExit = true;
|
||||
@@ -85,11 +85,11 @@ TEST_F(DeferrableAllocationDeletionTest, givenAllocationUsedByTwoOsContextsWhenA
|
||||
*device2->getDefaultEngine().commandStreamReceiver->getTagAddress() = 1u;
|
||||
allocation->updateTaskCount(1u, device1ContextId);
|
||||
allocation->updateTaskCount(1u, device2ContextId);
|
||||
EXPECT_TRUE(allocation->isUsedByContext(device1ContextId));
|
||||
EXPECT_TRUE(allocation->isUsedByContext(device2ContextId));
|
||||
EXPECT_TRUE(allocation->isUsedByOsContext(device1ContextId));
|
||||
EXPECT_TRUE(allocation->isUsedByOsContext(device2ContextId));
|
||||
EXPECT_EQ(0u, memoryManager->freeGraphicsMemoryCalled);
|
||||
asyncDeleter->deferDeletion(new DeferrableAllocationDeletion(*memoryManager, *allocation));
|
||||
while (allocation->isUsedByContext(device2ContextId)) // wait for second context completion signal
|
||||
while (allocation->isUsedByOsContext(device2ContextId)) // wait for second context completion signal
|
||||
std::this_thread::yield();
|
||||
EXPECT_EQ(0u, memoryManager->freeGraphicsMemoryCalled);
|
||||
asyncDeleter->allowExit = true;
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (C) 2018 Intel Corporation
|
||||
* Copyright (C) 2018-2019 Intel Corporation
|
||||
*
|
||||
* SPDX-License-Identifier: MIT
|
||||
*
|
||||
@@ -87,7 +87,7 @@ TEST(GraphicsAllocationTest, givenResidentGraphicsAllocationWhenResetResidencyTa
|
||||
graphicsAllocation.updateResidencyTaskCount(1u, 0u);
|
||||
EXPECT_TRUE(graphicsAllocation.isResident(0u));
|
||||
|
||||
graphicsAllocation.resetResidencyTaskCount(0u);
|
||||
graphicsAllocation.releaseResidencyInOsContext(0u);
|
||||
EXPECT_FALSE(graphicsAllocation.isResident(0u));
|
||||
}
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (C) 2018 Intel Corporation
|
||||
* Copyright (C) 2018-2019 Intel Corporation
|
||||
*
|
||||
* SPDX-License-Identifier: MIT
|
||||
*
|
||||
@@ -385,30 +385,30 @@ TEST(MemoryManagerTest, givenTimestampTagBufferTypeWhenGetAllocationDataIsCalled
|
||||
EXPECT_TRUE(allocData.flags.useSystemMemory);
|
||||
}
|
||||
|
||||
TEST(MemoryManagerTest, givenAllocationPropertiesWithShareableFlagEnabledWhenAllocateMemoryThenAllocationIsShareable) {
|
||||
TEST(MemoryManagerTest, givenAllocationPropertiesWithMultiOsContextCapableFlagEnabledWhenAllocateMemoryThenAllocationIsMultiOsContextCapable) {
|
||||
MockMemoryManager memoryManager(false, false);
|
||||
AllocationProperties properties{MemoryConstants::pageSize, GraphicsAllocation::AllocationType::BUFFER};
|
||||
properties.flags.shareable = true;
|
||||
properties.flags.multiOsContextCapable = true;
|
||||
|
||||
AllocationData allocData;
|
||||
MockMemoryManager::getAllocationData(allocData, properties, 0, nullptr);
|
||||
EXPECT_TRUE(allocData.flags.shareable);
|
||||
EXPECT_TRUE(allocData.flags.multiOsContextCapable);
|
||||
|
||||
auto allocation = memoryManager.allocateGraphicsMemoryWithProperties(properties);
|
||||
EXPECT_TRUE(allocation->isShareable());
|
||||
EXPECT_TRUE(allocation->isMultiOsContextCapable());
|
||||
memoryManager.freeGraphicsMemory(allocation);
|
||||
}
|
||||
|
||||
TEST(MemoryManagerTest, givenAllocationPropertiesWithShareableFlagDisabledWhenAllocateMemoryThenAllocationIsNotShareable) {
|
||||
TEST(MemoryManagerTest, givenAllocationPropertiesWithMultiOsContextCapableFlagDisabledWhenAllocateMemoryThenAllocationIsNotMultiOsContextCapable) {
|
||||
MockMemoryManager memoryManager(false, false);
|
||||
AllocationProperties properties{MemoryConstants::pageSize, GraphicsAllocation::AllocationType::BUFFER};
|
||||
properties.flags.shareable = false;
|
||||
properties.flags.multiOsContextCapable = false;
|
||||
|
||||
AllocationData allocData;
|
||||
MockMemoryManager::getAllocationData(allocData, properties, 0, nullptr);
|
||||
EXPECT_FALSE(allocData.flags.shareable);
|
||||
EXPECT_FALSE(allocData.flags.multiOsContextCapable);
|
||||
|
||||
auto allocation = memoryManager.allocateGraphicsMemoryWithProperties(properties);
|
||||
EXPECT_FALSE(allocation->isShareable());
|
||||
EXPECT_FALSE(allocation->isMultiOsContextCapable());
|
||||
memoryManager.freeGraphicsMemory(allocation);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user