diff --git a/projects/clr/rocclr/device/pal/palvirtual.cpp b/projects/clr/rocclr/device/pal/palvirtual.cpp index 44b06436d6..0ae8b85afa 100644 --- a/projects/clr/rocclr/device/pal/palvirtual.cpp +++ b/projects/clr/rocclr/device/pal/palvirtual.cpp @@ -2487,7 +2487,7 @@ void VirtualGPU::submitKernel(amd::NDRangeKernelCommand& vcmd) { // Submit kernel to HW if (!queue->submitKernelInternal(vcmd.sizes(), vcmd.kernel(), vcmd.parameters(), false, - vcmd.sharedMemBytes(), vcmd.cooperativeGroups())) { + vcmd.sharedMemBytes())) { vcmd.setStatus(CL_INVALID_OPERATION); } @@ -2503,7 +2503,7 @@ void VirtualGPU::submitKernel(amd::NDRangeKernelCommand& vcmd) { // Submit kernel to HW if (!submitKernelInternal(vcmd.sizes(), vcmd.kernel(), vcmd.parameters(), false, - vcmd.sharedMemBytes(), vcmd.cooperativeGroups())) { + vcmd.sharedMemBytes(), vcmd.getAnyOrderLaunchFlag())) { vcmd.setStatus(CL_INVALID_OPERATION); } @@ -2515,9 +2515,10 @@ void VirtualGPU::submitKernel(amd::NDRangeKernelCommand& vcmd) { bool VirtualGPU::submitKernelInternal(const amd::NDRangeContainer& sizes, const amd::Kernel& kernel, const_address parameters, bool nativeMem, uint32_t sharedMemBytes, - bool cooperativeGroup) { + bool anyOrder) { size_t newOffset[3] = {0, 0, 0}; size_t newGlobalSize[3] = {0, 0, 0}; + state_.anyOrder_ = anyOrder; int dim = -1; int iteration = 1; diff --git a/projects/clr/rocclr/device/pal/palvirtual.hpp b/projects/clr/rocclr/device/pal/palvirtual.hpp index 8086e5eb2c..61f472ed91 100644 --- a/projects/clr/rocclr/device/pal/palvirtual.hpp +++ b/projects/clr/rocclr/device/pal/palvirtual.hpp @@ -240,6 +240,7 @@ class VirtualGPU : public device::VirtualDevice { uint perfCounterEnabled_ : 1; //!< PerfCounter is enabled uint rgpCaptureEnabled_ : 1; //!< RGP capture is enabled in the runtime uint imageBufferWrtBack_ : 1; //!< Enable image buffer write back + uint anyOrder_ : 1; //!< Kernel launches don't need a barrier }; uint value_; State() : value_(0) {} @@ -267,7 +268,12 @@ class VirtualGPU : public device::VirtualDevice { //! Invalidates GPU caches if memory dependency tracking is disabled void sync(VirtualGPU& gpu) const { if (maxMemObjectsInQueue_ == 0) { - gpu.addBarrier(RgpSqqtBarrierReason::MemDependency); + // Ignore the barrier in any order mode. The app is responsible for synchronization. + // HW will execute the kernels asynchronously + if (!gpu.anyOrder()) { + // Wait for GPU and invalidate L1 cache + gpu.addBarrier(RgpSqqtBarrierReason::MemDependency); + } } } @@ -309,7 +315,7 @@ class VirtualGPU : public device::VirtualDevice { const_address parameters, //!< Parameters for the kernel bool nativeMem = true, //!< Native memory objects uint32_t sharedMemBytes = 0, //!< Shared memory size - bool cooperativeGroups = false //!< TRUE if cooperative groups mode is required + bool anyOrder = false //!< TRUE if any order launch mode is enabled ); void submitNativeFn(amd::NativeFnCommand& vcmd); void submitFillMemory(amd::FillMemoryCommand& vcmd); @@ -434,6 +440,9 @@ class VirtualGPU : public device::VirtualDevice { //! Checks if profiling is enabled bool profiling() const { return state_.profiling_; } + //! Checks if the queue is in any order mode + bool anyOrder() const { return state_.anyOrder_; } + //! Returns memory dependency class MemoryDependency& memoryDependency() { return memoryDependency_; }