mirror of
https://github.com/intel/compute-runtime.git
synced 2026-01-03 23:03:02 +08:00
Move OsContext id setting to constructor.
Change-Id: I1b809befc02536257800e3667307b8deabd5c95d
This commit is contained in:
committed by
sys_ocldev
parent
8e33ec04c5
commit
581805cc88
@@ -1825,13 +1825,24 @@ TEST(GraphicsAllocation, givenSharedHandleBasedConstructorWhenGraphicsAllocation
|
||||
}
|
||||
|
||||
TEST(ResidencyDataTest, givenOsContextWhenItIsRegisteredToMemoryManagerThenRefCountIncreases) {
|
||||
auto osContext = new OsContext(nullptr);
|
||||
auto osContext = new OsContext(nullptr, 0u);
|
||||
OsAgnosticMemoryManager memoryManager;
|
||||
memoryManager.registerOsContext(osContext);
|
||||
EXPECT_EQ(1u, memoryManager.getOsContextCount());
|
||||
EXPECT_EQ(1, osContext->getRefInternalCount());
|
||||
}
|
||||
|
||||
TEST(ResidencyDataTest, givenTwoOsContextsWhenTheyAreRegistredFromHigherToLowerThenProperSizeIsReturned) {
|
||||
auto osContext2 = new OsContext(nullptr, 1u);
|
||||
auto osContext = new OsContext(nullptr, 0u);
|
||||
OsAgnosticMemoryManager memoryManager;
|
||||
memoryManager.registerOsContext(osContext2);
|
||||
memoryManager.registerOsContext(osContext);
|
||||
EXPECT_EQ(2u, memoryManager.getOsContextCount());
|
||||
EXPECT_EQ(1, osContext->getRefInternalCount());
|
||||
EXPECT_EQ(1, osContext2->getRefInternalCount());
|
||||
}
|
||||
|
||||
TEST(ResidencyDataTest, givenResidencyDataWhenUpdateCompletionDataIsCalledThenItIsProperlyUpdated) {
|
||||
struct mockResidencyData : public ResidencyData {
|
||||
using ResidencyData::completionData;
|
||||
@@ -1839,9 +1850,8 @@ TEST(ResidencyDataTest, givenResidencyDataWhenUpdateCompletionDataIsCalledThenIt
|
||||
|
||||
mockResidencyData residency;
|
||||
|
||||
OsContext osContext(nullptr);
|
||||
OsContext osContext2(nullptr);
|
||||
osContext2.setContextId(1u);
|
||||
OsContext osContext(nullptr, 0u);
|
||||
OsContext osContext2(nullptr, 1u);
|
||||
|
||||
auto lastFenceValue = 45llu;
|
||||
auto lastFenceValue2 = 23llu;
|
||||
|
||||
Reference in New Issue
Block a user