[cfe-dev] PATCH: re-enable OpenCL extensions

Anastasia Stulova via cfe-dev cfe-dev at lists.llvm.org
Tue Jan 17 11:00:23 PST 2017


Hi Kalle,

Could you please send this to cfe-commits instead or even better setup the Phabricator review: https://reviews.llvm.org/ with "[OpenCL] ..." in a title. 

Generally it was discussed during the development that disabling the extensions by default for the targets that don't support OpenCL is the right approach.

Cheers,
Anastasia

-----Original Message-----
From: cfe-dev [mailto:cfe-dev-bounces at lists.llvm.org] On Behalf Of Kalle Raiskila via cfe-dev
Sent: 15 January 2017 14:41
To: cfe-dev at lists.llvm.org
Subject: [cfe-dev] PATCH: re-enable OpenCL extensions

Hi,

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 (https://github.com/pocl/pocl/issues/409).

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

works fine, but:
$ clang  -emit-llvm -x cl -o tmp.bc -c hello.cl --target=armv7-unknown-linux-gnueabihf
hello.cl:1:26: 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.
NVPTX and AMDGPU).
Most generic CPUs can handle all OpenCL extensions just fine.


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


More information about the cfe-dev mailing list