Skip to content

Commit 6b07853

Browse files
[SYCL] Change SYCL version according to standard (llvm#114790)
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
1 parent 8ab2730 commit 6b07853

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

clang/lib/Frontend/InitPreprocessor.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -587,7 +587,7 @@ static void InitializeStandardPredefinedMacros(const TargetInfo &TI,
587587
if (LangOpts.getSYCLVersion() == LangOptions::SYCL_2017)
588588
Builder.defineMacro("CL_SYCL_LANGUAGE_VERSION", "121");
589589
else if (LangOpts.getSYCLVersion() == LangOptions::SYCL_2020)
590-
Builder.defineMacro("SYCL_LANGUAGE_VERSION", "202001");
590+
Builder.defineMacro("SYCL_LANGUAGE_VERSION", "202012L");
591591
}
592592

593593
// Not "standard" per se, but available even with the -undef flag.

clang/test/Preprocessor/sycl-macro.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,5 +10,5 @@
1010
// CHECK-NOT:#define __SYCL_DEVICE_ONLY__ 1
1111
// CHECK-NOT:#define CL_SYCL_LANGUAGE_VERSION 121
1212
// CHECK-SYCL-STD:#define CL_SYCL_LANGUAGE_VERSION 121
13-
// CHECK-SYCL-STD-2020:#define SYCL_LANGUAGE_VERSION 202001
13+
// CHECK-SYCL-STD-2020:#define SYCL_LANGUAGE_VERSION 202012
1414
// CHECK-SYCL:#define __SYCL_DEVICE_ONLY__ 1

0 commit comments

Comments
 (0)