mirror of
https://github.com/intel/compute-runtime.git
synced 2025-12-26 07:00:17 +08:00
Capability to create multiple Regular contexts per engine
Ralated-To: NEO-7618 Signed-off-by: Dunajski, Bartosz <bartosz.dunajski@intel.com>
This commit is contained in:
committed by
Compute-Runtime-Automation
parent
7850d06c09
commit
99e0493a39
@@ -2748,6 +2748,50 @@ HWTEST_F(CommandQueueOnSpecificEngineTests, givenNotInitializedCcsOsContextWhenC
|
||||
EXPECT_TRUE(osContext.isInitialized());
|
||||
}
|
||||
|
||||
HWTEST_F(CommandQueueOnSpecificEngineTests, givenDebugFlagSetWhenCreatingCmdQueueThenAssignNextRegularContext) {
|
||||
DebugManagerStateRestore restore{};
|
||||
DebugManager.flags.NumberOfRegularContextsPerEngine.set(4);
|
||||
DebugManager.flags.NodeOrdinal.set(static_cast<int32_t>(aub_stream::ENGINE_CCS));
|
||||
|
||||
class MyMockGfxCoreHelper : public GfxCoreHelperHw<FamilyType> {
|
||||
public:
|
||||
const EngineInstancesContainer getGpgpuEngineInstances(const HardwareInfo &hwInfo) const override {
|
||||
EngineInstancesContainer result{};
|
||||
|
||||
result.push_back({aub_stream::ENGINE_CCS, EngineUsage::Regular});
|
||||
result.push_back({aub_stream::ENGINE_CCS, EngineUsage::Regular});
|
||||
result.push_back({aub_stream::ENGINE_CCS, EngineUsage::Regular});
|
||||
result.push_back({aub_stream::ENGINE_CCS, EngineUsage::Internal});
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
EngineGroupType getEngineGroupType(aub_stream::EngineType engineType, EngineUsage engineUsage, const HardwareInfo &hwInfo) const override {
|
||||
return EngineGroupType::Compute;
|
||||
}
|
||||
};
|
||||
|
||||
auto raiiGfxCoreHelper = overrideGfxCoreHelper<FamilyType, MyMockGfxCoreHelper>();
|
||||
|
||||
MockContext context{};
|
||||
auto &device = static_cast<MockDevice &>(context.getDevice(0)->getDevice());
|
||||
EXPECT_EQ(0u, device.defaultEngineIndex);
|
||||
|
||||
uint32_t expectedIndex = 0;
|
||||
|
||||
for (uint32_t i = 0; i < 8; i++) {
|
||||
MockCommandQueueHw<FamilyType> queue(&context, context.getDevice(0), nullptr);
|
||||
queue.initializeGpgpu();
|
||||
|
||||
EXPECT_EQ(queue.gpgpuEngine, &device.allEngines[expectedIndex]);
|
||||
|
||||
expectedIndex++;
|
||||
if (expectedIndex == 3) {
|
||||
expectedIndex = 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
TEST_F(MultiTileFixture, givenMultiSubDeviceAndCommandQueueUsingMainCopyEngineWhenReleaseMainCopyEngineThenDeviceAndSubdeviceSelectorReset) {
|
||||
MockExecutionEnvironment mockExecutionEnvironment{};
|
||||
auto &rootDeviceEnvironment = *mockExecutionEnvironment.rootDeviceEnvironments[0];
|
||||
|
||||
@@ -314,6 +314,7 @@ class ContextWithAsyncDeleterTest : public ::testing::WithParamInterface<bool>,
|
||||
deleter = new MockDeferredDeleter();
|
||||
|
||||
device->allEngines.clear();
|
||||
device->device.regularEngineGroups.clear();
|
||||
device->injectMemoryManager(memoryManager);
|
||||
device->createEngines();
|
||||
memoryManager->setDeferredDeleter(deleter);
|
||||
|
||||
@@ -677,7 +677,7 @@ class MockGfxCoreHelper : public GfxCoreHelperHw<GfxFamily> {
|
||||
const EngineInstancesContainer getGpgpuEngineInstances(const HardwareInfo &hwInfo) const override {
|
||||
EngineInstancesContainer result{};
|
||||
for (int i = 0; i < ccsCount; i++) {
|
||||
result.push_back({aub_stream::ENGINE_CCS, EngineUsage::Regular});
|
||||
result.push_back({static_cast<aub_stream::EngineType>(aub_stream::ENGINE_CCS + i), EngineUsage::Regular});
|
||||
}
|
||||
for (int i = 0; i < bcsCount; i++) {
|
||||
result.push_back({aub_stream::ENGINE_BCS, EngineUsage::Regular});
|
||||
|
||||
Reference in New Issue
Block a user