Skip to content

Commit

Permalink
[SYCL] Fix unused variable warnings (intel#12523)
Browse files Browse the repository at this point in the history
Fixes warnings introduced in intel#11758
  • Loading branch information
sergey-semenov authored Jan 29, 2024
1 parent 9a7e091 commit 2f56926
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 18 deletions.
7 changes: 3 additions & 4 deletions sycl/source/detail/queue_impl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -321,10 +321,9 @@ areEventsSafeForSchedulerBypass(const std::vector<sycl::event> &DepEvents,
return SyclEventImplPtr->getHandleRef() != nullptr;
};

return std::all_of(DepEvents.begin(), DepEvents.end(),
[&Context, &CheckEvent](const sycl::event &Event) {
return CheckEvent(Event);
});
return std::all_of(
DepEvents.begin(), DepEvents.end(),
[&CheckEvent](const sycl::event &Event) { return CheckEvent(Event); });
}

template <typename HandlerFuncT>
Expand Down
7 changes: 3 additions & 4 deletions sycl/source/detail/queue_impl.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -744,8 +744,7 @@ class queue_impl {

// template is needed for proper unit testing
template <typename HandlerType = handler>
void finalizeHandler(HandlerType &Handler, const CG::CGTYPE &Type,
event &EventRet) {
void finalizeHandler(HandlerType &Handler, event &EventRet) {
if (MIsInorder) {
// Accessing and changing of an event isn't atomic operation.
// Hence, here is the lock for thread-safety.
Expand Down Expand Up @@ -831,11 +830,11 @@ class queue_impl {
!(Handler.MKernel && Handler.MKernel->isInterop()) &&
ProgramManager::getInstance().kernelUsesAssert(Handler.MKernelName);

finalizeHandler(Handler, Type, Event);
finalizeHandler(Handler, Event);

(*PostProcess)(IsKernel, KernelUsesAssert, Event);
} else
finalizeHandler(Handler, Type, Event);
finalizeHandler(Handler, Event);

addEvent(Event);
return Event;
Expand Down
15 changes: 5 additions & 10 deletions sycl/unittests/scheduler/InOrderQueueSyncCheck.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -72,35 +72,30 @@ TEST_F(SchedulerTest, InOrderQueueSyncCheck) {
{
LimitedHandlerSimulation MockCGH;
EXPECT_CALL(MockCGH, depends_on).Times(0);
Queue->finalizeHandler<LimitedHandlerSimulation>(
MockCGH, detail::CG::CGTYPE::CodeplayHostTask, Event);
Queue->finalizeHandler<LimitedHandlerSimulation>(MockCGH, Event);
}
// host task
{
LimitedHandlerSimulation MockCGH;
EXPECT_CALL(MockCGH, depends_on).Times(1);
Queue->finalizeHandler<LimitedHandlerSimulation>(
MockCGH, detail::CG::CGTYPE::CodeplayHostTask, Event);
Queue->finalizeHandler<LimitedHandlerSimulation>(MockCGH, Event);
}
// kernel task
{
LimitedHandlerSimulation MockCGH;
EXPECT_CALL(MockCGH, depends_on).Times(1);
Queue->finalizeHandler<LimitedHandlerSimulation>(
MockCGH, detail::CG::CGTYPE::Kernel, Event);
Queue->finalizeHandler<LimitedHandlerSimulation>(MockCGH, Event);
}
// kernel task
{
LimitedHandlerSimulation MockCGH;
EXPECT_CALL(MockCGH, depends_on).Times(1);
Queue->finalizeHandler<LimitedHandlerSimulation>(
MockCGH, detail::CG::CGTYPE::Kernel, Event);
Queue->finalizeHandler<LimitedHandlerSimulation>(MockCGH, Event);
}
// host task
{
LimitedHandlerSimulation MockCGH;
EXPECT_CALL(MockCGH, depends_on).Times(1);
Queue->finalizeHandler<LimitedHandlerSimulation>(
MockCGH, detail::CG::CGTYPE::CodeplayHostTask, Event);
Queue->finalizeHandler<LimitedHandlerSimulation>(MockCGH, Event);
}
}

0 comments on commit 2f56926

Please sign in to comment.