mirror of
https://github.com/intel/compute-runtime.git
synced 2026-01-08 14:02:58 +08:00
Store default engine index per root device
Resolves: NEO-5768 Signed-off-by: Mateusz Jablonski <mateusz.jablonski@intel.com>
This commit is contained in:
committed by
Compute-Runtime-Automation
parent
8da0838ba4
commit
9a22d06efe
@@ -192,9 +192,10 @@ HWTEST_F(DeviceTest, givenNoHwCsrTypeAndModifiedDefaultEngineIndexWhenIsSimulati
|
||||
HWTEST_F(DeviceTest, givenDeviceWithoutSubDevicesWhenCreatingContextsThenMemoryManagerDefaultContextIsSetCorrectly) {
|
||||
UltDeviceFactory factory(1, 1);
|
||||
MockDevice &device = *factory.rootDevices[0];
|
||||
auto rootDeviceIndex = device.getRootDeviceIndex();
|
||||
MockMemoryManager *memoryManager = static_cast<MockMemoryManager *>(device.getMemoryManager());
|
||||
|
||||
OsContext *defaultOsContextMemoryManager = memoryManager->registeredEngines[memoryManager->defaultEngineIndex].osContext;
|
||||
OsContext *defaultOsContextMemoryManager = memoryManager->registeredEngines[memoryManager->defaultEngineIndex[rootDeviceIndex]].osContext;
|
||||
OsContext *defaultOsContextRootDevice = device.getDefaultEngine().osContext;
|
||||
EXPECT_EQ(defaultOsContextRootDevice, defaultOsContextMemoryManager);
|
||||
}
|
||||
@@ -202,9 +203,10 @@ HWTEST_F(DeviceTest, givenDeviceWithoutSubDevicesWhenCreatingContextsThenMemoryM
|
||||
HWTEST_F(DeviceTest, givenDeviceWithSubDevicesWhenCreatingContextsThenMemoryManagerDefaultContextIsSetCorrectly) {
|
||||
UltDeviceFactory factory(1, 2);
|
||||
MockDevice &device = *factory.rootDevices[0];
|
||||
auto rootDeviceIndex = device.getRootDeviceIndex();
|
||||
MockMemoryManager *memoryManager = static_cast<MockMemoryManager *>(device.getMemoryManager());
|
||||
|
||||
OsContext *defaultOsContextMemoryManager = memoryManager->registeredEngines[memoryManager->defaultEngineIndex].osContext;
|
||||
OsContext *defaultOsContextMemoryManager = memoryManager->registeredEngines[memoryManager->defaultEngineIndex[rootDeviceIndex]].osContext;
|
||||
OsContext *defaultOsContextRootDevice = device.getDefaultEngine().osContext;
|
||||
EXPECT_EQ(defaultOsContextRootDevice, defaultOsContextMemoryManager);
|
||||
}
|
||||
@@ -214,9 +216,11 @@ HWTEST_F(DeviceTest, givenMultiDeviceWhenCreatingContextsThenMemoryManagerDefaul
|
||||
MockDevice &device = *factory.rootDevices[2];
|
||||
MockMemoryManager *memoryManager = static_cast<MockMemoryManager *>(device.getMemoryManager());
|
||||
|
||||
OsContext *defaultOsContextMemoryManager = memoryManager->registeredEngines[memoryManager->defaultEngineIndex].osContext;
|
||||
OsContext *defaultOsContextRootDevice = device.getDefaultEngine().osContext;
|
||||
EXPECT_EQ(defaultOsContextRootDevice, defaultOsContextMemoryManager);
|
||||
for (auto &pRootDevice : factory.rootDevices) {
|
||||
OsContext *defaultOsContextMemoryManager = memoryManager->registeredEngines[memoryManager->defaultEngineIndex[pRootDevice->getRootDeviceIndex()]].osContext;
|
||||
OsContext *defaultOsContextRootDevice = pRootDevice->getDefaultEngine().osContext;
|
||||
EXPECT_EQ(defaultOsContextRootDevice, defaultOsContextMemoryManager);
|
||||
}
|
||||
}
|
||||
|
||||
TEST(DeviceCleanup, givenDeviceWhenItIsDestroyedThenFlushBatchedSubmissionsIsCalled) {
|
||||
|
||||
@@ -380,7 +380,7 @@ TEST_F(DrmMemoryManagerTest, givenDrmContextIdWhenAllocationIsCreatedThenPinWith
|
||||
for (auto engine : memoryManager->registeredEngines) {
|
||||
engine.osContext->incRefInternal();
|
||||
}
|
||||
auto drmContextId = memoryManager->getDefaultDrmContextId();
|
||||
auto drmContextId = memoryManager->getDefaultDrmContextId(rootDeviceIndex);
|
||||
ASSERT_NE(nullptr, memoryManager->pinBBs[rootDeviceIndex]);
|
||||
EXPECT_NE(0u, drmContextId);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user