1 #define _CLC_VLOAD_DECL(SUFFIX, MEM_TYPE, VEC_TYPE, WIDTH, ADDR_SPACE) \
2 _CLC_OVERLOAD _CLC_DECL VEC_TYPE vload##SUFFIX##WIDTH(size_t offset, const ADDR_SPACE MEM_TYPE *x);
4 #define _CLC_VECTOR_VLOAD_DECL(SUFFIX, MEM_TYPE, PRIM_TYPE, ADDR_SPACE) \
5 _CLC_VLOAD_DECL(SUFFIX, MEM_TYPE, PRIM_TYPE##2, 2, ADDR_SPACE) \
6 _CLC_VLOAD_DECL(SUFFIX, MEM_TYPE, PRIM_TYPE##3, 3, ADDR_SPACE) \
7 _CLC_VLOAD_DECL(SUFFIX, MEM_TYPE, PRIM_TYPE##4, 4, ADDR_SPACE) \
8 _CLC_VLOAD_DECL(SUFFIX, MEM_TYPE, PRIM_TYPE##8, 8, ADDR_SPACE) \
9 _CLC_VLOAD_DECL(SUFFIX, MEM_TYPE, PRIM_TYPE##16, 16, ADDR_SPACE)
11 #define _CLC_VECTOR_VLOAD_PRIM3(SUFFIX, MEM_TYPE, PRIM_TYPE) \
12 _CLC_VECTOR_VLOAD_DECL(SUFFIX, MEM_TYPE, PRIM_TYPE, __private) \
13 _CLC_VECTOR_VLOAD_DECL(SUFFIX, MEM_TYPE, PRIM_TYPE, __local) \
14 _CLC_VECTOR_VLOAD_DECL(SUFFIX, MEM_TYPE, PRIM_TYPE, __constant) \
15 _CLC_VECTOR_VLOAD_DECL(SUFFIX, MEM_TYPE, PRIM_TYPE, __global)
17 #define _CLC_VECTOR_VLOAD_PRIM1(PRIM_TYPE) \
18 _CLC_VECTOR_VLOAD_PRIM3(, PRIM_TYPE, PRIM_TYPE)
20 // Declare vector load prototypes
21 _CLC_VECTOR_VLOAD_PRIM1(char)
22 _CLC_VECTOR_VLOAD_PRIM1(uchar
)
23 _CLC_VECTOR_VLOAD_PRIM1(short)
24 _CLC_VECTOR_VLOAD_PRIM1(ushort
)
25 _CLC_VECTOR_VLOAD_PRIM1(int)
26 _CLC_VECTOR_VLOAD_PRIM1(uint
)
27 _CLC_VECTOR_VLOAD_PRIM1(long)
28 _CLC_VECTOR_VLOAD_PRIM1(ulong
)
29 _CLC_VECTOR_VLOAD_PRIM1(float)
30 _CLC_VECTOR_VLOAD_PRIM3(_half
, half
, float)
31 // Use suffix to declare aligned vloada_halfN
32 _CLC_VECTOR_VLOAD_PRIM3(a_half
, half
, float)
35 #pragma OPENCL EXTENSION cl_khr_fp64: enable
36 _CLC_VECTOR_VLOAD_PRIM1(double)
39 #pragma OPENCL EXTENSION cl_khr_fp16: enable
40 _CLC_VECTOR_VLOAD_PRIM1(half
)
43 // Scalar vload_half also needs to be declared
44 _CLC_VLOAD_DECL(_half
, half
, float, , __constant
)
45 _CLC_VLOAD_DECL(_half
, half
, float, , __global
)
46 _CLC_VLOAD_DECL(_half
, half
, float, , __local
)
47 _CLC_VLOAD_DECL(_half
, half
, float, , __private
)
49 // Scalar vloada_half is not part of the specs but CTS expects it
50 _CLC_VLOAD_DECL(a_half
, half
, float, , __constant
)
51 _CLC_VLOAD_DECL(a_half
, half
, float, , __global
)
52 _CLC_VLOAD_DECL(a_half
, half
, float, , __local
)
53 _CLC_VLOAD_DECL(a_half
, half
, float, , __private
)
55 #undef _CLC_VLOAD_DECL
56 #undef _CLC_VECTOR_VLOAD_DECL
57 #undef _CLC_VECTOR_VLOAD_PRIM3
58 #undef _CLC_VECTOR_VLOAD_PRIM1