blob: ed925ce2fa4b7edddd918d6b9215455f1d469d33 [file] [log] [blame]
Sven van Haastregt79a222f2019-06-03 09:39:11 +00001//==--- OpenCLBuiltins.td - OpenCL builtin declarations -------------------===//
2//
3// The LLVM Compiler Infrastructure
4//
5// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
6// See https://llvm.org/LICENSE.txt for license information.
7// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
8//
9//===----------------------------------------------------------------------===//
10//
11// This file contains TableGen definitions for OpenCL builtin function
12// declarations. In case of an unresolved function name in OpenCL, Clang will
13// check for a function described in this file when -fdeclare-opencl-builtins
14// is specified.
15//
16//===----------------------------------------------------------------------===//
17
18//===----------------------------------------------------------------------===//
19// Definitions of miscellaneous basic entities.
20//===----------------------------------------------------------------------===//
21// Versions of OpenCL
22class Version<int _Version> {
23 int Version = _Version;
24}
25def CL10: Version<100>;
26def CL11: Version<110>;
27def CL12: Version<120>;
28def CL20: Version<200>;
29
30// Address spaces
31// Pointer types need to be assigned an address space.
32class AddressSpace<string _AS> {
Sven van Haastregt89fb9e82019-07-29 14:55:29 +000033 string Name = _AS;
Sven van Haastregt79a222f2019-06-03 09:39:11 +000034}
Sven van Haastregt89fb9e82019-07-29 14:55:29 +000035def DefaultAS : AddressSpace<"clang::LangAS::Default">;
36def PrivateAS : AddressSpace<"clang::LangAS::opencl_private">;
37def GlobalAS : AddressSpace<"clang::LangAS::opencl_global">;
38def ConstantAS : AddressSpace<"clang::LangAS::opencl_constant">;
39def LocalAS : AddressSpace<"clang::LangAS::opencl_local">;
40def GenericAS : AddressSpace<"clang::LangAS::opencl_generic">;
Sven van Haastregt79a222f2019-06-03 09:39:11 +000041
42
Sven van Haastregtb21a3652019-08-19 11:56:03 +000043// Qualified Type. These map to ASTContext::QualType.
44class QualType<string _Name, bit _IsAbstract=0> {
Sven van Haastregt79a222f2019-06-03 09:39:11 +000045 // Name of the field or function in a clang::ASTContext
46 // E.g. Name="IntTy" for the int type, and "getIntPtrType()" for an intptr_t
47 string Name = _Name;
Sven van Haastregtb21a3652019-08-19 11:56:03 +000048 // Some QualTypes in this file represent an abstract type for which there is
49 // no corresponding AST QualType, e.g. a GenType or an `image2d_t` type
50 // without access qualifiers.
51 bit IsAbstract = _IsAbstract;
Sven van Haastregt79a222f2019-06-03 09:39:11 +000052}
53
Sven van Haastregtb21a3652019-08-19 11:56:03 +000054// List of integers.
55class IntList<string _Name, list<int> _List> {
56 string Name = _Name;
57 list<int> List = _List;
58}
59
Sven van Haastregt79a222f2019-06-03 09:39:11 +000060//===----------------------------------------------------------------------===//
61// OpenCL C classes for types
62//===----------------------------------------------------------------------===//
Sven van Haastregtb21a3652019-08-19 11:56:03 +000063// OpenCL C basic data types (int, float, image2d_t, ...).
64// Its Child classes can represent concrete types (e.g.: VectorType) or
65// custom types (e.g.: GenType).
66// Instances of these child classes should be used in Builtin function
67// arguments. See the definition of the "read_imagef" function as example.
Sven van Haastregt79a222f2019-06-03 09:39:11 +000068class Type<string _Name, QualType _QTName> {
Sven van Haastregtb21a3652019-08-19 11:56:03 +000069 // Name of the Type.
Sven van Haastregt79a222f2019-06-03 09:39:11 +000070 string Name = _Name;
Sven van Haastregtb21a3652019-08-19 11:56:03 +000071 // QualType associated with this type.
Sven van Haastregt79a222f2019-06-03 09:39:11 +000072 QualType QTName = _QTName;
Sven van Haastregtb21a3652019-08-19 11:56:03 +000073 // Size of the vector (if applicable).
74 int VecWidth = 1;
75 // Is a pointer.
Sven van Haastregt79a222f2019-06-03 09:39:11 +000076 bit IsPointer = 0;
Sven van Haastregtcc0ba282019-08-20 12:21:03 +000077 // "const" qualifier.
78 bit IsConst = 0;
79 // "volatile" qualifier.
80 bit IsVolatile = 0;
Sven van Haastregt79a222f2019-06-03 09:39:11 +000081 // Access qualifier. Must be one of ("RO", "WO", "RW").
82 string AccessQualifier = "";
Sven van Haastregtb21a3652019-08-19 11:56:03 +000083 // Address space.
Sven van Haastregtcc0ba282019-08-20 12:21:03 +000084 string AddrSpace = DefaultAS.Name;
Sven van Haastregt79a222f2019-06-03 09:39:11 +000085}
86
Sven van Haastregtcc0ba282019-08-20 12:21:03 +000087// OpenCL vector types (e.g. int2, int3, int16, float8, ...).
Sven van Haastregt79a222f2019-06-03 09:39:11 +000088class VectorType<Type _Ty, int _VecWidth> : Type<_Ty.Name, _Ty.QTName> {
Sven van Haastregtcc0ba282019-08-20 12:21:03 +000089 let VecWidth = _VecWidth;
90 // Inherited fields
91 let IsPointer = _Ty.IsPointer;
92 let IsConst = _Ty.IsConst;
93 let IsVolatile = _Ty.IsVolatile;
94 let AccessQualifier = _Ty.AccessQualifier;
95 let AddrSpace = _Ty.AddrSpace;
Sven van Haastregt79a222f2019-06-03 09:39:11 +000096}
97
Sven van Haastregtb21a3652019-08-19 11:56:03 +000098// OpenCL pointer types (e.g. int*, float*, ...).
Sven van Haastregtcc0ba282019-08-20 12:21:03 +000099class PointerType<Type _Ty, AddressSpace _AS = DefaultAS> :
Sven van Haastregt79a222f2019-06-03 09:39:11 +0000100 Type<_Ty.Name, _Ty.QTName> {
Sven van Haastregtcc0ba282019-08-20 12:21:03 +0000101 let AddrSpace = _AS.Name;
102 // Inherited fields
103 let VecWidth = _Ty.VecWidth;
104 let IsPointer = 1;
105 let IsConst = _Ty.IsConst;
106 let IsVolatile = _Ty.IsVolatile;
107 let AccessQualifier = _Ty.AccessQualifier;
108}
109
110// OpenCL const types (e.g. const int).
111class ConstType<Type _Ty> : Type<_Ty.Name, _Ty.QTName> {
112 let IsConst = 1;
113 // Inherited fields
114 let VecWidth = _Ty.VecWidth;
115 let IsPointer = _Ty.IsPointer;
116 let IsVolatile = _Ty.IsVolatile;
117 let AccessQualifier = _Ty.AccessQualifier;
118 let AddrSpace = _Ty.AddrSpace;
119}
120
121// OpenCL volatile types (e.g. volatile int).
122class VolatileType<Type _Ty> : Type<_Ty.Name, _Ty.QTName> {
123 let IsVolatile = 1;
124 // Inherited fields
125 let VecWidth = _Ty.VecWidth;
126 let IsPointer = _Ty.IsPointer;
127 let IsConst = _Ty.IsConst;
128 let AccessQualifier = _Ty.AccessQualifier;
129 let AddrSpace = _Ty.AddrSpace;
Sven van Haastregt79a222f2019-06-03 09:39:11 +0000130}
131
132// OpenCL image types (e.g. image2d_t, ...)
133class ImageType<Type _Ty, QualType _QTName, string _AccessQualifier> :
134 Type<_Ty.Name, _QTName> {
135 let AccessQualifier = _AccessQualifier;
136}
137
Sven van Haastregtb21a3652019-08-19 11:56:03 +0000138// List of Types.
139class TypeList<string _Name, list<Type> _Type> {
140 string Name = _Name;
141 list<Type> List = _Type;
142}
143
144// A GenericType is an abstract type that defines a set of types as a
145// combination of Types and vector sizes.
146//
147// E.g.: If TypeList = <int, float> and VectorList = <1, 2, 4>, then it
148// represents <int, int2, int4, float, float2, float4>.
149// _Ty : Name of the GenType.
150// _TypeList : List of basic data Types.
151// _VectorList : Sizes of the vector for each type of the _TypeList, 1 being a
152// scalar.
153//
154// Some rules apply when using multiple GenericType arguments in a declaration:
155// 1. The number of vector sizes must be equal or 1 for all gentypes in a
156// declaration.
157// 2. The number of Types must be equal or 1 for all gentypes in a
158// declaration.
159// 3. Generic types are combined by iterating over all generic types at once.
160// For example, for the following GenericTypes
161// GenT1 = GenericType<half, [1, 2]> and
162// GenT2 = GenericType<float, int, [1, 2]>
163// A declaration f(GenT1, GenT2) results in the combinations
164// f(half, float), f(half2, float2), f(half, int), f(half2, int2) .
165// 4. "sgentype" from the OpenCL specification is supported by specifying
166// a single vector size.
167// For example, for the following GenericTypes
168// GenT = GenericType<half, int, [1, 2]> and
169// SGenT = GenericType<half, int, [1]>
170// A declaration f(GenT, SGenT) results in the combinations
171// f(half, half), f(half2, half), f(int, int), f(int2, int) .
172class GenericType<string _Ty, TypeList _TypeList, IntList _VectorList> :
173 Type<_Ty, QualType<"null", 1>> {
174 // Possible element types of the generic type.
175 TypeList TypeList = _TypeList;
176 // Possible vector sizes of the types in the TypeList.
177 IntList VectorList = _VectorList;
178 // The VecWidth field is ignored for GenericTypes. Use VectorList instead.
179 let VecWidth = 0;
180}
181
Sven van Haastregt79a222f2019-06-03 09:39:11 +0000182//===----------------------------------------------------------------------===//
183// OpenCL C class for builtin functions
184//===----------------------------------------------------------------------===//
185class Builtin<string _Name, list<Type> _Signature> {
186 // Name of the builtin function
187 string Name = _Name;
188 // List of types used by the function. The first one is the return type and
189 // the following are the arguments. The list must have at least one element
190 // (the return type).
191 list<Type> Signature = _Signature;
192 // OpenCL Extension to which the function belongs (cl_khr_subgroups, ...)
193 string Extension = "";
194 // OpenCL Version to which the function belongs (CL10, ...)
195 Version Version = CL10;
196}
197
198//===----------------------------------------------------------------------===//
Sven van Haastregt79a222f2019-06-03 09:39:11 +0000199// Definitions of OpenCL C types
200//===----------------------------------------------------------------------===//
Sven van Haastregtb21a3652019-08-19 11:56:03 +0000201
202// OpenCL v1.0/1.2/2.0 s6.1.1: Built-in Scalar Data Types.
Sven van Haastregt89fb9e82019-07-29 14:55:29 +0000203def Bool : Type<"bool", QualType<"BoolTy">>;
204def Char : Type<"char", QualType<"CharTy">>;
205def UChar : Type<"uchar", QualType<"UnsignedCharTy">>;
206def Short : Type<"short", QualType<"ShortTy">>;
207def UShort : Type<"ushort", QualType<"UnsignedShortTy">>;
208def Int : Type<"int", QualType<"IntTy">>;
209def UInt : Type<"uint", QualType<"UnsignedIntTy">>;
210def Long : Type<"long", QualType<"LongTy">>;
211def ULong : Type<"ulong", QualType<"UnsignedLongTy">>;
212def Float : Type<"float", QualType<"FloatTy">>;
213def Double : Type<"double", QualType<"DoubleTy">>;
214def Half : Type<"half", QualType<"HalfTy">>;
215def Size : Type<"size_t", QualType<"getSizeType()">>;
216def PtrDiff : Type<"ptrdiff_t", QualType<"getPointerDiffType()">>;
217def IntPtr : Type<"intptr_t", QualType<"getIntPtrType()">>;
218def UIntPtr : Type<"uintPtr_t", QualType<"getUIntPtrType()">>;
219def Void : Type<"void_t", QualType<"VoidTy">>;
Sven van Haastregt79a222f2019-06-03 09:39:11 +0000220
Sven van Haastregtb21a3652019-08-19 11:56:03 +0000221// OpenCL v1.0/1.2/2.0 s6.1.2: Built-in Vector Data Types.
222// Built-in vector data types are created by TableGen's OpenCLBuiltinEmitter.
Sven van Haastregt79a222f2019-06-03 09:39:11 +0000223
224// OpenCL v1.2 s6.1.3: Other Built-in Data Types
225// These definitions with a "null" name are "abstract". They should not
226// be used in definitions of Builtin functions.
Sven van Haastregtb21a3652019-08-19 11:56:03 +0000227def image2d_t : Type<"image2d_t", QualType<"null", 1>>;
228def image3d_t : Type<"image3d_t", QualType<"null", 1>>;
229def image2d_array_t : Type<"image2d_array_t", QualType<"null", 1>>;
230def image1d_t : Type<"image1d_t", QualType<"null", 1>>;
231def image1d_buffer_t : Type<"image1d_buffer_t", QualType<"null", 1>>;
232def image1d_array_t : Type<"image1d_array_t", QualType<"null", 1>>;
Sven van Haastregt79a222f2019-06-03 09:39:11 +0000233// Unlike the few functions above, the following definitions can be used
234// in definitions of Builtin functions (they have a QualType with a name).
235foreach v = ["RO", "WO", "RW"] in {
236 def image2d_#v#_t : ImageType<image2d_t,
237 QualType<"OCLImage2d"#v#"Ty">,
238 v>;
239 def image3d_#v#_t : ImageType<image3d_t,
240 QualType<"OCLImage3d"#v#"Ty">,
241 v>;
242 def image2d_array#v#_t : ImageType<image2d_array_t,
243 QualType<"OCLImage2dArray"#v#"Ty">,
244 v>;
245 def image1d_#v#_t : ImageType<image1d_t,
246 QualType<"OCLImage1d"#v#"Ty">,
247 v>;
248 def image1d_buffer#v#_t : ImageType<image1d_buffer_t,
249 QualType<"OCLImage1dBuffer"#v#"Ty">,
250 v>;
251 def image1d_array#v#_t : ImageType<image1d_array_t,
252 QualType<"OCLImage1dArray"#v#"Ty">,
253 v>;
254}
255
Sven van Haastregt89fb9e82019-07-29 14:55:29 +0000256def Sampler : Type<"Sampler", QualType<"OCLSamplerTy">>;
257def Event : Type<"Event", QualType<"OCLEventTy">>;
Sven van Haastregt79a222f2019-06-03 09:39:11 +0000258
259//===----------------------------------------------------------------------===//
Sven van Haastregtb21a3652019-08-19 11:56:03 +0000260// Definitions of OpenCL gentype variants
261//===----------------------------------------------------------------------===//
262// The OpenCL specification often uses "gentype" in builtin function
263// declarations to indicate that a builtin function is available with various
264// argument and return types. The types represented by "gentype" vary between
265// different parts of the specification. The following definitions capture
266// the different type lists for gentypes in different parts of the
267// specification.
268
269// Vector width lists.
270def VecAndScalar: IntList<"VecAndScalar", [1, 2, 3, 4, 8, 16]>;
271def VecNoScalar : IntList<"VecNoScalar", [2, 3, 4, 8, 16]>;
272def Vec1 : IntList<"Vec1", [1]>;
273
274// Type lists.
Sven van Haastregtcc0ba282019-08-20 12:21:03 +0000275def TLAll : TypeList<"TLAll", [Char, UChar, Short, UShort, Int, UInt, Long, ULong, Float, Double, Half]>;
Sven van Haastregtb21a3652019-08-19 11:56:03 +0000276def TLFloat : TypeList<"TLFloat", [Float, Double, Half]>;
277
278def TLAllInts : TypeList<"TLAllInts", [Char, UChar, Short, UShort, Int, UInt, Long, ULong]>;
279
280// GenType definitions for multiple base types (e.g. all floating point types,
281// or all integer types).
Sven van Haastregtcc0ba282019-08-20 12:21:03 +0000282// All types
283def AGenTypeN : GenericType<"AGenTypeN", TLAll, VecAndScalar>;
284def AGenTypeNNoScalar : GenericType<"AGenTypeNNoScalar", TLAll, VecNoScalar>;
Sven van Haastregtb21a3652019-08-19 11:56:03 +0000285// All integer
286def AIGenType1 : GenericType<"AIGenType1", TLAllInts, Vec1>;
287def AIGenTypeN : GenericType<"AIGenTypeN", TLAllInts, VecAndScalar>;
288def AIGenTypeNNoScalar : GenericType<"AIGenTypeNNoScalar", TLAllInts, VecNoScalar>;
289// Float
290def FGenTypeN : GenericType<"FGenTypeN", TLFloat, VecAndScalar>;
291
292// GenType definitions for every single base type (e.g. fp32 only).
293// Names are like: GenTypeFloatVecAndScalar.
294foreach Type = [Char, UChar, Short, UShort,
295 Int, UInt, Long, ULong,
296 Float, Double, Half] in {
297 foreach VecSizes = [VecAndScalar, VecNoScalar] in {
298 def "GenType" # Type # VecSizes :
299 GenericType<"GenType" # Type # VecSizes,
300 TypeList<"GL" # Type.Name, [Type]>,
301 VecSizes>;
302 }
303}
304
305
306//===----------------------------------------------------------------------===//
Sven van Haastregt79a222f2019-06-03 09:39:11 +0000307// Definitions of OpenCL builtin functions
308//===----------------------------------------------------------------------===//
Sven van Haastregt89fb9e82019-07-29 14:55:29 +0000309//--------------------------------------------------------------------
310// OpenCL v1.1/1.2/2.0 s6.2.3 - Explicit conversions.
311// OpenCL v2.0 Extensions s5.1.1 and s6.1.1 - Conversions.
312
313// Generate the convert_* builtins functions.
314foreach RType = [Float, Double, Half, Char, UChar, Short,
315 UShort, Int, UInt, Long, ULong] in {
316 foreach IType = [Float, Double, Half, Char, UChar, Short,
317 UShort, Int, UInt, Long, ULong] in {
Sven van Haastregt79a222f2019-06-03 09:39:11 +0000318 foreach sat = ["", "_sat"] in {
Sven van Haastregt89fb9e82019-07-29 14:55:29 +0000319 foreach rnd = ["", "_rte", "_rtn", "_rtp", "_rtz"] in {
320 def : Builtin<"convert_" # RType.Name # sat # rnd, [RType, IType]>;
Sven van Haastregt79a222f2019-06-03 09:39:11 +0000321 foreach v = [2, 3, 4, 8, 16] in {
Sven van Haastregt89fb9e82019-07-29 14:55:29 +0000322 def : Builtin<"convert_" # RType.Name # v # sat # rnd,
Sven van Haastregt79a222f2019-06-03 09:39:11 +0000323 [VectorType<RType, v>,
324 VectorType<IType, v>]>;
325 }
326 }
327 }
328 }
329}
330
Sven van Haastregtcc0ba282019-08-20 12:21:03 +0000331//--------------------------------------------------------------------
332// OpenCL v1.1 s6.11.10, v1.2 s6.12.10, v2.0 s6.13.10: Async Copies from Global to Local Memory, Local to Global Memory, and Prefetch
333// OpenCL Extension v2.0 s5.1.7 and s6.1.7: Async Copies from Global to Local Memory, Local to Global Memory, and Prefetch
334// --- Table 18 ---
335foreach name = ["async_work_group_copy"] in {
336 def : Builtin<name, [Event, PointerType<AGenTypeN, LocalAS>, PointerType<ConstType<AGenTypeN>, GlobalAS>, Size, Event]>;
337 def : Builtin<name, [Event, PointerType<AGenTypeN, GlobalAS>, PointerType<ConstType<AGenTypeN>, LocalAS>, Size, Event]>;
338}
339foreach name = ["async_work_group_strided_copy"] in {
340 def : Builtin<name, [Event, PointerType<AGenTypeN, LocalAS>, PointerType<ConstType<AGenTypeN>, GlobalAS>, Size, Size, Event]>;
341 def : Builtin<name, [Event, PointerType<AGenTypeN, GlobalAS>, PointerType<ConstType<AGenTypeN>, LocalAS>, Size, Size, Event]>;
342}
343foreach name = ["wait_group_events"] in {
344 def : Builtin<name, [Void, Int, PointerType<Event, GenericAS>]>;
345}
346foreach name = ["prefetch"] in {
347 def : Builtin<name, [Void, PointerType<ConstType<AGenTypeN>, GlobalAS>, Size]>;
348}
349
350//--------------------------------------------------------------------
351// OpenCL v2.0 s6.13.11 - Atomics Functions.
352// Functions that use memory_order and cl_mem_fence_flags enums are not
353// declared here as the TableGen backend does not handle enums.
354
355// OpenCL v1.0 s9.5, s9.6, s9.7 - Atomic Functions for 32-bit integers.
356// --- Table 9.1 ---
357foreach Type = [Int, UInt] in {
358 foreach name = ["atom_add", "atom_sub", "atom_xchg"] in {
359 def : Builtin<name, [Type, PointerType<VolatileType<Type>, GlobalAS>, Type]>;
360 }
361 foreach name = ["atom_inc", "atom_dec"] in {
362 def : Builtin<name, [Type, PointerType<VolatileType<Type>, GlobalAS>]>;
363 }
364 foreach name = ["atom_cmpxchg"] in {
365 def : Builtin<name, [Type, PointerType<VolatileType<Type>, GlobalAS>, Type, Type]>;
366 }
367}
368
Sven van Haastregt79a222f2019-06-03 09:39:11 +0000369// OpenCL v1.2 s6.12.1: Work-Item Functions
Sven van Haastregt89fb9e82019-07-29 14:55:29 +0000370def get_work_dim : Builtin<"get_work_dim", [UInt]>;
Sven van Haastregt79a222f2019-06-03 09:39:11 +0000371foreach name = ["get_global_size", "get_global_id", "get_local_size",
372 "get_local_id", "get_num_groups", "get_group_id",
373 "get_global_offset"] in {
Sven van Haastregt89fb9e82019-07-29 14:55:29 +0000374 def : Builtin<name, [Size, UInt]>;
Sven van Haastregt79a222f2019-06-03 09:39:11 +0000375}
376
377// OpenCL v1.2 s6.12.2: Math Functions
378foreach name = ["acos", "acosh", "acospi",
379 "asin", "asinh", "asinpi",
380 "atan", "atanh", "atanpi"] in {
Sven van Haastregtb21a3652019-08-19 11:56:03 +0000381 def : Builtin<name, [FGenTypeN, FGenTypeN]>;
Sven van Haastregt79a222f2019-06-03 09:39:11 +0000382}
383
384foreach name = ["atan2", "atan2pi"] in {
Sven van Haastregtb21a3652019-08-19 11:56:03 +0000385 def : Builtin<name, [FGenTypeN, FGenTypeN, FGenTypeN]>;
Sven van Haastregt79a222f2019-06-03 09:39:11 +0000386}
387
388foreach name = ["fmax", "fmin"] in {
Sven van Haastregtb21a3652019-08-19 11:56:03 +0000389 def : Builtin<name, [FGenTypeN, FGenTypeN, FGenTypeN]>;
390 def : Builtin<name, [GenTypeFloatVecNoScalar, GenTypeFloatVecNoScalar, Float]>;
391 def : Builtin<name, [GenTypeDoubleVecNoScalar, GenTypeDoubleVecNoScalar, Double]>;
392 def : Builtin<name, [GenTypeHalfVecNoScalar, GenTypeHalfVecNoScalar, Half]>;
393}
394
395// OpenCL v1.1 s6.11.3, v1.2 s6.12.3, v2.0 s6.13.3 - Integer Functions
396foreach name = ["max", "min"] in {
397 def : Builtin<name, [AIGenTypeN, AIGenTypeN, AIGenTypeN]>;
398 def : Builtin<name, [AIGenTypeNNoScalar, AIGenTypeNNoScalar, AIGenType1]>;
Sven van Haastregt79a222f2019-06-03 09:39:11 +0000399}
400
401// OpenCL v1.2 s6.12.14: Built-in Image Read Functions
402def read_imagef : Builtin<"read_imagef",
Sven van Haastregtb21a3652019-08-19 11:56:03 +0000403 [VectorType<Float, 4>, image2d_RO_t, VectorType<Int, 2>]>;
Sven van Haastregt79a222f2019-06-03 09:39:11 +0000404def write_imagef : Builtin<"write_imagef",
Sven van Haastregt89fb9e82019-07-29 14:55:29 +0000405 [Void,
Sven van Haastregt79a222f2019-06-03 09:39:11 +0000406 image2d_WO_t,
Sven van Haastregt89fb9e82019-07-29 14:55:29 +0000407 VectorType<Int, 2>,
408 VectorType<Float, 4>]>;
Sven van Haastregt79a222f2019-06-03 09:39:11 +0000409
410
411// OpenCL v2.0 s9.17.3: Additions to section 6.13.1: Work-Item Functions
412let Version = CL20 in {
413 let Extension = "cl_khr_subgroups" in {
Sven van Haastregt89fb9e82019-07-29 14:55:29 +0000414 def get_sub_group_size : Builtin<"get_sub_group_size", [UInt]>;
415 def get_max_sub_group_size : Builtin<"get_max_sub_group_size", [UInt]>;
416 def get_num_sub_groups : Builtin<"get_num_sub_groups", [UInt]>;
Sven van Haastregt79a222f2019-06-03 09:39:11 +0000417 }
418}