Add helper engines to EngineInstanced Device

Signed-off-by: Bartosz Dunajski <bartosz.dunajski@intel.com>
This commit is contained in:
Bartosz Dunajski
2021-08-18 15:34:29 +00:00
committed by Compute-Runtime-Automation
parent 274fe055e9
commit 4fb5ceeb89
10 changed files with 55 additions and 24 deletions

View File

@ -678,8 +678,8 @@ TEST(GetDeviceInfo, WhenQueryingGenericAddressSpaceSupportThenProperValueIsRetur
template <typename GfxFamily, int ccsCount, int bcsCount>
class MockHwHelper : public HwHelperHw<GfxFamily> {
public:
const HwHelper::EngineInstancesContainer getGpgpuEngineInstances(const HardwareInfo &hwInfo) const override {
HwHelper::EngineInstancesContainer result{};
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});
}

View File

@ -366,7 +366,14 @@ struct EngineInstancedDeviceTests : public ::testing::Test {
template <typename MockDeviceT>
bool hasEngineInstancedEngines(MockDeviceT *device, aub_stream::EngineType engineType) {
bool ccsFound = false;
bool regularCcsFound = false;
bool internalCcsFound = false;
bool lowPriorityCcsFound = false;
OsContext *defaultOsContext = device->getDefaultEngine().osContext;
EXPECT_EQ(engineType, defaultOsContext->getEngineType());
EXPECT_EQ(EngineUsage::Regular, defaultOsContext->getEngineUsage());
EXPECT_TRUE(defaultOsContext->isDefaultContext());
for (auto &engine : device->engines) {
if ((engine.getEngineType() != engineType) && !EngineHelpers::isBcs(engine.getEngineType())) {
@ -377,17 +384,25 @@ struct EngineInstancedDeviceTests : public ::testing::Test {
auto osContext = engine.osContext;
if ((engine.getEngineType() == engineType) &&
osContext->isDefaultContext() &&
osContext->isRegular() &&
!osContext->isLowPriority() &&
!osContext->isInternalEngine()) {
EXPECT_FALSE(ccsFound);
ccsFound = true;
if (engine.getEngineType() == engineType) {
if (osContext->isRegular()) {
EXPECT_FALSE(regularCcsFound);
regularCcsFound = true;
} else if (osContext->isLowPriority()) {
EXPECT_FALSE(lowPriorityCcsFound);
lowPriorityCcsFound = true;
} else if (osContext->isInternalEngine()) {
EXPECT_FALSE(internalCcsFound);
internalCcsFound = true;
} else {
EXPECT_TRUE(false);
}
} else if (!EngineHelpers::isBcs(engine.getEngineType())) {
EXPECT_TRUE(false);
}
}
return ccsFound;
return (regularCcsFound && internalCcsFound && lowPriorityCcsFound);
}
DebugManagerStateRestore restorer;