summaryrefslogtreecommitdiff
path: root/generic/include/clc/shared/vstore.h
blob: 1f784f82fec0c6bf30b991b2350c020d18442328 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
#define _CLC_VSTORE_DECL(PRIM_TYPE, VEC_TYPE, WIDTH, ADDR_SPACE) \
  _CLC_OVERLOAD _CLC_DECL void vstore##WIDTH(VEC_TYPE vec, size_t offset, ADDR_SPACE PRIM_TYPE *out);

#define _CLC_VECTOR_VSTORE_DECL(PRIM_TYPE, ADDR_SPACE) \
  _CLC_VSTORE_DECL(PRIM_TYPE, PRIM_TYPE##2, 2, ADDR_SPACE) \
  _CLC_VSTORE_DECL(PRIM_TYPE, PRIM_TYPE##3, 3, ADDR_SPACE) \
  _CLC_VSTORE_DECL(PRIM_TYPE, PRIM_TYPE##4, 4, ADDR_SPACE) \
  _CLC_VSTORE_DECL(PRIM_TYPE, PRIM_TYPE##8, 8, ADDR_SPACE) \
  _CLC_VSTORE_DECL(PRIM_TYPE, PRIM_TYPE##16, 16, ADDR_SPACE)

#define _CLC_VECTOR_VSTORE_PRIM1(PRIM_TYPE) \
  _CLC_VECTOR_VSTORE_DECL(PRIM_TYPE, __private) \
  _CLC_VECTOR_VSTORE_DECL(PRIM_TYPE, __local) \
  _CLC_VECTOR_VSTORE_DECL(PRIM_TYPE, __global) \

#define _CLC_VECTOR_VSTORE_PRIM() \
    _CLC_VECTOR_VSTORE_PRIM1(char) \
    _CLC_VECTOR_VSTORE_PRIM1(uchar) \
    _CLC_VECTOR_VSTORE_PRIM1(short) \
    _CLC_VECTOR_VSTORE_PRIM1(ushort) \
    _CLC_VECTOR_VSTORE_PRIM1(int) \
    _CLC_VECTOR_VSTORE_PRIM1(uint) \
    _CLC_VECTOR_VSTORE_PRIM1(long) \
    _CLC_VECTOR_VSTORE_PRIM1(ulong) \
    _CLC_VECTOR_VSTORE_PRIM1(float) \
        
#ifdef cl_khr_fp64
#define _CLC_VECTOR_VSTORE() \
  _CLC_VECTOR_VSTORE_PRIM1(double) \
  _CLC_VECTOR_VSTORE_PRIM()
#else
#define _CLC_VECTOR_VSTORE() \
  _CLC_VECTOR_VSTORE_PRIM()
#endif

_CLC_VECTOR_VSTORE()