Skip to content

Conversation

@aelovikov-intel
Copy link
Contributor

@aelovikov-intel aelovikov-intel commented Oct 29, 2025

While resulting in extra restrictions to ensure not ABI-violations when
passing data between host and device, that makes distribution of SYCL
applications using SYCL RTC much easier, so we're willing to pay that
price. Kernel compiler extension is being updated accordingly.

Ideally, we'd like to use the same STL implementation as the host code,
but we cannot re-distribute GNU libstdc++/libc or MS C++/C
headers (including Windows SDK) due to legal restrictions, so we embed
LLVM's libcxx/libc headers instead.

The way SYCL (non-RTC) works is that we use the same host C++/C
headers for device compilation and ignore the actual
libc.so/libstdc++.so as we provide known entry points ourselves (be it
libclc/libdevice/etc.). As such, for SYCL RTC, we don't actually need to
build those runtimes for a gpu target either, and can just use the
headers they provide. However, libc implementation of
entrypoints/headers on Windows is very incomplete, but we don't really
need that. All we need is declarations of C Standard Library/POSIX
functions and there is a way to pass some extra defines/configs to make
it generate that. As such, we avoid LLVM_ENABLE_RUNTIMES and instead
configure libcxx/libc as extra projects manually, passing needed option
and avoid full builds and installation for the regular host toolchain.o

Another caveat is that we have to disable system include paths (to
exclude regular libc headers as having two libc implementations is
causing all sorts of issues). As such, this approach isn't working for
CUDA/HIP targets that need corresponding SDKs. Previous behavior of
requiring/using system C++ toolchain is retained for those targets.

@aelovikov-intel aelovikov-intel force-pushed the sycl-rtc-runtimes-headers branch from f54abd9 to c9bdf63 Compare October 29, 2025 18:54
@aelovikov-intel aelovikov-intel force-pushed the sycl-rtc-runtimes-headers branch from c9bdf63 to 350e8f2 Compare October 29, 2025 19:02
@aelovikov-intel aelovikov-intel force-pushed the sycl-rtc-runtimes-headers branch from 350e8f2 to 5c6f8b1 Compare October 29, 2025 19:41
@aelovikov-intel aelovikov-intel force-pushed the sycl-rtc-runtimes-headers branch from 5c6f8b1 to 9d0562d Compare October 30, 2025 00:07
@aelovikov-intel aelovikov-intel force-pushed the sycl-rtc-runtimes-headers branch from 9d0562d to 2299dcb Compare October 30, 2025 14:35
@aelovikov-intel aelovikov-intel force-pushed the sycl-rtc-runtimes-headers branch from 2299dcb to 9032697 Compare October 30, 2025 15:15
@aelovikov-intel aelovikov-intel force-pushed the sycl-rtc-runtimes-headers branch from 9032697 to 846f1c3 Compare October 30, 2025 17:01
@aelovikov-intel aelovikov-intel force-pushed the sycl-rtc-runtimes-headers branch from 846f1c3 to 99376a1 Compare November 3, 2025 15:49
@aelovikov-intel aelovikov-intel force-pushed the sycl-rtc-runtimes-headers branch from 99376a1 to 5506074 Compare November 3, 2025 21:42
- type: size_t
- type: size_t
- type: mbstate_t
- type: mbstate_t *__restrict
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This and the one below are part of the upstream llvm/llvm-project#164666.

@aelovikov-intel aelovikov-intel force-pushed the sycl-rtc-runtimes-headers branch from 5506074 to 6fffeb8 Compare November 4, 2025 17:15
Copy link
Contributor

@gmlueck gmlueck left a comment

Choose a reason for hiding this comment

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

Looks good!

@aelovikov-intel
Copy link
Contributor Author

@intel/llvm-reviewers-runtime, Chris is on vacation, can somebody else take a look?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

8 participants