[PATCH] D23712: [OpenCL] Override supported OpenCL extensions with -cl-ext option

Andrew Savonichev via cfe-commits cfe-commits at lists.llvm.org
Fri Aug 19 05:20:24 PDT 2016


asavonic created this revision.
asavonic added a reviewer: Anastasia.
asavonic added a subscriber: cfe-commits.

This patch adds a command line option '-cl-ext' to control a set of
supported OpenCL extensions. Option accepts a comma-separated list
of extensions prefixed with '+' or '-'.

It can be used together with a target triple to override support for some
extensions:

  // spir target supports all extensions, but we want to disable fp64
  clang -cc1 -triple spir-unknown-unknown -cl-ext=-cl_khr_fp64

Special 'all' extension allows to enable or disable all possible
extensions:

  // only fp64 will be supported
  clang -cc1 -triple spir-unknown-unknown -cl-ext=-all,+cl_khr_fp64

https://reviews.llvm.org/D23712

Files:
  include/clang/Basic/OpenCLOptions.h
  include/clang/Basic/TargetInfo.h
  include/clang/Basic/TargetOptions.h
  include/clang/Driver/Options.td
  lib/Basic/Targets.cpp
  lib/Frontend/CompilerInvocation.cpp
  test/SemaOpenCL/extensions.cl

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D23712.68674.patch
Type: text/x-patch
Size: 7133 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20160819/7500a6d2/attachment.bin>


More information about the cfe-commits mailing list