refactor: unify getGpgpuEngineInstances for xe2+

Signed-off-by: Maciej Plewka <maciej.plewka@intel.com>
This commit is contained in:
Maciej Plewka 2024-11-22 13:39:00 +00:00 committed by Compute-Runtime-Automation
parent 0454a9480a
commit fccca2dba7
4 changed files with 77 additions and 71 deletions

View File

@ -22,6 +22,52 @@ void GfxCoreHelperHw<Family>::applyAdditionalCompressionSettings(Gmm &gmm, bool
}
}
template <typename GfxFamily>
const EngineInstancesContainer GfxCoreHelperHw<GfxFamily>::getGpgpuEngineInstances(const RootDeviceEnvironment &rootDeviceEnvironment) const {
auto &hwInfo = *rootDeviceEnvironment.getHardwareInfo();
auto defaultEngine = getChosenEngineType(hwInfo);
EngineInstancesContainer engines;
uint32_t numCcs = hwInfo.gtSystemInfo.CCSInfo.NumberOfCCSEnabled;
if (hwInfo.featureTable.flags.ftrCCSNode) {
for (uint32_t i = 0; i < numCcs; i++) {
auto engineType = static_cast<aub_stream::EngineType>(i + aub_stream::ENGINE_CCS);
engines.push_back({engineType, EngineUsage::regular});
}
}
if ((debugManager.flags.NodeOrdinal.get() == static_cast<int32_t>(aub_stream::EngineType::ENGINE_CCCS)) ||
hwInfo.featureTable.flags.ftrRcsNode) {
engines.push_back({aub_stream::ENGINE_CCCS, EngineUsage::regular});
}
engines.push_back({defaultEngine, EngineUsage::lowPriority});
engines.push_back({defaultEngine, EngineUsage::internal});
if (hwInfo.capabilityTable.blitterOperationsSupported) {
if (hwInfo.featureTable.ftrBcsInfo.test(0)) {
engines.push_back({aub_stream::EngineType::ENGINE_BCS, EngineUsage::regular}); // Main copy engine
engines.push_back({aub_stream::EngineType::ENGINE_BCS, EngineUsage::internal}); // Internal usage
}
uint32_t internalIndex = getInternalCopyEngineIndex(hwInfo);
for (uint32_t i = 1; i < hwInfo.featureTable.ftrBcsInfo.size(); i++) {
if (hwInfo.featureTable.ftrBcsInfo.test(i)) {
auto engineType = static_cast<aub_stream::EngineType>((i - 1) + aub_stream::ENGINE_BCS1); // Link copy engine
engines.push_back({engineType, EngineUsage::regular});
if (i == internalIndex) {
engines.push_back({engineType, EngineUsage::internal});
}
}
}
}
return engines;
};
template <>
void GfxCoreHelperHw<Family>::applyRenderCompressionFlag(Gmm &gmm, uint32_t isCompressed) const {}

View File

@ -71,37 +71,6 @@ bool GfxCoreHelperHw<GfxFamily>::makeResidentBeforeLockNeeded(bool precondition)
return true;
}
template <typename GfxFamily>
const EngineInstancesContainer GfxCoreHelperHw<GfxFamily>::getGpgpuEngineInstances(const RootDeviceEnvironment &rootDeviceEnvironment) const {
auto &hwInfo = *rootDeviceEnvironment.getHardwareInfo();
auto defaultEngine = getChosenEngineType(hwInfo);
EngineInstancesContainer engines;
auto ailHelper = rootDeviceEnvironment.getAILConfigurationHelper();
auto forceRcs = ailHelper && ailHelper->forceRcs();
if (hwInfo.featureTable.flags.ftrCCSNode && !forceRcs) {
for (uint32_t i = 0; i < hwInfo.gtSystemInfo.CCSInfo.NumberOfCCSEnabled; i++) {
engines.push_back({static_cast<aub_stream::EngineType>(i + aub_stream::ENGINE_CCS), EngineUsage::regular});
}
}
if ((debugManager.flags.NodeOrdinal.get() == static_cast<int32_t>(aub_stream::EngineType::ENGINE_RCS)) ||
hwInfo.featureTable.flags.ftrRcsNode ||
forceRcs) {
engines.push_back({aub_stream::ENGINE_RCS, EngineUsage::regular});
}
engines.push_back({defaultEngine, EngineUsage::lowPriority});
engines.push_back({defaultEngine, EngineUsage::internal});
if (hwInfo.capabilityTable.blitterOperationsSupported && hwInfo.featureTable.ftrBcsInfo.test(0)) {
engines.push_back({aub_stream::ENGINE_BCS, EngineUsage::regular});
engines.push_back({aub_stream::ENGINE_BCS, EngineUsage::internal}); // internal usage
}
return engines;
};
template <typename GfxFamily>
EngineGroupType GfxCoreHelperHw<GfxFamily>::getEngineGroupType(aub_stream::EngineType engineType, EngineUsage engineUsage, const HardwareInfo &hwInfo) const {
if (engineType == aub_stream::ENGINE_RCS) {

View File

@ -46,46 +46,6 @@ uint8_t GfxCoreHelperHw<Family>::getBarriersCountFromHasBarriers(uint8_t hasBarr
return possibleBarriersCounts[hasBarriers];
}
template <>
const EngineInstancesContainer GfxCoreHelperHw<Family>::getGpgpuEngineInstances(const RootDeviceEnvironment &rootDeviceEnvironment) const {
auto &hwInfo = *rootDeviceEnvironment.getHardwareInfo();
auto defaultEngine = getChosenEngineType(hwInfo);
EngineInstancesContainer engines;
if (hwInfo.featureTable.flags.ftrCCSNode) {
for (uint32_t i = 0; i < hwInfo.gtSystemInfo.CCSInfo.NumberOfCCSEnabled; i++) {
engines.push_back({static_cast<aub_stream::EngineType>(i + aub_stream::ENGINE_CCS), EngineUsage::regular});
}
}
if ((debugManager.flags.NodeOrdinal.get() == static_cast<int32_t>(aub_stream::EngineType::ENGINE_CCCS)) ||
hwInfo.featureTable.flags.ftrRcsNode) {
engines.push_back({aub_stream::ENGINE_CCCS, EngineUsage::regular});
}
engines.push_back({defaultEngine, EngineUsage::lowPriority});
engines.push_back({defaultEngine, EngineUsage::internal});
if (hwInfo.capabilityTable.blitterOperationsSupported) {
if (hwInfo.featureTable.ftrBcsInfo.test(0)) {
engines.push_back({aub_stream::EngineType::ENGINE_BCS, EngineUsage::regular}); // Main copy engine
engines.push_back({aub_stream::EngineType::ENGINE_BCS, EngineUsage::internal}); // Internal usage
}
uint32_t internalIndex = getInternalCopyEngineIndex(hwInfo);
for (uint32_t i = 1; i < hwInfo.featureTable.ftrBcsInfo.size(); i++) {
if (hwInfo.featureTable.ftrBcsInfo.test(i)) {
auto engineType = static_cast<aub_stream::EngineType>((i - 1) + aub_stream::ENGINE_BCS1); // Link copy engine
engines.push_back({engineType, EngineUsage::regular});
if (i == internalIndex) {
engines.push_back({engineType, EngineUsage::internal});
}
}
}
}
return engines;
};
template <>
EngineGroupType GfxCoreHelperHw<Family>::getEngineGroupType(aub_stream::EngineType engineType, EngineUsage engineUsage, const HardwareInfo &hwInfo) const {
if (engineType == aub_stream::ENGINE_CCCS) {

View File

@ -164,6 +164,37 @@ bool MemorySynchronizationCommands<Family>::isBarrierPriorToPipelineSelectWaRequ
return rootDeviceEnvironment.getReleaseHelper()->isPipeControlPriorToPipelineSelectWaRequired();
}
template <>
const EngineInstancesContainer GfxCoreHelperHw<Family>::getGpgpuEngineInstances(const RootDeviceEnvironment &rootDeviceEnvironment) const {
auto &hwInfo = *rootDeviceEnvironment.getHardwareInfo();
auto defaultEngine = getChosenEngineType(hwInfo);
EngineInstancesContainer engines;
auto ailHelper = rootDeviceEnvironment.getAILConfigurationHelper();
auto forceRcs = ailHelper && ailHelper->forceRcs();
if (hwInfo.featureTable.flags.ftrCCSNode && !forceRcs) {
for (uint32_t i = 0; i < hwInfo.gtSystemInfo.CCSInfo.NumberOfCCSEnabled; i++) {
engines.push_back({static_cast<aub_stream::EngineType>(i + aub_stream::ENGINE_CCS), EngineUsage::regular});
}
}
if ((debugManager.flags.NodeOrdinal.get() == static_cast<int32_t>(aub_stream::EngineType::ENGINE_RCS)) ||
hwInfo.featureTable.flags.ftrRcsNode ||
forceRcs) {
engines.push_back({aub_stream::ENGINE_RCS, EngineUsage::regular});
}
engines.push_back({defaultEngine, EngineUsage::lowPriority});
engines.push_back({defaultEngine, EngineUsage::internal});
if (hwInfo.capabilityTable.blitterOperationsSupported && hwInfo.featureTable.ftrBcsInfo.test(0)) {
engines.push_back({aub_stream::ENGINE_BCS, EngineUsage::regular});
engines.push_back({aub_stream::ENGINE_BCS, EngineUsage::internal}); // internal usage
}
return engines;
};
template class GfxCoreHelperHw<Family>;
template class FlatBatchBufferHelperHw<Family>;
template struct MemorySynchronizationCommands<Family>;