feature: set HP flag when creating HardwareContextController

- for highPriority context

Related-To: NEO-7824

Signed-off-by: Mateusz Hoppe <mateusz.hoppe@intel.com>
This commit is contained in:
Mateusz Hoppe 2024-01-08 17:25:12 +00:00 committed by Compute-Runtime-Automation
parent 47ed5947c7
commit 31edeb0765
3 changed files with 23 additions and 3 deletions

View File

@ -1,5 +1,5 @@
/*
* Copyright (C) 2019-2023 Intel Corporation
* Copyright (C) 2019-2024 Intel Corporation
*
* SPDX-License-Identifier: MIT
*
@ -49,6 +49,10 @@ void CommandStreamReceiverSimulatedCommonHw<GfxFamily>::setupContext(OsContext &
flags |= contextGroupBit;
}
if (osContext.isHighPriority()) {
flags |= aub_stream::hardwareContextFlags::highPriority;
}
if (debugManager.flags.AppendAubStreamContextFlags.get() != -1) {
flags |= static_cast<uint32_t>(debugManager.flags.AppendAubStreamContextFlags.get());
}

View File

@ -1,5 +1,5 @@
/*
* Copyright (C) 2018-2023 Intel Corporation
* Copyright (C) 2018-2024 Intel Corporation
*
* SPDX-License-Identifier: MIT
*
@ -36,6 +36,7 @@ class OsContext : public ReferenceTrackedObject<OsContext> {
EngineUsage getEngineUsage() { return engineUsage; }
bool isRegular() const { return engineUsage == EngineUsage::regular; }
bool isLowPriority() const { return engineUsage == EngineUsage::lowPriority; }
bool isHighPriority() const { return engineUsage == EngineUsage::highPriority; }
bool isInternalEngine() const { return engineUsage == EngineUsage::internal; }
bool isCooperativeEngine() const { return engineUsage == EngineUsage::cooperative; }
bool isRootDevice() const { return rootDevice; }

View File

@ -1,5 +1,5 @@
/*
* Copyright (C) 2018-2023 Intel Corporation
* Copyright (C) 2018-2024 Intel Corporation
*
* SPDX-License-Identifier: MIT
*
@ -202,6 +202,21 @@ HWTEST_F(AubCommandStreamReceiverTests, givenAubCsrWhenOsContextIsSetThenCreateH
EXPECT_EQ(deviceIndex, mockHardwareContext->deviceIndex);
}
HWTEST_F(AubCommandStreamReceiverTests, givenAubCsrAndHighPriorityContextWhenOsContextIsSetThenCorrectFlagIsPassed) {
MockOsContext osContext(0, EngineDescriptorHelper::getDefaultDescriptor({aub_stream::ENGINE_RCS, EngineUsage::highPriority}, DeviceBitfield(1)));
std::string fileName = "file_name.aub";
MockAubManager *mockManager = new MockAubManager();
MockAubCenter *mockAubCenter = new MockAubCenter(pDevice->getRootDeviceEnvironment(), false, fileName, CommandStreamReceiverType::CSR_AUB);
mockAubCenter->aubManager = std::unique_ptr<MockAubManager>(mockManager);
pDevice->executionEnvironment->rootDeviceEnvironments[0]->aubCenter = std::unique_ptr<MockAubCenter>(mockAubCenter);
std::unique_ptr<AUBCommandStreamReceiverHw<FamilyType>> aubCsr(static_cast<AUBCommandStreamReceiverHw<FamilyType> *>(AUBCommandStreamReceiver::create(fileName, true, *pDevice->executionEnvironment, pDevice->getRootDeviceIndex(), pDevice->getDeviceBitfield())));
EXPECT_EQ(nullptr, aubCsr->hardwareContextController.get());
aubCsr->setupContext(osContext);
EXPECT_TRUE(aub_stream::hardwareContextFlags::highPriority & mockManager->contextFlags);
}
HWTEST_F(AubCommandStreamReceiverTests, givenAubCsrWhenLowPriorityOsContextIsSetThenDontCreateHardwareContext) {
MockOsContext osContext(0, EngineDescriptorHelper::getDefaultDescriptor({aub_stream::ENGINE_RCS, EngineUsage::lowPriority}));
std::string fileName = "file_name.aub";