From b982fb058cddbb1fee247141c72e20a096a4c364 Mon Sep 17 00:00:00 2001 From: "Dunajski, Bartosz" Date: Thu, 16 Jan 2020 17:52:17 +0100 Subject: [PATCH] Obtain BCS engine type through helper method Change-Id: I8a8bf99f3a73a4293013ab3bc73911e25a12b57e Signed-off-by: Dunajski, Bartosz --- core/helpers/engine_node_helper.cpp | 4 ++++ core/helpers/engine_node_helper.h | 3 +++ runtime/command_queue/command_queue.cpp | 5 +++-- 3 files changed, 10 insertions(+), 2 deletions(-) diff --git a/core/helpers/engine_node_helper.cpp b/core/helpers/engine_node_helper.cpp index 81aa9500d9..498aaf8a3a 100644 --- a/core/helpers/engine_node_helper.cpp +++ b/core/helpers/engine_node_helper.cpp @@ -16,5 +16,9 @@ bool isCcs(aub_stream::EngineType engineType) { bool isBcs(aub_stream::EngineType engineType) { return engineType == aub_stream::ENGINE_BCS; } + +aub_stream::EngineType getBcsEngineType(const HardwareInfo &hwInfo) { + return aub_stream::EngineType::ENGINE_BCS; +} } // namespace EngineHelpers } // namespace NEO diff --git a/core/helpers/engine_node_helper.h b/core/helpers/engine_node_helper.h index 7600ab0103..dc7f16a68b 100644 --- a/core/helpers/engine_node_helper.h +++ b/core/helpers/engine_node_helper.h @@ -10,8 +10,11 @@ #include "engine_node.h" namespace NEO { +struct HardwareInfo; + namespace EngineHelpers { bool isCcs(aub_stream::EngineType engineType); bool isBcs(aub_stream::EngineType engineType); +aub_stream::EngineType getBcsEngineType(const HardwareInfo &hwInfo); }; // namespace EngineHelpers } // namespace NEO diff --git a/runtime/command_queue/command_queue.cpp b/runtime/command_queue/command_queue.cpp index 1227b2c185..c75d2ccd1a 100644 --- a/runtime/command_queue/command_queue.cpp +++ b/runtime/command_queue/command_queue.cpp @@ -72,8 +72,9 @@ CommandQueue::CommandQueue(Context *context, Device *deviceId, const cl_queue_pr if (gpgpuEngine->commandStreamReceiver->peekTimestampPacketWriteEnabled()) { timestampPacketContainer = std::make_unique(); } - if (device->getExecutionEnvironment()->getHardwareInfo()->capabilityTable.blitterOperationsSupported) { - bcsEngine = &device->getDeviceById(0)->getEngine(aub_stream::EngineType::ENGINE_BCS, false); + auto hwInfo = device->getExecutionEnvironment()->getHardwareInfo(); + if (hwInfo->capabilityTable.blitterOperationsSupported) { + bcsEngine = &device->getDeviceById(0)->getEngine(EngineHelpers::getBcsEngineType(*hwInfo), false); } }