refactor: Remove unused cmdq round robin engine assign

Signed-off-by: Lukasz Jobczyk <lukasz.jobczyk@intel.com>
This commit is contained in:
Lukasz Jobczyk 2025-05-08 15:04:31 +00:00 committed by Compute-Runtime-Automation
parent ad99f00ba4
commit df2c776aab
17 changed files with 8 additions and 589 deletions

View File

@ -187,35 +187,17 @@ void CommandQueue::initializeGpgpu() const {
static std::mutex mutex;
std::lock_guard<std::mutex> lock(mutex);
if (gpgpuEngine == nullptr) {
auto &productHelper = device->getProductHelper();
auto engineRoundRobinAvailable = productHelper.isAssignEngineRoundRobinSupported() &&
this->isAssignEngineRoundRobinEnabled();
if (debugManager.flags.EnableCmdQRoundRobindEngineAssign.get() != -1) {
engineRoundRobinAvailable = debugManager.flags.EnableCmdQRoundRobindEngineAssign.get();
}
auto assignEngineRoundRobin =
!this->isSpecialCommandQueue &&
!this->queueFamilySelected &&
!(getCmdQueueProperties<cl_queue_priority_khr>(propertiesVector.data(), CL_QUEUE_PRIORITY_KHR) & static_cast<cl_queue_priority_khr>(CL_QUEUE_PRIORITY_LOW_KHR)) &&
engineRoundRobinAvailable;
auto defaultEngineType = device->getDefaultEngine().getEngineType();
const GfxCoreHelper &gfxCoreHelper = getDevice().getGfxCoreHelper();
bool secondaryContextsEnabled = gfxCoreHelper.areSecondaryContextsSupported();
if (assignEngineRoundRobin) {
this->gpgpuEngine = &device->getDevice().getNextEngineForCommandQueue();
} else {
if (secondaryContextsEnabled && EngineHelpers::isCcs(defaultEngineType)) {
tryAssignSecondaryEngine(device->getDevice(), gpgpuEngine, {defaultEngineType, EngineUsage::regular});
}
if (secondaryContextsEnabled && EngineHelpers::isCcs(defaultEngineType)) {
tryAssignSecondaryEngine(device->getDevice(), gpgpuEngine, {defaultEngineType, EngineUsage::regular});
}
if (gpgpuEngine == nullptr) {
this->gpgpuEngine = &device->getDefaultEngine();
}
if (gpgpuEngine == nullptr) {
this->gpgpuEngine = &device->getDefaultEngine();
}
this->initializeGpgpuInternals();

View File

@ -274,7 +274,6 @@ class CommandQueue : public BaseObject<_cl_command_queue> {
void allocateHeapMemory(IndirectHeapType heapType,
size_t minRequiredSize, IndirectHeap *&indirectHeap);
static bool isAssignEngineRoundRobinEnabled();
static bool isTimestampWaitEnabled();
MOCKABLE_VIRTUAL void releaseIndirectHeap(IndirectHeapType heapType);

View File

@ -9,10 +9,6 @@
namespace NEO {
bool CommandQueue::isAssignEngineRoundRobinEnabled() {
return true;
}
bool CommandQueue::isTimestampWaitEnabled() {
return true;
}

View File

@ -1,5 +1,5 @@
/*
* Copyright (C) 2018-2024 Intel Corporation
* Copyright (C) 2018-2025 Intel Corporation
*
* SPDX-License-Identifier: MIT
*
@ -326,7 +326,6 @@ HWTEST_F(EnqueueKernelTest, givenBcsEnabledWhenThread1EnqueueWriteBufferAndThrea
HWTEST_F(EnqueueKernelTest, givenBcsEnabledAndQueuePerThreadWhenEnqueueWriteBufferAndEnqueueNDRangeKernelInLoopThenIsNoRace) {
DebugManagerStateRestore debugRestorer;
debugManager.flags.ForceCsrLockInBcsEnqueueOnlyForGpgpuSubmission.set(1);
debugManager.flags.EnableCmdQRoundRobindEngineAssign.set(0);
HardwareInfo hwInfo = *pDevice->executionEnvironment->rootDeviceEnvironments[0]->getMutableHardwareInfo();
hwInfo.capabilityTable.blitterOperationsSupported = true;
REQUIRE_FULL_BLITTER_OR_SKIP(*pDevice->executionEnvironment->rootDeviceEnvironments[0]);

View File

@ -575,248 +575,6 @@ TEST_F(DeviceTests, givenAffinityMaskWhenCreatingClSubDevicesThenSkipDisabledDev
EXPECT_EQ(0b100u, clRootDevice->getSubDevice(1)->getDeviceBitfield().to_ulong());
}
struct SingleSliceDispatchSupportMatcher {
template <PRODUCT_FAMILY productFamily>
static constexpr bool isMatched() {
using GfxProduct = typename HwMapper<productFamily>::GfxProduct;
return GfxProduct::FrontEndStateSupport::singleSliceDispatchCcsMode;
}
};
HWTEST_F(DeviceTests, whenCreateMultipleCommandQueuesThenEnginesAreAssignedUsingRoundRobin) {
constexpr uint32_t genericDevicesCount = 1;
constexpr uint32_t ccsCount = 4;
DebugManagerStateRestore restorer;
debugManager.flags.EnableCmdQRoundRobindEngineAssign.set(1);
if (!createDevices(genericDevicesCount, ccsCount)) {
GTEST_SKIP();
}
auto &hwInfo = rootDevice->getHardwareInfo();
const auto &gfxCoreHelper = rootDevice->getGfxCoreHelper();
const auto &productHelper = rootDevice->getProductHelper();
if (!productHelper.isAssignEngineRoundRobinSupported()) {
GTEST_SKIP();
}
EXPECT_EQ(ccsCount, hwInfo.gtSystemInfo.CCSInfo.NumberOfCCSEnabled);
auto clRootDevice = std::make_unique<ClDevice>(*rootDevice, nullptr);
cl_device_id deviceIds[] = {clRootDevice.get()};
ClDeviceVector deviceVector{deviceIds, 1};
MockContext context(deviceVector);
std::array<std::unique_ptr<MockCommandQueueHw<FamilyType>>, 24> cmdQs;
for (auto &cmdQ : cmdQs) {
cmdQ = std::make_unique<MockCommandQueueHw<FamilyType>>(&context, clRootDevice.get(), nullptr);
}
const auto &defaultEngine = clRootDevice->getDefaultEngine();
const auto engineGroupType = gfxCoreHelper.getEngineGroupType(defaultEngine.getEngineType(), defaultEngine.getEngineUsage(), hwInfo);
auto defaultEngineGroupIndex = clRootDevice->getDevice().getEngineGroupIndexFromEngineGroupType(engineGroupType);
auto engines = clRootDevice->getDevice().getRegularEngineGroups()[defaultEngineGroupIndex].engines;
for (size_t i = 0; i < cmdQs.size(); i++) {
auto engineIndex = i % engines.size();
auto expectedCsr = engines[engineIndex].commandStreamReceiver;
auto csr = &cmdQs[i]->getGpgpuCommandStreamReceiver();
EXPECT_EQ(csr, expectedCsr);
}
}
HWTEST_F(DeviceTests, givenCmdQRoundRobindEngineAssignBitfieldwWenCreateMultipleCommandQueuesThenEnginesAreAssignedUsingRoundRobinSkippingNotAvailableEngines) {
constexpr uint32_t genericDevicesCount = 1;
constexpr uint32_t ccsCount = 4;
DebugManagerStateRestore restorer;
debugManager.flags.EnableCmdQRoundRobindEngineAssign.set(1);
debugManager.flags.CmdQRoundRobindEngineAssignBitfield.set(0b1101);
if (!createDevices(genericDevicesCount, ccsCount)) {
GTEST_SKIP();
}
auto &hwInfo = rootDevice->getHardwareInfo();
const auto &gfxCoreHelper = rootDevice->getGfxCoreHelper();
const auto &productHelper = rootDevice->getProductHelper();
if (!productHelper.isAssignEngineRoundRobinSupported()) {
GTEST_SKIP();
}
EXPECT_EQ(ccsCount, hwInfo.gtSystemInfo.CCSInfo.NumberOfCCSEnabled);
auto clRootDevice = std::make_unique<ClDevice>(*rootDevice, nullptr);
cl_device_id deviceIds[] = {clRootDevice.get()};
ClDeviceVector deviceVector{deviceIds, 1};
MockContext context(deviceVector);
std::array<std::unique_ptr<MockCommandQueueHw<FamilyType>>, 24> cmdQs;
for (auto &cmdQ : cmdQs) {
cmdQ = std::make_unique<MockCommandQueueHw<FamilyType>>(&context, clRootDevice.get(), nullptr);
}
const auto &defaultEngine = clRootDevice->getDefaultEngine();
const auto engineGroupType = gfxCoreHelper.getEngineGroupType(defaultEngine.getEngineType(), defaultEngine.getEngineUsage(), hwInfo);
auto defaultEngineGroupIndex = clRootDevice->getDevice().getEngineGroupIndexFromEngineGroupType(engineGroupType);
auto engines = clRootDevice->getDevice().getRegularEngineGroups()[defaultEngineGroupIndex].engines;
for (size_t i = 0, j = 0; i < cmdQs.size(); i++, j++) {
if ((j % engines.size()) == 1) {
j++;
}
auto engineIndex = j % engines.size();
auto expectedCsr = engines[engineIndex].commandStreamReceiver;
auto csr = &cmdQs[i]->getGpgpuCommandStreamReceiver();
EXPECT_EQ(csr, expectedCsr);
}
}
HWTEST_F(DeviceTests, givenCmdQRoundRobindEngineAssignNTo1wWenCreateMultipleCommandQueuesThenEnginesAreAssignedUsingRoundRobinAndNQueuesShareSameCsr) {
constexpr uint32_t genericDevicesCount = 1;
constexpr uint32_t ccsCount = 4;
DebugManagerStateRestore restorer;
debugManager.flags.EnableCmdQRoundRobindEngineAssign.set(1);
debugManager.flags.CmdQRoundRobindEngineAssignNTo1.set(3);
if (!createDevices(genericDevicesCount, ccsCount)) {
GTEST_SKIP();
}
auto &hwInfo = rootDevice->getHardwareInfo();
const auto &gfxCoreHelper = rootDevice->getGfxCoreHelper();
const auto &productHelper = rootDevice->getProductHelper();
if (!productHelper.isAssignEngineRoundRobinSupported()) {
GTEST_SKIP();
}
EXPECT_EQ(ccsCount, hwInfo.gtSystemInfo.CCSInfo.NumberOfCCSEnabled);
auto clRootDevice = std::make_unique<ClDevice>(*rootDevice, nullptr);
cl_device_id deviceIds[] = {clRootDevice.get()};
ClDeviceVector deviceVector{deviceIds, 1};
MockContext context(deviceVector);
std::array<std::unique_ptr<MockCommandQueueHw<FamilyType>>, 24> cmdQs;
for (auto &cmdQ : cmdQs) {
cmdQ = std::make_unique<MockCommandQueueHw<FamilyType>>(&context, clRootDevice.get(), nullptr);
}
const auto &defaultEngine = clRootDevice->getDefaultEngine();
const auto engineGroupType = gfxCoreHelper.getEngineGroupType(defaultEngine.getEngineType(), defaultEngine.getEngineUsage(), hwInfo);
auto defaultEngineGroupIndex = clRootDevice->getDevice().getEngineGroupIndexFromEngineGroupType(engineGroupType);
auto engines = clRootDevice->getDevice().getRegularEngineGroups()[defaultEngineGroupIndex].engines;
for (size_t i = 0, j = 0; i < cmdQs.size(); i++, j++) {
auto engineIndex = (j / 3) % engines.size();
auto expectedCsr = engines[engineIndex].commandStreamReceiver;
auto csr = &cmdQs[i]->getGpgpuCommandStreamReceiver();
EXPECT_EQ(csr, expectedCsr);
}
}
HWTEST_F(DeviceTests, givenCmdQRoundRobindEngineAssignNTo1AndCmdQRoundRobindEngineAssignBitfieldwWenCreateMultipleCommandQueuesThenEnginesAreAssignedProperlyUsingRoundRobin) {
constexpr uint32_t genericDevicesCount = 1;
constexpr uint32_t ccsCount = 4;
DebugManagerStateRestore restorer;
debugManager.flags.EnableCmdQRoundRobindEngineAssign.set(1);
debugManager.flags.CmdQRoundRobindEngineAssignNTo1.set(3);
debugManager.flags.CmdQRoundRobindEngineAssignBitfield.set(0b1101);
if (!createDevices(genericDevicesCount, ccsCount)) {
GTEST_SKIP();
}
auto &hwInfo = rootDevice->getHardwareInfo();
const auto &gfxCoreHelper = rootDevice->getGfxCoreHelper();
const auto &productHelper = rootDevice->getProductHelper();
if (!productHelper.isAssignEngineRoundRobinSupported()) {
GTEST_SKIP();
}
EXPECT_EQ(ccsCount, hwInfo.gtSystemInfo.CCSInfo.NumberOfCCSEnabled);
auto clRootDevice = std::make_unique<ClDevice>(*rootDevice, nullptr);
cl_device_id deviceIds[] = {clRootDevice.get()};
ClDeviceVector deviceVector{deviceIds, 1};
MockContext context(deviceVector);
std::array<std::unique_ptr<MockCommandQueueHw<FamilyType>>, 24> cmdQs;
for (auto &cmdQ : cmdQs) {
cmdQ = std::make_unique<MockCommandQueueHw<FamilyType>>(&context, clRootDevice.get(), nullptr);
}
const auto &defaultEngine = clRootDevice->getDefaultEngine();
const auto engineGroupType = gfxCoreHelper.getEngineGroupType(defaultEngine.getEngineType(), defaultEngine.getEngineUsage(), hwInfo);
auto defaultEngineGroupIndex = clRootDevice->getDevice().getEngineGroupIndexFromEngineGroupType(engineGroupType);
auto engines = clRootDevice->getDevice().getRegularEngineGroups()[defaultEngineGroupIndex].engines;
for (size_t i = 0, j = 0; i < cmdQs.size(); i++, j++) {
while (((j / 3) % engines.size()) == 1) {
j++;
}
auto engineIndex = (j / 3) % engines.size();
auto expectedCsr = engines[engineIndex].commandStreamReceiver;
auto csr = &cmdQs[i]->getGpgpuCommandStreamReceiver();
EXPECT_EQ(csr, expectedCsr);
}
}
HWTEST_F(DeviceTests, givenEnableCmdQRoundRobindEngineAssignDisabledWenCreateMultipleCommandQueuesThenDefaultEngineAssigned) {
constexpr uint32_t genericDevicesCount = 1;
constexpr uint32_t ccsCount = 4;
DebugManagerStateRestore restorer;
debugManager.flags.EnableCmdQRoundRobindEngineAssign.set(0);
if (!createDevices(genericDevicesCount, ccsCount)) {
GTEST_SKIP();
}
auto &hwInfo = rootDevice->getHardwareInfo();
const auto &productHelper = rootDevice->getProductHelper();
if (!productHelper.isAssignEngineRoundRobinSupported()) {
GTEST_SKIP();
}
EXPECT_EQ(ccsCount, hwInfo.gtSystemInfo.CCSInfo.NumberOfCCSEnabled);
auto clRootDevice = std::make_unique<ClDevice>(*rootDevice, nullptr);
cl_device_id deviceIds[] = {clRootDevice.get()};
ClDeviceVector deviceVector{deviceIds, 1};
MockContext context(deviceVector);
std::array<std::unique_ptr<MockCommandQueueHw<FamilyType>>, 24> cmdQs;
for (auto &cmdQ : cmdQs) {
cmdQ = std::make_unique<MockCommandQueueHw<FamilyType>>(&context, clRootDevice.get(), nullptr);
}
const auto &defaultEngine = clRootDevice->getDefaultEngine();
for (auto &cmdQ : cmdQs) {
auto expectedCsr = defaultEngine.commandStreamReceiver;
auto csr = &cmdQ->getGpgpuCommandStreamReceiver();
EXPECT_EQ(csr, expectedCsr);
}
}
TEST(SubDevicesTest, whenInitializeRootCsrThenDirectSubmissionIsNotInitialized) {
auto device = std::make_unique<MockDevice>();
device->initializeRootCommandStreamReceiver();

View File

@ -11,10 +11,6 @@
namespace NEO {
bool CommandQueue::isAssignEngineRoundRobinEnabled() {
return false;
}
bool CommandQueue::isTimestampWaitEnabled() {
return ultHwConfig.useWaitForTimestamps;
}

View File

@ -891,10 +891,6 @@ TEST(DirectSubmissionControllerTest, whenCheckDirectSubmissionControllerSupportT
EXPECT_TRUE(DirectSubmissionController::isSupported());
}
TEST(CommandQueueTest, whenCheckEngineRoundRobinAssignThenReturnsTrue) {
EXPECT_TRUE(CommandQueue::isAssignEngineRoundRobinEnabled());
}
TEST(CommandQueueTest, whenCheckEngineTimestampWaitEnabledThenReturnsTrue) {
EXPECT_TRUE(CommandQueue::isTimestampWaitEnabled());
}

View File

@ -536,13 +536,7 @@ DECLARE_DEBUG_VARIABLE(int32_t, EnableUserFenceForCompletionWait, -1, "-1: defau
DECLARE_DEBUG_VARIABLE(int32_t, OverrideUserFenceStartValue, -1, "-1: default (disabled), >1: Instead of starting from 0, use different start value.")
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, CmdQRoundRobindEngineAssignBitfield, -1, "-1: default, >0: bitfield with supported engines")
DECLARE_DEBUG_VARIABLE(int32_t, CmdQRoundRobindEngineAssignNTo1, -1, "-1: default, >0: assign same engine to N queues")
DECLARE_DEBUG_VARIABLE(int32_t, EnableCopyEngineSelector, -1, "Do not choose only main copy engine, -1: default, 0: disable, 1: enable")
DECLARE_DEBUG_VARIABLE(int32_t, EnableCmdQRoundRobindBcsEngineAssign, -1, "-1: default, 0: disable, 1: enable")
DECLARE_DEBUG_VARIABLE(int32_t, EnableCmdQRoundRobindBcsEngineAssignLimit, -1, "-1: default, >=0: round robin limit")
DECLARE_DEBUG_VARIABLE(int32_t, EnableCmdQRoundRobindBcsEngineAssignStartingValue, -1, "-1: default, >=0: round robin starting point")
DECLARE_DEBUG_VARIABLE(int32_t, ForceBCSForInternalCopyEngine, -1, "-1: default, do not force, 0: main copy engine, 1: copy engine index")
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")

View File

@ -878,25 +878,6 @@ EngineControl &Device::getInternalEngine() {
return this->getNearestGenericSubDevice(0)->getEngine(engineType, EngineUsage::internal);
}
EngineControl &Device::getNextEngineForCommandQueue() {
this->initializeEngineRoundRobinControls();
const auto &defaultEngine = this->getDefaultEngine();
const auto &hardwareInfo = this->getHardwareInfo();
const auto &gfxCoreHelper = getGfxCoreHelper();
const auto engineGroupType = gfxCoreHelper.getEngineGroupType(defaultEngine.getEngineType(), defaultEngine.getEngineUsage(), hardwareInfo);
const auto defaultEngineGroupIndex = this->getEngineGroupIndexFromEngineGroupType(engineGroupType);
auto &engineGroup = this->getRegularEngineGroups()[defaultEngineGroupIndex];
auto engineIndex = 0u;
do {
engineIndex = (this->regularCommandQueuesCreatedWithinDeviceCount++ / this->queuesPerEngineCount) % engineGroup.engines.size();
} while (!this->availableEnginesForCommandQueueusRoundRobin.test(engineIndex));
return engineGroup.engines[engineIndex];
}
EngineControl *Device::getInternalCopyEngine() {
if (!getHardwareInfo().capabilityTable.blitterOperationsSupported) {
return nullptr;
@ -989,28 +970,6 @@ void Device::finalizeRayTracing() {
}
}
void Device::initializeEngineRoundRobinControls() {
if (this->availableEnginesForCommandQueueusRoundRobin.any()) {
return;
}
uint32_t queuesPerEngine = 1u;
if (debugManager.flags.CmdQRoundRobindEngineAssignNTo1.get() != -1) {
queuesPerEngine = debugManager.flags.CmdQRoundRobindEngineAssignNTo1.get();
}
this->queuesPerEngineCount = queuesPerEngine;
std::bitset<8> availableEngines = std::numeric_limits<uint8_t>::max();
if (debugManager.flags.CmdQRoundRobindEngineAssignBitfield.get() != -1) {
availableEngines = debugManager.flags.CmdQRoundRobindEngineAssignBitfield.get();
}
this->availableEnginesForCommandQueueusRoundRobin = availableEngines;
}
OSTime *Device::getOSTime() const { return getRootDeviceEnvironment().osTime.get(); };
bool Device::getUuid(std::array<uint8_t, ProductHelper::uuidSize> &uuid) {

View File

@ -121,7 +121,6 @@ class Device : public ReferenceTrackedObject<Device>, NEO::NonCopyableAndNonMova
size_t getEngineGroupIndexFromEngineGroupType(EngineGroupType engineGroupType) const;
EngineControl &getEngine(uint32_t index);
EngineControl &getDefaultEngine();
EngineControl &getNextEngineForCommandQueue();
EngineControl &getInternalEngine();
EngineControl *getInternalCopyEngine();
EngineControl *getHpCopyEngine();
@ -319,7 +318,6 @@ class Device : public ReferenceTrackedObject<Device>, NEO::NonCopyableAndNonMova
std::atomic_uint32_t regularCommandQueuesCreatedWithinDeviceCount{0};
std::bitset<8> availableEnginesForCommandQueueusRoundRobin = 0;
uint32_t queuesPerEngineCount = 1;
void initializeEngineRoundRobinControls();
bool hasGenericSubDevices = false;
bool rootCsrCreated = false;
const uint32_t rootDeviceIndex;

View File

@ -1,5 +1,5 @@
/*
* Copyright (C) 2019-2024 Intel Corporation
* Copyright (C) 2019-2025 Intel Corporation
*
* SPDX-License-Identifier: MIT
*
@ -205,51 +205,6 @@ aub_stream::EngineType selectLinkCopyEngine(const RootDeviceEnvironment &rootDev
auto &gfxCoreHelper = rootDeviceEnvironment.getHelper<GfxCoreHelper>();
auto &productHelper = rootDeviceEnvironment.getProductHelper();
auto &hwInfo = *rootDeviceEnvironment.getHardwareInfo();
auto enableCmdQRoundRobindBcsEngineAssign = false;
if (debugManager.flags.EnableCmdQRoundRobindBcsEngineAssign.get() != -1) {
enableCmdQRoundRobindBcsEngineAssign = debugManager.flags.EnableCmdQRoundRobindBcsEngineAssign.get();
}
if (enableCmdQRoundRobindBcsEngineAssign) {
aub_stream::EngineType engineType;
auto bcsRoundRobinLimit = EngineHelpers::numLinkedCopyEngines;
auto engineOffset = 0u;
auto mainCE = false;
if (debugManager.flags.EnableCmdQRoundRobindBcsEngineAssignStartingValue.get() != -1) {
engineOffset = debugManager.flags.EnableCmdQRoundRobindBcsEngineAssignStartingValue.get();
mainCE = engineOffset == 0;
}
if (mainCE) {
bcsRoundRobinLimit++;
}
if (debugManager.flags.EnableCmdQRoundRobindBcsEngineAssignLimit.get() != -1) {
bcsRoundRobinLimit = debugManager.flags.EnableCmdQRoundRobindBcsEngineAssignLimit.get();
}
do {
auto selectEngineValue = (selectorCopyEngine.fetch_add(1u) % bcsRoundRobinLimit) + engineOffset;
if (mainCE) {
if (selectEngineValue == 0u) {
engineType = aub_stream::EngineType::ENGINE_BCS;
} else {
engineType = static_cast<aub_stream::EngineType>(aub_stream::EngineType::ENGINE_BCS1 + selectEngineValue - 1);
}
} else {
engineType = static_cast<aub_stream::EngineType>(aub_stream::EngineType::ENGINE_BCS1 + selectEngineValue);
}
} while (!gfxCoreHelper.isSubDeviceEngineSupported(rootDeviceEnvironment, deviceBitfield, engineType) || !hwInfo.featureTable.ftrBcsInfo.test(engineType == aub_stream::EngineType::ENGINE_BCS
? 0
: engineType - aub_stream::EngineType::ENGINE_BCS1 + 1));
return engineType;
}
const aub_stream::EngineType engine1 = gfxCoreHelper.isSubDeviceEngineSupported(rootDeviceEnvironment, deviceBitfield, aub_stream::ENGINE_BCS1) && aub_stream::ENGINE_BCS1 != productHelper.getDefaultCopyEngine()
? aub_stream::ENGINE_BCS1

View File

@ -163,7 +163,6 @@ class ProductHelper {
virtual bool isCpuCopyNecessary(const void *ptr, MemoryManager *memoryManager) const = 0;
virtual bool isUnlockingLockedPtrNecessary(const HardwareInfo &hwInfo) const = 0;
virtual bool isAdjustWalkOrderAvailable(const ReleaseHelper *releaseHelper) const = 0;
virtual bool isAssignEngineRoundRobinSupported() const = 0;
virtual uint32_t getL1CachePolicy(bool isDebuggerActive) const = 0;
virtual bool isEvictionIfNecessaryFlagSupported() const = 0;
virtual void adjustNumberOfCcs(HardwareInfo &hwInfo) const = 0;

View File

@ -323,11 +323,6 @@ LocalMemoryAccessMode ProductHelperHw<gfxProduct>::getLocalMemoryAccessMode(cons
return getDefaultLocalMemoryAccessMode(hwInfo);
}
template <PRODUCT_FAMILY gfxProduct>
bool ProductHelperHw<gfxProduct>::isAssignEngineRoundRobinSupported() const {
return false;
}
template <PRODUCT_FAMILY gfxProduct>
std::pair<bool, bool> ProductHelperHw<gfxProduct>::isPipeControlPriorToNonPipelinedStateCommandsWARequired(const HardwareInfo &hwInfo, bool isRcs, const ReleaseHelper *releaseHelper) const {
auto isBasicWARequired = false;

View File

@ -105,7 +105,6 @@ class ProductHelperHw : public ProductHelper {
bool isCpuCopyNecessary(const void *ptr, MemoryManager *memoryManager) const override;
bool isUnlockingLockedPtrNecessary(const HardwareInfo &hwInfo) const override;
bool isAdjustWalkOrderAvailable(const ReleaseHelper *releaseHelper) const override;
bool isAssignEngineRoundRobinSupported() const override;
uint32_t getL1CachePolicy(bool isDebuggerActive) const override;
bool isEvictionIfNecessaryFlagSupported() const override;
void adjustNumberOfCcs(HardwareInfo &hwInfo) const override;

View File

@ -355,12 +355,6 @@ OverrideUseKmdWaitFunction = -1
EnableCacheFlushAfterWalkerForAllQueues = -1
Force32BitDriverSupport = -1
EnableCopyEngineSelector = -1
EnableCmdQRoundRobindEngineAssign = -1
CmdQRoundRobindEngineAssignBitfield = -1
CmdQRoundRobindEngineAssignNTo1 = -1
EnableCmdQRoundRobindBcsEngineAssign = -1
EnableCmdQRoundRobindBcsEngineAssignLimit = -1
EnableCmdQRoundRobindBcsEngineAssignStartingValue = -1
ForceBCSForInternalCopyEngine = -1
OverrideCmdQueueSynchronousMode = -1
OverrideImmediateCmdListSynchronousMode = -1

View File

@ -1,5 +1,5 @@
/*
* Copyright (C) 2021-2024 Intel Corporation
* Copyright (C) 2021-2025 Intel Corporation
*
* SPDX-License-Identifier: MIT
*
@ -126,202 +126,6 @@ HWTEST2_F(EngineNodeHelperTestsXeHPAndLater, givenLessThanFourCopyEnginesWhenGet
}
}
HWTEST2_F(EngineNodeHelperTestsXeHPAndLater, givenEnableCmdQRoundRobindBcsEngineAssignWhenSelectLinkCopyEngineThenRoundRobinOverAllAvailableLinkedCopyEngines, IsAtLeastXeHpCore) {
DebugManagerStateRestore restore;
debugManager.flags.EnableCmdQRoundRobindBcsEngineAssign.set(1u);
DeviceBitfield deviceBitfield = 0b10;
auto &rootDeviceEnvironment = pDevice->getRootDeviceEnvironment();
auto &hwInfo = *rootDeviceEnvironment.getMutableHardwareInfo();
hwInfo.featureTable.ftrBcsInfo.set(7);
auto &selectorCopyEngine = pDevice->getNearestGenericSubDevice(0)->getSelectorCopyEngine();
int32_t expectedEngineType = aub_stream::EngineType::ENGINE_BCS1;
auto &gfxCoreHelper = pDevice->getGfxCoreHelper();
for (int32_t i = 0; i <= 20; i++) {
while (!gfxCoreHelper.isSubDeviceEngineSupported(rootDeviceEnvironment, deviceBitfield, static_cast<aub_stream::EngineType>(expectedEngineType)) || !hwInfo.featureTable.ftrBcsInfo.test(expectedEngineType - aub_stream::EngineType::ENGINE_BCS1 + 1)) {
expectedEngineType++;
if (static_cast<aub_stream::EngineType>(expectedEngineType) > aub_stream::EngineType::ENGINE_BCS8) {
expectedEngineType = aub_stream::EngineType::ENGINE_BCS1;
}
}
auto engineType = EngineHelpers::selectLinkCopyEngine(pDevice->getRootDeviceEnvironment(), deviceBitfield, selectorCopyEngine.selector);
EXPECT_EQ(engineType, static_cast<aub_stream::EngineType>(expectedEngineType));
expectedEngineType++;
if (static_cast<aub_stream::EngineType>(expectedEngineType) > aub_stream::EngineType::ENGINE_BCS8) {
expectedEngineType = aub_stream::EngineType::ENGINE_BCS1;
}
}
}
HWTEST2_F(EngineNodeHelperTestsXeHPAndLater, givenEnableCmdQRoundRobindBcsEngineAssignAndMainCopyEngineIncludedWhenSelectLinkCopyEngineThenRoundRobinOverAllAvailableLinkedCopyEnginesAndMainCopyEngine, IsAtLeastXeHpCore) {
DebugManagerStateRestore restore;
debugManager.flags.EnableCmdQRoundRobindBcsEngineAssign.set(1u);
debugManager.flags.EnableCmdQRoundRobindBcsEngineAssignStartingValue.set(0);
DeviceBitfield deviceBitfield = 0b10;
auto &rootDeviceEnvironment = pDevice->getRootDeviceEnvironment();
auto &hwInfo = *rootDeviceEnvironment.getMutableHardwareInfo();
hwInfo.featureTable.ftrBcsInfo = 0x17f;
auto &selectorCopyEngine = pDevice->getNearestGenericSubDevice(0)->getSelectorCopyEngine();
int32_t expectedEngineType = aub_stream::EngineType::ENGINE_BCS;
auto &gfxCoreHelper = pDevice->getGfxCoreHelper();
for (int32_t i = 0; i <= 20; i++) {
while (!gfxCoreHelper.isSubDeviceEngineSupported(rootDeviceEnvironment, deviceBitfield, static_cast<aub_stream::EngineType>(expectedEngineType)) || !hwInfo.featureTable.ftrBcsInfo.test(expectedEngineType == aub_stream::EngineType::ENGINE_BCS
? 0
: expectedEngineType - aub_stream::EngineType::ENGINE_BCS1 + 1)) {
if (expectedEngineType == aub_stream::EngineType::ENGINE_BCS) {
expectedEngineType = aub_stream::EngineType::ENGINE_BCS1;
} else {
expectedEngineType++;
}
if (static_cast<aub_stream::EngineType>(expectedEngineType) > aub_stream::EngineType::ENGINE_BCS8) {
expectedEngineType = aub_stream::EngineType::ENGINE_BCS;
}
}
auto engineType = EngineHelpers::selectLinkCopyEngine(pDevice->getRootDeviceEnvironment(), deviceBitfield, selectorCopyEngine.selector);
EXPECT_EQ(engineType, static_cast<aub_stream::EngineType>(expectedEngineType));
if (expectedEngineType == aub_stream::EngineType::ENGINE_BCS) {
expectedEngineType = aub_stream::EngineType::ENGINE_BCS1;
} else {
expectedEngineType++;
}
if (static_cast<aub_stream::EngineType>(expectedEngineType) > aub_stream::EngineType::ENGINE_BCS8) {
expectedEngineType = aub_stream::EngineType::ENGINE_BCS;
}
}
}
HWTEST2_F(EngineNodeHelperTestsXeHPAndLater, givenEnableCmdQRoundRobindBcsEngineAssignAndMainCopyEngineIncludedAndLimitSetWhenSelectLinkCopyEngineThenRoundRobinOverAllAvailableLinkedCopyEnginesAndMainCopyEngine, IsAtLeastXeHpCore) {
DebugManagerStateRestore restore;
debugManager.flags.EnableCmdQRoundRobindBcsEngineAssign.set(1u);
debugManager.flags.EnableCmdQRoundRobindBcsEngineAssignStartingValue.set(0);
debugManager.flags.EnableCmdQRoundRobindBcsEngineAssignLimit.set(6);
DeviceBitfield deviceBitfield = 0b10;
auto &rootDeviceEnvironment = pDevice->getRootDeviceEnvironment();
auto &hwInfo = *rootDeviceEnvironment.getMutableHardwareInfo();
hwInfo.featureTable.ftrBcsInfo = 0x17f;
auto &selectorCopyEngine = pDevice->getNearestGenericSubDevice(0)->getSelectorCopyEngine();
int32_t expectedEngineType = aub_stream::EngineType::ENGINE_BCS;
auto &gfxCoreHelper = pDevice->getGfxCoreHelper();
for (int32_t i = 0; i <= 20; i++) {
while (!gfxCoreHelper.isSubDeviceEngineSupported(rootDeviceEnvironment, deviceBitfield, static_cast<aub_stream::EngineType>(expectedEngineType)) || !hwInfo.featureTable.ftrBcsInfo.test(expectedEngineType == aub_stream::EngineType::ENGINE_BCS
? 0
: expectedEngineType - aub_stream::EngineType::ENGINE_BCS1 + 1)) {
if (expectedEngineType == aub_stream::EngineType::ENGINE_BCS) {
expectedEngineType = aub_stream::EngineType::ENGINE_BCS1;
} else {
expectedEngineType++;
}
if (static_cast<aub_stream::EngineType>(expectedEngineType) > aub_stream::EngineType::ENGINE_BCS5) {
expectedEngineType = aub_stream::EngineType::ENGINE_BCS;
}
}
auto engineType = EngineHelpers::selectLinkCopyEngine(pDevice->getRootDeviceEnvironment(), deviceBitfield, selectorCopyEngine.selector);
EXPECT_EQ(engineType, static_cast<aub_stream::EngineType>(expectedEngineType));
if (expectedEngineType == aub_stream::EngineType::ENGINE_BCS) {
expectedEngineType = aub_stream::EngineType::ENGINE_BCS1;
} else {
expectedEngineType++;
}
if (static_cast<aub_stream::EngineType>(expectedEngineType) > aub_stream::EngineType::ENGINE_BCS5) {
expectedEngineType = aub_stream::EngineType::ENGINE_BCS;
}
}
}
HWTEST2_F(EngineNodeHelperTestsXeHPAndLater, givenEnableCmdQRoundRobindBcsEngineAssignAndLimitSetWhenSelectLinkCopyEngineThenRoundRobinOverAllAvailableLinkedCopyEnginesAndMainCopyEngine, IsAtLeastXeHpCore) {
DebugManagerStateRestore restore;
debugManager.flags.EnableCmdQRoundRobindBcsEngineAssign.set(1u);
debugManager.flags.EnableCmdQRoundRobindBcsEngineAssignLimit.set(6);
DeviceBitfield deviceBitfield = 0b10;
auto &rootDeviceEnvironment = pDevice->getRootDeviceEnvironment();
auto &hwInfo = *rootDeviceEnvironment.getMutableHardwareInfo();
hwInfo.featureTable.ftrBcsInfo = 0x17f;
auto &selectorCopyEngine = pDevice->getNearestGenericSubDevice(0)->getSelectorCopyEngine();
int32_t expectedEngineType = aub_stream::EngineType::ENGINE_BCS1;
auto &gfxCoreHelper = pDevice->getGfxCoreHelper();
for (int32_t i = 0; i <= 20; i++) {
while (!gfxCoreHelper.isSubDeviceEngineSupported(rootDeviceEnvironment, deviceBitfield, static_cast<aub_stream::EngineType>(expectedEngineType)) || !hwInfo.featureTable.ftrBcsInfo.test(expectedEngineType == aub_stream::EngineType::ENGINE_BCS
? 0
: expectedEngineType - aub_stream::EngineType::ENGINE_BCS1 + 1)) {
if (expectedEngineType == aub_stream::EngineType::ENGINE_BCS) {
expectedEngineType = aub_stream::EngineType::ENGINE_BCS1;
} else {
expectedEngineType++;
}
if (static_cast<aub_stream::EngineType>(expectedEngineType) > aub_stream::EngineType::ENGINE_BCS6) {
expectedEngineType = aub_stream::EngineType::ENGINE_BCS1;
}
}
auto engineType = EngineHelpers::selectLinkCopyEngine(pDevice->getRootDeviceEnvironment(), deviceBitfield, selectorCopyEngine.selector);
EXPECT_EQ(engineType, static_cast<aub_stream::EngineType>(expectedEngineType));
if (expectedEngineType == aub_stream::EngineType::ENGINE_BCS) {
expectedEngineType = aub_stream::EngineType::ENGINE_BCS1;
} else {
expectedEngineType++;
}
if (static_cast<aub_stream::EngineType>(expectedEngineType) > aub_stream::EngineType::ENGINE_BCS6) {
expectedEngineType = aub_stream::EngineType::ENGINE_BCS1;
}
}
}
HWTEST2_F(EngineNodeHelperTestsXeHPAndLater, givenEnableCmdQRoundRobindBcsEngineAssignAndStartOffsetIncludedWhenSelectLinkCopyEngineThenRoundRobinOverAllAvailableLinkedCopyEngines, IsAtLeastXeHpCore) {
DebugManagerStateRestore restore;
debugManager.flags.EnableCmdQRoundRobindBcsEngineAssign.set(1u);
debugManager.flags.EnableCmdQRoundRobindBcsEngineAssignStartingValue.set(2);
debugManager.flags.EnableCmdQRoundRobindBcsEngineAssignLimit.set(5);
DeviceBitfield deviceBitfield = 0b10;
auto &rootDeviceEnvironment = pDevice->getRootDeviceEnvironment();
auto &hwInfo = *rootDeviceEnvironment.getMutableHardwareInfo();
hwInfo.featureTable.ftrBcsInfo = 0x17f;
auto &selectorCopyEngine = pDevice->getNearestGenericSubDevice(0)->getSelectorCopyEngine();
int32_t expectedEngineType = aub_stream::EngineType::ENGINE_BCS3;
auto &gfxCoreHelper = pDevice->getGfxCoreHelper();
for (int32_t i = 0; i <= 20; i++) {
while (!gfxCoreHelper.isSubDeviceEngineSupported(rootDeviceEnvironment, deviceBitfield, static_cast<aub_stream::EngineType>(expectedEngineType)) || !hwInfo.featureTable.ftrBcsInfo.test(expectedEngineType == aub_stream::EngineType::ENGINE_BCS
? 0
: expectedEngineType - aub_stream::EngineType::ENGINE_BCS1 + 1)) {
if (expectedEngineType == aub_stream::EngineType::ENGINE_BCS) {
expectedEngineType = aub_stream::EngineType::ENGINE_BCS1;
} else {
expectedEngineType++;
}
if (static_cast<aub_stream::EngineType>(expectedEngineType) > aub_stream::EngineType::ENGINE_BCS7) {
expectedEngineType = aub_stream::EngineType::ENGINE_BCS3;
}
}
auto engineType = EngineHelpers::selectLinkCopyEngine(pDevice->getRootDeviceEnvironment(), deviceBitfield, selectorCopyEngine.selector);
EXPECT_EQ(engineType, static_cast<aub_stream::EngineType>(expectedEngineType));
if (expectedEngineType == aub_stream::EngineType::ENGINE_BCS) {
expectedEngineType = aub_stream::EngineType::ENGINE_BCS1;
} else {
expectedEngineType++;
}
if (static_cast<aub_stream::EngineType>(expectedEngineType) > aub_stream::EngineType::ENGINE_BCS7) {
expectedEngineType = aub_stream::EngineType::ENGINE_BCS3;
}
}
}
HWTEST2_F(EngineNodeHelperTestsXeHPAndLater, givenHpCopyEngineWhenSelectLinkCopyEngineThenHpEngineIsNotSelected, IsAtLeastXeHpCore) {
DebugManagerStateRestore restore;
debugManager.flags.ContextGroupSize.set(8);

View File

@ -343,10 +343,6 @@ HWTEST_F(ProductHelperTest, givenVariousDebugKeyValuesWhenGettingLocalMemoryAcce
EXPECT_EQ(LocalMemoryAccessMode::cpuAccessDisallowed, productHelper->getLocalMemoryAccessMode(pInHwInfo));
}
HWTEST_F(ProductHelperTest, WhenCheckAssignEngineRoundRobinSupportedThenReturnFalse) {
EXPECT_FALSE(productHelper->isAssignEngineRoundRobinSupported());
}
HWTEST2_F(ProductHelperTest, givenProductHelperWhenAskedIfPipeControlPriorToNonPipelinedStateCommandsWARequiredThenFalseIsReturned, IsNotXeHpgOrXeHpcCore) {
auto isRcs = false;