OpenCL Queue Families extension 12/n

Fix engine selection for copy engines

Signed-off-by: Maciej Dziuban <maciej.dziuban@intel.com>
Relate-To: NEO-5120
This commit is contained in:
Maciej Dziuban
2021-01-19 17:32:22 +00:00
committed by Compute-Runtime-Automation
parent 3ab932b101
commit 160e5ec112
5 changed files with 67 additions and 4 deletions

View File

@@ -1,5 +1,5 @@
/*
* Copyright (C) 2017-2020 Intel Corporation
* Copyright (C) 2017-2021 Intel Corporation
*
* SPDX-License-Identifier: MIT
*
@@ -243,6 +243,21 @@ const std::vector<EngineControl> *Device::getNonEmptyEngineGroup(size_t index) c
return nullptr;
}
size_t Device::getIndexOfNonEmptyEngineGroup(EngineGroupType engineGroupType) const {
const auto groupIndex = static_cast<size_t>(engineGroupType);
UNRECOVERABLE_IF(groupIndex >= engineGroups.size());
UNRECOVERABLE_IF(engineGroups[groupIndex].empty());
size_t result = 0u;
for (auto currentGroupIndex = 0u; currentGroupIndex < groupIndex; currentGroupIndex++) {
if (!engineGroups[currentGroupIndex].empty()) {
result++;
}
}
return result;
}
EngineControl &Device::getEngine(aub_stream::EngineType engineType, bool lowPriority, bool internalUsage) {
for (auto &engine : engines) {
if (engine.osContext->getEngineType() == engineType &&

View File

@@ -1,5 +1,5 @@
/*
* Copyright (C) 2017-2020 Intel Corporation
* Copyright (C) 2017-2021 Intel Corporation
*
* SPDX-License-Identifier: MIT
*
@@ -18,6 +18,8 @@
#include "opencl/source/os_interface/performance_counters.h"
#include "engine_group_types.h"
namespace NEO {
class OSTime;
class SourceLevelDebugger;
@@ -50,6 +52,7 @@ class Device : public ReferenceTrackedObject<Device> {
return this->engineGroups;
}
const std::vector<EngineControl> *getNonEmptyEngineGroup(size_t index) const;
size_t getIndexOfNonEmptyEngineGroup(EngineGroupType engineGroupType) const;
EngineControl &getEngine(uint32_t index);
EngineControl &getDefaultEngine();
EngineControl &getInternalEngine();