Skip to content

Commit ae357c7

Browse files
Skip disabled engines when round robin over copy engines
Signed-off-by: Lukasz Jobczyk <[email protected]>
1 parent 538e0ae commit ae357c7

File tree

3 files changed

+8
-5
lines changed

3 files changed

+8
-5
lines changed

opencl/test/unit_test/helpers/engine_node_helper_tests_xehp_and_later.cpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,12 +46,13 @@ HWTEST2_F(EngineNodeHelperTestsXeHPAndLater, givenEnableCmdQRoundRobindBcsEngine
4646
DebugManager.flags.EnableCmdQRoundRobindBcsEngineAssign.set(1u);
4747
DeviceBitfield deviceBitfield = 0b10;
4848

49-
const auto hwInfo = pDevice->getHardwareInfo();
49+
auto hwInfo = *pDevice->getRootDeviceEnvironment().getMutableHardwareInfo();
50+
hwInfo.featureTable.ftrBcsInfo.set(7);
5051
auto &selectorCopyEngine = pDevice->getNearestGenericSubDevice(0)->getSelectorCopyEngine();
5152

5253
int32_t expectedEngineType = aub_stream::EngineType::ENGINE_BCS1;
5354
for (int32_t i = 0; i <= 20; i++) {
54-
while (!HwHelper::get(hwInfo.platform.eRenderCoreFamily).isSubDeviceEngineSupported(hwInfo, deviceBitfield, static_cast<aub_stream::EngineType>(expectedEngineType))) {
55+
while (!HwHelper::get(hwInfo.platform.eRenderCoreFamily).isSubDeviceEngineSupported(hwInfo, deviceBitfield, static_cast<aub_stream::EngineType>(expectedEngineType)) || !hwInfo.featureTable.ftrBcsInfo.test(expectedEngineType - aub_stream::EngineType::ENGINE_BCS1 + 1)) {
5556
expectedEngineType++;
5657
if (static_cast<aub_stream::EngineType>(expectedEngineType) > aub_stream::EngineType::ENGINE_BCS8) {
5758
expectedEngineType = aub_stream::EngineType::ENGINE_BCS1;

shared/source/helpers/engine_node_helper.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -162,8 +162,8 @@ aub_stream::EngineType selectLinkCopyEngine(const HardwareInfo &hwInfo, const De
162162
if (enableCmdQRoundRobindBcsEngineAssign) {
163163
aub_stream::EngineType engineType;
164164
do {
165-
engineType = static_cast<aub_stream::EngineType>(aub_stream::EngineType::ENGINE_BCS1 + (selectorCopyEngine.fetch_add(1u) % 8));
166-
} while (!HwHelper::get(hwInfo.platform.eRenderCoreFamily).isSubDeviceEngineSupported(hwInfo, deviceBitfield, engineType));
165+
engineType = static_cast<aub_stream::EngineType>(aub_stream::EngineType::ENGINE_BCS1 + (selectorCopyEngine.fetch_add(1u) % EngineHelpers::numLinkedCopyEngines));
166+
} while (!HwHelper::get(hwInfo.platform.eRenderCoreFamily).isSubDeviceEngineSupported(hwInfo, deviceBitfield, engineType) || !hwInfo.featureTable.ftrBcsInfo.test(engineType - aub_stream::EngineType::ENGINE_BCS1 + 1));
167167

168168
return engineType;
169169
}

shared/source/helpers/engine_node_helper.h

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (C) 2019-2021 Intel Corporation
2+
* Copyright (C) 2019-2022 Intel Corporation
33
*
44
* SPDX-License-Identifier: MIT
55
*
@@ -64,6 +64,8 @@ constexpr bool isLinkBcs(aub_stream::EngineType engineType) {
6464
return engineType >= aub_stream::ENGINE_BCS1 && engineType <= aub_stream::ENGINE_BCS8;
6565
}
6666

67+
constexpr uint32_t numLinkedCopyEngines = 8u;
68+
6769
bool linkCopyEnginesSupported(const HardwareInfo &hwInfo, const DeviceBitfield &deviceBitfield);
6870

6971
aub_stream::EngineType selectLinkCopyEngine(const HardwareInfo &hwInfo, const DeviceBitfield &deviceBitfield, std::atomic<uint32_t> &selectorCopyEngine);

0 commit comments

Comments
 (0)