Skip to content

Commit

Permalink
Revert "Add finish before command queue is released"
Browse files Browse the repository at this point in the history
This reverts commit 50fae92.

Signed-off-by: Compute-Runtime-Validation <compute-runtime-validation@intel.com>
  • Loading branch information
Compute-Runtime-Validation authored and Compute-Runtime-Automation committed Aug 5, 2022
1 parent 1f21d34 commit b38c750
Show file tree
Hide file tree
Showing 7 changed files with 2 additions and 32 deletions.
2 changes: 0 additions & 2 deletions opencl/source/command_queue/command_queue.h
Original file line number Diff line number Diff line change
Expand Up @@ -357,8 +357,6 @@ class CommandQueue : public BaseObject<_cl_command_queue> {

bool isTextureCacheFlushNeeded(uint32_t commandType) const;

void finishBeforeRelease();

protected:
void *enqueueReadMemObjForMap(TransferProperties &transferProperties, EventsRequest &eventsRequest, cl_int &errcodeRet);
cl_int enqueueWriteMemObjForUnmap(MemObj *memObj, void *mappedPtr, EventsRequest &eventsRequest);
Expand Down
4 changes: 0 additions & 4 deletions opencl/source/dll/command_queue_dll.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,4 @@ bool CommandQueue::isTimestampWaitEnabled() {
return true;
}

void CommandQueue::finishBeforeRelease() {
this->finish();
}

} // namespace NEO
1 change: 0 additions & 1 deletion opencl/source/helpers/queue_helpers.h
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,6 @@ inline void releaseQueue(cl_command_queue commandQueue, cl_int &retVal) {
if (queue) {
queue->flush();
releaseVirtualEvent(*queue);
queue->finishBeforeRelease();
queue->release();
retVal = CL_SUCCESS;
}
Expand Down
11 changes: 0 additions & 11 deletions opencl/test/unit_test/command_queue/command_queue_tests.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1531,17 +1531,6 @@ TEST(CommandQueueDestructorTest, whenCommandQueueIsDestroyedThenDestroysTimestam
EXPECT_EQ(1, context->getRefInternalCount()); // NOLINT(clang-analyzer-cplusplus.NewDelete)
}

TEST(CommandQueueDestructorTest, GivenCommandQueueWhenDeletedThenFinishIsCalled) {
auto context = std::make_unique<MockContext>();
EXPECT_EQ(1, context->getRefInternalCount());
auto queue = new MockCommandQueue(context.get(), context->getDevice(0), nullptr, false);
cl_int ret = 0;
bool finishCalled = false;
queue->finishCalled = &finishCalled;
releaseQueue(queue, ret);
EXPECT_TRUE(finishCalled); // NOLINT
}

TEST(CommandQueuePropertiesTests, whenGetEngineIsCalledThenQueueEngineIsReturned) {
MockCommandQueue queue;
EngineControl engineControl;
Expand Down
3 changes: 1 addition & 2 deletions opencl/test/unit_test/helpers/queue_helpers_tests.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,7 @@ using namespace NEO;

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

EXPECT_EQ(1, cmdQ->getRefInternalCount());
Expand Down
5 changes: 0 additions & 5 deletions opencl/test/unit_test/libult/command_queue_ult.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,4 @@ bool CommandQueue::isTimestampWaitEnabled() {
return ultHwConfig.useWaitForTimestamps;
}

void CommandQueue::finishBeforeRelease() {
*this->getHwTagAddress() = this->taskCount;
this->finish();
}

} // namespace NEO
8 changes: 1 addition & 7 deletions opencl/test/unit_test/mocks/mock_command_queue.h
Original file line number Diff line number Diff line change
Expand Up @@ -206,12 +206,7 @@ class MockCommandQueue : public CommandQueue {
cl_int enqueueResourceBarrier(BarrierCommand *resourceBarrier, cl_uint numEventsInWaitList, const cl_event *eventWaitList,
cl_event *event) override { return CL_SUCCESS; }

cl_int finish() override {
if (finishCalled) {
*finishCalled = true;
}
return CL_SUCCESS;
}
cl_int finish() override { return CL_SUCCESS; }

cl_int flush() override { return CL_SUCCESS; }

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

template <typename GfxFamily>
Expand Down

0 comments on commit b38c750

Please sign in to comment.