mirror of
https://github.com/intel/compute-runtime.git
synced 2025-12-25 13:33:02 +08:00
feature: add support for HP copy engine context
- add support for contect group with HP copy engine - choose HP copy engine when available Related-To: NEO-11983 Signed-off-by: Mateusz Hoppe <mateusz.hoppe@intel.com>
This commit is contained in:
committed by
Compute-Runtime-Automation
parent
ce6e7f63af
commit
3fbcbcaef2
@@ -256,12 +256,21 @@ aub_stream::EngineType selectLinkCopyEngine(const RootDeviceEnvironment &rootDev
|
||||
: aub_stream::ENGINE_BCS4;
|
||||
const aub_stream::EngineType engine2 = aub_stream::ENGINE_BCS2;
|
||||
|
||||
if (isBcsEnabled(hwInfo, engine1) && isBcsEnabled(hwInfo, engine2)) {
|
||||
auto hpEngine = gfxCoreHelper.getDefaultHpCopyEngine(hwInfo);
|
||||
|
||||
if (isBcsEnabled(hwInfo, engine1) && engine1 != hpEngine &&
|
||||
isBcsEnabled(hwInfo, engine2) && engine2 != hpEngine) {
|
||||
// both BCS enabled, round robin
|
||||
return selectorCopyEngine.fetch_xor(1u) ? engine1 : engine2;
|
||||
} else {
|
||||
// one BCS enabled
|
||||
return isBcsEnabled(hwInfo, engine1) ? engine1 : engine2;
|
||||
if (isBcsEnabled(hwInfo, engine1) && (engine1 != hpEngine)) {
|
||||
return engine1;
|
||||
} else if (isBcsEnabled(hwInfo, engine2) && (engine2 != hpEngine)) {
|
||||
return engine2;
|
||||
} else {
|
||||
return productHelper.getDefaultCopyEngine();
|
||||
}
|
||||
}
|
||||
}
|
||||
aub_stream::EngineType mapCcsIndexToEngineType(uint32_t index) {
|
||||
|
||||
@@ -182,6 +182,8 @@ class GfxCoreHelper {
|
||||
|
||||
virtual bool areSecondaryContextsSupported() const = 0;
|
||||
virtual uint32_t getContextGroupContextsCount() const = 0;
|
||||
virtual uint32_t getContextGroupHpContextsCount(EngineGroupType type) const = 0;
|
||||
virtual aub_stream::EngineType getDefaultHpCopyEngine(const HardwareInfo &hwInfo) const = 0;
|
||||
|
||||
virtual bool is48ResourceNeededForCmdBuffer() const = 0;
|
||||
virtual uint32_t getKernelPrivateMemSize(const KernelDescriptor &kernelDescriptor) const = 0;
|
||||
@@ -418,6 +420,8 @@ class GfxCoreHelperHw : public GfxCoreHelper {
|
||||
|
||||
bool areSecondaryContextsSupported() const override;
|
||||
uint32_t getContextGroupContextsCount() const override;
|
||||
uint32_t getContextGroupHpContextsCount(EngineGroupType type) const override;
|
||||
aub_stream::EngineType getDefaultHpCopyEngine(const HardwareInfo &hwInfo) const override;
|
||||
|
||||
bool is48ResourceNeededForCmdBuffer() const override;
|
||||
|
||||
|
||||
@@ -748,6 +748,17 @@ uint32_t GfxCoreHelperHw<GfxFamily>::getContextGroupContextsCount() const {
|
||||
return 0;
|
||||
}
|
||||
|
||||
template <typename GfxFamily>
|
||||
uint32_t GfxCoreHelperHw<GfxFamily>::getContextGroupHpContextsCount(EngineGroupType type) const {
|
||||
return std::min(getContextGroupContextsCount() / 2, 4u);
|
||||
}
|
||||
|
||||
template <typename GfxFamily>
|
||||
aub_stream::EngineType GfxCoreHelperHw<GfxFamily>::getDefaultHpCopyEngine(const HardwareInfo &hwInfo) const {
|
||||
|
||||
return aub_stream::EngineType::NUM_ENGINES;
|
||||
}
|
||||
|
||||
template <typename GfxFamily>
|
||||
bool GfxCoreHelperHw<GfxFamily>::is48ResourceNeededForCmdBuffer() const {
|
||||
return true;
|
||||
|
||||
Reference in New Issue
Block a user