Skip to content

Commit 3bf842d

Browse files
Introduced dpctl::utils::queues_are_compatible
Usage queues_are_compatible(exec_q, {alloc_q1, alloc_q2, ...}). Returns true if compatible, false otherwise.
1 parent fcc302a commit 3bf842d

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

dpctl/apis/include/dpctl4pybind11.hpp

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -547,6 +547,19 @@ sycl::event keep_args_alive(sycl::queue q,
547547
return host_task_ev;
548548
}
549549

550+
template <std::size_t num>
551+
bool queues_are_compatible(sycl::queue exec_q,
552+
const sycl::queue (&alloc_qs)[num])
553+
{
554+
for (std::size_t i = 0; i < num; ++i) {
555+
556+
if (exec_q != alloc_qs[i]) {
557+
return false;
558+
}
559+
}
560+
return true;
561+
}
562+
550563
} // end namespace utils
551564

552565
} // end namespace dpctl

0 commit comments

Comments
 (0)