Skip to content

[WIN] Fix error C7555: use of designated initializers requires at least '/std:c++20'#4889

Merged
whitneywhtsang merged 1 commit into
mainfrom
whitneywhtsang/win
Aug 12, 2025
Merged

[WIN] Fix error C7555: use of designated initializers requires at least '/std:c++20'#4889
whitneywhtsang merged 1 commit into
mainfrom
whitneywhtsang/win

Conversation

@whitneywhtsang
Copy link
Copy Markdown
Contributor

@whitneywhtsang whitneywhtsang commented Aug 12, 2025

Fixes #4890

…ast '/std:c++20'`

Signed-off-by: Whitney Tsang <whitney.tsang@intel.com>
Copy link
Copy Markdown
Contributor

@etiotto etiotto left a comment

Choose a reason for hiding this comment

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

Can we simply change the std level to C++20 instead of changing the code ?

@whitneywhtsang
Copy link
Copy Markdown
Contributor Author

Can we simply change the std level to C++20 instead of changing the code ?

It is intentionally made Windows build C++17 compliant: #2837.
The issue doesn't explain why.

@kwasd
Copy link
Copy Markdown
Contributor

kwasd commented Aug 12, 2025

trying to switch to 20 here, not sure about effects: #4891

@kwasd
Copy link
Copy Markdown
Contributor

kwasd commented Aug 12, 2025

Builds with C++20.
So have to merge either #4889 (change code) or #4891 (switch compiler to C++20) to unblock the CI.

@whitneywhtsang
Copy link
Copy Markdown
Contributor Author

Builds with C++20. So have to merge either #4889 (change code) or #4891 (switch compiler to C++20) to unblock the CI.

@kwasd Do you know why the error is not reported on Linux? Note upstream set to C++17: https://github.com/triton-lang/triton/blob/main/CMakeLists.txt#L11.

@kwasd
Copy link
Copy Markdown
Contributor

kwasd commented Aug 12, 2025

I have only an assumption: other compiler is not very strict about the standard. Something similar described here.

@kwasd
Copy link
Copy Markdown
Contributor

kwasd commented Aug 12, 2025

It seems like on Linux it use -std=gnu++17 by default.
Setting to -std=c++17 gives other errors, but not this particular case (run)

@kwasd kwasd mentioned this pull request Aug 12, 2025
@kwasd
Copy link
Copy Markdown
Contributor

kwasd commented Aug 12, 2025

The issue doesn't explain why.

By Anatoly
#2833 (comment):

Do you know if upstream is opened to changing to C++20 compliant?

I don't know, it seems to me that there is a connection with PyTorch, which still uses c++17 standard. I suppose that as soon as it updates the standard, Triton will do the same.

@etiotto
Copy link
Copy Markdown
Contributor

etiotto commented Aug 12, 2025

Triton doesn't have to use the same C++ std level that PyTorch uses. Using -std=C++20 would be fine, but I am also fine to fix the source code as per this PR.

@whitneywhtsang whitneywhtsang merged commit ef8b117 into main Aug 12, 2025
15 checks passed
@whitneywhtsang whitneywhtsang deleted the whitneywhtsang/win branch August 12, 2025 19:15
@kwasd
Copy link
Copy Markdown
Contributor

kwasd commented Aug 12, 2025

Triton doesn't have to use the same C++ std level that PyTorch uses. Using -std=C++20 would be fine, but I am also fine to fix the source code as per this PR.

There's other C++20-related upstream PRs and discussions
triton-lang/triton#5186
triton-lang/triton#6615
triton-lang/triton#5291

@intel intel deleted a comment from ivanstepanovftw Aug 12, 2025
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.

Windows build broken (C7555: use of designated initializers requires at least '/std:c++20')

3 participants