Skip to content

Commit

Permalink
[SYCL] Change SYCL version according to standard (llvm#114790)
Browse files Browse the repository at this point in the history
Version of SYCL was changed according to the latest agreement:
The lower 2 digits are not formally specified, but we plan to use these
to identify the month in which we submit the specification for
ratification, which is similar to the C++ macro __cplusplus.

Since the SYCL 2020 specification was submitted for ratification in
December of 2020, the macro's value is now 202012 for SYCL 2020.
see PR for details 
KhronosGroup/SYCL-Docs#634
  • Loading branch information
dklochkov-emb authored and TIFitis committed Dec 8, 2024
1 parent 711438b commit 6ab22f2
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion clang/lib/Frontend/InitPreprocessor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -587,7 +587,7 @@ static void InitializeStandardPredefinedMacros(const TargetInfo &TI,
if (LangOpts.getSYCLVersion() == LangOptions::SYCL_2017)
Builder.defineMacro("CL_SYCL_LANGUAGE_VERSION", "121");
else if (LangOpts.getSYCLVersion() == LangOptions::SYCL_2020)
Builder.defineMacro("SYCL_LANGUAGE_VERSION", "202001");
Builder.defineMacro("SYCL_LANGUAGE_VERSION", "202012L");
}

// Not "standard" per se, but available even with the -undef flag.
Expand Down
2 changes: 1 addition & 1 deletion clang/test/Preprocessor/sycl-macro.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,5 @@
// CHECK-NOT:#define __SYCL_DEVICE_ONLY__ 1
// CHECK-NOT:#define CL_SYCL_LANGUAGE_VERSION 121
// CHECK-SYCL-STD:#define CL_SYCL_LANGUAGE_VERSION 121
// CHECK-SYCL-STD-2020:#define SYCL_LANGUAGE_VERSION 202001
// CHECK-SYCL-STD-2020:#define SYCL_LANGUAGE_VERSION 202012
// CHECK-SYCL:#define __SYCL_DEVICE_ONLY__ 1

0 comments on commit 6ab22f2

Please sign in to comment.