[all-commits] [llvm/llvm-project] 9738ad: [libsycl] Add single_task (#192499)

Kseniya Tikhomirova via All-commits all-commits at lists.llvm.org
Mon Jun 1 04:00:14 PDT 2026


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 9738adaff8e2ea79917858a5e6349572e884c4cd
      https://github.com/llvm/llvm-project/commit/9738adaff8e2ea79917858a5e6349572e884c4cd
  Author: Kseniya Tikhomirova <kseniya.tikhomirova at intel.com>
  Date:   2026-06-01 (Mon, 01 Jun 2026)

  Changed paths:
    M libsycl/docs/index.rst
    A libsycl/include/sycl/__impl/detail/get_device_kernel_info.hpp
    A libsycl/include/sycl/__impl/detail/unified_range_view.hpp
    M libsycl/include/sycl/__impl/queue.hpp
    M libsycl/src/detail/global_objects.cpp
    M libsycl/src/detail/program_manager.cpp
    M libsycl/src/detail/program_manager.hpp
    M libsycl/src/detail/queue_impl.cpp
    M libsycl/src/detail/queue_impl.hpp
    M libsycl/src/queue.cpp
    A libsycl/test/basic/get_backend.cpp
    A libsycl/test/basic/submit_fn_ptr.cpp

  Log Message:
  -----------
  [libsycl] Add single_task (#192499)

Depends on liboffload PR:
https://github.com/llvm/llvm-project/pull/194333.

The approach with void sycl_kernel_launch(pack of arguments) implies
that
we can use or copy arguments only during that call. Since it pass only
kernel arguments as parameters and returns void - we have to split
setting
of extra kernel data like event dependencies and range and getting
result
event from arguments handling and direct kernel submision if it is
possible. Key stages: 1) passing to queue (or handler in future)
dependency
events and range (for parallel_for), saving them in queue (copy/move).
2)
wrapping kernel arguments into typeless wrappers (pointer based,
initially
no copy) and passing to the queue. Then depending on scenario (without
host
tasks and accessors we should be able to submit everything directly)
collection of arguments is converted to preferred liboffload structure
(no
copy of objects, copy of pointers) and passed to liboffload or RT does
deep
copy of provided arguments (simple copy of pointer of USM and copy of
value
for other arguments) to keep them alive till kernel enqueue outside
parent
submit call. 3) getting event associated with kernel enqueue. Key notes:
1)
Having these 3 separated calls is not the best solution but the only one
allowing to avoid copy for some scenarios (otherwise we have to do deep
copy always and then do joined kernel submission outside
sycl_kernel_launch
scope). 2) submit must be thread-safe. Since we have 3 calls we need to
keep kernel params and resulting event in a per queue + per thread/per
kernel way. To achieve this without copy and joined kernel submission
queue
(in future - handler) stores thread_local data for kernel submission.
thread_local can't be used for non-static class members so they are
static.
Given: same queue can be used from different threads but thread can't
use
different queues at the same moment; that means that we actually need
per
thread storage.

This is part of the SYCL support upstreaming effort. The relevant RFCs
can be found here:


https://discourse.llvm.org/t/rfc-add-full-support-for-the-sycl-programming-model/74080
https://discourse.llvm.org/t/rfc-sycl-runtime-upstreaming/74479

---------

Signed-off-by: Tikhomirova, Kseniya <kseniya.tikhomirova at intel.com>



To unsubscribe from these emails, change your notification settings at https://github.com/llvm/llvm-project/settings/notifications


More information about the All-commits mailing list