Skip to content

Commit

Permalink
refactor: simplify engine mapping array
Browse files Browse the repository at this point in the history
Signed-off-by: Mateusz Jablonski <[email protected]>
  • Loading branch information
JablonskiMateusz authored and Compute-Runtime-Automation committed Jan 19, 2024
1 parent d7d3a6b commit 93e941f
Showing 1 changed file with 4 additions and 7 deletions.
11 changes: 4 additions & 7 deletions shared/source/os_interface/linux/engine_info.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -17,14 +17,11 @@
#include "shared/source/os_interface/linux/drm_wrappers.h"
#include "shared/source/os_interface/product_helper.h"

#include <array>
#include <iterator>

namespace NEO {
namespace DrmEngineMappingHelper {
constexpr std::array<aub_stream::EngineType, 9> engineMapping = {{aub_stream::ENGINE_BCS, aub_stream::ENGINE_BCS1, aub_stream::ENGINE_BCS2,
aub_stream::ENGINE_BCS3, aub_stream::ENGINE_BCS4, aub_stream::ENGINE_BCS5,
aub_stream::ENGINE_BCS6, aub_stream::ENGINE_BCS7, aub_stream::ENGINE_BCS8}};
constexpr aub_stream::EngineType engineMapping[] = {aub_stream::ENGINE_BCS, aub_stream::ENGINE_BCS1, aub_stream::ENGINE_BCS2,
aub_stream::ENGINE_BCS3, aub_stream::ENGINE_BCS4, aub_stream::ENGINE_BCS5,
aub_stream::ENGINE_BCS6, aub_stream::ENGINE_BCS7, aub_stream::ENGINE_BCS8};

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

auto getCopyEnginesMappingIterator(const NEO::RootDeviceEnvironment &rootDeviceEnvironment) {
auto mappingCopyEngineIt = DrmEngineMappingHelper::engineMapping.begin();
auto mappingCopyEngineIt = DrmEngineMappingHelper::engineMapping;
if (const auto defaultCopyEngine = rootDeviceEnvironment.getProductHelper().getDefaultCopyEngine(); defaultCopyEngine != *mappingCopyEngineIt) {
mappingCopyEngineIt++;
} // Note that BCS0 may not be enabled
Expand Down

0 comments on commit 93e941f

Please sign in to comment.