Refactor: Update Device::engineGroups to store only available engine groups

Simplify logic around engine groups.
Remove no longer needed code.

Related-To: NEO-6219

Signed-off-by: Filip Hazubski <filip.hazubski@intel.com>
This commit is contained in:
Filip Hazubski
2021-11-26 12:47:01 +00:00
committed by Compute-Runtime-Automation
parent 133e13b319
commit 4461b8ea3f
23 changed files with 196 additions and 302 deletions

View File

@@ -32,8 +32,12 @@ struct SelectorCopyEngine : NonCopyableOrMovableClass {
class Device : public ReferenceTrackedObject<Device> {
public:
using EngineGroupT = std::vector<EngineControl>;
using EngineGroupsT = EngineGroupT[CommonConstants::engineGroupCount];
using EnginesT = std::vector<EngineControl>;
struct EngineGroupT {
EngineGroupType engineGroupType;
EnginesT engines;
};
using EngineGroupsT = std::vector<EngineGroupT>;
Device &operator=(const Device &) = delete;
Device(const Device &) = delete;
@@ -61,8 +65,7 @@ class Device : public ReferenceTrackedObject<Device> {
EngineGroupsT &getEngineGroups() {
return this->engineGroups;
}
const std::vector<EngineControl> *getNonEmptyEngineGroup(size_t index) const;
size_t getIndexOfNonEmptyEngineGroup(EngineGroupType engineGroupType) const;
size_t getEngineGroupIndexFromEngineGroupType(EngineGroupType engineGroupType) const;
EngineControl &getEngine(uint32_t index);
EngineControl &getDefaultEngine();
EngineControl &getNextEngineForCommandQueue();
@@ -83,7 +86,7 @@ class Device : public ReferenceTrackedObject<Device> {
MOCKABLE_VIRTUAL bool isDebuggerActive() const;
Debugger *getDebugger() const { return getRootDeviceEnvironment().debugger.get(); }
NEO::SourceLevelDebugger *getSourceLevelDebugger();
const std::vector<EngineControl> &getEngines() const;
const EnginesT &getEngines() const;
const std::string getDeviceName(const HardwareInfo &hwInfo) const;
ExecutionEnvironment *getExecutionEnvironment() const { return executionEnvironment; }
@@ -162,7 +165,7 @@ class Device : public ReferenceTrackedObject<Device> {
std::unique_ptr<PerformanceCounters> performanceCounters;
std::vector<std::unique_ptr<CommandStreamReceiver>> commandStreamReceivers;
std::vector<EngineControl> engines;
EnginesT engines;
EngineGroupsT engineGroups;
std::vector<SubDevice *> subdevices;