diff --git a/opencl/source/command_queue/command_queue.cpp b/opencl/source/command_queue/command_queue.cpp index 4dfdc5ecb3..486eca1abd 100644 --- a/opencl/source/command_queue/command_queue.cpp +++ b/opencl/source/command_queue/command_queue.cpp @@ -1619,13 +1619,6 @@ bool CommandQueue::isValidForStagingBufferCopy(Device &device, void *dstPtr, con // Direct transfer from mapped allocation is faster than staging buffer return false; } - auto rootDeviceIndex = device.getRootDeviceIndex(); - auto isLocalMem = device.getMemoryManager()->isLocalMemorySupported(rootDeviceIndex); - if (isOOQEnabled() && getGpgpuCommandStreamReceiver().isBusy() && !isLocalMem) { - // It's not beneficial to make copy through staging buffers if it's OOQ, - // compute engine is busy and device is iGPU. - return false; - } CsrSelectionArgs csrSelectionArgs{CL_COMMAND_SVM_MEMCPY, nullptr}; csrSelectionArgs.direction = TransferDirection::hostToLocal; auto csr = &selectCsrForBuiltinOperation(csrSelectionArgs); diff --git a/opencl/test/unit_test/command_queue/enqueue_svm_tests.cpp b/opencl/test/unit_test/command_queue/enqueue_svm_tests.cpp index f65d314999..c80bc017ff 100644 --- a/opencl/test/unit_test/command_queue/enqueue_svm_tests.cpp +++ b/opencl/test/unit_test/command_queue/enqueue_svm_tests.cpp @@ -2608,54 +2608,3 @@ HWTEST_F(StagingBufferTest, givenIsValidForStagingBufferCopyWhenSrcIsMappedThenR auto [buffer, mappedPtr] = createBufferAndMapItOnGpu(); EXPECT_FALSE(myCmdQ.isValidForStagingBufferCopy(pClDevice->getDevice(), dstPtr, mappedPtr, buffer->getSize(), false)); } - -HWTEST_F(StagingBufferTest, givenIsValidForStagingBufferCopyWhenIsNotLocalMemoryAndOOQAndGpuBusyThenReturnFalse) { - DebugManagerStateRestore restore{}; - debugManager.flags.EnableCopyWithStagingBuffers.set(1); - - auto mockDevice = std::make_unique(MockDevice::createWithNewExecutionEnvironment(defaultHwInfo.get())); - auto mockContext = std::make_unique(mockDevice.get()); - MockCommandQueueHw myCmdQ(mockContext.get(), mockDevice.get(), 0); - - SVMAllocsManager::UnifiedMemoryProperties unifiedMemoryProperties(InternalMemoryType::deviceUnifiedMemory, 1, mockContext->getRootDeviceIndices(), mockContext->getDeviceBitfields()); - unifiedMemoryProperties.device = &mockDevice->getDevice(); - auto dstPtr = mockContext->getSVMAllocsManager()->createUnifiedMemoryAllocation(copySize, unifiedMemoryProperties); - auto ccsCsr = static_cast *>(&myCmdQ.getGpgpuCommandStreamReceiver()); - - *ccsCsr->tagAddress = 0u; - ccsCsr->taskCount = 0u; - EXPECT_TRUE(myCmdQ.isValidForStagingBufferCopy(mockDevice->getDevice(), dstPtr, srcPtr, 1024ul, false)); - - *ccsCsr->tagAddress = 0u; - ccsCsr->taskCount = 1u; - EXPECT_TRUE(myCmdQ.isValidForStagingBufferCopy(mockDevice->getDevice(), dstPtr, srcPtr, 1024ul, false)); - - myCmdQ.setOoqEnabled(); - EXPECT_FALSE(myCmdQ.isValidForStagingBufferCopy(mockDevice->getDevice(), dstPtr, srcPtr, 1024ul, false)); - mockContext->getSVMAllocsManager()->freeSVMAlloc(dstPtr); -} - -HWTEST_F(StagingBufferTest, givenIsValidForStagingBufferCopyWhenIsLocalMemoryAndOOQAndGpuBusyThenReturnTrue) { - DebugManagerStateRestore restore{}; - debugManager.flags.EnableCopyWithStagingBuffers.set(1); - debugManager.flags.EnableLocalMemory.set(1); - - auto mockDevice = std::make_unique(MockDevice::createWithNewExecutionEnvironment(defaultHwInfo.get())); - auto mockContext = std::make_unique(mockDevice.get()); - MockCommandQueueHw myCmdQ(mockContext.get(), mockDevice.get(), 0); - - SVMAllocsManager::UnifiedMemoryProperties unifiedMemoryProperties(InternalMemoryType::deviceUnifiedMemory, 1, mockContext->getRootDeviceIndices(), mockContext->getDeviceBitfields()); - unifiedMemoryProperties.device = &mockDevice->getDevice(); - auto dstPtr = mockContext->getSVMAllocsManager()->createUnifiedMemoryAllocation(copySize, unifiedMemoryProperties); - auto ccsCsr = static_cast *>(&myCmdQ.getGpgpuCommandStreamReceiver()); - - *ccsCsr->tagAddress = 0u; - ccsCsr->taskCount = 0u; - EXPECT_TRUE(myCmdQ.isValidForStagingBufferCopy(mockDevice->getDevice(), dstPtr, srcPtr, 1024ul, false)); - - *ccsCsr->tagAddress = 0u; - ccsCsr->taskCount = 1u; - myCmdQ.setOoqEnabled(); - EXPECT_TRUE(myCmdQ.isValidForStagingBufferCopy(mockDevice->getDevice(), dstPtr, srcPtr, 1024ul, false)); - mockContext->getSVMAllocsManager()->freeSVMAlloc(dstPtr); -}