Just adding a preprocessor #define for the extension.
Patch by Alexey Sotkin
Differential D51402
[OpenCL] Adding cl_intel_planar_yuv extension sidorovd on Aug 29 2018, 12:08 AM. Authored by
Details
Diff Detail Event TimelineComment Actions Will this extension require any Clang changes that are not possible to add using this approach for vendor extensions: If not I would suggest to add this to the header file instead. Comment Actions I'm not sure if I put pragmas in an appropriate place (I mean in the very beginning of the header).
Comment Actions @Anastasia , since there is a problem I described, wouldn't you mind if I stay with the first iteration of the patch (adding the extension to OpenCLExtensions.def) and after we'll investigate what is wrong with -cl-ext approach? Comment Actions I would prefer not to add it to Clang directly unless absolutely necessary. I think it's ok to add this in the header for now as is, but then investigate how we can add an architecture guard later. Please, could you just move the testing into test/Headers/opencl-c-header.cl, because test/SemaOpenCL/extension-version.cl is for Clang built in extensions. |
@yaxunl, do you think we need to add some kind of architecture guard for such things? Like it should only be added if the architecture supports the extension? But I guess -cl-ext=+cl_intel_planar_yuv trick might not work here because it's not a Clang known extension?
So may be the right solution here is to introduce a target specific header? For now it can be explicitly included but we could think of a target hook to preload a target specific header...