mirror of
https://github.com/intel/compute-runtime.git
synced 2025-12-25 13:33:02 +08:00
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:
committed by
Compute-Runtime-Automation
parent
0c8d2e616e
commit
4292f7e5e6
@@ -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));
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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>
|
||||
|
||||
Reference in New Issue
Block a user