Skip to content

[SYCL][NFC] Remove unnecessary enable_if #7879

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Dec 28, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 7 additions & 12 deletions sycl/source/detail/scheduler/graph_builder.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -538,8 +538,8 @@ Scheduler::GraphBuilder::addHostAccessor(Requirement *Req,

// Need empty command to be blocked until host accessor is destructed
EmptyCommand *EmptyCmd =
addEmptyCmd<Requirement>(UpdateHostAccCmd, {Req}, HostQueue,
Command::BlockReason::HostAccessor, ToEnqueue);
addEmptyCmd(UpdateHostAccCmd, {Req}, HostQueue,
Command::BlockReason::HostAccessor, ToEnqueue);

Req->MBlockedCmd = EmptyCmd;

Expand Down Expand Up @@ -851,15 +851,10 @@ void Scheduler::GraphBuilder::markModifiedIfWrite(MemObjRecord *Record,
}
}

template <typename T>
typename detail::enable_if_t<
std::is_same<typename std::remove_cv_t<T>, Requirement>::value,
EmptyCommand *>
Scheduler::GraphBuilder::addEmptyCmd(Command *Cmd, const std::vector<T *> &Reqs,
const QueueImplPtr &Queue,
Command::BlockReason Reason,
std::vector<Command *> &ToEnqueue,
const bool AddDepsToLeaves) {
EmptyCommand *Scheduler::GraphBuilder::addEmptyCmd(
Command *Cmd, const std::vector<Requirement *> &Reqs,
const QueueImplPtr &Queue, Command::BlockReason Reason,
std::vector<Command *> &ToEnqueue, const bool AddDepsToLeaves) {
EmptyCommand *EmptyCmd =
new EmptyCommand(Scheduler::getInstance().getDefaultHostQueue());

Expand All @@ -870,7 +865,7 @@ Scheduler::GraphBuilder::addEmptyCmd(Command *Cmd, const std::vector<T *> &Reqs,
EmptyCmd->MEnqueueStatus = EnqueueResultT::SyclEnqueueBlocked;
EmptyCmd->MBlockReason = Reason;

for (T *Req : Reqs) {
for (Requirement *Req : Reqs) {
MemObjRecord *Record = getOrInsertMemObjRecord(Queue, Req, ToEnqueue);
AllocaCommandBase *AllocaCmd =
getOrCreateAllocaForReq(Record, Req, Queue, ToEnqueue);
Expand Down
14 changes: 6 additions & 8 deletions sycl/source/detail/scheduler/scheduler.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -653,14 +653,12 @@ class Scheduler {
const Requirement *Req,
const ContextImplPtr &Context);

template <typename T>
typename detail::enable_if_t<
std::is_same<typename std::remove_cv_t<T>, Requirement>::value,
EmptyCommand *>
addEmptyCmd(Command *Cmd, const std::vector<T *> &Req,
const QueueImplPtr &Queue, Command::BlockReason Reason,
std::vector<Command *> &ToEnqueue,
const bool AddDepsToLeaves = true);
EmptyCommand *addEmptyCmd(Command *Cmd,
const std::vector<Requirement *> &Req,
const QueueImplPtr &Queue,
Command::BlockReason Reason,
std::vector<Command *> &ToEnqueue,
const bool AddDepsToLeaves = true);

void createGraphForCommand(Command *NewCmd, CG &CG, bool isInteropTask,
std::vector<Requirement *> &Reqs,
Expand Down