PATCH: re-enable OpenCL extensions

Kalle Raiskila via cfe-commits cfe-commits at
Thu Jan 19 00:03:24 PST 2017


I noticed a change from clang 3.8 to 3.9, that it disabled all OpenCL extension pragmas per default.
This broke pocl on e.g. ARM for LLVM 3.9 (

$ echo "#pragma OPENCL EXTENSION cl_khr_icd: enable" >
$ clang  -emit-llvm -x cl -o tmp.bc -c

works fine, but:
$ clang  -emit-llvm -x cl -o tmp.bc -c --target=armv7-unknown-linux-gnueabihf warning: unsupported OpenCL extension 'cl_khr_icd' - ignoring [-Wignored-pragmas]
#pragma OPENCL EXTENSION cl_khr_icd: enable
1 warning generated.

Attached is a patch that enables OpenCL extensions for all targets per default, and then sets the
status quo of supported extensions for those targets that currently customize their settings (i.e.
Most generic CPUs can handle all OpenCL extensions just fine.

Please keep me as CC, I am not subscribed to the list.

-------------- next part --------------
A non-text attachment was scrubbed...
Name: enable_OCL_extensions.patch
Type: text/x-patch
Size: 1959 bytes
Desc: not available
URL: <>

More information about the cfe-commits mailing list