LLVM  14.0.0git
cl_common_defines.h
Go to the documentation of this file.
1 #ifndef CL_COMMON_DEFINES_H
2 #define CL_COMMON_DEFINES_H
3 // This file includes defines that are common to both kernel code and
4 // the NVPTX back-end.
5 
6 //
7 // Common defines for Image intrinsics
8 // Channel order
9 enum {
10  CLK_R = 0x10B0,
11  CLK_A = 0x10B1,
12  CLK_RG = 0x10B2,
13  CLK_RA = 0x10B3,
14  CLK_RGB = 0x10B4,
15  CLK_RGBA = 0x10B5,
16  CLK_BGRA = 0x10B6,
17  CLK_ARGB = 0x10B7,
18 
19 #if (__NV_CL_C_VERSION == __NV_CL_C_VERSION_1_0)
20  CLK_xRGB = 0x10B7,
21 #endif
22 
23  CLK_INTENSITY = 0x10B8,
24  CLK_LUMINANCE = 0x10B9
25 
26 #if (__NV_CL_C_VERSION >= __NV_CL_C_VERSION_1_1)
27  ,
28  CLK_Rx = 0x10BA,
29  CLK_RGx = 0x10BB,
30  CLK_RGBx = 0x10BC
31 #endif
32 };
33 
34 typedef enum clk_channel_type {
35  // valid formats for float return types
36  CLK_SNORM_INT8 = 0x10D0, // four channel RGBA unorm8
37  CLK_SNORM_INT16 = 0x10D1, // four channel RGBA unorm16
38  CLK_UNORM_INT8 = 0x10D2, // four channel RGBA unorm8
39  CLK_UNORM_INT16 = 0x10D3, // four channel RGBA unorm16
40  CLK_HALF_FLOAT = 0x10DD, // four channel RGBA half
41  CLK_FLOAT = 0x10DE, // four channel RGBA float
42 
43 #if (__NV_CL_C_VERSION >= __NV_CL_C_VERSION_1_1)
47 #endif
48 
49  // valid only for integer return types
50  CLK_SIGNED_INT8 = 0x10D7,
51  CLK_SIGNED_INT16 = 0x10D8,
52  CLK_SIGNED_INT32 = 0x10D9,
56 
57  // CI SPI for CPU
58  __CLK_UNORM_INT8888, // four channel ARGB unorm8
59  __CLK_UNORM_INT8888R, // four channel BGRA unorm8
60 
63  __CLK_VALID_IMAGE_TYPE_MASK_BITS = 4, // number of bits required to
64  // represent any image type
67 
68 typedef enum clk_sampler_type {
75 
76 #if (__NV_CL_C_VERSION >= __NV_CL_C_VERSION_1_1)
78 #endif
82  __CLK_ADDRESS_BITS = 3, // number of bits required to
83  // represent address info
84 
90  __CLK_NORMALIZED_BITS = 1, // number of bits required to
91  // represent normalization
92 
99  __CLK_FILTER_BITS = 2, // number of bits required to
100  // represent address info
101 
108 
112 
115  (int) 0x80000000 >> (__CLK_ANISOTROPIC_RATIO_BITS - 1)
117 
118 // Memory synchronization
119 #define CLK_LOCAL_MEM_FENCE (1 << 0)
120 #define CLK_GLOBAL_MEM_FENCE (1 << 1)
121 
122 #endif // CL_COMMON_DEFINES_H
CLK_UNSIGNED_INT32
@ CLK_UNSIGNED_INT32
Definition: cl_common_defines.h:55
CLK_UNSIGNED_INT16
@ CLK_UNSIGNED_INT16
Definition: cl_common_defines.h:54
CLK_UNORM_SHORT_565
@ CLK_UNORM_SHORT_565
Definition: cl_common_defines.h:44
CLK_RA
@ CLK_RA
Definition: cl_common_defines.h:13
__CLK_ADDRESS_BASE
@ __CLK_ADDRESS_BASE
Definition: cl_common_defines.h:69
CLK_INTENSITY
@ CLK_INTENSITY
Definition: cl_common_defines.h:23
CLK_NORMALIZED_COORDS_TRUE
@ CLK_NORMALIZED_COORDS_TRUE
Definition: cl_common_defines.h:87
__CLK_SAMPLER_MASK
@ __CLK_SAMPLER_MASK
Definition: cl_common_defines.h:110
__CLK_VALID_IMAGE_TYPE_MASK
@ __CLK_VALID_IMAGE_TYPE_MASK
Definition: cl_common_defines.h:65
CLK_BGRA
@ CLK_BGRA
Definition: cl_common_defines.h:16
__CLK_MIP_BITS
@ __CLK_MIP_BITS
Definition: cl_common_defines.h:107
CLK_FILTER_ANISOTROPIC
@ CLK_FILTER_ANISOTROPIC
Definition: cl_common_defines.h:96
__CLK_MIP_MASK
@ __CLK_MIP_MASK
Definition: cl_common_defines.h:106
CLK_UNORM_INT16
@ CLK_UNORM_INT16
Definition: cl_common_defines.h:39
__CLK_INVALID_IMAGE_TYPE
@ __CLK_INVALID_IMAGE_TYPE
Definition: cl_common_defines.h:62
CLK_ADDRESS_CLAMP
@ CLK_ADDRESS_CLAMP
Definition: cl_common_defines.h:71
__CLK_NORMALIZED_BITS
@ __CLK_NORMALIZED_BITS
Definition: cl_common_defines.h:90
CLK_FILTER_LINEAR
@ CLK_FILTER_LINEAR
Definition: cl_common_defines.h:95
CLK_LUMINANCE
@ CLK_LUMINANCE
Definition: cl_common_defines.h:24
clk_sampler_type
clk_sampler_type
Definition: cl_common_defines.h:68
__CLK_UNORM_INT8888
@ __CLK_UNORM_INT8888
Definition: cl_common_defines.h:58
int
Clang compiles this i1 i64 store i64 i64 store i64 i64 store i64 i64 store i64 align Which gets codegen d xmm0 movaps rbp movaps rbp movaps rbp movaps rbp rbp rbp rbp rbp It would be better to have movq s of instead of the movaps s LLVM produces ret int
Definition: README.txt:536
CLK_ADDRESS_MIRRORED_REPEAT
@ CLK_ADDRESS_MIRRORED_REPEAT
Definition: cl_common_defines.h:77
__CLK_VALID_IMAGE_TYPE_MASK_BITS
@ __CLK_VALID_IMAGE_TYPE_MASK_BITS
Definition: cl_common_defines.h:63
CLK_ADDRESS_CLAMP_TO_EDGE
@ CLK_ADDRESS_CLAMP_TO_EDGE
Definition: cl_common_defines.h:72
CLK_HALF_FLOAT
@ CLK_HALF_FLOAT
Definition: cl_common_defines.h:40
CLK_RGBA
@ CLK_RGBA
Definition: cl_common_defines.h:15
__CLK_FILTER_MASK
@ __CLK_FILTER_MASK
Definition: cl_common_defines.h:97
CLK_ADDRESS_NONE
@ CLK_ADDRESS_NONE
Definition: cl_common_defines.h:70
__CLK_ANISOTROPIC_RATIO_BITS
@ __CLK_ANISOTROPIC_RATIO_BITS
Definition: cl_common_defines.h:113
CLK_SIGNED_INT8
@ CLK_SIGNED_INT8
Definition: cl_common_defines.h:50
CLK_RG
@ CLK_RG
Definition: cl_common_defines.h:12
CLK_UNORM_INT8
@ CLK_UNORM_INT8
Definition: cl_common_defines.h:38
CLK_Rx
@ CLK_Rx
Definition: cl_common_defines.h:28
__CLK_ANISOTROPIC_RATIO_MASK
@ __CLK_ANISOTROPIC_RATIO_MASK
Definition: cl_common_defines.h:114
CLK_SIGNED_INT32
@ CLK_SIGNED_INT32
Definition: cl_common_defines.h:52
CLK_RGB
@ CLK_RGB
Definition: cl_common_defines.h:14
CLK_ADDRESS_MIRROR
@ CLK_ADDRESS_MIRROR
Definition: cl_common_defines.h:74
__CLK_ADDRESS_BITS
@ __CLK_ADDRESS_BITS
Definition: cl_common_defines.h:82
CLK_RGBx
@ CLK_RGBx
Definition: cl_common_defines.h:30
CLK_ADDRESS_REPEAT
@ CLK_ADDRESS_REPEAT
Definition: cl_common_defines.h:73
__CLK_FILTER_BITS
@ __CLK_FILTER_BITS
Definition: cl_common_defines.h:99
CLK_MIP_NEAREST
@ CLK_MIP_NEAREST
Definition: cl_common_defines.h:103
__CLK_FILTER_BASE
@ __CLK_FILTER_BASE
Definition: cl_common_defines.h:93
__CLK_NORMALIZED_BASE
@ __CLK_NORMALIZED_BASE
Definition: cl_common_defines.h:85
CLK_SNORM_INT8
@ CLK_SNORM_INT8
Definition: cl_common_defines.h:36
__CLK_MIP_BASE
@ __CLK_MIP_BASE
Definition: cl_common_defines.h:102
__CLK_SAMPLER_BITS
@ __CLK_SAMPLER_BITS
Definition: cl_common_defines.h:109
CLK_ARGB
@ CLK_ARGB
Definition: cl_common_defines.h:17
__CLK_UNORM_INT8888R
@ __CLK_UNORM_INT8888R
Definition: cl_common_defines.h:59
CLK_MIP_ANISOTROPIC
@ CLK_MIP_ANISOTROPIC
Definition: cl_common_defines.h:105
CLK_FILTER_NEAREST
@ CLK_FILTER_NEAREST
Definition: cl_common_defines.h:94
CLK_RGx
@ CLK_RGx
Definition: cl_common_defines.h:29
__CLK_ADDRESS_MASK
@ __CLK_ADDRESS_MASK
Definition: cl_common_defines.h:79
CLK_R
@ CLK_R
Definition: cl_common_defines.h:10
CLK_MIP_LINEAR
@ CLK_MIP_LINEAR
Definition: cl_common_defines.h:104
CLK_UNSIGNED_INT8
@ CLK_UNSIGNED_INT8
Definition: cl_common_defines.h:53
CLK_SNORM_INT16
@ CLK_SNORM_INT16
Definition: cl_common_defines.h:37
CLK_A
@ CLK_A
Definition: cl_common_defines.h:11
CLK_NORMALIZED_COORDS_FALSE
@ CLK_NORMALIZED_COORDS_FALSE
Definition: cl_common_defines.h:86
CLK_UNORM_INT_101010
@ CLK_UNORM_INT_101010
Definition: cl_common_defines.h:46
__CLK_NORMALIZED_MASK
@ __CLK_NORMALIZED_MASK
Definition: cl_common_defines.h:88
CLK_SIGNED_INT16
@ CLK_SIGNED_INT16
Definition: cl_common_defines.h:51
CLK_UNORM_SHORT_555
@ CLK_UNORM_SHORT_555
Definition: cl_common_defines.h:45
CLK_xRGB
@ CLK_xRGB
Definition: cl_common_defines.h:20
__CLK_VALID_IMAGE_TYPE_COUNT
@ __CLK_VALID_IMAGE_TYPE_COUNT
Definition: cl_common_defines.h:61
clk_channel_type
clk_channel_type
Definition: cl_common_defines.h:34
CLK_FLOAT
@ CLK_FLOAT
Definition: cl_common_defines.h:41