Skip to content

Sycl jit toolchain versions - #23018

Draft
koparasy wants to merge 4 commits into
intel:syclfrom
koparasy:sycl-jit-toolchain-versions
Draft

Sycl jit toolchain versions#23018
koparasy wants to merge 4 commits into
intel:syclfrom
koparasy:sycl-jit-toolchain-versions

Conversation

@koparasy

Copy link
Copy Markdown
Contributor

No description provided.

koparasy and others added 4 commits August 24, 2026 14:42
Scripts + docs for embedding multiple SYCL versions in one libsycl-jit.so:
- snapshot-version.sh: import a released toolchain (headers + libdevice
  sources + regenerated generated-headers + unified-runtime) into a frozen
  sycl-toolchains/sycl-v-<label>/ snapshot.
- build-version-libdevice.sh: build a version's device libraries from its
  own sources with the new clang.
- README.md documents the layout, the latest-is-live model, the import-once/
  own-git-history workflow, and the promotion/drop policy.
- .gitattributes marks the vendored snapshots linguist-vendored.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Pristine frozen snapshots of the oneAPI DPC++ v6.2.2 and v6.3.0 releases
(headers, unified-runtime, regenerated version/feature_test/device_aspect
headers, and libdevice sources), imported via snapshot-version.sh. VERSION
records the origin tag + commit SHA for each.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
…hots

New-clang compatibility fix. clang removed 'buffer_location' from the
sycl_type attribute's SYCLType enum (FPGA kernel_arg_buffer_location metadata
removal, intel#22499), so the old headers' __SYCL_TYPE(buffer_location)
is rejected during RTC device compilation. The annotation is a no-op under the
new compiler, so dropping it is semantically safe. First tracked divergence of
these snapshots from their upstream import.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Behind new CMake option SYCL_JIT_EMBED_LEGACY_TOOLCHAINS (OFF by default, so
the default build is byte-identical):

- CMakeLists.txt: stage the live tree under latest/ and each sycl-v-*/ snapshot
  under its own subtree (vendored headers + shared new-compiler resource/OpenCL
  headers + per-version device libraries built by build-version-libdevice.sh).
  generate.py then embeds every subtree from the one install dir.
- DeviceCompilation.cpp (guarded by JIT_MULTIVERSION_TOOLCHAIN): make the
  toolchain prefix version-aware (thread-local active version; default latest,
  overridable via JIT_RTC_TOOLCHAIN_VERSION / setActiveToolchainVersion), so
  clang++, resource headers, sycl headers and libdevice all resolve within the
  selected version's subtree. Also add include/unified-runtime to the search
  path so both <ur_api.h> and <unified-runtime/ur_api.h> spellings resolve.

A single libsycl-jit.so can then RTC-compile against multiple SYCL versions,
selected at runtime. Validated on PVC: latest and v6.2.2/v6.3.0 each compile
and run against their own headers + libdevice.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@koparasy

Copy link
Copy Markdown
Contributor Author

@vmustya multi version SYCL JIT headers.

How it works:

  • A script imports a released toolchain (headers + libdevice sources) into a vendored, version-tagged snapshot committed to the repo. Adding a version = run the script + commit; dropping one = delete the dir.
  • The build embeds every version's headers and per-version device libraries into the one .so. Each version's libdevice is rebuilt from its own sources by the new compiler, so the implementation stays matched to its headers (no risky sharing across versions).
  • The runtime routes to the selected version's subtree. All of this is behind a build option that's off by default — normal builds are byte-for-byte unchanged.

In this PR I pick 2 released versions as "copies" just to test things out.

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.

1 participant