summaryrefslogtreecommitdiffstats
path: root/clang/test/SemaOpenCL/extensions.cl
Commit message (Collapse)AuthorAgeFilesLines
* [OpenCL] Rename lang mode flag for C++ modeAnastasia Stulova2019-07-251-1/+1
| | | | | | | | | | | | Rename lang mode flag to -cl-std=clc++/-cl-std=CLC++ or -std=clc++/-std=CLC++. This aligns with OpenCL C conversion and removes ambiguity with OpenCL C++. Differential Revision: https://reviews.llvm.org/D65102 llvm-svn: 367008
* [OpenCL] Improved testing of default header.Anastasia Stulova2019-03-191-1/+1
| | | | | | | | | Improved some checks and moved testing of the default header in C++ mode into the Headers folder. Differential Revision: https://reviews.llvm.org/D59486 llvm-svn: 356450
* [PR41007][OpenCL] Allow printf in C++ mode.Anastasia Stulova2019-03-121-1/+1
| | | | | | | | | As for OpenCL C, we need to allow using printf and toolchain variadic functions (prefixed by "__") in C++ mode. Differential Revision: https://reviews.llvm.org/D59219 llvm-svn: 355915
* [OpenCL][PR40603] In C++ preserve compatibility with OpenCL C v2.0Anastasia Stulova2019-02-071-2/+7
| | | | | | | | | | Valid OpenCL C code should still compile in C++ mode. This change enables extensions and OpenCL types. Differential Revision: https://reviews.llvm.org/D57824 llvm-svn: 353431
* [OpenCL] Traverse vector types for ocl extensions supportAlexey Sotkin2018-09-031-0/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: Given the following kernel: __kernel void foo() { double d; double4 dd; } and cl_khr_fp64 is disabled, the compilation would fail due to the presence of 'double d', but when removed, it passes. The expectation is that extended vector types of unsupported types will also be unsupported. The patch adds the check for this scenario. Patch by: Ofir Cohen Reviewers: bader, Anastasia, AlexeySotkin, yaxunl Reviewed By: Anastasia Subscribers: cfe-commits Differential Revision: https://reviews.llvm.org/D51296 llvm-svn: 341309
* [OpenCL] Re-enable supported core extensions based on opencl version when ↵Konstantin Zhuravlyov2017-01-061-0/+13
| | | | | | | | disabling all extensions using pragma Differential Revision: https://reviews.llvm.org/D28257 llvm-svn: 291243
* Recommit r289979 [OpenCL] Allow disabling types and declarations associated ↵Yaxun Liu2016-12-181-2/+0
| | | | | | | | with extensions Fixed undefined behavior due to cast integer to bool in initializer list. llvm-svn: 290056
* Revert r289979 due to regressionsYaxun Liu2016-12-161-0/+2
| | | | llvm-svn: 289991
* [OpenCL] Allow disabling types and declarations associated with extensionsYaxun Liu2016-12-161-2/+0
| | | | | | | | | | | | | | | | | | Added a map to associate types and declarations with extensions. Refactored existing diagnostic for disabled types associated with extensions and extended it to declarations for generic situation. Fixed some bugs for types associated with extensions. Allow users to use pragma to declare types and functions for supported extensions, e.g. #pragma OPENCL EXTENSION the_new_extension_name : begin // declare types and functions associated with the extension here #pragma OPENCL EXTENSION the_new_extension_name : end Differential Revision: https://reviews.llvm.org/D21698 llvm-svn: 289979
* Fixing cast condition for removing casts from builtin FPClassification.Neil Hickey2016-12-141-0/+8
| | | | | | | | | | | The function SemaBuiltinFPClassification removed superfluous float to double casts, this was changed to also remove float to float casts but this isn't valid in all cases, for example when doing an rvaluetolvalue cast. Added a check to only remove if this was a conventional floating cast. Added additional tests into SemaOpenCL/extensions to cover these cases llvm-svn: 289650
* Improve handling of floating point literals in OpenCL to only use double ↵Neil Hickey2016-12-131-1/+11
| | | | | | | | | | | | | | precision if the target supports fp64. This change makes sure single-precision floating point types are used if the cl_fp64 extension is not supported by the target. Also removed the check to see whether the OpenCL version is >= 1.2, as this has been incorporated into the extension setting code. Differential Revision: https://reviews.llvm.org/D24235 llvm-svn: 289544
* Revert "Improve handling of floating point literals in OpenCL to only use ↵Renato Golin2016-11-141-10/+2
| | | | | | | | double precision if the target supports fp64." This reverts commit r286815, as it broke all ARM and AArch64 bots. llvm-svn: 286818
* Improve handling of floating point literals in OpenCL to only use double ↵Neil Hickey2016-11-141-2/+10
| | | | | | | | | | | | | | precision if the target supports fp64. This change makes sure single-precision floating point types are used if the cl_fp64 extension is not supported by the target. Also removed the check to see whether the OpenCL version is >= 1.2, as this has been incorporated into the extension setting code. Differential Revision: https://reviews.llvm.org/D24235 llvm-svn: 286815
* [OpenCL] Override supported OpenCL extensions with -cl-ext optionAlexey Bader2016-11-011-1/+25
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: This patch adds a command line option '-cl-ext' to control a set of supported OpenCL extensions. Option accepts a comma-separated list of extensions prefixed with '+' or '-'. It can be used together with a target triple to override support for some extensions: // spir target supports all extensions, but we want to disable fp64 clang -cc1 -triple spir-unknown-unknown -cl-ext=-cl_khr_fp64 Special 'all' extension allows to enable or disable all possible extensions: // only fp64 will be supported clang -cc1 -triple spir-unknown-unknown -cl-ext=-all,+cl_khr_fp64 Patch by asavonic (Andrew Savonichev). Reviewers: joey, yaxunl Subscribers: yaxunl, bader, Anastasia, cfe-commits Differential Revision: https://reviews.llvm.org/D23712 llvm-svn: 285700
* Reverting r281714 due to causing an assert when calling builtins that expect ↵Neil Hickey2016-09-191-10/+1
| | | | | | a double, from CL llvm-svn: 281899
* Improve handling of floating point literals in OpenCL to only use double ↵Neil Hickey2016-09-161-1/+10
| | | | | | | | precision if the target supports fp64 https://reviews.llvm.org/D24235 llvm-svn: 281714
* [OpenCL] Add supported OpenCL extensions to target info.Yaxun Liu2016-05-161-0/+36
| | | | | | | | | | Add supported OpenCL extensions to target info. It serves as default values to save the users of the burden setting each supported extensions and optional core features in command line. Re-commit after fixing build error due to missing override attribute. Differential Revision: http://reviews.llvm.org/D19484 llvm-svn: 269670
* Revert "[OpenCL] Add supported OpenCL extensions to target info."Yaxun Liu2016-05-131-36/+0
| | | | | | | | | Revert r269431 due to build failure caused by warning msg: llvm/tools/clang/lib/Basic/Targets.cpp:2090:9: error: 'setSupportedOpenCLOpts' overrides a member function but is not marked 'override' [-Werror,-Winconsistent-missing-override] void setSupportedOpenCLOpts() { llvm-svn: 269435
* [OpenCL] Add supported OpenCL extensions to target info.Yaxun Liu2016-05-131-0/+36
Add supported OpenCL extensions to target info. It serves as default values to save the users of the burden setting each supported extensions and optional core features in command line. Differential Revision: http://reviews.llvm.org/D19484 llvm-svn: 269431
OpenPOWER on IntegriCloud