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

Anton Zabaznov via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Fri Apr 23 05:54:25 PDT 2021


azabaznov added a comment.

> 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?

Yeah, then we should  use `S.getOpenCLOptions().isAvailableOption("cl_khr_fp64", S.getLangOpts())` to check for enabled pragma. And do I understand correctly that the pragma is not needed in OpenCL C 1.2+ since extension became core?


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

https://reviews.llvm.org/D100980



More information about the cfe-commits mailing list