@@ -78,7 +78,7 @@ KernelImmutableData::~KernelImmutableData() {
7878
7979inline void patchWithImplicitSurface (ArrayRef<uint8_t > crossThreadData, ArrayRef<uint8_t > surfaceStateHeap,
8080 uintptr_t ptrToPatchInCrossThreadData, NEO::GraphicsAllocation &allocation,
81- const NEO::ArgDescPointer &ptr, const NEO::Device &device) {
81+ const NEO::ArgDescPointer &ptr, const NEO::Device &device, bool useGlobalAtomics ) {
8282 if (false == crossThreadData.empty ()) {
8383 NEO::patchPointer (crossThreadData, ptr, ptrToPatchInCrossThreadData);
8484 }
@@ -88,7 +88,7 @@ inline void patchWithImplicitSurface(ArrayRef<uint8_t> crossThreadData, ArrayRef
8888 void *addressToPatch = reinterpret_cast <void *>(allocation.getUnderlyingBuffer ());
8989 size_t sizeToPatch = allocation.getUnderlyingBufferSize ();
9090 NEO::Buffer::setSurfaceState (&device, surfaceState, false , false , sizeToPatch, addressToPatch, 0 ,
91- &allocation, 0 , 0 , false , device.getNumAvailableDevices () > 1 );
91+ &allocation, 0 , 0 , useGlobalAtomics , device.getNumAvailableDevices () > 1 );
9292 }
9393}
9494
@@ -171,7 +171,8 @@ void KernelImmutableData::initialize(NEO::KernelInfo *kernelInfo, Device *device
171171
172172 patchWithImplicitSurface (crossThredDataArrayRef, surfaceStateHeapArrayRef,
173173 static_cast <uintptr_t >(globalConstBuffer->getGpuAddressToPatch ()),
174- *globalConstBuffer, kernelDescriptor->payloadMappings .implicitArgs .globalConstantsSurfaceAddress , *neoDevice);
174+ *globalConstBuffer, kernelDescriptor->payloadMappings .implicitArgs .globalConstantsSurfaceAddress ,
175+ *neoDevice, kernelDescriptor->kernelAttributes .flags .useGlobalAtomics );
175176 this ->residencyContainer .push_back (globalConstBuffer);
176177 } else if (nullptr != globalConstBuffer) {
177178 this ->residencyContainer .push_back (globalConstBuffer);
@@ -182,7 +183,8 @@ void KernelImmutableData::initialize(NEO::KernelInfo *kernelInfo, Device *device
182183
183184 patchWithImplicitSurface (crossThredDataArrayRef, surfaceStateHeapArrayRef,
184185 static_cast <uintptr_t >(globalVarBuffer->getGpuAddressToPatch ()),
185- *globalVarBuffer, kernelDescriptor->payloadMappings .implicitArgs .globalVariablesSurfaceAddress , *neoDevice);
186+ *globalVarBuffer, kernelDescriptor->payloadMappings .implicitArgs .globalVariablesSurfaceAddress ,
187+ *neoDevice, kernelDescriptor->kernelAttributes .flags .useGlobalAtomics );
186188 this ->residencyContainer .push_back (globalVarBuffer);
187189 } else if (nullptr != globalVarBuffer) {
188190 this ->residencyContainer .push_back (globalVarBuffer);
@@ -741,7 +743,8 @@ ze_result_t KernelImp::initialize(const ze_kernel_desc_t *desc) {
741743
742744 patchWithImplicitSurface (crossThredDataArrayRef, surfaceStateHeapArrayRef,
743745 static_cast <uintptr_t >(privateMemoryGraphicsAllocation->getGpuAddressToPatch ()),
744- *privateMemoryGraphicsAllocation, kernelImmData->getDescriptor ().payloadMappings .implicitArgs .privateMemoryAddress , *neoDevice);
746+ *privateMemoryGraphicsAllocation, kernelImmData->getDescriptor ().payloadMappings .implicitArgs .privateMemoryAddress ,
747+ *neoDevice, kernelAttributes.flags .useGlobalAtomics );
745748
746749 this ->residencyContainer .push_back (this ->privateMemoryGraphicsAllocation );
747750 }
@@ -794,7 +797,7 @@ void KernelImp::setDebugSurface() {
794797 patchWithImplicitSurface (ArrayRef<uint8_t >(), surfaceStateHeapRef,
795798 0 ,
796799 *device->getDebugSurface (), this ->getImmutableData ()->getDescriptor ().payloadMappings .implicitArgs .systemThreadSurfaceAddress ,
797- *device->getNEODevice ());
800+ *device->getNEODevice (), getKernelDescriptor (). kernelAttributes . flags . useGlobalAtomics );
798801 }
799802}
800803void *KernelImp::patchBindlessSurfaceState (NEO::GraphicsAllocation *alloc, uint32_t bindless) {
0 commit comments