Add AssignBCSAtEnqueue debug flag

Signed-off-by: Lukasz Jobczyk <lukasz.jobczyk@intel.com>
This commit is contained in:
Lukasz Jobczyk
2022-03-01 11:24:30 +00:00
committed by Compute-Runtime-Automation
parent 05bf7a4315
commit 3c30e1b02b
5 changed files with 46 additions and 3 deletions

View File

@@ -179,8 +179,17 @@ CommandStreamReceiver &CommandQueue::selectCsrForBuiltinOperation(const CsrSelec
case TransferDirection::HostToLocal:
case TransferDirection::LocalToHost: {
preferBcs = true;
preferredBcsEngineType = EngineHelpers::getBcsEngineType(device->getHardwareInfo(), device->getDeviceBitfield(),
device->getSelectorCopyEngine(), false);
auto preferredBCSType = true;
if (DebugManager.flags.AssignBCSAtEnqueue.get() != -1) {
preferredBCSType = DebugManager.flags.AssignBCSAtEnqueue.get();
}
if (preferredBCSType) {
preferredBcsEngineType = EngineHelpers::getBcsEngineType(device->getHardwareInfo(), device->getDeviceBitfield(),
device->getSelectorCopyEngine(), false);
}
break;
}
default:
@@ -189,7 +198,16 @@ CommandStreamReceiver &CommandQueue::selectCsrForBuiltinOperation(const CsrSelec
CommandStreamReceiver *selectedCsr = nullptr;
if (preferBcs) {
selectedCsr = getBcsCommandStreamReceiver(preferredBcsEngineType);
auto assignBCS = true;
if (DebugManager.flags.AssignBCSAtEnqueue.get() != -1) {
assignBCS = DebugManager.flags.AssignBCSAtEnqueue.get();
}
if (assignBCS) {
selectedCsr = getBcsCommandStreamReceiver(preferredBcsEngineType);
}
if (selectedCsr == nullptr && !bcsEngineTypes.empty()) {
selectedCsr = getBcsCommandStreamReceiver(bcsEngineTypes[0]);
}

View File

@@ -1069,6 +1069,7 @@ template <typename GfxFamily>
template <uint32_t cmdType>
void CommandQueueHw<GfxFamily>::enqueueBlit(const MultiDispatchInfo &multiDispatchInfo, cl_uint numEventsInWaitList, const cl_event *eventWaitList, cl_event *event, bool blocking, CommandStreamReceiver &bcsCsr) {
auto commandStreamReceiverOwnership = getGpgpuCommandStreamReceiver().obtainUniqueOwnership();
auto bcsCommandStreamReceiverOwnership = bcsCsr.obtainUniqueOwnership();
EventsRequest eventsRequest(numEventsInWaitList, eventWaitList, event);
EventBuilder eventBuilder;
@@ -1154,6 +1155,7 @@ void CommandQueueHw<GfxFamily>::enqueueBlit(const MultiDispatchInfo &multiDispat
timestampPacketDependencies.moveNodesToNewContainer(*deferredTimestampPackets);
queueOwnership.unlock();
bcsCommandStreamReceiverOwnership.unlock();
commandStreamReceiverOwnership.unlock();
if (blocking) {