Currently, we have support for SYCL 1.2.1 (also known as SYCL 2017). This patch introduces the start of support for SYCL 2020 mode, which is the latest SYCL standard available at (https://www.khronos.org/registry/SYCL/specs/sycl-2020/html/sycl-2020.html). This sets the default SYCL to be 2020 in the driver, and introduces the notion of a "default" version (set to 2020) when cc1 is in SYCL mode but there was no explicit -sycl-std= specified on the command line.
Details
Diff Detail
Event Timeline
LGTM, but want others to look first.
clang/lib/Frontend/InitPreprocessor.cpp | ||
---|---|---|
481 | This seems very related, but perhaps a part of a different patch? I think I'm probably OK bringing this in during this patch, but it isn't strictly related to adding 2020 support. |
clang/include/clang/Basic/LangOptions.h | ||
---|---|---|
130 | Do you want to change it to a scoped enum or will this cause major issues? ClangABI is a scoped enum?!? |
clang/include/clang/Basic/LangOptions.h | ||
---|---|---|
130 | Given that it's already scoped to LangOptions, I think a scoped enum adds more noise than anything. It'd make it awkward to name the actual enumerators due to using dates. I think we'd wind up needing to write LangOptions::SYCLMajorVersion::Ver2017 (or something along those lines), which doesn't seem like a huge win to me. WDYT? |
clang/include/clang/Basic/LangOptions.h | ||
---|---|---|
130 | FWIW, I agree that a scoped enum wouldn't improve things here. |
:-)
FWIW, I think it's because LangOptions::Ver1 would be hard to understand compared to LangOptions::ClangABI::Ver1, whereas in this case, LangOptions::SYCL_2020 is reasonably clear as to what's meant.
I don't think the presence of the word 'Major' in Aaron's version above is the most offensive to me. While I think a good case can be made to make this just SYCLVersion (I don't think we have a minor version?), I think making this a scoped-enum is just going to end up with a worse experience. LangOptions::SYCL_2020 is equally as descriptive as LangOptions::SYCLVersion::Ver2020. And I'd say is even MORE descriptive, since Ver2020 has a very low information density.
To me, those convey the same amount of information, so the use of the scoped enum doesn't get us much (but it would mean we can't use LangOptions::SYCL for any other purpose in the future).
Looks like this breaks tests on macOS:
http://45.33.8.238/macm1/9739/step_7.txt
http://45.33.8.238/mac/31615/step_7.txt
Please take a look, and please revert for now if it takes a while to fix.
Thank you -- I think I've resolved the issue in ccbac06a072b86ea3b46479e478a1abee8520ef8
~Aaron
Do you want to change it to a scoped enum or will this cause major issues? ClangABI is a scoped enum?!?