[PATCH] D125243: [OpenCL] Make -cl-ext a driver option

Anastasia Stulova via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Mon May 9 09:54:42 PDT 2022


Anastasia created this revision.
Anastasia added a reviewer: svenvh.
Herald added subscribers: Naghasan, ebevhan, yaxunl.
Herald added a project: All.
Anastasia requested review of this revision.
Herald added a subscriber: MaskRay.

For generic targets such as SPIR-V clang sets all OpenCL extensions/features as supported by default. However targets are unlikely to support all extensions/features which creates a problem when such generic SPIR-V binary is compiled for a specific target later on.

For SPIR-V we will likely provide control of extensions via vendor components in the target triple: https://discourse.llvm.org/t/setting-version-environment-and-extensions-for-spir-v-target, however this doesn't eliminate the need of finer-grained control of extensions for example to support some specific or emerging target architectures.

Therefore this patch exposes `-cl-ext` flag for finer-grained control of extensions and features being targeted in the OpenCL kernels to improve error reporting and control of features generated in generic binaries like SPIR-V.


https://reviews.llvm.org/D125243

Files:
  clang/docs/OpenCLSupport.rst
  clang/docs/UsersManual.rst
  clang/include/clang/Driver/Options.td
  clang/lib/Driver/ToolChains/Clang.cpp
  clang/test/Driver/opencl.cl

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D125243.428115.patch
Type: text/x-patch
Size: 7480 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20220509/5869af09/attachment-0001.bin>


More information about the cfe-commits mailing list