2019-10-14 13:33:18 +02:00
|
|
|
/*
|
2021-05-17 15:22:49 +00:00
|
|
|
* Copyright (C) 2019-2021 Intel Corporation
|
2019-10-14 13:33:18 +02:00
|
|
|
*
|
|
|
|
|
* SPDX-License-Identifier: MIT
|
|
|
|
|
*
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
#pragma once
|
|
|
|
|
|
2021-08-11 17:36:00 +00:00
|
|
|
#include "shared/source/command_stream/preemption_mode.h"
|
|
|
|
|
#include "shared/source/helpers/common_types.h"
|
2021-08-18 15:34:29 +00:00
|
|
|
#include "shared/source/utilities/stackvec.h"
|
2021-08-11 17:36:00 +00:00
|
|
|
|
2019-10-14 13:33:18 +02:00
|
|
|
#include "engine_node.h"
|
|
|
|
|
|
2020-02-24 18:25:42 +01:00
|
|
|
#include <atomic>
|
2021-05-17 15:22:49 +00:00
|
|
|
#include <string>
|
2020-09-15 17:29:02 +02:00
|
|
|
#include <utility>
|
2020-02-24 18:25:42 +01:00
|
|
|
|
2019-10-14 13:33:18 +02:00
|
|
|
namespace NEO {
|
2020-01-16 17:52:17 +01:00
|
|
|
struct HardwareInfo;
|
2021-07-02 11:34:07 +00:00
|
|
|
struct SelectorCopyEngine;
|
2020-01-16 17:52:17 +01:00
|
|
|
|
2020-09-15 17:29:02 +02:00
|
|
|
enum class EngineUsage : uint32_t {
|
|
|
|
|
Regular,
|
|
|
|
|
LowPriority,
|
2021-05-17 15:22:49 +00:00
|
|
|
Internal,
|
2021-08-16 18:24:13 +00:00
|
|
|
Cooperative,
|
2021-05-17 15:22:49 +00:00
|
|
|
|
|
|
|
|
EngineUsageCount,
|
2020-09-15 17:29:02 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
using EngineTypeUsage = std::pair<aub_stream::EngineType, EngineUsage>;
|
2021-08-18 15:34:29 +00:00
|
|
|
using EngineInstancesContainer = StackVec<EngineTypeUsage, 32>;
|
2020-09-15 17:29:02 +02:00
|
|
|
|
2021-08-11 17:36:00 +00:00
|
|
|
struct EngineDescriptor {
|
|
|
|
|
EngineDescriptor() = delete;
|
2021-08-12 15:43:07 +00:00
|
|
|
constexpr EngineDescriptor(EngineTypeUsage engineTypeUsage, DeviceBitfield deviceBitfield, PreemptionMode preemptionMode, bool isRootDevice, bool isEngineInstanced)
|
|
|
|
|
: engineTypeUsage(engineTypeUsage), deviceBitfield(deviceBitfield), preemptionMode(preemptionMode), isRootDevice(isRootDevice), isEngineInstanced(isEngineInstanced) {}
|
2021-08-11 17:36:00 +00:00
|
|
|
|
|
|
|
|
EngineTypeUsage engineTypeUsage;
|
|
|
|
|
DeviceBitfield deviceBitfield;
|
|
|
|
|
PreemptionMode preemptionMode;
|
|
|
|
|
bool isRootDevice;
|
2021-08-12 15:43:07 +00:00
|
|
|
bool isEngineInstanced;
|
2021-08-11 17:36:00 +00:00
|
|
|
};
|
|
|
|
|
|
2020-01-13 13:15:03 +01:00
|
|
|
namespace EngineHelpers {
|
2019-10-14 13:33:18 +02:00
|
|
|
bool isCcs(aub_stream::EngineType engineType);
|
2019-11-25 18:37:19 +01:00
|
|
|
bool isBcs(aub_stream::EngineType engineType);
|
2021-08-17 14:15:49 +00:00
|
|
|
aub_stream::EngineType getBcsEngineType(const HardwareInfo &hwInfo, const DeviceBitfield &deviceBitfield, SelectorCopyEngine &selectorCopyEngine, bool internalUsage);
|
2021-07-02 11:34:07 +00:00
|
|
|
void releaseBcsEngineType(aub_stream::EngineType engineType, SelectorCopyEngine &selectorCopyEngine);
|
2021-08-10 11:20:40 +00:00
|
|
|
aub_stream::EngineType remapEngineTypeToHwSpecific(aub_stream::EngineType inputType, const HardwareInfo &hwInfo);
|
2021-05-17 15:22:49 +00:00
|
|
|
|
|
|
|
|
std::string engineTypeToString(aub_stream::EngineType engineType);
|
|
|
|
|
std::string engineTypeToStringAdditional(aub_stream::EngineType engineType);
|
|
|
|
|
std::string engineUsageToString(EngineUsage usage);
|
|
|
|
|
|
2020-01-13 13:15:03 +01:00
|
|
|
}; // namespace EngineHelpers
|
2019-10-14 13:33:18 +02:00
|
|
|
} // namespace NEO
|