Skip to content

Commit b38c750

Browse files
Revert "Add finish before command queue is released"
This reverts commit 50fae92. Signed-off-by: Compute-Runtime-Validation <compute-runtime-validation@intel.com>
1 parent 1f21d34 commit b38c750

File tree

7 files changed

+2
-32
lines changed

7 files changed

+2
-32
lines changed

opencl/source/command_queue/command_queue.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -357,8 +357,6 @@ class CommandQueue : public BaseObject<_cl_command_queue> {
357357

358358
bool isTextureCacheFlushNeeded(uint32_t commandType) const;
359359

360-
void finishBeforeRelease();
361-
362360
protected:
363361
void *enqueueReadMemObjForMap(TransferProperties &transferProperties, EventsRequest &eventsRequest, cl_int &errcodeRet);
364362
cl_int enqueueWriteMemObjForUnmap(MemObj *memObj, void *mappedPtr, EventsRequest &eventsRequest);

opencl/source/dll/command_queue_dll.cpp

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,4 @@ bool CommandQueue::isTimestampWaitEnabled() {
1717
return true;
1818
}
1919

20-
void CommandQueue::finishBeforeRelease() {
21-
this->finish();
22-
}
23-
2420
} // namespace NEO

opencl/source/helpers/queue_helpers.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,6 @@ inline void releaseQueue(cl_command_queue commandQueue, cl_int &retVal) {
4848
if (queue) {
4949
queue->flush();
5050
releaseVirtualEvent(*queue);
51-
queue->finishBeforeRelease();
5251
queue->release();
5352
retVal = CL_SUCCESS;
5453
}

opencl/test/unit_test/command_queue/command_queue_tests.cpp

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1531,17 +1531,6 @@ TEST(CommandQueueDestructorTest, whenCommandQueueIsDestroyedThenDestroysTimestam
15311531
EXPECT_EQ(1, context->getRefInternalCount()); // NOLINT(clang-analyzer-cplusplus.NewDelete)
15321532
}
15331533

1534-
TEST(CommandQueueDestructorTest, GivenCommandQueueWhenDeletedThenFinishIsCalled) {
1535-
auto context = std::make_unique<MockContext>();
1536-
EXPECT_EQ(1, context->getRefInternalCount());
1537-
auto queue = new MockCommandQueue(context.get(), context->getDevice(0), nullptr, false);
1538-
cl_int ret = 0;
1539-
bool finishCalled = false;
1540-
queue->finishCalled = &finishCalled;
1541-
releaseQueue(queue, ret);
1542-
EXPECT_TRUE(finishCalled); // NOLINT
1543-
}
1544-
15451534
TEST(CommandQueuePropertiesTests, whenGetEngineIsCalledThenQueueEngineIsReturned) {
15461535
MockCommandQueue queue;
15471536
EngineControl engineControl;

opencl/test/unit_test/helpers/queue_helpers_tests.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,7 @@ using namespace NEO;
1616

1717
TEST(QueueHelpersTest, givenCommandQueueWithoutVirtualEventWhenReleaseQueueIsCalledThenCmdQInternalRefCountIsNotDecremented) {
1818
cl_int retVal = CL_SUCCESS;
19-
MockContext context;
20-
MockCommandQueue *cmdQ = new MockCommandQueue(&context, context.getDevice(0), 0, false);
19+
MockCommandQueue *cmdQ = new MockCommandQueue;
2120
EXPECT_EQ(1, cmdQ->getRefInternalCount());
2221

2322
EXPECT_EQ(1, cmdQ->getRefInternalCount());

opencl/test/unit_test/libult/command_queue_ult.cpp

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,4 @@ bool CommandQueue::isTimestampWaitEnabled() {
1919
return ultHwConfig.useWaitForTimestamps;
2020
}
2121

22-
void CommandQueue::finishBeforeRelease() {
23-
*this->getHwTagAddress() = this->taskCount;
24-
this->finish();
25-
}
26-
2722
} // namespace NEO

opencl/test/unit_test/mocks/mock_command_queue.h

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -206,12 +206,7 @@ class MockCommandQueue : public CommandQueue {
206206
cl_int enqueueResourceBarrier(BarrierCommand *resourceBarrier, cl_uint numEventsInWaitList, const cl_event *eventWaitList,
207207
cl_event *event) override { return CL_SUCCESS; }
208208

209-
cl_int finish() override {
210-
if (finishCalled) {
211-
*finishCalled = true;
212-
}
213-
return CL_SUCCESS;
214-
}
209+
cl_int finish() override { return CL_SUCCESS; }
215210

216211
cl_int flush() override { return CL_SUCCESS; }
217212

@@ -232,7 +227,6 @@ class MockCommandQueue : public CommandQueue {
232227
std::atomic<uint32_t> latestTaskCountWaited{std::numeric_limits<uint32_t>::max()};
233228
std::optional<WaitStatus> waitUntilCompleteReturnValue{};
234229
int waitUntilCompleteCalledCount{0};
235-
bool *finishCalled = nullptr;
236230
};
237231

238232
template <typename GfxFamily>

0 commit comments

Comments
 (0)