mirror of
https://github.com/intel/compute-runtime.git
synced 2025-12-21 09:14:47 +08:00
Assign engine to command queue using round robin algorithm
Signed-off-by: Lukasz Jobczyk <lukasz.jobczyk@intel.com>
This commit is contained in:
committed by
Compute-Runtime-Automation
parent
cc2ba84fc8
commit
1c68ac1cbc
@@ -307,6 +307,7 @@ DECLARE_DEBUG_VARIABLE(int32_t, EnableUserFenceForCompletionWait, -1, "-1: defau
|
||||
DECLARE_DEBUG_VARIABLE(int32_t, EnableUserFenceUseCtxId, -1, "-1: default (disabled), 0: disable, 1: enable : Use Context Id in Wait User Fence when waiting for completion tag")
|
||||
DECLARE_DEBUG_VARIABLE(int32_t, SetKmdWaitTimeout, -1, "-1: default (infinity), >0: amount of time units for wait function timeout")
|
||||
DECLARE_DEBUG_VARIABLE(int32_t, OverrideNotifyEnableForTagUpdatePostSync, -1, "-1: default (usage determined by user fence wait call), 0: disable use of NotifyEnable flag, 1: enable use NotifyEnable flag")
|
||||
DECLARE_DEBUG_VARIABLE(int32_t, EnableCmdQRoundRobindEngineAssign, -1, "-1: default, 0: disable, 1: enable")
|
||||
DECLARE_DEBUG_VARIABLE(int32_t, Force32BitDriverSupport, -1, "-1: default, 0: disable, 1: enable, Forces the driver to support 32 bit.")
|
||||
DECLARE_DEBUG_VARIABLE(int32_t, OverrideSystolicPipelineSelect, -1, "set SYSTOLIC MODE ENABLE in PIPELINE_SELECT cmd, -1:default, 0:disable, 1:enable")
|
||||
DECLARE_DEBUG_VARIABLE(int32_t, OverrideSystolicInComputeWalker, -1, "set SYSTOLIC MODE ENABLE in COMPUTE_WALKER cmd, -1:default, 0:disable, 1:enable")
|
||||
|
||||
@@ -565,6 +565,20 @@ EngineControl &Device::getInternalEngine() {
|
||||
return this->getNearestGenericSubDevice(0)->getEngine(engineType, EngineUsage::Internal);
|
||||
}
|
||||
|
||||
EngineControl &Device::getNextEngineForCommandQueue() {
|
||||
const auto &defaultEngine = this->getDefaultEngine();
|
||||
|
||||
const auto &hardwareInfo = this->getHardwareInfo();
|
||||
const auto &hwHelper = NEO::HwHelper::get(hardwareInfo.platform.eRenderCoreFamily);
|
||||
const auto engineGroupType = hwHelper.getEngineGroupType(defaultEngine.getEngineType(), defaultEngine.getEngineUsage(), hardwareInfo);
|
||||
|
||||
auto defaultEngineGroupIndex = this->getIndexOfNonEmptyEngineGroup(engineGroupType);
|
||||
auto engines = this->getEngineGroups()[defaultEngineGroupIndex];
|
||||
|
||||
auto engineIndex = this->regularCommandQueuesCreatedWithinDeviceCount++ % engines.size();
|
||||
return this->getEngineGroups()[defaultEngineGroupIndex][engineIndex];
|
||||
}
|
||||
|
||||
EngineControl *Device::getInternalCopyEngine() {
|
||||
if (!getHardwareInfo().capabilityTable.blitterOperationsSupported) {
|
||||
return nullptr;
|
||||
|
||||
@@ -65,6 +65,7 @@ class Device : public ReferenceTrackedObject<Device> {
|
||||
size_t getIndexOfNonEmptyEngineGroup(EngineGroupType engineGroupType) const;
|
||||
EngineControl &getEngine(uint32_t index);
|
||||
EngineControl &getDefaultEngine();
|
||||
EngineControl &getNextEngineForCommandQueue();
|
||||
EngineControl &getInternalEngine();
|
||||
EngineControl *getInternalCopyEngine();
|
||||
SelectorCopyEngine &getSelectorCopyEngine();
|
||||
@@ -172,6 +173,7 @@ class Device : public ReferenceTrackedObject<Device> {
|
||||
aub_stream::EngineType engineInstancedType = aub_stream::EngineType::NUM_ENGINES;
|
||||
uint32_t defaultEngineIndex = 0;
|
||||
uint32_t numSubDevices = 0;
|
||||
std::atomic_uint32_t regularCommandQueuesCreatedWithinDeviceCount{0};
|
||||
bool hasGenericSubDevices = false;
|
||||
bool engineInstanced = false;
|
||||
bool rootCsrCreated = false;
|
||||
|
||||
@@ -108,6 +108,7 @@ class HwHelper {
|
||||
virtual bool useOnlyGlobalTimestamps() const = 0;
|
||||
virtual bool useSystemMemoryPlacementForISA(const HardwareInfo &hwInfo) const = 0;
|
||||
virtual bool packedFormatsSupported() const = 0;
|
||||
virtual bool isAssignEngineRoundRobinSupported() const = 0;
|
||||
virtual bool isRcsAvailable(const HardwareInfo &hwInfo) const = 0;
|
||||
virtual bool isCooperativeDispatchSupported(const EngineGroupType engineGroupType, const HardwareInfo &hwInfo) const = 0;
|
||||
virtual uint32_t adjustMaxWorkGroupCount(uint32_t maxWorkGroupCount, const EngineGroupType engineGroupType,
|
||||
@@ -357,6 +358,8 @@ class HwHelperHw : public HwHelper {
|
||||
|
||||
bool additionalPipeControlArgsRequired() const override;
|
||||
|
||||
bool isAssignEngineRoundRobinSupported() const override;
|
||||
|
||||
bool isEngineTypeRemappingToHwSpecificRequired() const override;
|
||||
|
||||
bool isSipKernelAsHexadecimalArrayPreferred() const override;
|
||||
|
||||
@@ -40,6 +40,11 @@ bool HwHelperHw<GfxFamily>::timestampPacketWriteSupported() const {
|
||||
return false;
|
||||
}
|
||||
|
||||
template <typename GfxFamily>
|
||||
bool HwHelperHw<GfxFamily>::isAssignEngineRoundRobinSupported() const {
|
||||
return false;
|
||||
}
|
||||
|
||||
template <typename GfxFamily>
|
||||
const EngineInstancesContainer HwHelperHw<GfxFamily>::getGpgpuEngineInstances(const HardwareInfo &hwInfo) const {
|
||||
return {
|
||||
|
||||
@@ -133,6 +133,11 @@ uint32_t HwHelperHw<GfxFamily>::getPlanarYuvMaxHeight() const {
|
||||
return planarYuvMaxHeight;
|
||||
}
|
||||
|
||||
template <typename GfxFamily>
|
||||
bool HwHelperHw<GfxFamily>::isAssignEngineRoundRobinSupported() const {
|
||||
return true;
|
||||
}
|
||||
|
||||
template <typename GfxFamily>
|
||||
aub_stream::MMIOList HwHelperHw<GfxFamily>::getExtraMmioList(const HardwareInfo &hwInfo, const GmmHelper &gmmHelper) const {
|
||||
aub_stream::MMIOList mmioList;
|
||||
|
||||
Reference in New Issue
Block a user