[PATCH] D100980: [OpenCL] Allow use of double type without extension pragma

Anastasia Stulova via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Thu Apr 22 05:04:54 PDT 2021


Anastasia added a comment.

In D100980#2708012 <https://reviews.llvm.org/D100980#2708012>, @azabaznov wrote:

> Same as for https://reviews.llvm.org/D100984, `cl_khr_fp64` wasn't always core and thus it requires pragma for OpenCL C < 1.2 versions.
>
> //9.3 Double Precision Floating-Point, OpenCL C 1.0// (https://www.khronos.org/registry/OpenCL/specs/opencl-1.0.pdf):
>
>   OpenCL 1.0 adds support for double precision floating-point as an optional extension. An application that wants to use double will need to include the #pragma OPENCL EXTENSION cl_khr_fp64 : enable directive before any double precision data type is declared in the kernel code.

Ok, we can change to check for

  S.getOpenCLOptions().isAvailable("cl_khr_fp64", S.getLangOpts())

instead of `isSupported` but out of curiosity considering that we have failed to implement the extension pragmas anyway (see description in https://reviews.llvm.org/D100976) do you think it is valuable to keep this behavior at all? It would be like doing something partially correct but not fully correct.

The reason why I would prefer to avoid unnecessary uses of prgmas is that they are confusing and inconsistent so the less of them we have the easier it is for the developers and users of clang.


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D100980/new/

https://reviews.llvm.org/D100980



More information about the cfe-commits mailing list