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

Anastasia Stulova via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Fri Apr 23 03:48:18 PDT 2021


Anastasia added a comment.

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

>> do you think it is valuable to keep this behavior at all?
>
> As I said, I would be happy too if we remove pragma extension as it will really simplify the codebase of OpenCL in clang and the usage of optional functionality itself. Maybe we should add a diagnostic that pragma is ignored?

For `cl_khr_fp64` I still want to keep the pragma for the other use case - to convert double literal into single-precision (https://github.com/KhronosGroup/OpenCL-Docs/issues/578). The reason why I think it could be useful is that the precision change might lead to a different result depending on the precision of the calculation. So I think pragmas could be useful to control whether double literal is single-precision or not to avoid this problem occur when code is compiled for different targets?

When we parse the pragma we don't know what it is used for in the code so it won't be possible to emit the warning conditionally.


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

https://reviews.llvm.org/D100980



More information about the cfe-commits mailing list