mirror of
https://github.com/intel/compute-runtime.git
synced 2025-09-15 13:01:45 +08:00
Add helper engines to EngineInstanced Device
Signed-off-by: Bartosz Dunajski <bartosz.dunajski@intel.com>
This commit is contained in:

committed by
Compute-Runtime-Automation

parent
274fe055e9
commit
4fb5ceeb89
@ -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});
|
||||
}
|
||||
|
@ -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;
|
||||
|
Reference in New Issue
Block a user