summaryrefslogtreecommitdiffstats
path: root/clang/lib/Headers/opencl-c.h
Commit message (Collapse)AuthorAgeFilesLines
* [OpenCL] Fix declaration of enqueue_markerYaxun Liu2019-08-221-1/+1
| | | | | | Differential Revision: https://reviews.llvm.org/D66512 llvm-svn: 369641
* [OpenCL] Fix lang mode predefined macros for C++ mode.Anastasia Stulova2019-08-121-105/+105
| | | | | | | | | | | | | In C++ mode we should only avoid adding __OPENCL_C_VERSION__, all other predefined macros about the language mode are still valid. This change also fixes the language version check in the headers accordingly. Differential Revision: https://reviews.llvm.org/D65941 llvm-svn: 368552
* [OpenCL] Remove more duplicates from opencl-c.hSven van Haastregt2019-06-241-29/+0
| | | | | | | | Identified the duplicate declarations using sort lib/Headers/opencl-c.h | uniq -c | grep ' 2' llvm-svn: 364173
* [OpenCL][PR41963] Add generic addr space to old atomics in C++ modeAnastasia Stulova2019-06-211-0/+45
| | | | | | | | | Add overloads with generic address space pointer to old atomics. This is currently only added for C++ compilation mode. Differential Revision: https://reviews.llvm.org/D62335 llvm-svn: 364071
* [OpenCL] Remove duplicate read_image declarationsSven van Haastregt2019-06-211-47/+0
| | | | | | Patch by Pierre Gondois. llvm-svn: 364020
* [OpenCL] Split type and macro definitions into opencl-c-base.hSven van Haastregt2019-06-191-535/+2
| | | | | | | | | | | | | | | | Using the -fdeclare-opencl-builtins option will require a way to predefine types and macros such as `int4`, `CLK_GLOBAL_MEM_FENCE`, etc. Move these out of opencl-c.h into opencl-c-base.h such that the latter can be shared by -fdeclare-opencl-builtins and -finclude-default-header. This changes the behaviour of -finclude-default-header when -fdeclare-opencl-builtins is specified: instead of including the full header, it will include the header with only the base definitions. Differential revision: https://reviews.llvm.org/D63256 llvm-svn: 363794
* [OpenCL] Undefine cl_intel_planar_yuv extensionAndrew Savonichev2019-06-031-3/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: Remove unnecessary definition (otherwise the extension will be defined where it's not supposed to be defined). Consider the code: #pragma OPENCL EXTENSION cl_intel_planar_yuv : begin // some declarations #pragma OPENCL EXTENSION cl_intel_planar_yuv : end is enough for extension to become known for clang. Patch by: Dmitry Sidorov <dmitry.sidorov@intel.com> Reviewers: Anastasia, yaxunl Reviewed By: Anastasia Tags: #clang Differential Revision: https://reviews.llvm.org/D58666 llvm-svn: 362398
* [OpenCL] Add support for the cl_arm_integer_dot_product extensionsKevin Petit2019-05-241-0/+28
| | | | | | | | | The specification is available in the Khronos OpenCL registry: https://www.khronos.org/registry/OpenCL/extensions/arm/cl_arm_integer_dot_product.txt Signed-off-by: Kevin Petit <kevin.petit@arm.com> llvm-svn: 361641
* OpenCL: Use length modifier for warning on vector printf argumentsMatt Arsenault2019-01-291-1/+1
| | | | | | | | | | | | Re-enable format string warnings on printf. The warnings are still incomplete. Apparently it is undefined to use a vector specifier without a length modifier, which is not currently warned on. Additionally, type warnings appear to not be working with the hh modifier, and aren't warning on all of the special restrictions from c99 printf. llvm-svn: 352540
* Revert "OpenCL: Extend argument promotion rules to vector types"Matt Arsenault2019-01-291-1/+1
| | | | | | | | | | | | This reverts r348083. This was based on a misreading of the spec for printf specifiers. Also revert r343653, as without a subsequent patch, a correctly specified format for a vector will incorrectly warn. Fixes bug 40491. llvm-svn: 352539
* Update the file headers across all of the LLVM projects in the monorepoChandler Carruth2019-01-191-4/+3
| | | | | | | | | | | | | | | | | to reflect the new license. We understand that people may be surprised that we're moving the header entirely to discuss the new license. We checked this carefully with the Foundation's lawyer and we believe this is the correct approach. Essentially, all code in the project is now made available by the LLVM project under our new license, so you will see that the license headers include that license only. Some of our contributors have contributed code under our old license, and accordingly, we have retained a copy of our old license notice in the top-level files in each project and repository. llvm-svn: 351636
* [OpenCL] opencl-c.h: read_image*(): sampler-less, and image{1,2}d_array_t ↵Roman Lebedev2019-01-151-2/+15
| | | | | | | | | | | | | | | | | | | | | | | | | | variants are OpenCL-1.2+, mark them as such Summary: Refer to [[ https://www.khronos.org/registry/OpenCL/specs/opencl-1.1.pdf#page=242 | `6.11.13.2 Built-in Image Functions` ]], and [[ https://www.khronos.org/registry/OpenCL/specs/opencl-1.1.pdf#page=306 | `9.6.8 Image Read and Write Functions` ]] of the OpenCL 1.1 spec. * There is no mention of `image1d_array_t` and `image2d_array_t` anywhere in the OpenCL 1.1 spec. * All the `read_image{f,i,ui,h}()` functions, as of OpenCL 1.1 spec, have a second required parameter `sampler_t sampler` Should have prevented the following regression: https://redmine.darktable.org/issues/12493 Reviewers: yaxunl, Anastasia, echuraev, asavonic Reviewed By: Anastasia Subscribers: cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D56646 llvm-svn: 351188
* [OpenCL] Add support of cl_intel_device_side_avc_motion_estimation extensionAndrew Savonichev2018-11-081-0/+631
| | | | | | | | | | | | | | | | | | Summary: Documentation can be found at https://www.khronos.org/registry/OpenCL/extensions/intel/cl_intel_device_side_avc_motion_estimation.txt Patch by Kristina Bessonova Reviewers: Anastasia, yaxunl, shafik Reviewed By: Anastasia Subscribers: arphaman, sidorovd, AlexeySotkin, krisb, bader, asavonic, cfe-commits Differential Revision: https://reviews.llvm.org/D51484 llvm-svn: 346392
* Revert r346326 [OpenCL] Add support of ↵Andrew Savonichev2018-11-071-631/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | cl_intel_device_side_avc_motion_estimation This patch breaks Index/opencl-types.cl LIT test: Script: -- : 'RUN: at line 1'; stage1/bin/c-index-test -test-print-type llvm/tools/clang/test/Index/opencl-types.cl -cl-std=CL2.0 | stage1/bin/FileCheck llvm/tools/clang/test/Index/opencl-types.cl -- Command Output (stderr): -- llvm/tools/clang/test/Index/opencl-types.cl:3:26: warning: unsupported OpenCL extension 'cl_khr_fp16' - ignoring [-Wignored-pragmas] llvm/tools/clang/test/Index/opencl-types.cl:4:26: warning: unsupported OpenCL extension 'cl_khr_fp64' - ignoring [-Wignored-pragmas] llvm/tools/clang/test/Index/opencl-types.cl:8:9: error: use of type 'double' requires cl_khr_fp64 extension to be enabled llvm/tools/clang/test/Index/opencl-types.cl:11:8: error: declaring variable of type 'half' is not allowed llvm/tools/clang/test/Index/opencl-types.cl:15:3: error: use of type 'double' requires cl_khr_fp64 extension to be enabled llvm/tools/clang/test/Index/opencl-types.cl:16:3: error: use of type 'double4' (vector of 4 'double' values) requires cl_khr_fp64 extension to be enabled llvm/tools/clang/test/Index/opencl-types.cl:26:26: warning: unsupported OpenCL extension 'cl_khr_gl_msaa_sharing' - ignoring [-Wignored-pragmas] llvm/tools/clang/test/Index/opencl-types.cl:35:44: error: use of type '__read_only image2d_msaa_t' requires cl_khr_gl_msaa_sharing extension to be enabled llvm/tools/clang/test/Index/opencl-types.cl:36:49: error: use of type '__read_only image2d_array_msaa_t' requires cl_khr_gl_msaa_sharing extension to be enabled llvm/tools/clang/test/Index/opencl-types.cl:37:49: error: use of type '__read_only image2d_msaa_depth_t' requires cl_khr_gl_msaa_sharing extension to be enabled llvm/tools/clang/test/Index/opencl-types.cl:38:54: error: use of type '__read_only image2d_array_msaa_depth_t' requires cl_khr_gl_msaa_sharing extension to be enabled llvm-svn: 346338
* [OpenCL] Add support of cl_intel_device_side_avc_motion_estimation extensionAndrew Savonichev2018-11-071-0/+631
| | | | | | | | | | | | | | | | | | Summary: Documentation can be found at https://www.khronos.org/registry/OpenCL/extensions/intel/cl_intel_device_side_avc_motion_estimation.txt Patch by Kristina Bessonova Reviewers: Anastasia, yaxunl, shafik Reviewed By: Anastasia Subscribers: arphaman, sidorovd, AlexeySotkin, krisb, bader, asavonic, cfe-commits Differential Revision: https://reviews.llvm.org/D51484 llvm-svn: 346326
* [OpenCL] Remove PIPE_RESERVE_ID_VALID_BIT from opencl-c.hAndrew Savonichev2018-10-231-1/+0
| | | | | | | | | | | | | | | | | Summary: PIPE_RESERVE_ID_VALID_BIT is implementation defined, so lets not keep it in the header. Previously the topic was discussed here: https://reviews.llvm.org/D32896 Reviewers: Anastasia, yaxunl Reviewed By: Anastasia Subscribers: cfe-commits, asavonic, bader Differential Revision: https://reviews.llvm.org/D52658 llvm-svn: 345051
* [OpenCL] Add cl_intel_planar_yuv extensionAndrew Savonichev2018-10-231-0/+8
| | | | | | | | | | Just adding a preprocessor #define for the extension. Patch by Alexey Sotkin and Dmitry Sidorov Phabricator review: https://reviews.llvm.org/D51402 llvm-svn: 345044
* OpenCL: Mark printf format string argumentMatt Arsenault2018-10-031-1/+1
| | | | | | Fixes not warning on format string errors. llvm-svn: 343653
* Remove trailing spaceFangrui Song2018-07-301-4/+4
| | | | | | sed -Ei 's/[[:space:]]+$//' include/**/*.{def,h,td} lib/**/*.{cpp,h} llvm-svn: 338291
* [NFC] fix trivial typos in commentsHiroshi Inoue2018-01-291-2/+2
| | | | | | "to to" -> "to" llvm-svn: 323627
* [OpenCL] Reorder the CLK_sRGBx/sRGBA defines, NFCSven van Haastregt2018-01-111-1/+1
| | | | | | | Swap them so that all channel order defines are ordered according to their values. llvm-svn: 322278
* [OpenCL] Add extensions cl_intel_subgroups and cl_intel_subgroups_shortAlexey Sotkin2017-11-271-0/+307
| | | | | | | | | | | | Reviewers: yaxunl, Anastasia, bader Reviewed By: Anastasia, bader Subscribers: cfe-commits Differential Revision: https://reviews.llvm.org/D39936 llvm-svn: 319011
* [OpenCL] Remove extra select functions from opencl-c.hYaxun Liu2017-08-051-324/+10
| | | | | | | | | | | | | | | | | | | OpenCL spec v2.0 s6.13.6: gentype select (gentype a, gentype b, igentype c) gentype select (gentype a, gentype b, ugentype c) igentype and ugentype must have the same number of elements and bits as gentype. Differential Revision: https://reviews.llvm.org/D36259 llvm-svn: 310160
* Add OpenCL 2.0 atomic builtin functions as Clang builtinYaxun Liu2017-08-041-12/+13
| | | | | | | | | | | | | | | | | | | | | OpenCL 2.0 atomic builtin functions have a scope argument which is ideally represented as synchronization scope argument in LLVM atomic instructions. Clang supports translating Clang atomic builtin functions to LLVM atomic instructions. However it currently does not support synchronization scope of LLVM atomic instructions. Without this, users have to use LLVM assembly code to implement OpenCL atomic builtin functions. This patch adds OpenCL 2.0 atomic builtin functions as Clang builtin functions, which supports generating LLVM atomic instructions with synchronization scope operand. Currently only constant memory scope argument is supported. Support of non-constant memory scope argument will be added later. Differential Revision: https://reviews.llvm.org/D28691 llvm-svn: 310082
* [OpenCL] Added checking OpenCL version for cl_khr_mipmap_image built-insEgor Churaev2017-05-101-4/+10
| | | | | | | | | | | | Reviewers: Anastasia, cfe-commits Reviewed By: Anastasia Subscribers: bader, yaxunl Differential Revision: https://reviews.llvm.org/D32897 llvm-svn: 302630
* [OpenCL] Fix extension guards for atomic functionsAnastasia Stulova2017-03-201-4/+2
| | | | | | | | Review: D30830 Patch by James Price! llvm-svn: 298256
* [OpenCL] Implement as_type operator as alias of __builtin_astype.Egor Churaev2017-03-161-766/+74
| | | | | | | | | | | | Reviewers: Anastasia Reviewed By: Anastasia Subscribers: cfe-commits, yaxunl, bader Differential Revision: https://reviews.llvm.org/D28136 llvm-svn: 297947
* [OpenCL] Correct ndrange_t implementationAnastasia Stulova2017-02-161-4/+0
| | | | | | | | | | | | | | | Removed ndrange_t as Clang builtin type and added as a struct type in the OpenCL header. Use type name to do the Sema checking in enqueue_kernel and modify IR generation accordingly. Review: D28058 Patch by Dmitry Borisenkov! llvm-svn: 295311
* [OpenCL] Diagnose write_only image3d when extension is disabledAnastasia Stulova2017-01-251-0/+34
| | | | | | | | | | | | | | Prior to OpenCL 2.0, image3d_t can only be used with the write_only access qualifier when the cl_khr_3d_image_writes extension is enabled, see e.g. OpenCL 1.1 s6.8b. Require the extension for write_only image3d_t types and guard uses of write_only image3d_t in the OpenCL header. Patch by Sven van Haastregt! Review: https://reviews.llvm.org/D28860 llvm-svn: 293050
* Recommit r289979 [OpenCL] Allow disabling types and declarations associated ↵Yaxun Liu2016-12-181-0/+4
| | | | | | | | 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-4/+0
| | | | llvm-svn: 289991
* [OpenCL] Allow disabling types and declarations associated with extensionsYaxun Liu2016-12-161-0/+4
| | | | | | | | | | | | | | | | | | 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
* [OpenCL] Mark group functions as convergent in opencl-c.hYaxun Liu2016-11-011-167/+168
| | | | | | | | | | Certain OpenCL builtin functions are supposed to be executed by all threads in a work group or sub group. Such functions should not be made divergent during transformation. It makes sense to mark them with convergent attribute. The adding of convergent attribute is based on Ettore Speziale's work and the original proposal and patch can be found at https://www.mail-archive.com/cfe-commits@lists.llvm.org/msg22271.html. Differential Revision: https://reviews.llvm.org/D25343 llvm-svn: 285725
* [OpenCL] Diagnose variadic argumentsAnastasia Stulova2016-10-281-0/+2
| | | | | | | | | | | | | | OpenCL disallows using variadic arguments (s6.9.e and s6.12.5 OpenCL v2.0) apart from some exceptions: - printf - enqueue_kernel This change adds error diagnostic for variadic functions but accepts printf and any compiler internal function (which should cover __enqueue_kernel_XXX cases). It also unifies diagnostic with block prototype and adds missing uncaught cases for blocks. llvm-svn: 285395
* [OpenCL] Add missing atom_xor for 64 bit to opencl-c.hYaxun Liu2016-10-251-0/+7
| | | | | | Differential Revision: https://reviews.llvm.org/D25954 llvm-svn: 285125
* [OpenCL] Make is_valid_event, create_user_event overloadable.Alexey Bader2016-08-301-2/+2
| | | | | | | | | | | | | | Summary: Make is_valid_event and create_user_event overloadable like other built-ins. Patch by Evgeniy Tyurin. Reviewers: bader, yaxunl Subscribers: Anastasia, cfe-commits Differential Revision: https://reviews.llvm.org/D23914 llvm-svn: 280097
* [OpenCL] AMDGPU: Add extensions cl_amd_media_ops and cl_amd_media_ops2Yaxun Liu2016-08-161-0/+190
| | | | | | Differential Revision: https://reviews.llvm.org/D23322 llvm-svn: 278851
* [OpenCL] Remove extra native_ functions from opencl-c.hYaxun Liu2016-08-041-112/+0
| | | | | | | | | | There should be no native_ builtin functions with double type arguments. Patch by Aaron En Ye Shi. Differential Revision : https://reviews.llvm.org/D23071 llvm-svn: 277754
* [OpenCL] Added CLK_ABGR definition for get_image_channel_order return valueYaxun Liu2016-07-291-0/+1
| | | | | | | | | | Added CLK_ABGR definition for get_image_channel_order return value inside opencl-c.h file. Patch by Aaron En Ye Shi. Differential Revision: https://reviews.llvm.org/D22767 llvm-svn: 277179
* [OpenCL] An implementation of device side enqueue (DSE) from OpenCL v2.0 ↵Anastasia Stulova2016-07-051-6/+0
| | | | | | | | | | | | | | | | | s6.13.17. - Added new Builtins: enqueue_kernel, get_kernel_work_group_size and get_kernel_preferred_work_group_size_multiple. These Builtins use custom check to diagnose parameters of the passed Blocks i. e. variable number of 'local void*' type params, and check different overloads specified in Table 6.31 of OpenCL v2.0. - IR is generated as an internal library call for each OpenCL Builtin, reusing ObjC Block implementation. Review: http://reviews.llvm.org/D20249 llvm-svn: 274540
* [OpenCL] Add attribute 'pure' to read_image built-in functions to enable ↵Alexey Bader2016-06-291-215/+215
| | | | | | | | | | | | optimizations. Reviewers: Anastasia, yaxunl Subscribers: pekka.jaaskelainen, pxli168, cfe-commits Differential Revision: http://reviews.llvm.org/D21795 llvm-svn: 274122
* [OpenCL] Add the default header file opencl-c.h for OpenCL C languageYaxun Liu2016-05-301-0/+16968
| | | | | | | | | | | | OpenCL has large number of "builtin" functions ("builtin" in the sense of OpenCL spec) which are defined in header files. To compile OpenCL kernels using these builtin functions, a header file is needed. This header file is based on the Khronos implementation (https://github.com/KhronosGroup/SPIR/blob/spirv-1.0/lib/Headers/opencl.h) with heavy refactoring. Re-commit after fixing failures on ppc64/systemz etc. Differential Revision: http://reviews.llvm.org/D18369 llvm-svn: 271197
* Revert r271136 [OpenCL] Add the default header file opencl-c.h for OpenCL C ↵Yaxun Liu2016-05-281-16902/+0
| | | | | | language due to build failure on ppc64/hexagon/systemz. llvm-svn: 271144
* [OpenCL] Add the default header file opencl-c.h for OpenCL C languageYaxun Liu2016-05-281-0/+16902
OpenCL has large number of "builtin" functions ("builtin" in the sense of OpenCL spec) which are defined in header files. To compile OpenCL kernels using these builtin functions, a header file is needed. This header file is based on the Khronos implementation (https://github.com/KhronosGroup/SPIR/blob/spirv-1.0/lib/Headers/opencl.h) with heavy refactoring. Differential Revision: http://reviews.llvm.org/D18369 llvm-svn: 271136
OpenPOWER on IntegriCloud