feature: enable BCS split for copy offload queues

Related-To: NEO-14557

Signed-off-by: Bartosz Dunajski <bartosz.dunajski@intel.com>
This commit is contained in:
Bartosz Dunajski
2025-08-27 11:01:59 +00:00
committed by Compute-Runtime-Automation
parent e01c47152e
commit 2e58669fe9
9 changed files with 48 additions and 14 deletions

View File

@@ -353,6 +353,8 @@ ze_result_t CommandListCoreFamily<gfxCoreFamily>::initialize(Device *device, NEO
enableCopyOperationOffload();
}
enableImmediateBcsSplit();
return returnType;
}

View File

@@ -257,10 +257,6 @@ CommandList *CommandList::createImmediate(uint32_t productFamily, Device *device
commandList->isTbxMode = csr->isTbxMode();
commandList->commandListPreemptionMode = device->getDevicePreemptionMode();
if (!internalUsage) {
commandList->isBcsSplitNeeded = deviceImp->bcsSplit->setupDevice(csr);
}
commandList->copyThroughLockedPtrEnabled = gfxCoreHelper.copyThroughLockedPtrEnabled(hwInfo, productHelper);
const bool cmdListSupportsCopyOffload = commandList->isInOrderExecutionEnabled() && !productHelper.isDcFlushAllowed();
@@ -269,9 +265,17 @@ CommandList *CommandList::createImmediate(uint32_t productFamily, Device *device
commandList->enableCopyOperationOffload();
}
commandList->enableImmediateBcsSplit();
return commandList;
}
void CommandListImp::enableImmediateBcsSplit() {
if (device->getNEODevice()->isBcsSplitSupported() && isImmediateType() && !internalUsage && !isBcsSplitNeeded) {
isBcsSplitNeeded = static_cast<DeviceImp *>(getDevice())->bcsSplit->setupDevice(getCsr(false), isCopyOffloadEnabled());
}
}
void CommandListImp::enableCopyOperationOffload() {
if (isCopyOnly(false) || !static_cast<DeviceImp *>(device)->tryGetCopyEngineOrdinal().has_value()) {
return;

View File

@@ -56,6 +56,7 @@ struct CommandListImp : public CommandList {
uint64_t getInOrderExecDeviceGpuAddress() const;
size_t getInOrderExecHostRequiredSize() const;
uint64_t getInOrderExecHostGpuAddress() const;
void enableImmediateBcsSplit();
protected:
std::shared_ptr<NEO::InOrderExecInfo> inOrderExecInfo;

View File

@@ -19,7 +19,7 @@
namespace L0 {
bool BcsSplit::setupDevice(NEO::CommandStreamReceiver *csr) {
bool BcsSplit::setupDevice(NEO::CommandStreamReceiver *csr, bool copyOffloadEnabled) {
auto &productHelper = this->device.getProductHelper();
auto bcsSplitSettings = productHelper.getBcsSplitSettings(this->device.getHwInfo());
@@ -29,12 +29,12 @@ bool BcsSplit::setupDevice(NEO::CommandStreamReceiver *csr) {
// If expectedTileCount==1, route root device to Tile0, otherwise use all Tiles
bool tileCountMatch = (bcsSplitSettings.requiredTileCount == 1) || (this->device.getNEODevice()->getNumSubDevices() == bcsSplitSettings.requiredTileCount);
bool engineMatch = (csr->getOsContext().getEngineType() == productHelper.getDefaultCopyEngine());
if (copyOffloadEnabled && NEO::debugManager.flags.SplitBcsForCopyOffload.get() != 0) {
engineMatch = NEO::EngineHelpers::isComputeEngine(csr->getOsContext().getEngineType());
}
auto initializeBcsSplit = this->device.getNEODevice()->isBcsSplitSupported() &&
(csr->getOsContext().getEngineType() == productHelper.getDefaultCopyEngine()) &&
tileCountMatch;
if (!initializeBcsSplit) {
if (!(engineMatch && tileCountMatch)) {
return false;
}

View File

@@ -169,7 +169,7 @@ struct BcsSplit {
return result;
}
bool setupDevice(NEO::CommandStreamReceiver *csr);
bool setupDevice(NEO::CommandStreamReceiver *csr, bool copyOffloadEnabled);
void releaseResources();
std::vector<CommandList *> &getCmdListsForSplit(NEO::TransferDirection direction);
void setupEnginesMask(NEO::BcsSplitSettings &settings);