Refactor BCS in OpenCL CommandQueue

- use CopyEngineState class to hold task count and engine type
- pass engine type to updateBcsTaskCount

Related-To: NEO-6057
Signed-off-by: Maciej Dziuban <maciej.dziuban@intel.com>
This commit is contained in:
Maciej Dziuban
2021-09-17 17:09:06 +00:00
committed by Compute-Runtime-Automation
parent d6bb9bf0dd
commit 04b6a604ec
7 changed files with 32 additions and 24 deletions

View File

@@ -138,6 +138,7 @@ CompletionStamp &CommandComputeKernel::submit(uint32_t taskLevel, bool terminate
auto &commandStreamReceiver = commandQueue.getGpgpuCommandStreamReceiver();
bool executionModelKernel = kernel->isParentKernel;
auto devQueue = commandQueue.getContext().getDefaultDeviceQueue();
auto bcsCsrForAuxTranslation = commandQueue.getBcsForAuxTranslation();
auto commandStreamReceiverOwnership = commandStreamReceiver.obtainUniqueOwnership();
bool isCcsUsed = EngineHelpers::isCcs(commandQueue.getGpgpuEngine().osContext->getEngineType());
@@ -204,13 +205,12 @@ CompletionStamp &CommandComputeKernel::submit(uint32_t taskLevel, bool terminate
}
if (kernelOperation->blitPropertiesContainer.size() > 0) {
auto &bcsCsr = *commandQueue.getBcsForAuxTranslation();
CsrDependencies csrDeps;
eventsRequest.fillCsrDependenciesForTimestampPacketContainer(csrDeps, bcsCsr, CsrDependencies::DependenciesType::All);
eventsRequest.fillCsrDependenciesForTimestampPacketContainer(csrDeps, *bcsCsrForAuxTranslation, CsrDependencies::DependenciesType::All);
BlitProperties::setupDependenciesForAuxTranslation(kernelOperation->blitPropertiesContainer, *timestampPacketDependencies,
*currentTimestampPacketNodes, csrDeps,
commandQueue.getGpgpuCommandStreamReceiver(), bcsCsr);
commandQueue.getGpgpuCommandStreamReceiver(), *bcsCsrForAuxTranslation);
}
const auto &kernelDescriptor = kernel->getKernelInfo().kernelDescriptor;
@@ -288,8 +288,8 @@ CompletionStamp &CommandComputeKernel::submit(uint32_t taskLevel, bool terminate
uint32_t bcsTaskCount = 0u;
if (kernelOperation->blitPropertiesContainer.size() > 0) {
bcsTaskCount = commandQueue.getBcsForAuxTranslation()->blitBuffer(kernelOperation->blitPropertiesContainer, false, commandQueue.isProfilingEnabled(), commandQueue.getDevice());
commandQueue.updateBcsTaskCount(bcsTaskCount);
bcsTaskCount = bcsCsrForAuxTranslation->blitBuffer(kernelOperation->blitPropertiesContainer, false, commandQueue.isProfilingEnabled(), commandQueue.getDevice());
commandQueue.updateBcsTaskCount(bcsCsrForAuxTranslation->getOsContext().getEngineType(), bcsTaskCount);
}
commandQueue.updateLatestSentEnqueueType(EnqueueProperties::Operation::GpuKernel);
@@ -326,9 +326,8 @@ void CommandWithoutKernel::dispatchBlitOperation() {
eventsRequest.fillCsrDependenciesForTaskCountContainer(blitProperties.csrDependencies, *bcsCsr);
}
auto bcsTaskCount = bcsCsr->blitBuffer(kernelOperation->blitPropertiesContainer, false, commandQueue.isProfilingEnabled(), commandQueue.getDevice());
commandQueue.updateBcsTaskCount(bcsTaskCount);
const auto newTaskCount = bcsCsr->blitBuffer(kernelOperation->blitPropertiesContainer, false, commandQueue.isProfilingEnabled(), commandQueue.getDevice());
commandQueue.updateBcsTaskCount(bcsCsr->getOsContext().getEngineType(), newTaskCount);
}
CompletionStamp &CommandWithoutKernel::submit(uint32_t taskLevel, bool terminated) {