summaryrefslogtreecommitdiffstats
path: root/clang/test/CodeGenOpenCL/kernel-arg-info.cl
Commit message (Collapse)AuthorAgeFilesLines
* [OpenCL] Fix access qualifiers metadata for kernel arguments with typedefAlexey Sotkin2017-07-261-0/+22
| | | | | | | | Subscribers: cfe-commits, yaxunl, Anastasia Differential Revision: https://reviews.llvm.org/D35420 llvm-svn: 309155
* [OpenCL] Added extended tests on metadata generation for half data type and ↵Egor Churaev2017-07-181-9/+28
| | | | | | | | | | | | | | arrays. Reviewers: Anastasia Reviewed By: Anastasia Subscribers: bader, cfe-commits, yaxunl Differential Revision: https://reviews.llvm.org/D35000 llvm-svn: 308266
* [OpenCL] Do not generate "kernel_arg_type_qual" metadata for non-pointer argsEgor Churaev2017-03-311-6/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: "kernel_arg_type_qual" metadata should contain const/volatile/restrict tags only for pointer types to match the corresponding requirement of the OpenCL specification. OpenCL 2.0 spec 5.9.3 Kernel Object Queries: CL_KERNEL_ARG_TYPE_VOLATILE is returned if the argument is a pointer and the referenced type is declared with the volatile qualifier. [...] Similarly, CL_KERNEL_ARG_TYPE_CONST is returned if the argument is a pointer and the referenced type is declared with the restrict or const qualifier. [...] CL_KERNEL_ARG_TYPE_RESTRICT will be returned if the pointer type is marked restrict. Reviewers: Anastasia, cfe-commits Reviewed By: Anastasia Subscribers: bader, yaxunl Differential Revision: https://reviews.llvm.org/D31321 llvm-svn: 299192
* [OpenCL] Remove access qualifiers on images in arg info metadata.Alexey Bader2016-09-061-10/+10
| | | | | | | | | | | | | | | | | | | | | | | | Summary: Remove access qualifiers on images in arg info metadata: * kernel_arg_type * kernel_arg_base_type Image access qualifiers are inseparable from type in clang implementation, but OpenCL spec provides a special query to get access qualifier via clGetKernelArgInfo with CL_KERNEL_ARG_ACCESS_QUALIFIER. Besides that OpenCL conformance test_api get_kernel_arg_info expects image types without access qualifier. Patch by Evgeniy Tyurin. Reviewers: bader, yaxunl, Anastasia Subscribers: cfe-commits Differential Revision: https://reviews.llvm.org/D23915 llvm-svn: 280699
* [OpenCL] Fix access qualifiers handling for typedefsAlexey Bader2016-07-081-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | OpenCL s6.6: "Access qualifier must be used with image object arguments of kernels and of user-defined functions [...] If no qualifier is provided, read_only is assumed". This does not define the behavior for image types used in typedef declaration, but following the spec logic, we should allow access qualifiers specification in typedefs, e.g.: typedef write_only image1d_t img1d_wo; Unlike cv-qualifiers, user cannot add access qualifier to a typedef type, i.e. this is not allowed: typedef image1d_t img1d; // note: previously declared 'read_only' here void foo(write_only img1d im) {} // error: multiple access qualifier Patch by Andrew Savonichev. Reviewers: Anastasia Stulova. Differential revision: http://reviews.llvm.org/D20948 llvm-svn: 274858
* [OpenCL] Use function metadata to represent kernel attributesYaxun Liu2016-06-221-36/+69
| | | | | | | | This patch uses function metadata to represent reqd_work_group_size, work_group_size_hint and vector_type_hint kernel attributes and kernel argument info. Differential Revision: http://reviews.llvm.org/D20979 llvm-svn: 273425
* IR: Make metadata typeless in assembly, clang sideDuncan P. N. Exon Smith2014-12-151-33/+33
| | | | | | Match LLVM changes from r224257. llvm-svn: 224259
* Always emit kernel arg info for SPIR.Sameer Sahasrabuddhe2014-12-041-6/+12
| | | | | | | | | | | | | | | http://llvm.org/bugs/show_bug.cgi?id=21555 Currently, kernel argument metadata is omitted unless the "-cl-kernel-arg-info" option is specified. But the SPIR 1.2 spec requires that all metadata except kernel_arg_name should always be emitted, and kernel_arg_name is only emitted when "-cl-kernel-arg-info" is specified. Patch ported by Ryan Burn from the Khronos SPIR generator. https://github.com/KhronosGroup/SPIR llvm-svn: 223340
* Add OpenCL/SPIR kernel_arg_base_type metadata nodeFraser Cormack2014-07-301-0/+12
| | | | | | | | | | | | | | As defined in the SPIR 1.2 specification, this node behaves similarly to kernel_arg_type but will print the underlying type name, e.g., without typedefs. Example: typedef unsigned int myunsignedint; would report: 'myunsignedint' in the kernel_arg_type node 'uint' in the kernel_arg_base_type node llvm-svn: 214308
* Fix OpenCL/SPIR kernel_arg_type metadata nodeFraser Cormack2014-07-301-0/+9
| | | | | | | | | | | | This fixes a bug where kernel_arg_type was always changing 'unsigned ' to 'u' for any parameter type, including non-canonical types. Example: typedef unsigned int myunsignedint; would report: "myunt" llvm-svn: 214305
* When printing types for the OpenCL kernel metadata, use the PrintingPolicy.Joey Gouly2014-04-041-0/+8
| | | | | | | | This allows 'half' to be printed as 'half' and not as '__fp16'. Patch by Fraser Cormack! llvm-svn: 205624
* The OpenCL specification states that images are allocated Pekka Jaaskelainen2014-01-091-1/+1
| | | | | | | | | | | from the global address space (6.5.1 of the OpenCL 1.2 specification). This makes clang construct the image arguments in the global address space and generate the argument metadata with the correct address space descriptor. Patch by Pedro Ferreira! llvm-svn: 198868
* Generate metadata to implement the -cl-kernel-arg-info option.Guy Benyei2013-03-241-3/+16
| | | | | | OpenCL 1.2 spec. 5.7.3. llvm-svn: 177839
* Fix an OpenCL test case. Pointer arguments to kernels must be declared with theJoey Gouly2013-02-211-1/+1
| | | | | | __global, __constant or __local qualifier. llvm-svn: 175735
* Add OpenCL metadata for kernel arg names. This output is controlled via a ↵Tanya Lattner2012-07-111-0/+7
flag as noted in the OpenCL Spec. Includes a test case. llvm-svn: 160092
OpenPOWER on IntegriCloud