Revert "performance: enable staging read for cl buffers"

This reverts commit 3d6c6b4a91.

Signed-off-by: Compute-Runtime-Validation <compute-runtime-validation@intel.com>
This commit is contained in:
Compute-Runtime-Validation
2025-03-19 00:11:41 +01:00
committed by Compute-Runtime-Automation
parent 0c8d2e616e
commit 4292f7e5e6
3 changed files with 10 additions and 51 deletions

View File

@@ -2390,27 +2390,16 @@ cl_int CL_API_CALL clEnqueueReadBuffer(cl_command_queue commandQueue,
return retVal;
}
if (pCommandQueue->isValidForStagingTransfer(pBuffer, ptr, cb, CL_COMMAND_READ_BUFFER, blockingRead, numEventsInWaitList > 0)) {
retVal = pCommandQueue->enqueueStagingBufferTransfer(
CL_COMMAND_READ_BUFFER,
pBuffer,
blockingRead,
offset,
cb,
ptr,
event);
} else {
retVal = pCommandQueue->enqueueReadBuffer(
pBuffer,
blockingRead,
offset,
cb,
ptr,
nullptr,
numEventsInWaitList,
eventWaitList,
event);
}
retVal = pCommandQueue->enqueueReadBuffer(
pBuffer,
blockingRead,
offset,
cb,
ptr,
nullptr,
numEventsInWaitList,
eventWaitList,
event);
}
DBG_LOG_INPUTS("event", getClFileLogger().getEvents(reinterpret_cast<const uintptr_t *>(event), 1u));

View File

@@ -40,34 +40,6 @@ TEST_F(ClEnqueueReadBufferTests, GivenCorrectArgumentsWhenReadingBufferThenSucce
EXPECT_EQ(CL_SUCCESS, retVal);
}
TEST_F(ClEnqueueReadBufferTests, GivenNonUsmMemoryWhenReadingBufferThenNonUsmPointerIsNotImported) {
DebugManagerStateRestore restorer{};
// 1KB staging buffer size
debugManager.flags.StagingBufferSize.set(1);
debugManager.flags.EnableCopyWithStagingBuffers.set(1);
MockContext context{};
MockGraphicsAllocation allocation{};
MockBuffer buffer{&context, allocation};
MockCommandQueue commandQueue{context};
char data[2048];
auto retVal = clEnqueueReadBuffer(
&commandQueue,
&buffer,
false,
0,
sizeof(data),
data,
0,
nullptr,
nullptr);
EXPECT_EQ(CL_SUCCESS, retVal);
// 2 * 1KB copies
EXPECT_EQ(2u, commandQueue.enqueueReadBufferImplCalledCount);
}
TEST_F(ClEnqueueReadBufferTests, GivenQueueIncapableArgumentsWhenReadingBufferThenInvalidOperationIsReturned) {
MockBuffer buffer{};
auto data = 1;

View File

@@ -193,7 +193,6 @@ class MockCommandQueue : public CommandQueue {
cl_int enqueueReadBufferImpl(Buffer *buffer, cl_bool blockingRead, size_t offset, size_t cb,
void *ptr, GraphicsAllocation *mapAllocation, cl_uint numEventsInWaitList,
const cl_event *eventWaitList, cl_event *event, CommandStreamReceiver &csr) override {
enqueueReadBufferImplCalledCount++;
return CL_SUCCESS;
}
@@ -283,7 +282,6 @@ class MockCommandQueue : public CommandQueue {
std::atomic<TaskCountType> latestTaskCountWaited{std::numeric_limits<TaskCountType>::max()};
std::optional<WaitStatus> waitUntilCompleteReturnValue{};
int waitUntilCompleteCalledCount{0};
size_t enqueueReadBufferImplCalledCount = 0;
};
template <typename GfxFamily>