mirror of
https://github.com/intel/compute-runtime.git
synced 2025-12-18 22:08:53 +08:00
fix: Set context group count for root device engine correctly
Related-To: NEO-16676 This ensures that the OsContext is only marked as part of a context group when useContextGroup is true, aligning the OsContext's state with the actual context grouping logic. Signed-off-by: Slawomir Milczarek <slawomir.milczarek@intel.com>
This commit is contained in:
committed by
Compute-Runtime-Automation
parent
ae1721c065
commit
c7475fefde
@@ -107,7 +107,7 @@ bool RootDevice::createRootDeviceEngine(EngineTypeUsage engineTypeUsage, DeviceB
|
||||
|
||||
auto osContext = getMemoryManager()->createAndRegisterOsContext(rootCommandStreamReceiver.get(), engineDescriptor);
|
||||
|
||||
osContext->setContextGroupCount(gfxCoreHelper.getContextGroupContextsCount());
|
||||
osContext->setContextGroupCount(useContextGroup ? gfxCoreHelper.getContextGroupContextsCount() : 0);
|
||||
osContext->setIsPrimaryEngine(isPrimaryEngine);
|
||||
|
||||
rootCommandStreamReceiver->setupContext(*osContext);
|
||||
|
||||
@@ -2977,6 +2977,33 @@ HWTEST_F(DeviceTests, givenMaskedSubDevicesWhenCallingPollForCompletionOnRootDev
|
||||
EXPECT_EQ(callCount, numMaskedSubDevices);
|
||||
}
|
||||
|
||||
HWTEST_F(DeviceTests, givenEngineUsageWhenCreatingRootDeviceEngineThenIsPartOfContextGroupIsSetCorrectly) {
|
||||
DebugManagerStateRestore dbgRestorer;
|
||||
const uint32_t contextGroupSize = 8;
|
||||
debugManager.flags.ContextGroupSize.set(contextGroupSize);
|
||||
|
||||
struct TestCase {
|
||||
EngineUsage engineUsage;
|
||||
bool expectedIsPartOfContextGroup;
|
||||
};
|
||||
|
||||
std::vector<TestCase> testCases = {
|
||||
{EngineUsage::regular, true}, // Regular engine should be part of context group
|
||||
{EngineUsage::highPriority, false}, // High-priority engine should NOT be part of context group
|
||||
{EngineUsage::lowPriority, false}, // Low-priority engine should NOT be part of context group
|
||||
};
|
||||
|
||||
for (const auto &testCase : testCases) {
|
||||
auto device = std::make_unique<MockDevice>();
|
||||
EngineTypeUsage engineTypeUsage = {aub_stream::ENGINE_CCS, testCase.engineUsage};
|
||||
bool result = device->createRootDeviceEngine(engineTypeUsage, device->getDeviceBitfield());
|
||||
EXPECT_TRUE(result);
|
||||
|
||||
auto &osContext = device->getAllEngines().back().osContext;
|
||||
EXPECT_EQ(testCase.expectedIsPartOfContextGroup, osContext->isPartOfContextGroup());
|
||||
}
|
||||
}
|
||||
|
||||
TEST(DeviceCanAccessPeerTest, givenTheSameDeviceThenCanAccessPeerReturnsTrue) {
|
||||
UltDeviceFactory deviceFactory{2, 0};
|
||||
auto rootDevice0 = deviceFactory.rootDevices[0];
|
||||
|
||||
Reference in New Issue
Block a user