Skip to content

Conversation

@KseniyaTikhomirova
Copy link
Contributor

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

@KseniyaTikhomirova
Copy link
Contributor Author

@tahonermann, @dvrogozh, @asudarsa, @aelovikov-intel, @sergey-semenov, @bader, @againull, @YuriPlyakhin, @vinser52

FYI, published for review.

@tahonermann tahonermann self-requested a review November 17, 2025 18:07
aelovikov-intel added a commit to aelovikov-intel/llvm-project that referenced this pull request Nov 18, 2025
Various offload APIs `olGet*Info` are essentially untyped because they
"return" value via `void *PropValue` output parameter. However, for C++
consumers (e.g., [SYCL][1] in llvm#166927) it would be beneficial if we could recover
that type information. Before this PR it was only encoded in the
comments near corresponding information info descriptors, e.g.,

```c++
///////////////////////////////////////////////////////////////////////////////
/// @brief Supported event info.
typedef enum ol_event_info_t {
  /// [ol_queue_handle_t] The handle of the queue associated with the device.
  OL_EVENT_INFO_QUEUE = 0,
  /// [bool] True if and only if the event is complete.
  OL_EVENT_INFO_IS_COMPLETE = 1,
  /// @cond
  OL_EVENT_INFO_LAST = 2,
  OL_EVENT_INFO_FORCE_UINT32 = 0x7fffffff
  /// @endcond

} ol_event_info_t;
```

so was imposible for consumers to recover programmatically.

[1] https://github.com/llvm/llvm-project/blob/b22192afdcbda7441e7a8fe7cbc9a06903e9e6ea/libsycl/src/detail/platform_impl.hpp#L78-L90
aelovikov-intel added a commit to aelovikov-intel/llvm-project that referenced this pull request Nov 18, 2025
Various offload APIs `olGet*Info` are essentially untyped because they
"return" value via `void *PropValue` output parameter. However, for C++
consumers (e.g., [SYCL][1] in llvm#166927) it would be beneficial if we could recover
that type information. Before this PR it was only encoded in the
comments near corresponding information info descriptors, e.g.,

```c++
///////////////////////////////////////////////////////////////////////////////
/// @brief Supported event info.
typedef enum ol_event_info_t {
  /// [ol_queue_handle_t] The handle of the queue associated with the device.
  OL_EVENT_INFO_QUEUE = 0,
  /// [bool] True if and only if the event is complete.
  OL_EVENT_INFO_IS_COMPLETE = 1,
  /// @cond
  OL_EVENT_INFO_LAST = 2,
  OL_EVENT_INFO_FORCE_UINT32 = 0x7fffffff
  /// @endcond

} ol_event_info_t;
```

so was imposible for consumers to recover programmatically.

[1] https://github.com/llvm/llvm-project/blob/b22192afdcbda7441e7a8fe7cbc9a06903e9e6ea/libsycl/src/detail/platform_impl.hpp#L78-L90
aelovikov-intel added a commit to aelovikov-intel/llvm-project that referenced this pull request Nov 18, 2025
Various offload APIs `olGet*Info` are essentially untyped because they
"return" value via `void *PropValue` output parameter. However, for C++
consumers (e.g., SYCL in llvm#166927) it would be beneficial if we could recover
that type information. Before this PR it was only encoded in the
comments near corresponding information info descriptors, e.g.,

```c++
///////////////////////////////////////////////////////////////////////////////
/// @brief Supported event info.
typedef enum ol_event_info_t {
  /// [ol_queue_handle_t] The handle of the queue associated with the device.
  OL_EVENT_INFO_QUEUE = 0,
  /// [bool] True if and only if the event is complete.
  OL_EVENT_INFO_IS_COMPLETE = 1,
  /// @cond
  OL_EVENT_INFO_LAST = 2,
  OL_EVENT_INFO_FORCE_UINT32 = 0x7fffffff
  /// @endcond

} ol_event_info_t;
```

and not accessible programmatically.
@KseniyaTikhomirova
Copy link
Contributor Author

KseniyaTikhomirova commented Dec 8, 2025

I'd like to define naming style for the upstreaming code base.

Given:
General LLVM rule says:

In general, names should be in camel case (e.g. TextFileReader and isLValue())

and

As an exception, classes that mimic STL classes can have member names in STL’s style of lowercase words separated by underscores (e.g. begin(), push_back(), and empty()).

SYCL 2020 declare types in STL's style with snake case.

LLVM guide has no requirements about file names so I suggest:

  1. all file names under libsycl folder (.h, .cpp, .md, etc) will be in snake_case (no exceptions)
  2. SYCL API type names - follow SYCL2020 spec naming - snake_case
  3. all detail (excluding STL-like types) types to use CamelCase.

changes comparing to impl/llvm:
all API and impl related files are already in snake case but docs and tests use mixed style.
I suggest to use snake_case for all files in repo.

docs example:
https://github.com/intel/llvm/blob/sycl/sycl/doc/design/CompileTimeProperties.md
mixed style examples (see folder names as well)
https://github.com/intel/llvm/blob/sycl/sycl/test-e2e/AddressCast/dynamic_address_cast.cpp
https://github.com/intel/llvm/blob/sycl/sycl/unittests/accessor/AccessorImplicitConversion.cpp
https://github.com/intel/llvm/blob/sycl/sycl/test/e2e_test_requirements/check_e2eexpr_logic.cpp

Apply CamelCase to our impl and service classes in snake_case, for example platform_impl should become PlatformImpl and so on:
example, see forward decl: https://github.com/intel/llvm/blob/sycl/sycl/source/detail/program_manager/program_manager.hpp#L76

@bader @tahonermann could you please provide your opinion:

  1. should we even align style or it is good to go with what we have in intel/llvm
  2. agree or not with proposed strategy

@bader
Copy link
Contributor

bader commented Dec 8, 2025

I'd like to define naming style for the upstreaming code base.

LLVM guide has no requirements about file names so I suggest:

  1. all file names under libsycl folder (.h, .cpp, .md, etc) will be in snake_case (no exceptions)
  2. SYCL API type names - follow SYCL2020 spec naming - snake_case
  3. all detail (excluding STL-like types) types to use CamelCase.

@KseniyaTikhomirova, please, create a libsycl/docs/CodingGuidelines.rst file and put your suggestion there. Let's separate this discussion from adding SYCL platform.

changes comparing to impl/llvm:

What is impl/llvm? Do you mean intel/llvm repository?

Copy link
Contributor

@tahonermann tahonermann left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I got part of the way through the PR today. I'll review more tomorrow.

@Fznamznon Fznamznon added the SYCL https://registry.khronos.org/SYCL label Dec 11, 2025
@KseniyaTikhomirova
Copy link
Contributor Author

I'd like to define naming style for the upstreaming code base.
LLVM guide has no requirements about file names so I suggest:

  1. all file names under libsycl folder (.h, .cpp, .md, etc) will be in snake_case (no exceptions)
  2. SYCL API type names - follow SYCL2020 spec naming - snake_case
  3. all detail (excluding STL-like types) types to use CamelCase.

@KseniyaTikhomirova, please, create a libsycl/docs/CodingGuidelines.rst file and put your suggestion there. Let's separate this discussion from adding SYCL platform.

changes comparing to impl/llvm:

What is impl/llvm? Do you mean intel/llvm repository?

thanks for suggestion, done #171867
@bader @tahonermann @AlexeySachkov @sergey-semenov @vinser52 it would be nice to get your opinion. I am not able to add you as reviewers to llvm-project PRs so inviting directly. Thanks.

Signed-off-by: Tikhomirova, Kseniya <[email protected]>
Signed-off-by: Tikhomirova, Kseniya <[email protected]>
Signed-off-by: Tikhomirova, Kseniya <[email protected]>
Signed-off-by: Tikhomirova, Kseniya <[email protected]>
Signed-off-by: Tikhomirova, Kseniya <[email protected]>
Signed-off-by: Tikhomirova, Kseniya <[email protected]>
Signed-off-by: Tikhomirova, Kseniya <[email protected]>
Signed-off-by: Tikhomirova, Kseniya <[email protected]>
Signed-off-by: Tikhomirova, Kseniya <[email protected]>
Signed-off-by: Tikhomirova, Kseniya <[email protected]>
Signed-off-by: Tikhomirova, Kseniya <[email protected]>
Signed-off-by: Tikhomirova, Kseniya <[email protected]>
@KseniyaTikhomirova
Copy link
Contributor Author

FYI,

Signed-off-by: Tikhomirova, Kseniya <[email protected]>
Copy link
Contributor

@tahonermann tahonermann left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I finally got all the way through the PR. Most of the new suggestions are rewording of comments, but there are some questions buried in there too. Overall, the code looks nice and clean to me.

Signed-off-by: Tikhomirova, Kseniya <[email protected]>
@KseniyaTikhomirova
Copy link
Contributor Author

@tahonermann thank you for the review.
I have applied changes and replied to comments that I want to discuss before applying.

@tahonermann
Copy link
Contributor

Apply CamelCase to our impl and service classes in snake_case, for example platform_impl should become PlatformImpl and so on: example, see forward decl: https://github.com/intel/llvm/blob/sycl/sycl/source/detail/program_manager/program_manager.hpp#L76

@bader @tahonermann could you please provide your opinion:

1. should we even align style or it is good to go with what we have in intel/llvm

2. agree or not with proposed strategy

Just to close this question out. My personal preference would be to use the standard C++ and SYCL naming styles everywhere for two main reasons:

  • It avoids the cognitive overhead of having to remember which style to use where.
  • I find them easier to read than CamelCase.

That being said, this is only my personal preference and I don't think it should be given much, if any, weight in determining style policy for this project. I think you and @bader should decide what you think is best; there isn't a wrong answer.

Signed-off-by: Tikhomirova, Kseniya <[email protected]>
@KseniyaTikhomirova
Copy link
Contributor Author

@tahonermann thank you, I fixed the rest of the comments here 2767396

@KseniyaTikhomirova
Copy link
Contributor Author

Rebased and checked locally:

$ sycl-ls
[level_zero:unknown]
$ sycl-ls -v
[level_zero:unknown]

Platforms: 1
Platform [#1]:
    Version  : v0.0.1
    Name     : LEVEL_ZERO
    Vendor   : Unknown platform vendor
    Devices  : unknown

Copy link
Contributor

@tahonermann tahonermann left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @KseniyaTikhomirova! This looks good to me, so I'm accepting. I did add one minor suggestion for the added assertion for you to consider.

Signed-off-by: Tikhomirova, Kseniya <[email protected]>
@bader bader merged commit 4f7c733 into llvm:main Jan 20, 2026
11 checks passed
BStott6 pushed a commit to BStott6/llvm-project that referenced this pull request Jan 22, 2026
…#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 <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

SYCL https://registry.khronos.org/SYCL

Projects

None yet

Development

Successfully merging this pull request may close these issues.

9 participants