<li><ahref="#SingleTaskSYCLSingleTask">Run a Task with a Single Thread</a></li>
</ul>
</nav>
<p><ahref="classtf_1_1syclFlow.html" class="m-doc">tf::<wbr/>syclFlow</a> provides a template method, <ahref="classtf_1_1syclFlow.html#a05ff6f331b6cf48e21ae7f0d6aea9094" class="m-doc">tf::<wbr/>syclFlow::<wbr/>single_task</a>, for creating a task to run the given callable using a single kernel thread.</p><sectionid="SingleTaskSYCLSingleTask"><h2><ahref="#SingleTaskSYCLSingleTask">Run a Task with a Single Thread</a></h2><p>You can create a task to run a kernel function just once, i.e., using one GPU thread. This is handy when you want to set up a single or a few global variables that do not need multiple threads and will be used by multiple kernels afterwards. The following example creates a single-task kernel that sets <code>gpu_variable</code> to 1.</p><preclass="m-code"><spanclass="n">sycl</span><spanclass="o">::</span><spanclass="n">queue</span><spanclass="w"></span><spanclass="n">queue</span><spanclass="p">;</span><spanclass="w"></span>