[llvm-branch-commits] [llvm] [libsycl] add single_task (PR #188797)
Sergey Semenov via llvm-branch-commits
llvm-branch-commits at lists.llvm.org
Fri Mar 27 09:40:43 PDT 2026
================
@@ -138,12 +161,85 @@ class _LIBSYCL_EXPORT queue {
template <typename Param>
typename Param::return_type get_backend_info() const;
+ /// Defines and invokes a SYCL kernel function as a lambda expression or a
+ /// named function object type.
+ ///
+ /// \param kernelFunc is the kernel functor or lambda.
+ /// \return an event that represents the status of the submitted kernel.
+ template <typename KernelName, typename KernelType>
+ event single_task(const KernelType &kernelFunc) {
+ return single_task<KernelName, KernelType>({}, kernelFunc);
+ }
+
+ /// Defines and invokes a SYCL kernel function as a lambda expression or a
+ /// named function object type.
+ ///
+ /// \param depEvent is an event that specifies the kernel dependency.
+ /// \param kernelFunc is the kernel functor or lambda.
+ /// \return an event that represents the status of the submitted kernel.
+ template <typename KernelName, typename KernelType>
+ event single_task(event depEvent, const KernelType &kernelFunc) {
+ return single_task<KernelName, KernelType>({depEvent}, kernelFunc);
+ }
+
+ /// Defines and invokes a SYCL kernel function as a lambda expression or a
+ /// named function object type.
+ ///
+ /// \param depEvents is a collection of events which specify the kernel
+ /// dependencies.
+ /// \param kernelFunc is the kernel functor or lambda.
+ /// \return an event that represents the status of the submitted kernel.
+ template <typename KernelName, typename KernelType>
+ event single_task(const std::vector<event> &depEvents,
+ const KernelType &kernelFunc) {
+ static_assert(
+ (detail::CheckFunctionSignature<std::remove_reference_t<KernelType>,
+ void()>::value),
+ "sycl::queue::single_task() requires a kernel instead of command "
+ "group. ");
----------------
sergey-semenov wrote:
```suggestion
"sycl::queue::single_task() requires a kernel instead of a command "
"group");
```
https://github.com/llvm/llvm-project/pull/188797
More information about the llvm-branch-commits
mailing list