|
| 1 | +#ifndef __CLC_CLC_AS_TYPE_H__ |
| 2 | +#define __CLC_CLC_AS_TYPE_H__ |
| 3 | + |
| 4 | +#define __clc_as_char(x) __builtin_astype(x, char) |
| 5 | +#define __clc_as_uchar(x) __builtin_astype(x, uchar) |
| 6 | +#define __clc_as_short(x) __builtin_astype(x, short) |
| 7 | +#define __clc_as_ushort(x) __builtin_astype(x, ushort) |
| 8 | +#define __clc_as_int(x) __builtin_astype(x, int) |
| 9 | +#define __clc_as_uint(x) __builtin_astype(x, uint) |
| 10 | +#define __clc_as_long(x) __builtin_astype(x, long) |
| 11 | +#define __clc_as_ulong(x) __builtin_astype(x, ulong) |
| 12 | +#define __clc_as_float(x) __builtin_astype(x, float) |
| 13 | + |
| 14 | +#define __clc_as_char2(x) __builtin_astype(x, char2) |
| 15 | +#define __clc_as_uchar2(x) __builtin_astype(x, uchar2) |
| 16 | +#define __clc_as_short2(x) __builtin_astype(x, short2) |
| 17 | +#define __clc_as_ushort2(x) __builtin_astype(x, ushort2) |
| 18 | +#define __clc_as_int2(x) __builtin_astype(x, int2) |
| 19 | +#define __clc_as_uint2(x) __builtin_astype(x, uint2) |
| 20 | +#define __clc_as_long2(x) __builtin_astype(x, long2) |
| 21 | +#define __clc_as_ulong2(x) __builtin_astype(x, ulong2) |
| 22 | +#define __clc_as_float2(x) __builtin_astype(x, float2) |
| 23 | + |
| 24 | +#define __clc_as_char3(x) __builtin_astype(x, char3) |
| 25 | +#define __clc_as_uchar3(x) __builtin_astype(x, uchar3) |
| 26 | +#define __clc_as_short3(x) __builtin_astype(x, short3) |
| 27 | +#define __clc_as_ushort3(x) __builtin_astype(x, ushort3) |
| 28 | +#define __clc_as_int3(x) __builtin_astype(x, int3) |
| 29 | +#define __clc_as_uint3(x) __builtin_astype(x, uint3) |
| 30 | +#define __clc_as_long3(x) __builtin_astype(x, long3) |
| 31 | +#define __clc_as_ulong3(x) __builtin_astype(x, ulong3) |
| 32 | +#define __clc_as_float3(x) __builtin_astype(x, float3) |
| 33 | + |
| 34 | +#define __clc_as_char4(x) __builtin_astype(x, char4) |
| 35 | +#define __clc_as_uchar4(x) __builtin_astype(x, uchar4) |
| 36 | +#define __clc_as_short4(x) __builtin_astype(x, short4) |
| 37 | +#define __clc_as_ushort4(x) __builtin_astype(x, ushort4) |
| 38 | +#define __clc_as_int4(x) __builtin_astype(x, int4) |
| 39 | +#define __clc_as_uint4(x) __builtin_astype(x, uint4) |
| 40 | +#define __clc_as_long4(x) __builtin_astype(x, long4) |
| 41 | +#define __clc_as_ulong4(x) __builtin_astype(x, ulong4) |
| 42 | +#define __clc_as_float4(x) __builtin_astype(x, float4) |
| 43 | + |
| 44 | +#define __clc_as_char8(x) __builtin_astype(x, char8) |
| 45 | +#define __clc_as_uchar8(x) __builtin_astype(x, uchar8) |
| 46 | +#define __clc_as_short8(x) __builtin_astype(x, short8) |
| 47 | +#define __clc_as_ushort8(x) __builtin_astype(x, ushort8) |
| 48 | +#define __clc_as_int8(x) __builtin_astype(x, int8) |
| 49 | +#define __clc_as_uint8(x) __builtin_astype(x, uint8) |
| 50 | +#define __clc_as_long8(x) __builtin_astype(x, long8) |
| 51 | +#define __clc_as_ulong8(x) __builtin_astype(x, ulong8) |
| 52 | +#define __clc_as_float8(x) __builtin_astype(x, float8) |
| 53 | + |
| 54 | +#define __clc_as_char16(x) __builtin_astype(x, char16) |
| 55 | +#define __clc_as_uchar16(x) __builtin_astype(x, uchar16) |
| 56 | +#define __clc_as_short16(x) __builtin_astype(x, short16) |
| 57 | +#define __clc_as_ushort16(x) __builtin_astype(x, ushort16) |
| 58 | +#define __clc_as_int16(x) __builtin_astype(x, int16) |
| 59 | +#define __clc_as_uint16(x) __builtin_astype(x, uint16) |
| 60 | +#define __clc_as_long16(x) __builtin_astype(x, long16) |
| 61 | +#define __clc_as_ulong16(x) __builtin_astype(x, ulong16) |
| 62 | +#define __clc_as_float16(x) __builtin_astype(x, float16) |
| 63 | + |
| 64 | +#ifdef cl_khr_fp64 |
| 65 | +#define __clc_as_double(x) __builtin_astype(x, double) |
| 66 | +#define __clc_as_double2(x) __builtin_astype(x, double2) |
| 67 | +#define __clc_as_double3(x) __builtin_astype(x, double3) |
| 68 | +#define __clc_as_double4(x) __builtin_astype(x, double4) |
| 69 | +#define __clc_as_double8(x) __builtin_astype(x, double8) |
| 70 | +#define __clc_as_double16(x) __builtin_astype(x, double16) |
| 71 | +#endif |
| 72 | + |
| 73 | +#ifdef cl_khr_fp16 |
| 74 | +#define __clc_as_half(x) __builtin_astype(x, half) |
| 75 | +#define __clc_as_half2(x) __builtin_astype(x, half2) |
| 76 | +#define __clc_as_half3(x) __builtin_astype(x, half3) |
| 77 | +#define __clc_as_half4(x) __builtin_astype(x, half4) |
| 78 | +#define __clc_as_half8(x) __builtin_astype(x, half8) |
| 79 | +#define __clc_as_half16(x) __builtin_astype(x, half16) |
| 80 | +#endif |
| 81 | + |
| 82 | +#endif // __CLC_CLC_AS_TYPE_H__ |
0 commit comments