[cfe-dev] [RFC][OpenCL] Allow users to add supported OpenCL extensions by pragma

Liu, Yaxun (Sam) via cfe-dev cfe-dev at lists.llvm.org
Fri Jun 10 11:40:27 PDT 2016


Currently Clang defines supported OpenCL extensions for each target based on triple and CPU. As a default configuration this seems sufficient.

However if vendors and library developers want to add support of their own extensions, they have to modify Clang, which is very inconvenient.

We need a flexible and expressive way to add supported extensions for vendors and library developers.

Brian has a proposal which introduces a pragma to add supported extensions:

#pragma OPENCL EXTENSION the_new_extension_name : register

This pragma tells clang the name of a new OpenCL extension and request that it process it just like any other OpenCL extension, e.g. recognize

#pragma OPENCL EXTENSION the_new_extension_name : enable/disable

in subsequent code.

Since this pragma can be used in the header file of vendors or library developers' OpenCL implementations, it can provide flexible and expressive way to represent supported extensions when combined with other preprocessor constructs.

Any feedbacks? Thanks.

Sam


-------------- next part --------------
A non-text attachment was scrubbed...
Name: winmail.dat
Type: application/ms-tnef
Size: 12155 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20160610/9ec434ec/attachment.bin>


More information about the cfe-dev mailing list