[PATCH] Fix OpenCL 1.2 double as an optional core feature behaviour

Neil Henning llvm at neil-henning.co.uk
Thu Jan 29 02:40:10 PST 2015


Hi rsmith,

In OpenCL 1.2, using double no longer requires using the pragma cl_khr_fp64, instead a kernel is allowed to use double, but must first have queried clGetDeviceInfo's CL_DEVICE_DOUBLE_FP_CONFIG.

Page 197, section 6.1.1 of the OpenCL 1.2 specification has a footnote 23 describing this behaviour.

I've also added test cases such that the pragma must be used if targeting OpenCL 1.0 or 1.1, but is ignored in 1.2 and 2.0.

http://reviews.llvm.org/D7245

Files:
  lib/Sema/SemaExpr.cpp
  lib/Sema/SemaType.cpp
  test/SemaOpenCL/extension-fp64-cl1.1.cl
  test/SemaOpenCL/optional-core-fp64-cl1.2.cl
  test/SemaOpenCL/optional-core-fp64-cl2.0.cl

EMAIL PREFERENCES
  http://reviews.llvm.org/settings/panel/emailpreferences/
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D7245.18944.patch
Type: text/x-patch
Size: 3082 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20150129/f2424dfb/attachment.bin>


More information about the cfe-commits mailing list