Skip to content

[SYCL] Add Self macro versioning#21572

Open
ykhatav wants to merge 5 commits intointel:syclfrom
ykhatav:self-macro-versioning
Open

[SYCL] Add Self macro versioning#21572
ykhatav wants to merge 5 commits intointel:syclfrom
ykhatav:self-macro-versioning

Conversation

@ykhatav
Copy link
Contributor

@ykhatav ykhatav commented Mar 19, 2026

Adds DPC++ compiler self-identification macros to differentiate intel/llvm compiler from upstream Clang and enable version detection for intel/llvm releases.
Fixes:#21509
Depends on: #21570

elizabethandrews and others added 3 commits March 19, 2026 07:31
cmake/Modules/DPCPPVersion.cmake should be updated to hold
version information for each release.
@ykhatav ykhatav marked this pull request as ready for review March 19, 2026 19:47
@ykhatav ykhatav requested review from a team and bader as code owners March 19, 2026 19:47
@ykhatav
Copy link
Contributor Author

ykhatav commented Mar 19, 2026

CC: @tahonermann , @dvrogozh

@tahonermann
Copy link
Contributor

Thanks @ykhatav, this looks good to me once #21570 is merged.

Copy link

@dvrogozh dvrogozh left a comment

Choose a reason for hiding this comment

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

Let's get #21570 merged first then rebase this one on top. Setting -1 just to avoid accidental merge.

Copy link
Contributor

@YuriPlyakhin YuriPlyakhin left a comment

Choose a reason for hiding this comment

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

llvm/CMakeLists.txt change LGTM

Copy link
Contributor

@hchilama hchilama left a comment

Choose a reason for hiding this comment

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

Driver - LGTM

Builder.defineMacro("__VERSION__", "\"" +
Twine(getClangFullCPPVersion()) + "\"");
// with GCC 4.2.1. Now, just return the full DPC++ version
Builder.defineMacro("__VERSION__",

Choose a reason for hiding this comment

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

@tahonermann , how about __VERSION__. Do we leave it with clang or update to dpcpp?

Copy link
Contributor

Choose a reason for hiding this comment

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

I think we update it to DPC++. That macro traditionally tracked GCC version, but Clang diverged from that some time ago. I don't think we need to be consistent with Clang for this one.

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.

6 participants