Add extra parameters to Buffer::setSurfaceState() method

Signed-off-by: Igor Venevtsev <igor.venevtsev@intel.com>
This commit is contained in:
Igor Venevtsev
2021-03-03 12:25:26 +00:00
committed by Compute-Runtime-Automation
parent 9114a3e414
commit 52e118fe49
20 changed files with 92 additions and 50 deletions

View File

@@ -540,7 +540,10 @@ bool CommandQueue::setupDebugSurface(Kernel *kernel) {
kernel->getKernelInfo(rootDeviceIndex).kernelDescriptor.payloadMappings.implicitArgs.systemThreadSurfaceAddress.bindful);
void *addressToPatch = reinterpret_cast<void *>(debugSurface->getGpuAddress());
size_t sizeToPatch = debugSurface->getUnderlyingBufferSize();
Buffer::setSurfaceState(&device->getDevice(), surfaceState, false, false, sizeToPatch, addressToPatch, 0, debugSurface, 0, 0);
Buffer::setSurfaceState(&device->getDevice(), surfaceState, false, false, sizeToPatch,
addressToPatch, 0, debugSurface, 0, 0,
kernel->getDefaultKernelInfo().kernelDescriptor.kernelAttributes.flags.useGlobalAtomics,
kernel->getTotalNumDevicesInContext());
return true;
}

View File

@@ -710,6 +710,7 @@ CompletionStamp CommandQueueHw<GfxFamily>::enqueueNonBlocked(
Kernel *kernel = nullptr;
bool usePerDssBackedBuffer = false;
bool auxTranslationRequired = false;
bool useGlobalAtomics = false;
for (auto &dispatchInfo : multiDispatchInfo) {
if (kernel != dispatchInfo.getKernel()) {
@@ -731,6 +732,10 @@ CompletionStamp CommandQueueHw<GfxFamily>::enqueueNonBlocked(
if (kernel->requiresPerDssBackedBuffer(rootDeviceIndex)) {
usePerDssBackedBuffer = true;
}
if (kernel->getDefaultKernelInfo().kernelDescriptor.kernelAttributes.flags.useGlobalAtomics) {
useGlobalAtomics = true;
}
}
if (mediaSamplerRequired) {
@@ -776,9 +781,6 @@ CompletionStamp CommandQueueHw<GfxFamily>::enqueueNonBlocked(
auto memoryCompressionState = getGpgpuCommandStreamReceiver().getMemoryCompressionState(auxTranslationRequired);
auto context = kernel->getProgram()->getContextPtr();
auto numDevicesInContext = context ? context->getNumDevices() : 1u;
DispatchFlags dispatchFlags(
{}, //csrDependencies
&timestampPacketDependencies.barrierNodes, //barrierTimestampPacketNodes
@@ -805,8 +807,8 @@ CompletionStamp CommandQueueHw<GfxFamily>::enqueueNonBlocked(
false, //epilogueRequired
usePerDssBackedBuffer, //usePerDssBackedBuffer
kernel->isSingleSubdevicePreferred(), //useSingleSubdevice
kernel->getDefaultKernelInfo().kernelDescriptor.kernelAttributes.flags.useGlobalAtomics, //useGlobalAtomics
numDevicesInContext //numDevicesInContext
useGlobalAtomics, //useGlobalAtomics
kernel->getTotalNumDevicesInContext() //numDevicesInContext
);
dispatchFlags.pipelineSelectArgs.mediaSamplerRequired = mediaSamplerRequired;

View File

@@ -101,7 +101,9 @@ void HardwareInterface<GfxFamily>::dispatchWalker(
void *addressToPatch = reinterpret_cast<void *>(debugSurface->getGpuAddress());
size_t sizeToPatch = debugSurface->getUnderlyingBufferSize();
Buffer::setSurfaceState(&commandQueue.getDevice(), commandQueue.getDevice().getDebugger()->getDebugSurfaceReservedSurfaceState(*ssh),
false, false, sizeToPatch, addressToPatch, 0, debugSurface, 0, 0);
false, false, sizeToPatch, addressToPatch, 0, debugSurface, 0, 0,
mainKernel->getDefaultKernelInfo().kernelDescriptor.kernelAttributes.flags.useGlobalAtomics,
mainKernel->getTotalNumDevicesInContext());
}
auto numSupportedDevices = commandQueue.getGpgpuCommandStreamReceiver().getOsContext().getNumSupportedDevices();