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
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
#![allow(non_camel_case_types)]
use libc::c_void;
use std::default::Default;
pub type size_t = usize;
pub type intptr_t = isize;
pub type c_char = i8;
pub type c_uchar = u8;
pub type cl_platform_id = *mut c_void;
pub type cl_device_id = *mut c_void;
pub type cl_context = *mut c_void;
pub type cl_command_queue = *mut c_void;
pub type cl_mem = *mut c_void;
pub type cl_program = *mut c_void;
pub type cl_kernel = *mut c_void;
pub type cl_event = *mut c_void;
pub type cl_sampler = *mut c_void;
pub type cl_char = c_char;
pub type cl_uchar = u8;
pub type cl_short = i16;
pub type cl_ushort = u16;
pub type cl_int = i32;
pub type cl_uint = u32;
pub type cl_long = i64;
pub type cl_ulong = u64;
pub type cl_half = u16;
pub type cl_float = f32;
pub type cl_double = f64;
pub type cl_bool = cl_uint;
pub type cl_bitfield = cl_ulong;
pub type cl_properties = cl_ulong;
pub type cl_device_type = cl_bitfield;
pub type cl_platform_info = cl_uint;
pub type cl_device_info = cl_uint;
pub type cl_device_fp_config = cl_bitfield;
pub type cl_device_mem_cache_type = cl_uint;
pub type cl_device_local_mem_type = cl_uint;
pub type cl_device_exec_capabilities = cl_bitfield;
pub type cl_device_svm_capabilities = cl_bitfield;
pub type cl_command_queue_properties = cl_bitfield;
pub type cl_device_partition_property = intptr_t;
pub type cl_device_affinity_domain = cl_bitfield;
pub type cl_context_properties = intptr_t;
pub type cl_context_info = cl_uint;
pub type cl_queue_properties = cl_properties;
pub type cl_command_queue_info = cl_uint;
pub type cl_channel_order = cl_uint;
pub type cl_channel_type = cl_uint;
pub type cl_mem_flags = cl_bitfield;
pub type cl_svm_mem_flags = cl_bitfield;
pub type cl_mem_object_type = cl_uint;
pub type cl_mem_info = cl_uint;
pub type cl_mem_migration_flags = cl_bitfield;
pub type cl_image_info = cl_uint;
pub type cl_buffer_create_type = cl_uint;
pub type cl_addressing_mode = cl_uint;
pub type cl_filter_mode = cl_uint;
pub type cl_sampler_info = cl_uint;
pub type cl_map_flags = cl_bitfield;
pub type cl_pipe_properties = intptr_t;
pub type cl_pipe_info = cl_uint;
pub type cl_program_info = cl_uint;
pub type cl_program_build_info = cl_uint;
pub type cl_program_binary_type = cl_uint;
pub type cl_build_status = cl_int;
pub type cl_kernel_info = cl_uint;
pub type cl_kernel_arg_info = cl_uint;
pub type cl_kernel_arg_address_qualifier = cl_uint;
pub type cl_kernel_arg_access_qualifier = cl_uint;
pub type cl_kernel_arg_type_qualifier = cl_bitfield;
pub type cl_kernel_work_group_info = cl_uint;
pub type cl_kernel_sub_group_info = cl_uint;
pub type cl_event_info = cl_uint;
pub type cl_command_type = cl_uint;
pub type cl_profiling_info = cl_uint;
pub type cl_sampler_properties = cl_properties;
pub type cl_kernel_exec_info = cl_uint;
pub type cl_device_atomic_capabilities = cl_bitfield;
pub type cl_device_device_enqueue_capabilities = cl_bitfield;
pub type cl_khronos_vendor_id = cl_uint;
pub type cl_mem_properties = cl_properties;
pub type cl_version = cl_uint;
#[derive(Debug, Clone, PartialEq)]
#[repr(C)]
pub struct cl_image_format {
pub image_channel_order: cl_channel_order,
pub image_channel_data_type: cl_channel_type,
}
impl Default for cl_image_format {
fn default() -> Self {
Self {
image_channel_order: 0,
image_channel_data_type: 0,
}
}
}
#[derive(Debug, Clone, PartialEq)]
#[repr(C)]
pub struct cl_image_desc {
pub image_type: cl_mem_object_type,
pub image_width: size_t,
pub image_height: size_t,
pub image_depth: size_t,
pub image_array_size: size_t,
pub image_row_pitch: size_t,
pub image_slice_pitch: size_t,
pub num_mip_levels: cl_uint,
pub mem_samples: cl_uint,
pub mem_object: cl_mem,
}
impl Default for cl_image_desc {
fn default() -> Self {
Self {
image_type: 0,
image_width: 0,
image_height: 0,
image_depth: 0,
image_array_size: 0,
image_row_pitch: 0,
image_slice_pitch: 0,
num_mip_levels: 0,
mem_samples: 0,
mem_object: std::ptr::null_mut(),
}
}
}
#[derive(Debug, Clone, PartialEq)]
#[repr(C)]
pub struct cl_buffer_region {
pub origin: size_t,
pub size: size_t,
}
impl Default for cl_buffer_region {
fn default() -> Self {
Self { origin: 0, size: 0 }
}
}
pub const CL_NAME_VERSION_MAX_NAME_SIZE: usize = 64;
#[derive(Debug, Clone, PartialEq)]
#[repr(C)]
pub struct cl_name_version {
pub version: cl_version,
pub name: [c_char; CL_NAME_VERSION_MAX_NAME_SIZE],
}
impl Default for cl_name_version {
fn default() -> Self {
Self {
version: 0,
name: [0; 64],
}
}
}