|
1 | 1 | #ifndef CLC_AS_TYPE |
2 | 2 | #define CLC_AS_TYPE |
3 | 3 |
|
| 4 | +#define as_char(x) __builtin_astype(x, char) |
4 | 5 | #define as_schar(x) __builtin_astype(x, schar) |
| 6 | +#define as_uchar(x) __builtin_astype(x, uchar) |
| 7 | +#define as_short(x) __builtin_astype(x, short) |
| 8 | +#define as_ushort(x) __builtin_astype(x, ushort) |
| 9 | +#define as_int(x) __builtin_astype(x, int) |
| 10 | +#define as_uint(x) __builtin_astype(x, uint) |
| 11 | +#define as_long(x) __builtin_astype(x, long) |
| 12 | +#define as_ulong(x) __builtin_astype(x, ulong) |
| 13 | +#define as_float(x) __builtin_astype(x, float) |
| 14 | + |
| 15 | +#define as_char2(x) __builtin_astype(x, char2) |
5 | 16 | #define as_schar2(x) __builtin_astype(x, schar2) |
| 17 | +#define as_uchar2(x) __builtin_astype(x, uchar2) |
| 18 | +#define as_short2(x) __builtin_astype(x, short2) |
| 19 | +#define as_ushort2(x) __builtin_astype(x, ushort2) |
| 20 | +#define as_int2(x) __builtin_astype(x, int2) |
| 21 | +#define as_uint2(x) __builtin_astype(x, uint2) |
| 22 | +#define as_long2(x) __builtin_astype(x, long2) |
| 23 | +#define as_ulong2(x) __builtin_astype(x, ulong2) |
| 24 | +#define as_float2(x) __builtin_astype(x, float2) |
| 25 | + |
| 26 | +#define as_char3(x) __builtin_astype(x, char3) |
6 | 27 | #define as_schar3(x) __builtin_astype(x, schar3) |
| 28 | +#define as_uchar3(x) __builtin_astype(x, uchar3) |
| 29 | +#define as_short3(x) __builtin_astype(x, short3) |
| 30 | +#define as_ushort3(x) __builtin_astype(x, ushort3) |
| 31 | +#define as_int3(x) __builtin_astype(x, int3) |
| 32 | +#define as_uint3(x) __builtin_astype(x, uint3) |
| 33 | +#define as_long3(x) __builtin_astype(x, long3) |
| 34 | +#define as_ulong3(x) __builtin_astype(x, ulong3) |
| 35 | +#define as_float3(x) __builtin_astype(x, float3) |
| 36 | + |
| 37 | +#define as_char4(x) __builtin_astype(x, char4) |
7 | 38 | #define as_schar4(x) __builtin_astype(x, schar4) |
| 39 | +#define as_uchar4(x) __builtin_astype(x, uchar4) |
| 40 | +#define as_short4(x) __builtin_astype(x, short4) |
| 41 | +#define as_ushort4(x) __builtin_astype(x, ushort4) |
| 42 | +#define as_int4(x) __builtin_astype(x, int4) |
| 43 | +#define as_uint4(x) __builtin_astype(x, uint4) |
| 44 | +#define as_long4(x) __builtin_astype(x, long4) |
| 45 | +#define as_ulong4(x) __builtin_astype(x, ulong4) |
| 46 | +#define as_float4(x) __builtin_astype(x, float4) |
| 47 | + |
| 48 | +#define as_char8(x) __builtin_astype(x, char8) |
8 | 49 | #define as_schar8(x) __builtin_astype(x, schar8) |
| 50 | +#define as_uchar8(x) __builtin_astype(x, uchar8) |
| 51 | +#define as_short8(x) __builtin_astype(x, short8) |
| 52 | +#define as_ushort8(x) __builtin_astype(x, ushort8) |
| 53 | +#define as_int8(x) __builtin_astype(x, int8) |
| 54 | +#define as_uint8(x) __builtin_astype(x, uint8) |
| 55 | +#define as_long8(x) __builtin_astype(x, long8) |
| 56 | +#define as_ulong8(x) __builtin_astype(x, ulong8) |
| 57 | +#define as_float8(x) __builtin_astype(x, float8) |
| 58 | + |
| 59 | +#define as_char16(x) __builtin_astype(x, char16) |
9 | 60 | #define as_schar16(x) __builtin_astype(x, schar16) |
| 61 | +#define as_uchar16(x) __builtin_astype(x, uchar16) |
| 62 | +#define as_short16(x) __builtin_astype(x, short16) |
| 63 | +#define as_ushort16(x) __builtin_astype(x, ushort16) |
| 64 | +#define as_int16(x) __builtin_astype(x, int16) |
| 65 | +#define as_uint16(x) __builtin_astype(x, uint16) |
| 66 | +#define as_long16(x) __builtin_astype(x, long16) |
| 67 | +#define as_ulong16(x) __builtin_astype(x, ulong16) |
| 68 | +#define as_float16(x) __builtin_astype(x, float16) |
| 69 | + |
| 70 | +#ifdef cl_khr_fp64 |
| 71 | +#define as_double(x) __builtin_astype(x, double) |
| 72 | +#define as_double2(x) __builtin_astype(x, double2) |
| 73 | +#define as_double3(x) __builtin_astype(x, double3) |
| 74 | +#define as_double4(x) __builtin_astype(x, double4) |
| 75 | +#define as_double8(x) __builtin_astype(x, double8) |
| 76 | +#define as_double16(x) __builtin_astype(x, double16) |
| 77 | +#endif |
| 78 | + |
| 79 | +#ifdef cl_khr_fp16 |
| 80 | +#define as_half(x) __builtin_astype(x, half) |
| 81 | +#define as_half2(x) __builtin_astype(x, half2) |
| 82 | +#define as_half3(x) __builtin_astype(x, half3) |
| 83 | +#define as_half4(x) __builtin_astype(x, half4) |
| 84 | +#define as_half8(x) __builtin_astype(x, half8) |
| 85 | +#define as_half16(x) __builtin_astype(x, half16) |
| 86 | +#endif |
10 | 87 |
|
11 | 88 | #ifdef __CLC_HAS_FLOAT16 |
12 | 89 | #define as_float16_t(x) __builtin_astype(x, __clc_float16_t) |
|
0 commit comments