Skip to content

Commit 93e941f

Browse files
refactor: simplify engine mapping array
Signed-off-by: Mateusz Jablonski <[email protected]>
1 parent d7d3a6b commit 93e941f

File tree

1 file changed

+4
-7
lines changed

1 file changed

+4
-7
lines changed

shared/source/os_interface/linux/engine_info.cpp

+4-7
Original file line numberDiff line numberDiff line change
@@ -17,14 +17,11 @@
1717
#include "shared/source/os_interface/linux/drm_wrappers.h"
1818
#include "shared/source/os_interface/product_helper.h"
1919

20-
#include <array>
21-
#include <iterator>
22-
2320
namespace NEO {
2421
namespace DrmEngineMappingHelper {
25-
constexpr std::array<aub_stream::EngineType, 9> engineMapping = {{aub_stream::ENGINE_BCS, aub_stream::ENGINE_BCS1, aub_stream::ENGINE_BCS2,
26-
aub_stream::ENGINE_BCS3, aub_stream::ENGINE_BCS4, aub_stream::ENGINE_BCS5,
27-
aub_stream::ENGINE_BCS6, aub_stream::ENGINE_BCS7, aub_stream::ENGINE_BCS8}};
22+
constexpr aub_stream::EngineType engineMapping[] = {aub_stream::ENGINE_BCS, aub_stream::ENGINE_BCS1, aub_stream::ENGINE_BCS2,
23+
aub_stream::ENGINE_BCS3, aub_stream::ENGINE_BCS4, aub_stream::ENGINE_BCS5,
24+
aub_stream::ENGINE_BCS6, aub_stream::ENGINE_BCS7, aub_stream::ENGINE_BCS8};
2825

2926
// 3 types of copy engines:
3027
// - Main - BCS (legacy, aka. BCS0)
@@ -51,7 +48,7 @@ void assignLinkCopyEngine(std::vector<EngineInfo::EngineToInstanceMap> &tileToEn
5148
}
5249

5350
auto getCopyEnginesMappingIterator(const NEO::RootDeviceEnvironment &rootDeviceEnvironment) {
54-
auto mappingCopyEngineIt = DrmEngineMappingHelper::engineMapping.begin();
51+
auto mappingCopyEngineIt = DrmEngineMappingHelper::engineMapping;
5552
if (const auto defaultCopyEngine = rootDeviceEnvironment.getProductHelper().getDefaultCopyEngine(); defaultCopyEngine != *mappingCopyEngineIt) {
5653
mappingCopyEngineIt++;
5754
} // Note that BCS0 may not be enabled

0 commit comments

Comments
 (0)