LANGOPT(ShortEnums , 1, 0, "short enum types")
LANGOPT(OpenCL , 1, 0, "OpenCL")
+LANGOPT(OpenCLVersion , 32, 0, "OpenCL version")
LANGOPT(CUDA , 1, 0, "CUDA")
LANGOPT(AssumeSaneOperatorNew , 1, 1, "implicit __attribute__((malloc)) for C++'s new operators")
LANGSTANDARD(opencl, "cl",
"OpenCL 1.0",
BCPLComment | C99 | Digraphs | HexFloat)
+LANGSTANDARD(opencl11, "CL1.1",
+ "OpenCL 1.1",
+ BCPLComment | C99 | Digraphs | HexFloat)
+LANGSTANDARD(opencl12, "CL1.2",
+ "OpenCL 1.2",
+ BCPLComment | C99 | Digraphs | HexFloat)
// CUDA
LANGSTANDARD(cuda, "cuda",
Opts.HexFloats = Std.hasHexFloats();
Opts.ImplicitInt = Std.hasImplicitInt();
- // OpenCL has some additional defaults.
+ // Set OpenCL Version.
if (LangStd == LangStandard::lang_opencl) {
Opts.OpenCL = 1;
+ Opts.OpenCLVersion = 100;
+ }
+ else if (LangStd == LangStandard::lang_opencl11) {
+ Opts.OpenCL = 1;
+ Opts.OpenCLVersion = 110;
+ }
+ else if (LangStd == LangStandard::lang_opencl12) {
+ Opts.OpenCL = 1;
+ Opts.OpenCLVersion = 120;
+ }
+
+ // OpenCL has some additional defaults.
+ if (Opts.OpenCL) {
Opts.AltiVec = 0;
Opts.CXXOperatorNames = 1;
Opts.LaxVectorConversions = 0;