Fix OpenCL C for 32bit targets without 64bit doubles
schnetter at gmail.com
Tue Dec 17 08:53:14 PST 2013
On Dec 17, 2013, at 5:13 , Pekka Jääskeläinen <pekka.jaaskelainen at tut.fi> wrote:
> The attached patch ensures we do not override target's setting for
> double with OpenCL C in case it is set to be the same as FloatWidth.
> This can happen with 32bit targets (currently at least TCE in LLVM)
> that define double as float, and thus might support only the
> OpenCL EP or just do not support the fp64 extension of OpenCL.
> Good to commit?
Ideally, clang would record at this place whether OpenCL double (and long) are supported. This is a target-dependent property, and this routine (which may override target-specific settings) would be a good place to do so. Currently, this fact is only implicitly recorded via the condition sizeof(double)!=sizeof(float).
Later, the default values of the cl_khr_float64 and cl_khr_int64 attributes can then be set accordingly.
Is it possible to disable double and long in clang without causing major breakage? If not, the patch is fine.
Erik Schnetter <schnetter at gmail.com>
My email is as private as my paper mail. I therefore support encrypting
and signing email messages. Get my PGP key from http://pgp.mit.edu/.
-------------- next part --------------
A non-text attachment was scrubbed...
Size: 203 bytes
Desc: Message signed with OpenPGP using GPGMail
More information about the llvm-commits