Details
- Reviewers
Anastasia
Diff Detail
Event Timeline
lib/Sema/SemaType.cpp | ||
---|---|---|
1505 | Please update with clang ToT since OpenCLOptions has interface changes. |
test/SemaOpenCL/unknown_type.cl | ||
---|---|---|
1 | Could this be merged with similar test in test/SemaOpenCL/extensions.cl instyead of adding a new file? |
This diagnostic was added in this commit: https://reviews.llvm.org/rL289979
It is something like that: "use of undeclared identifier 'double2'; did you mean 'double'?"
This message isn't clear enough and it is difficult to understand that I forgot to enable cl_khr_fp64 extension. May be it will be better to change this diagnostic message to something like that: "use of type 'double2' (vector of 2 'double' values) requires cl_khr_fp64 extension to be enabled"
with the new pragma for associating types with extensions. This feature can be implemented by solely modify opencl-c.h by adding #pragma OPENCL EXTENSION cl_khr_fp64 : begin/end around vector double type definitions, e.g.
#pragma OPENCL EXTENSION cl_khr_fp64 : begin typedef double double2 __attribute__((ext_vector_type(2))); typedef double double3 __attribute__((ext_vector_type(3))); typedef double double4 __attribute__((ext_vector_type(4))); typedef double double8 __attribute__((ext_vector_type(8))); typedef double double16 __attribute__((ext_vector_type(16))); #pragma OPENCL EXTENSION cl_khr_fp64 : end #ifdef cl_khr_fp64 #if __OPENCL_C_VERSION__ < CL_VERSION_1_2 #pragma OPENCL EXTENSION cl_khr_fp64 : enable #endif #endif
The
#pragma OPENCL EXTENSION cl_khr_fp64 : enable
is for suppressing diagnostics due to using double type in builtin functions. Ideally they should also be surrounded by #pragma OPENCL EXTENSION cl_khr_fp64 : begin/end.
Please update with clang ToT since OpenCLOptions has interface changes.