@@ -343,13 +343,10 @@ cl_int Kernel::initialize() {
343343 Buffer::setSurfaceState (&pClDevice->getDevice (), surfaceState, false , false , 0 , nullptr , 0 , nullptr , 0 , 0 );
344344 }
345345
346- if (patchInfo.pAllocateStatelessDefaultDeviceQueueSurface ) {
347-
348- if (requiresSshForBuffers (rootDeviceIndex)) {
349- auto surfaceState = ptrOffset (reinterpret_cast <uintptr_t *>(getSurfaceStateHeap (rootDeviceIndex)),
350- patchInfo.pAllocateStatelessDefaultDeviceQueueSurface ->SurfaceStateHeapOffset );
351- Buffer::setSurfaceState (&pClDevice->getDevice (), surfaceState, false , false , 0 , nullptr , 0 , nullptr , 0 , 0 );
352- }
346+ if (isValidOffset (kernelDescriptor.payloadMappings .implicitArgs .deviceSideEnqueueDefaultQueueSurfaceAddress .bindful )) {
347+ auto surfaceState = ptrOffset (reinterpret_cast <uintptr_t *>(getSurfaceStateHeap (rootDeviceIndex)),
348+ kernelDescriptor.payloadMappings .implicitArgs .deviceSideEnqueueDefaultQueueSurfaceAddress .bindful );
349+ Buffer::setSurfaceState (&pClDevice->getDevice (), surfaceState, false , false , 0 , nullptr , 0 , nullptr , 0 , 0 );
353350 }
354351
355352 setThreadArbitrationPolicy (hwHelper.getDefaultThreadArbitrationPolicy ());
@@ -2444,23 +2441,17 @@ void Kernel::provideInitializationHints() {
24442441}
24452442
24462443void Kernel::patchDefaultDeviceQueue (DeviceQueue *devQueue) {
2447-
24482444 auto rootDeviceIndex = devQueue->getDevice ().getRootDeviceIndex ();
2449- const auto &patchInfo = kernelInfos[rootDeviceIndex]->patchInfo ;
2450- if (patchInfo.pAllocateStatelessDefaultDeviceQueueSurface ) {
2451- if (kernelDeviceInfos[rootDeviceIndex].crossThreadData ) {
2452- auto patchLocation = ptrOffset (reinterpret_cast <uint32_t *>(getCrossThreadData (rootDeviceIndex)),
2453- patchInfo.pAllocateStatelessDefaultDeviceQueueSurface ->DataParamOffset );
2454-
2455- patchWithRequiredSize (patchLocation, patchInfo.pAllocateStatelessDefaultDeviceQueueSurface ->DataParamSize ,
2456- static_cast <uintptr_t >(devQueue->getQueueBuffer ()->getGpuAddressToPatch ()));
2457- }
2458- if (requiresSshForBuffers (rootDeviceIndex)) {
2459- auto surfaceState = ptrOffset (reinterpret_cast <uintptr_t *>(getSurfaceStateHeap (rootDeviceIndex)),
2460- patchInfo.pAllocateStatelessDefaultDeviceQueueSurface ->SurfaceStateHeapOffset );
2461- Buffer::setSurfaceState (&devQueue->getDevice (), surfaceState, false , false , devQueue->getQueueBuffer ()->getUnderlyingBufferSize (),
2462- (void *)devQueue->getQueueBuffer ()->getGpuAddress (), 0 , devQueue->getQueueBuffer (), 0 , 0 );
2463- }
2445+ const auto &defaultQueueSurfaceAddress = kernelInfos[rootDeviceIndex]->kernelDescriptor .payloadMappings .implicitArgs .deviceSideEnqueueDefaultQueueSurfaceAddress ;
2446+ if (isValidOffset (defaultQueueSurfaceAddress.stateless ) && kernelDeviceInfos[rootDeviceIndex].crossThreadData ) {
2447+ auto patchLocation = ptrOffset (reinterpret_cast <uint32_t *>(getCrossThreadData (rootDeviceIndex)), defaultQueueSurfaceAddress.stateless );
2448+ patchWithRequiredSize (patchLocation, defaultQueueSurfaceAddress.pointerSize ,
2449+ static_cast <uintptr_t >(devQueue->getQueueBuffer ()->getGpuAddressToPatch ()));
2450+ }
2451+ if (isValidOffset (defaultQueueSurfaceAddress.bindful )) {
2452+ auto surfaceState = ptrOffset (reinterpret_cast <uintptr_t *>(getSurfaceStateHeap (rootDeviceIndex)), defaultQueueSurfaceAddress.bindful );
2453+ Buffer::setSurfaceState (&devQueue->getDevice (), surfaceState, false , false , devQueue->getQueueBuffer ()->getUnderlyingBufferSize (),
2454+ (void *)devQueue->getQueueBuffer ()->getGpuAddress (), 0 , devQueue->getQueueBuffer (), 0 , 0 );
24642455 }
24652456}
24662457
0 commit comments