-
Notifications
You must be signed in to change notification settings - Fork 68
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Change the base C++ version #680
Open
gmlueck
wants to merge
2
commits into
KhronosGroup:main
Choose a base branch
from
gmlueck:gmlueck/base-cpp
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 1 commit
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think the repetition of "C++ core language" here is confusing. The second sentence in this paragraph defines "C++ core language" to mean "C++17", so these sentences appear to be talking about different versions of C++17.
How about:
The first sentence in the paragraph already talks about SYCL implementations "conforming to" specific C++ versions, which is why I picked that wording.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The term "C++ core language" is intended to identify whatever C++ version the implementation chooses. The first sentence says that an implementation must choose one of the versions listed in section
<<sec:normativerefs>>
(which are all the versions from C++17 and greater).In practice, I expect that most SYCL implementations will choose the C++ version via a command line parameter like
-std=
.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What happens when ISO C++26 is out but this is not yet mentioned in the SYCL spec as s normative norm? Is it up to the implementation whether a program using C++26 in host part will work? 🤔
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh, I see. I misunderstood the sentence. I read "This version of C++" as referring to C++17, not as "the C++ standard to which a SYCL implementation conforms".
If we wanted to make this unambiguous we could say:
or
...but if I'm alone in thinking the original wording is confusing, you can ignore me!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't see this as a practical problem. There are already C++ compilers that support proposed C++26 features even though there is no ratified C++26 specification yet. Those compilers can exist -- they just aren't conformant to any spec yet. I think it could be the same for SYCL. An implementation can choose to support C++26 with SYCL if it wants. It just won't be strictly conformant to the SYCL spec.
What would be the alternative? I guess the SYCL spec could say that the core C++ version could be any future version of C++ even though we don't know what language features this would include. I think that would be more problematic because we wouldn't know how those unknown language features would work in device code.
This reminds me ... we should think through all the new language features in C++20 and C++23 and decide if they are legal in device code. For those that are not, we need to add them to section 5.5 "Language restrictions for device functions".
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I updated the wording according to your suggestion in d5d63ed.