16 Commits

Author SHA1 Message Date
Kseniya Tikhomirova
c4b0f9959a
[libsycl] Add device image registration & compatibility check (#187528)
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@intel.com>
2026-04-02 13:06:44 +02:00
Michael Kruse
afb80bddf1
[Runtimes] Introduce variables containing resource dir paths (#177953)
Introduce common infrastructure for runtimes that determines compiler
resource path locations. These variables introduced are:

 * RUNTIMES_OUTPUT_RESOURCE_DIR
 * RUNTIMES_INSTALL_RESOURCE_PATH
 
That contain the location for the compiler resource path (typically
`lib/clang/<version>`) in the build tree and the install tree (the
latter relative to CMAKE_INSTALL_PREFIX).

Additionally, define

 * RUNTIMES_OUTPUT_RESOURCE_LIB_DIR
 * RUNTIMES_INSTALL_RESOURCE_LIB_PATH

as for the location of clang/flang version-locked libraries (typically
`lib${LLVM_LIBDIR_SUFFIX}/<targer-triple>`, but also depends on `APPLE`
and `LLVM_ENABLE_PER_TARGET_RUNTIME_DIR`). This code is moved from
flang-rt and initially becomes its only user.

Refactored out of #171610 as requested
[here](https://github.com/llvm/llvm-project/pull/171610#discussion_r2687382481).

Extracted `get_runtimes_target_libdir_common` from compiler-rt as
requested
[here](https://github.com/llvm/llvm-project/pull/171610#discussion_r2689565634).
 
Added TODO comments to all runtimes as requested
[here](https://github.com/llvm/llvm-project/pull/171610#issuecomment-3789598635).
2026-04-02 10:32:14 +00:00
Kseniya Tikhomirova
2bb6b59028
[libsycl] add USM alloc/free functions (#184111)
Depends on https://github.com/llvm/llvm-project/pull/184110

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@intel.com>
2026-03-19 10:35:56 +01:00
Kseniya Tikhomirova
a40e83b29c
[libsycl] Add sycl::queue stub (#184110)
Part 2 of changes needed for USM alloc/dealloc impl.

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@intel.com>
2026-03-04 16:54:56 +01:00
Kseniya Tikhomirova
bad56dbb23
[libsycl] Add sycl::context stub (#182826)
Part 1 of changes needed for USM alloc/dealloc impl.


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@intel.com>
2026-02-27 18:43:34 +01:00
Nick Sarnie
251e9c429b
[libsycl] Fix build after global dtor change (#183077)
Fixes build after https://github.com/llvm/llvm-project/pull/181366

---------

Signed-off-by: Nick Sarnie <nick.sarnie@intel.com>
2026-02-24 15:44:07 +00:00
Kseniya Tikhomirova
3e2fb2e7cb
[libsycl] Fix for static vars deinit order (libsycl vs liboffload) (#181366)
both libsycl & liboffload uses static variables. 
on Linux static variable destructor is called earlier than the method
with `__attribute__((destructor(...)))`.
this fix helps to avoid crash due to liboffload static variable early
destruction.

the approach utilizes the following rule
"For each local object obj with static storage duration, obj is
destroyed as if a function calling the destructor of obj were registered
with
[std::atexit](https://en.cppreference.com/w/cpp/utility/program/atexit.html)
at the completion of the constructor of obj."
from `std::exit`.
in the first call of get_platforms we call liboffload's iterateDevices
that leads to liboffload static storage initialization. Then we
initialize our own local static var after this to be able to call our
shutdown methods earlier and before the liboffload objects are
destructed at the end of program.

Important note:
SYCL RT follows SYCL 2020 specification that doesn't declare any
init/shutdown methods that can help to avoid usage of static variables.

---------

Signed-off-by: Tikhomirova, Kseniya <kseniya.tikhomirova@intel.com>
2026-02-24 15:20:07 +00:00
Nick Sarnie
142aa7b9b0
[libsycl] Fix build after olInit change (#182057)
After https://github.com/llvm/llvm-project/pull/181872 the function
takes an argument. Pass `nullptr` to have it do the same thing as
before.

This wasn't caught because the only builder that builds `libsycl` is not
in the production builder area at the moment.

Signed-off-by: Nick Sarnie <nick.sarnie@intel.com>
2026-02-18 16:37:39 +00:00
Kseniya Tikhomirova
94298f3411
[libsycl] Add lit configuration files and basic test (#177407)
This PR brings initial version of lit configs for libsycl tests.
We plan to add more tests for libsycl integration with the compiler in
the future.

---------

Signed-off-by: Tikhomirova, Kseniya <kseniya.tikhomirova@intel.com>
2026-02-11 20:19:33 +01:00
Kseniya Tikhomirova
debff92649
[SYCL] Add sycl::device initial implementation (#176972)
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

Plan for next PR:

E2E lit configs & test for get_platforms & get_devices impl
context & USM free functions impl

---------

Signed-off-by: Tikhomirova, Kseniya <kseniya.tikhomirova@intel.com>
2026-02-06 06:48:09 -08:00
Alexey Bader
284d6d6c49
[libsycl][NFC] Assign lead maintainers for the project (#176769)
To align with https://llvm.org/docs/DeveloperPolicy.html#maintainers
libsycl project must explicitly list lead maintainers.
2026-01-23 08:42:14 -08:00
Kseniya Tikhomirova
4f7c733293
[SYCL] Add platform enumeration and info query using liboffload (#166927)
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

The SYCL runtime is device-agnostic and uses liboffload for offloading
to GPU. This commit adds a dependency on liboffload, implementation of
platform::get_platforms, platform::get_backend and platform::get_info
methods, initial implementation of sycl-ls tool for manual testing of
added functionality.

Plan for next PR:

device/context impl, rest of platform
test infrastructure (depends on L0 liboffload plugin CI, our effort is
joined) ABI tests

---------

Signed-off-by: Tikhomirova, Kseniya <kseniya.tikhomirova@intel.com>
2026-01-20 07:41:51 -08:00
Kseniya Tikhomirova
4a4befec69
[SYCL] Add CodingGuidelines.rst for libsycl (#171867)
Signed-off-by: Tikhomirova, Kseniya <kseniya.tikhomirova@intel.com>
2026-01-15 01:39:45 -08:00
Tom Honermann
93e18db3e4
[libsycl] fix license link in README.md. 2025-12-01 16:34:37 -05:00
Kseniya Tikhomirova
f31e1cf012
[libsycl] Add Maintainers.md file (#168550)
Signed-off-by: Tikhomirova, Kseniya <kseniya.tikhomirova@intel.com>
2025-11-24 08:34:01 -08:00
Kseniya Tikhomirova
4cec4938c6
[SYCL] Add libsycl, a SYCL RT library implementation project (#144372)
This patch introduces libsycl, a SYCL runtime library implementation, as
a top-level LLVM runtime project.
SYCL spec:
https://registry.khronos.org/SYCL/specs/sycl-2020/html/sycl-2020.html

Commit contains the basic folder layout and CMake infrastructure to
build a dummy SYCL library.

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

Upcoming PRs:
- UR offloading library fetch & build 
- partial implementation of sycl::platform: requires offloading layer,
requires classes for backend loading & enumeration.

---------

Signed-off-by: Tikhomirova, Kseniya <kseniya.tikhomirova@intel.com>
Co-authored-by: Alexey Bader <alexey.bader@intel.com>
2025-07-31 11:28:39 -07:00