Skip to content

Commit 1ccb99e

Browse files
[SYCL][NFC] Simplify offset queue shortcut overloading (#6442)
1 parent 92471f8 commit 1ccb99e

File tree

1 file changed

+4
-32
lines changed

1 file changed

+4
-32
lines changed

sycl/include/sycl/queue.hpp

Lines changed: 4 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -872,40 +872,12 @@ class __SYCL_EXPORT queue {
872872
/// \param WorkItemOffset specifies the offset for each work item id
873873
/// \param KernelFunc is the Kernel functor or lambda
874874
/// \param CodeLoc contains the code location of user code
875-
template <typename KernelName = detail::auto_name, typename KernelType>
876-
event parallel_for(range<1> Range, id<1> WorkItemOffset,
877-
const std::vector<event> &DepEvents,
878-
_KERNELFUNCPARAM(KernelFunc)) {
879-
return parallel_for_impl<KernelName>(Range, WorkItemOffset, DepEvents,
880-
KernelFunc);
881-
}
882-
883-
/// parallel_for version with a kernel represented as a lambda + range and
884-
/// offset that specify global size and global offset correspondingly.
885-
///
886-
/// \param Range specifies the global work space of the kernel
887-
/// \param WorkItemOffset specifies the offset for each work item id
888-
/// \param KernelFunc is the Kernel functor or lambda
889-
/// \param CodeLoc contains the code location of user code
890-
template <typename KernelName = detail::auto_name, typename KernelType>
891-
event parallel_for(range<2> Range, id<2> WorkItemOffset,
892-
const std::vector<event> &DepEvents,
893-
_KERNELFUNCPARAM(KernelFunc)) {
894-
return parallel_for_impl<KernelName>(Range, WorkItemOffset, DepEvents,
895-
KernelFunc);
896-
}
897-
898-
/// parallel_for version with a kernel represented as a lambda + range and
899-
/// offset that specify global size and global offset correspondingly.
900-
///
901-
/// \param Range specifies the global work space of the kernel
902-
/// \param WorkItemOffset specifies the offset for each work item id
903-
/// \param KernelFunc is the Kernel functor or lambda
904-
/// \param CodeLoc contains the code location of user code
905-
template <typename KernelName = detail::auto_name, typename KernelType>
906-
event parallel_for(range<3> Range, id<3> WorkItemOffset,
875+
template <typename KernelName = detail::auto_name, typename KernelType,
876+
int Dim>
877+
event parallel_for(range<Dim> Range, id<Dim> WorkItemOffset,
907878
const std::vector<event> &DepEvents,
908879
_KERNELFUNCPARAM(KernelFunc)) {
880+
static_assert(1 <= Dim && Dim <= 3, "Invalid number of dimensions");
909881
return parallel_for_impl<KernelName>(Range, WorkItemOffset, DepEvents,
910882
KernelFunc);
911883
}

0 commit comments

Comments
 (0)