[OpenCL] Add support of OpenCL C 3.0 __opencl_c_fp64
authorAnton Zabaznov <anton.zabaznov@intel.com>
Fri, 21 May 2021 11:07:23 +0000 (14:07 +0300)
committerAnton Zabaznov <anton.zabaznov@intel.com>
Fri, 21 May 2021 12:01:19 +0000 (15:01 +0300)
commit826905787ae4c8540bb8a2384fac59c606c7eaff
treef737da042402f518e458d3ce1a09dc1cdbd8fd6c
parent469833f418e1704331f8dccb06ccd391f8d726e1
[OpenCL] Add support of OpenCL C 3.0 __opencl_c_fp64

There already exists cl_khr_fp64 extension. So OpenCL C 3.0
and higher should use the feature, earlier versions still
use the extension. OpenCL C 3.0 API spec states that extension
will be not described in the option string if corresponding
optional functionality is not supported (see 4.2. Querying Devices).
Due to that fact the usage of features for OpenCL C 3.0 must
be as follows:

```
$ clang -Xclang -cl-ext=+cl_khr_fp64,+__opencl_c_fp64 ...

$ clang -Xclang -cl-ext=-cl_khr_fp64,-__opencl_c_fp64 ...
```

e.g. the feature and the equivalent extension (if exists)
must be set to the same values

Reviewed By: Anastasia

Differential Revision: https://reviews.llvm.org/D96524
12 files changed:
clang/docs/OpenCLSupport.rst
clang/include/clang/Basic/DiagnosticCommonKinds.td
clang/include/clang/Basic/DiagnosticSemaKinds.td
clang/lib/Basic/Targets.cpp
clang/lib/Basic/Targets/AMDGPU.h
clang/lib/Basic/Targets/NVPTX.h
clang/lib/Frontend/CompilerInstance.cpp
clang/lib/Sema/SemaExpr.cpp
clang/lib/Sema/SemaType.cpp
clang/test/CodeGenOpenCL/printf.cl
clang/test/Misc/opencl-c-3.0.incorrect_options.cl [new file with mode: 0644]
clang/test/SemaOpenCL/fp64-fp16-options.cl [moved from clang/test/SemaOpenCL/extensions.cl with 71% similarity]