1#[repr(C)]
4#[derive(Default)]
5pub struct __IncompleteArrayField<T>(::core::marker::PhantomData<T>, [T; 0]);
6impl<T> __IncompleteArrayField<T> {
7 #[inline]
8 pub const fn new() -> Self {
9 __IncompleteArrayField(::core::marker::PhantomData, [])
10 }
11 #[inline]
12 pub fn as_ptr(&self) -> *const T {
13 self as *const _ as *const T
14 }
15 #[inline]
16 pub fn as_mut_ptr(&mut self) -> *mut T {
17 self as *mut _ as *mut T
18 }
19 #[inline]
20 pub unsafe fn as_slice(&self, len: usize) -> &[T] {
21 ::core::slice::from_raw_parts(self.as_ptr(), len)
22 }
23 #[inline]
24 pub unsafe fn as_mut_slice(&mut self, len: usize) -> &mut [T] {
25 ::core::slice::from_raw_parts_mut(self.as_mut_ptr(), len)
26 }
27}
28impl<T> ::core::fmt::Debug for __IncompleteArrayField<T> {
29 fn fmt(&self, fmt: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
30 fmt.write_str("__IncompleteArrayField")
31 }
32}
33pub const __GNUC_VA_LIST: u32 = 1;
34pub const __bool_true_false_are_defined: u32 = 1;
35pub const true_: u32 = 1;
36pub const false_: u32 = 0;
37pub const _STDINT_H: u32 = 1;
38pub const _FEATURES_H: u32 = 1;
39pub const _DEFAULT_SOURCE: u32 = 1;
40pub const __GLIBC_USE_ISOC2X: u32 = 0;
41pub const __USE_ISOC11: u32 = 1;
42pub const __USE_ISOC99: u32 = 1;
43pub const __USE_ISOC95: u32 = 1;
44pub const __USE_POSIX_IMPLICITLY: u32 = 1;
45pub const _POSIX_SOURCE: u32 = 1;
46pub const _POSIX_C_SOURCE: u32 = 200809;
47pub const __USE_POSIX: u32 = 1;
48pub const __USE_POSIX2: u32 = 1;
49pub const __USE_POSIX199309: u32 = 1;
50pub const __USE_POSIX199506: u32 = 1;
51pub const __USE_XOPEN2K: u32 = 1;
52pub const __USE_XOPEN2K8: u32 = 1;
53pub const _ATFILE_SOURCE: u32 = 1;
54pub const __WORDSIZE: u32 = 64;
55pub const __WORDSIZE_TIME64_COMPAT32: u32 = 1;
56pub const __SYSCALL_WORDSIZE: u32 = 64;
57pub const __TIMESIZE: u32 = 64;
58pub const __USE_MISC: u32 = 1;
59pub const __USE_ATFILE: u32 = 1;
60pub const __USE_FORTIFY_LEVEL: u32 = 0;
61pub const __GLIBC_USE_DEPRECATED_GETS: u32 = 0;
62pub const __GLIBC_USE_DEPRECATED_SCANF: u32 = 0;
63pub const _STDC_PREDEF_H: u32 = 1;
64pub const __STDC_IEC_559__: u32 = 1;
65pub const __STDC_IEC_60559_BFP__: u32 = 201404;
66pub const __STDC_IEC_559_COMPLEX__: u32 = 1;
67pub const __STDC_IEC_60559_COMPLEX__: u32 = 201404;
68pub const __STDC_ISO_10646__: u32 = 201706;
69pub const __GNU_LIBRARY__: u32 = 6;
70pub const __GLIBC__: u32 = 2;
71pub const __GLIBC_MINOR__: u32 = 36;
72pub const _SYS_CDEFS_H: u32 = 1;
73pub const __glibc_c99_flexarr_available: u32 = 1;
74pub const __LDOUBLE_REDIRECTS_TO_FLOAT128_ABI: u32 = 0;
75pub const __HAVE_GENERIC_SELECTION: u32 = 1;
76pub const __GLIBC_USE_LIB_EXT2: u32 = 0;
77pub const __GLIBC_USE_IEC_60559_BFP_EXT: u32 = 0;
78pub const __GLIBC_USE_IEC_60559_BFP_EXT_C2X: u32 = 0;
79pub const __GLIBC_USE_IEC_60559_EXT: u32 = 0;
80pub const __GLIBC_USE_IEC_60559_FUNCS_EXT: u32 = 0;
81pub const __GLIBC_USE_IEC_60559_FUNCS_EXT_C2X: u32 = 0;
82pub const __GLIBC_USE_IEC_60559_TYPES_EXT: u32 = 0;
83pub const _BITS_TYPES_H: u32 = 1;
84pub const _BITS_TYPESIZES_H: u32 = 1;
85pub const __OFF_T_MATCHES_OFF64_T: u32 = 1;
86pub const __INO_T_MATCHES_INO64_T: u32 = 1;
87pub const __RLIM_T_MATCHES_RLIM64_T: u32 = 1;
88pub const __STATFS_MATCHES_STATFS64: u32 = 1;
89pub const __KERNEL_OLD_TIMEVAL_MATCHES_TIMEVAL64: u32 = 1;
90pub const __FD_SETSIZE: u32 = 1024;
91pub const _BITS_TIME64_H: u32 = 1;
92pub const _BITS_WCHAR_H: u32 = 1;
93pub const _BITS_STDINT_INTN_H: u32 = 1;
94pub const _BITS_STDINT_UINTN_H: u32 = 1;
95pub const INT8_MIN: i32 = -128;
96pub const INT16_MIN: i32 = -32768;
97pub const INT32_MIN: i32 = -2147483648;
98pub const INT8_MAX: u32 = 127;
99pub const INT16_MAX: u32 = 32767;
100pub const INT32_MAX: u32 = 2147483647;
101pub const UINT8_MAX: u32 = 255;
102pub const UINT16_MAX: u32 = 65535;
103pub const UINT32_MAX: u32 = 4294967295;
104pub const INT_LEAST8_MIN: i32 = -128;
105pub const INT_LEAST16_MIN: i32 = -32768;
106pub const INT_LEAST32_MIN: i32 = -2147483648;
107pub const INT_LEAST8_MAX: u32 = 127;
108pub const INT_LEAST16_MAX: u32 = 32767;
109pub const INT_LEAST32_MAX: u32 = 2147483647;
110pub const UINT_LEAST8_MAX: u32 = 255;
111pub const UINT_LEAST16_MAX: u32 = 65535;
112pub const UINT_LEAST32_MAX: u32 = 4294967295;
113pub const INT_FAST8_MIN: i32 = -128;
114pub const INT_FAST16_MIN: i64 = -9223372036854775808;
115pub const INT_FAST32_MIN: i64 = -9223372036854775808;
116pub const INT_FAST8_MAX: u32 = 127;
117pub const INT_FAST16_MAX: u64 = 9223372036854775807;
118pub const INT_FAST32_MAX: u64 = 9223372036854775807;
119pub const UINT_FAST8_MAX: u32 = 255;
120pub const UINT_FAST16_MAX: i32 = -1;
121pub const UINT_FAST32_MAX: i32 = -1;
122pub const INTPTR_MIN: i64 = -9223372036854775808;
123pub const INTPTR_MAX: u64 = 9223372036854775807;
124pub const UINTPTR_MAX: i32 = -1;
125pub const PTRDIFF_MIN: i64 = -9223372036854775808;
126pub const PTRDIFF_MAX: u64 = 9223372036854775807;
127pub const SIG_ATOMIC_MIN: i32 = -2147483648;
128pub const SIG_ATOMIC_MAX: u32 = 2147483647;
129pub const SIZE_MAX: i32 = -1;
130pub const WINT_MIN: u32 = 0;
131pub const WINT_MAX: u32 = 4294967295;
132pub const kTfLiteOptionalTensor: i32 = -1;
133pub const _STDLIB_H: u32 = 1;
134pub const WNOHANG: u32 = 1;
135pub const WUNTRACED: u32 = 2;
136pub const WSTOPPED: u32 = 2;
137pub const WEXITED: u32 = 4;
138pub const WCONTINUED: u32 = 8;
139pub const WNOWAIT: u32 = 16777216;
140pub const __WNOTHREAD: u32 = 536870912;
141pub const __WALL: u32 = 1073741824;
142pub const __WCLONE: u32 = 2147483648;
143pub const __W_CONTINUED: u32 = 65535;
144pub const __WCOREFLAG: u32 = 128;
145pub const __HAVE_FLOAT128: u32 = 0;
146pub const __HAVE_DISTINCT_FLOAT128: u32 = 0;
147pub const __HAVE_FLOAT64X: u32 = 1;
148pub const __HAVE_FLOAT64X_LONG_DOUBLE: u32 = 1;
149pub const __HAVE_FLOAT16: u32 = 0;
150pub const __HAVE_FLOAT32: u32 = 1;
151pub const __HAVE_FLOAT64: u32 = 1;
152pub const __HAVE_FLOAT32X: u32 = 1;
153pub const __HAVE_FLOAT128X: u32 = 0;
154pub const __HAVE_DISTINCT_FLOAT16: u32 = 0;
155pub const __HAVE_DISTINCT_FLOAT32: u32 = 0;
156pub const __HAVE_DISTINCT_FLOAT64: u32 = 0;
157pub const __HAVE_DISTINCT_FLOAT32X: u32 = 0;
158pub const __HAVE_DISTINCT_FLOAT64X: u32 = 0;
159pub const __HAVE_DISTINCT_FLOAT128X: u32 = 0;
160pub const __HAVE_FLOATN_NOT_TYPEDEF: u32 = 0;
161pub const __ldiv_t_defined: u32 = 1;
162pub const __lldiv_t_defined: u32 = 1;
163pub const RAND_MAX: u32 = 2147483647;
164pub const EXIT_FAILURE: u32 = 1;
165pub const EXIT_SUCCESS: u32 = 0;
166pub const _SYS_TYPES_H: u32 = 1;
167pub const __clock_t_defined: u32 = 1;
168pub const __clockid_t_defined: u32 = 1;
169pub const __time_t_defined: u32 = 1;
170pub const __timer_t_defined: u32 = 1;
171pub const __BIT_TYPES_DEFINED__: u32 = 1;
172pub const _ENDIAN_H: u32 = 1;
173pub const _BITS_ENDIAN_H: u32 = 1;
174pub const __LITTLE_ENDIAN: u32 = 1234;
175pub const __BIG_ENDIAN: u32 = 4321;
176pub const __PDP_ENDIAN: u32 = 3412;
177pub const _BITS_ENDIANNESS_H: u32 = 1;
178pub const __BYTE_ORDER: u32 = 1234;
179pub const __FLOAT_WORD_ORDER: u32 = 1234;
180pub const LITTLE_ENDIAN: u32 = 1234;
181pub const BIG_ENDIAN: u32 = 4321;
182pub const PDP_ENDIAN: u32 = 3412;
183pub const BYTE_ORDER: u32 = 1234;
184pub const _BITS_BYTESWAP_H: u32 = 1;
185pub const _BITS_UINTN_IDENTITY_H: u32 = 1;
186pub const _SYS_SELECT_H: u32 = 1;
187pub const __sigset_t_defined: u32 = 1;
188pub const __timeval_defined: u32 = 1;
189pub const _STRUCT_TIMESPEC: u32 = 1;
190pub const FD_SETSIZE: u32 = 1024;
191pub const _BITS_PTHREADTYPES_COMMON_H: u32 = 1;
192pub const _THREAD_SHARED_TYPES_H: u32 = 1;
193pub const _BITS_PTHREADTYPES_ARCH_H: u32 = 1;
194pub const __SIZEOF_PTHREAD_MUTEX_T: u32 = 40;
195pub const __SIZEOF_PTHREAD_ATTR_T: u32 = 56;
196pub const __SIZEOF_PTHREAD_RWLOCK_T: u32 = 56;
197pub const __SIZEOF_PTHREAD_BARRIER_T: u32 = 32;
198pub const __SIZEOF_PTHREAD_MUTEXATTR_T: u32 = 4;
199pub const __SIZEOF_PTHREAD_COND_T: u32 = 48;
200pub const __SIZEOF_PTHREAD_CONDATTR_T: u32 = 4;
201pub const __SIZEOF_PTHREAD_RWLOCKATTR_T: u32 = 8;
202pub const __SIZEOF_PTHREAD_BARRIERATTR_T: u32 = 4;
203pub const _THREAD_MUTEX_INTERNAL_H: u32 = 1;
204pub const __PTHREAD_MUTEX_HAVE_PREV: u32 = 1;
205pub const __have_pthread_attr_t: u32 = 1;
206pub const _ALLOCA_H: u32 = 1;
207pub const _STDIO_H: u32 = 1;
208pub const _____fpos_t_defined: u32 = 1;
209pub const ____mbstate_t_defined: u32 = 1;
210pub const _____fpos64_t_defined: u32 = 1;
211pub const ____FILE_defined: u32 = 1;
212pub const __FILE_defined: u32 = 1;
213pub const __struct_FILE_defined: u32 = 1;
214pub const _IO_EOF_SEEN: u32 = 16;
215pub const _IO_ERR_SEEN: u32 = 32;
216pub const _IO_USER_LOCK: u32 = 32768;
217pub const _IOFBF: u32 = 0;
218pub const _IOLBF: u32 = 1;
219pub const _IONBF: u32 = 2;
220pub const BUFSIZ: u32 = 8192;
221pub const EOF: i32 = -1;
222pub const SEEK_SET: u32 = 0;
223pub const SEEK_CUR: u32 = 1;
224pub const SEEK_END: u32 = 2;
225pub const P_tmpdir: &[u8; 5] = b"/tmp\0";
226pub const _BITS_STDIO_LIM_H: u32 = 1;
227pub const L_tmpnam: u32 = 20;
228pub const TMP_MAX: u32 = 238328;
229pub const FILENAME_MAX: u32 = 4096;
230pub const L_ctermid: u32 = 9;
231pub const FOPEN_MAX: u32 = 16;
232pub type va_list = __builtin_va_list;
233pub type __gnuc_va_list = __builtin_va_list;
234pub type wchar_t = ::core::ffi::c_int;
235#[repr(C)]
236#[repr(align(16))]
237#[derive(Debug, Copy, Clone)]
238pub struct max_align_t {
239 pub __clang_max_align_nonce1: ::core::ffi::c_longlong,
240 pub __bindgen_padding_0: u64,
241 pub __clang_max_align_nonce2: u128,
242}
243#[test]
244fn bindgen_test_layout_max_align_t() {
245 const UNINIT: ::core::mem::MaybeUninit<max_align_t> = ::core::mem::MaybeUninit::uninit();
246 let ptr = UNINIT.as_ptr();
247 assert_eq!(
248 ::core::mem::size_of::<max_align_t>(),
249 32usize,
250 concat!("Size of: ", stringify!(max_align_t))
251 );
252 assert_eq!(
253 ::core::mem::align_of::<max_align_t>(),
254 16usize,
255 concat!("Alignment of ", stringify!(max_align_t))
256 );
257 assert_eq!(
258 unsafe { ::core::ptr::addr_of!((*ptr).__clang_max_align_nonce1) as usize - ptr as usize },
259 0usize,
260 concat!(
261 "Offset of field: ",
262 stringify!(max_align_t),
263 "::",
264 stringify!(__clang_max_align_nonce1)
265 )
266 );
267 assert_eq!(
268 unsafe { ::core::ptr::addr_of!((*ptr).__clang_max_align_nonce2) as usize - ptr as usize },
269 16usize,
270 concat!(
271 "Offset of field: ",
272 stringify!(max_align_t),
273 "::",
274 stringify!(__clang_max_align_nonce2)
275 )
276 );
277}
278pub type __u_char = ::core::ffi::c_uchar;
279pub type __u_short = ::core::ffi::c_ushort;
280pub type __u_int = ::core::ffi::c_uint;
281pub type __u_long = ::core::ffi::c_ulong;
282pub type __int8_t = ::core::ffi::c_schar;
283pub type __uint8_t = ::core::ffi::c_uchar;
284pub type __int16_t = ::core::ffi::c_short;
285pub type __uint16_t = ::core::ffi::c_ushort;
286pub type __int32_t = ::core::ffi::c_int;
287pub type __uint32_t = ::core::ffi::c_uint;
288pub type __int64_t = ::core::ffi::c_long;
289pub type __uint64_t = ::core::ffi::c_ulong;
290pub type __int_least8_t = __int8_t;
291pub type __uint_least8_t = __uint8_t;
292pub type __int_least16_t = __int16_t;
293pub type __uint_least16_t = __uint16_t;
294pub type __int_least32_t = __int32_t;
295pub type __uint_least32_t = __uint32_t;
296pub type __int_least64_t = __int64_t;
297pub type __uint_least64_t = __uint64_t;
298pub type __quad_t = ::core::ffi::c_long;
299pub type __u_quad_t = ::core::ffi::c_ulong;
300pub type __intmax_t = ::core::ffi::c_long;
301pub type __uintmax_t = ::core::ffi::c_ulong;
302pub type __dev_t = ::core::ffi::c_ulong;
303pub type __uid_t = ::core::ffi::c_uint;
304pub type __gid_t = ::core::ffi::c_uint;
305pub type __ino_t = ::core::ffi::c_ulong;
306pub type __ino64_t = ::core::ffi::c_ulong;
307pub type __mode_t = ::core::ffi::c_uint;
308pub type __nlink_t = ::core::ffi::c_ulong;
309pub type __off_t = ::core::ffi::c_long;
310pub type __off64_t = ::core::ffi::c_long;
311pub type __pid_t = ::core::ffi::c_int;
312#[repr(C)]
313#[derive(Debug, Copy, Clone)]
314pub struct __fsid_t {
315 pub __val: [::core::ffi::c_int; 2usize],
316}
317#[test]
318fn bindgen_test_layout___fsid_t() {
319 const UNINIT: ::core::mem::MaybeUninit<__fsid_t> = ::core::mem::MaybeUninit::uninit();
320 let ptr = UNINIT.as_ptr();
321 assert_eq!(
322 ::core::mem::size_of::<__fsid_t>(),
323 8usize,
324 concat!("Size of: ", stringify!(__fsid_t))
325 );
326 assert_eq!(
327 ::core::mem::align_of::<__fsid_t>(),
328 4usize,
329 concat!("Alignment of ", stringify!(__fsid_t))
330 );
331 assert_eq!(
332 unsafe { ::core::ptr::addr_of!((*ptr).__val) as usize - ptr as usize },
333 0usize,
334 concat!(
335 "Offset of field: ",
336 stringify!(__fsid_t),
337 "::",
338 stringify!(__val)
339 )
340 );
341}
342pub type __clock_t = ::core::ffi::c_long;
343pub type __rlim_t = ::core::ffi::c_ulong;
344pub type __rlim64_t = ::core::ffi::c_ulong;
345pub type __id_t = ::core::ffi::c_uint;
346pub type __time_t = ::core::ffi::c_long;
347pub type __useconds_t = ::core::ffi::c_uint;
348pub type __suseconds_t = ::core::ffi::c_long;
349pub type __suseconds64_t = ::core::ffi::c_long;
350pub type __daddr_t = ::core::ffi::c_int;
351pub type __key_t = ::core::ffi::c_int;
352pub type __clockid_t = ::core::ffi::c_int;
353pub type __timer_t = *mut ::core::ffi::c_void;
354pub type __blksize_t = ::core::ffi::c_long;
355pub type __blkcnt_t = ::core::ffi::c_long;
356pub type __blkcnt64_t = ::core::ffi::c_long;
357pub type __fsblkcnt_t = ::core::ffi::c_ulong;
358pub type __fsblkcnt64_t = ::core::ffi::c_ulong;
359pub type __fsfilcnt_t = ::core::ffi::c_ulong;
360pub type __fsfilcnt64_t = ::core::ffi::c_ulong;
361pub type __fsword_t = ::core::ffi::c_long;
362pub type __ssize_t = ::core::ffi::c_long;
363pub type __syscall_slong_t = ::core::ffi::c_long;
364pub type __syscall_ulong_t = ::core::ffi::c_ulong;
365pub type __loff_t = __off64_t;
366pub type __caddr_t = *mut ::core::ffi::c_char;
367pub type __intptr_t = ::core::ffi::c_long;
368pub type __socklen_t = ::core::ffi::c_uint;
369pub type __sig_atomic_t = ::core::ffi::c_int;
370pub type int_least8_t = __int_least8_t;
371pub type int_least16_t = __int_least16_t;
372pub type int_least32_t = __int_least32_t;
373pub type int_least64_t = __int_least64_t;
374pub type uint_least8_t = __uint_least8_t;
375pub type uint_least16_t = __uint_least16_t;
376pub type uint_least32_t = __uint_least32_t;
377pub type uint_least64_t = __uint_least64_t;
378pub type int_fast8_t = ::core::ffi::c_schar;
379pub type int_fast16_t = ::core::ffi::c_long;
380pub type int_fast32_t = ::core::ffi::c_long;
381pub type int_fast64_t = ::core::ffi::c_long;
382pub type uint_fast8_t = ::core::ffi::c_uchar;
383pub type uint_fast16_t = ::core::ffi::c_ulong;
384pub type uint_fast32_t = ::core::ffi::c_ulong;
385pub type uint_fast64_t = ::core::ffi::c_ulong;
386pub type intmax_t = __intmax_t;
387pub type uintmax_t = __uintmax_t;
388#[repr(u32)]
389#[doc = " Note that new error status values may be added in future in order to\n indicate more fine-grained internal states, therefore, applications should\n not rely on status values being members of the enum."]
390#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
391pub enum TfLiteStatus {
392 #[doc = " Success"]
393 kTfLiteOk = 0,
394 #[doc = " Generally referring to an error in the runtime (i.e. interpreter)"]
395 kTfLiteError = 1,
396 #[doc = " Generally referring to an error from a TfLiteDelegate itself."]
397 kTfLiteDelegateError = 2,
398 #[doc = " Generally referring to an error in applying a delegate due to\n incompatibility between runtime and delegate, e.g., this error is returned\n when trying to apply a TF Lite delegate onto a model graph that's already\n immutable."]
399 kTfLiteApplicationError = 3,
400 #[doc = " Generally referring to serialized delegate data not being found.\n See tflite::delegates::Serialization."]
401 kTfLiteDelegateDataNotFound = 4,
402 #[doc = " Generally referring to data-writing issues in delegate serialization.\n See tflite::delegates::Serialization."]
403 kTfLiteDelegateDataWriteError = 5,
404 #[doc = " Generally referring to data-reading issues in delegate serialization.\n See tflite::delegates::Serialization."]
405 kTfLiteDelegateDataReadError = 6,
406 #[doc = " Generally referring to issues when the TF Lite model has ops that cannot\n be resolved at runtime. This could happen when the specific op is not\n registered or built with the TF Lite framework."]
407 kTfLiteUnresolvedOps = 7,
408 #[doc = " Generally referring to invocation cancelled by the user.\n See `interpreter::Cancel`."]
409 kTfLiteCancelled = 8,
410}
411#[repr(u32)]
412#[doc = " Types supported by tensor"]
413#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
414pub enum TfLiteType {
415 kTfLiteNoType = 0,
416 kTfLiteFloat32 = 1,
417 kTfLiteInt32 = 2,
418 kTfLiteUInt8 = 3,
419 kTfLiteInt64 = 4,
420 kTfLiteString = 5,
421 kTfLiteBool = 6,
422 kTfLiteInt16 = 7,
423 kTfLiteComplex64 = 8,
424 kTfLiteInt8 = 9,
425 kTfLiteFloat16 = 10,
426 kTfLiteFloat64 = 11,
427 kTfLiteComplex128 = 12,
428 kTfLiteUInt64 = 13,
429 kTfLiteResource = 14,
430 kTfLiteVariant = 15,
431 kTfLiteUInt32 = 16,
432 kTfLiteUInt16 = 17,
433 kTfLiteInt4 = 18,
434 kTfLiteBFloat16 = 19,
435}
436#[doc = " Legacy. Will be deprecated in favor of `TfLiteAffineQuantization`.\n If per-layer quantization is specified this field will still be populated in\n addition to `TfLiteAffineQuantization`.\n Parameters for asymmetric quantization. Quantized values can be converted\n back to float using: `real_value = scale * (quantized_value - zero_point)`"]
437#[repr(C)]
438#[derive(Debug, Copy, Clone)]
439pub struct TfLiteQuantizationParams {
440 pub scale: f32,
441 pub zero_point: i32,
442}
443#[test]
444fn bindgen_test_layout_TfLiteQuantizationParams() {
445 const UNINIT: ::core::mem::MaybeUninit<TfLiteQuantizationParams> =
446 ::core::mem::MaybeUninit::uninit();
447 let ptr = UNINIT.as_ptr();
448 assert_eq!(
449 ::core::mem::size_of::<TfLiteQuantizationParams>(),
450 8usize,
451 concat!("Size of: ", stringify!(TfLiteQuantizationParams))
452 );
453 assert_eq!(
454 ::core::mem::align_of::<TfLiteQuantizationParams>(),
455 4usize,
456 concat!("Alignment of ", stringify!(TfLiteQuantizationParams))
457 );
458 assert_eq!(
459 unsafe { ::core::ptr::addr_of!((*ptr).scale) as usize - ptr as usize },
460 0usize,
461 concat!(
462 "Offset of field: ",
463 stringify!(TfLiteQuantizationParams),
464 "::",
465 stringify!(scale)
466 )
467 );
468 assert_eq!(
469 unsafe { ::core::ptr::addr_of!((*ptr).zero_point) as usize - ptr as usize },
470 4usize,
471 concat!(
472 "Offset of field: ",
473 stringify!(TfLiteQuantizationParams),
474 "::",
475 stringify!(zero_point)
476 )
477 );
478}
479#[repr(C)]
480#[derive(Debug, Copy, Clone)]
481pub struct TfLiteOpaqueContext {
482 _unused: [u8; 0],
483}
484#[repr(C)]
485#[derive(Debug, Copy, Clone)]
486pub struct TfLiteOpaqueNode {
487 _unused: [u8; 0],
488}
489#[repr(C)]
490#[derive(Debug, Copy, Clone)]
491pub struct TfLiteOpaqueTensor {
492 _unused: [u8; 0],
493}
494#[repr(C)]
495#[derive(Debug, Copy, Clone)]
496pub struct TfLiteOpaqueDelegateStruct {
497 _unused: [u8; 0],
498}
499#[doc = " WARNING: This is an experimental interface that is subject to change."]
500pub type TfLiteOpaqueDelegate = TfLiteDelegate;
501#[repr(u32)]
502#[doc = " The list of external context types known to TF Lite. This list exists solely\n to avoid conflicts and to ensure ops can share the external contexts they\n need. Access to the external contexts is controlled by one of the\n corresponding support files."]
503#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
504pub enum TfLiteExternalContextType {
505 kTfLiteEigenContext = 0,
506 #[doc = " include eigen_support.h to use."]
507 kTfLiteGemmLowpContext = 1,
508 #[doc = " include gemm_support.h to use."]
509 kTfLiteEdgeTpuContext = 2,
510 #[doc = " Placeholder for Edge TPU support."]
511 kTfLiteCpuBackendContext = 3,
512 #[doc = " include cpu_backend_context.h to use."]
513 kTfLiteMaxExternalContexts = 4,
514}
515#[doc = " An external context is a collection of information unrelated to the TF Lite\n framework, but useful to a subset of the ops. TF Lite knows very little\n about the actual contexts, but it keeps a list of them, and is able to\n refresh them if configurations like the number of recommended threads\n change."]
516#[repr(C)]
517#[derive(Debug, Copy, Clone)]
518pub struct TfLiteExternalContext {
519 pub type_: TfLiteExternalContextType,
520 pub Refresh:
521 ::core::option::Option<unsafe extern "C" fn(context: *mut TfLiteContext) -> TfLiteStatus>,
522}
523#[test]
524fn bindgen_test_layout_TfLiteExternalContext() {
525 const UNINIT: ::core::mem::MaybeUninit<TfLiteExternalContext> =
526 ::core::mem::MaybeUninit::uninit();
527 let ptr = UNINIT.as_ptr();
528 assert_eq!(
529 ::core::mem::size_of::<TfLiteExternalContext>(),
530 16usize,
531 concat!("Size of: ", stringify!(TfLiteExternalContext))
532 );
533 assert_eq!(
534 ::core::mem::align_of::<TfLiteExternalContext>(),
535 8usize,
536 concat!("Alignment of ", stringify!(TfLiteExternalContext))
537 );
538 assert_eq!(
539 unsafe { ::core::ptr::addr_of!((*ptr).type_) as usize - ptr as usize },
540 0usize,
541 concat!(
542 "Offset of field: ",
543 stringify!(TfLiteExternalContext),
544 "::",
545 stringify!(type_)
546 )
547 );
548 assert_eq!(
549 unsafe { ::core::ptr::addr_of!((*ptr).Refresh) as usize - ptr as usize },
550 8usize,
551 concat!(
552 "Offset of field: ",
553 stringify!(TfLiteExternalContext),
554 "::",
555 stringify!(Refresh)
556 )
557 );
558}
559#[doc = " Fixed size list of integers. Used for dimensions and inputs/outputs tensor\n indices"]
560#[repr(C)]
561#[derive(Debug)]
562pub struct TfLiteIntArray {
563 pub size: ::core::ffi::c_int,
564 pub data: __IncompleteArrayField<::core::ffi::c_int>,
565}
566#[test]
567fn bindgen_test_layout_TfLiteIntArray() {
568 const UNINIT: ::core::mem::MaybeUninit<TfLiteIntArray> = ::core::mem::MaybeUninit::uninit();
569 let ptr = UNINIT.as_ptr();
570 assert_eq!(
571 ::core::mem::size_of::<TfLiteIntArray>(),
572 4usize,
573 concat!("Size of: ", stringify!(TfLiteIntArray))
574 );
575 assert_eq!(
576 ::core::mem::align_of::<TfLiteIntArray>(),
577 4usize,
578 concat!("Alignment of ", stringify!(TfLiteIntArray))
579 );
580 assert_eq!(
581 unsafe { ::core::ptr::addr_of!((*ptr).size) as usize - ptr as usize },
582 0usize,
583 concat!(
584 "Offset of field: ",
585 stringify!(TfLiteIntArray),
586 "::",
587 stringify!(size)
588 )
589 );
590 assert_eq!(
591 unsafe { ::core::ptr::addr_of!((*ptr).data) as usize - ptr as usize },
592 4usize,
593 concat!(
594 "Offset of field: ",
595 stringify!(TfLiteIntArray),
596 "::",
597 stringify!(data)
598 )
599 );
600}
601extern "C" {
602 #[doc = " Given the size (number of elements) in a TfLiteIntArray, calculate its size\n in bytes."]
603 pub fn TfLiteIntArrayGetSizeInBytes(size: ::core::ffi::c_int) -> usize;
604}
605extern "C" {
606 #[doc = " Create a array of a given `size` (uninitialized entries).\n This returns a pointer, that you must free using TfLiteIntArrayFree()."]
607 pub fn TfLiteIntArrayCreate(size: ::core::ffi::c_int) -> *mut TfLiteIntArray;
608}
609extern "C" {
610 #[doc = " Check if two intarrays are equal. Returns 1 if they are equal, 0 otherwise."]
611 pub fn TfLiteIntArrayEqual(
612 a: *const TfLiteIntArray,
613 b: *const TfLiteIntArray,
614 ) -> ::core::ffi::c_int;
615}
616extern "C" {
617 #[doc = " Check if an intarray equals an array. Returns 1 if equals, 0 otherwise."]
618 pub fn TfLiteIntArrayEqualsArray(
619 a: *const TfLiteIntArray,
620 b_size: ::core::ffi::c_int,
621 b_data: *const ::core::ffi::c_int,
622 ) -> ::core::ffi::c_int;
623}
624extern "C" {
625 #[doc = " Create a copy of an array passed as `src`.\n You are expected to free memory with TfLiteIntArrayFree"]
626 pub fn TfLiteIntArrayCopy(src: *const TfLiteIntArray) -> *mut TfLiteIntArray;
627}
628extern "C" {
629 #[doc = " Free memory of array `a`."]
630 pub fn TfLiteIntArrayFree(a: *mut TfLiteIntArray);
631}
632#[doc = " Fixed size list of floats. Used for per-channel quantization."]
633#[repr(C)]
634#[derive(Debug)]
635pub struct TfLiteFloatArray {
636 pub size: ::core::ffi::c_int,
637 pub data: __IncompleteArrayField<f32>,
638}
639#[test]
640fn bindgen_test_layout_TfLiteFloatArray() {
641 const UNINIT: ::core::mem::MaybeUninit<TfLiteFloatArray> = ::core::mem::MaybeUninit::uninit();
642 let ptr = UNINIT.as_ptr();
643 assert_eq!(
644 ::core::mem::size_of::<TfLiteFloatArray>(),
645 4usize,
646 concat!("Size of: ", stringify!(TfLiteFloatArray))
647 );
648 assert_eq!(
649 ::core::mem::align_of::<TfLiteFloatArray>(),
650 4usize,
651 concat!("Alignment of ", stringify!(TfLiteFloatArray))
652 );
653 assert_eq!(
654 unsafe { ::core::ptr::addr_of!((*ptr).size) as usize - ptr as usize },
655 0usize,
656 concat!(
657 "Offset of field: ",
658 stringify!(TfLiteFloatArray),
659 "::",
660 stringify!(size)
661 )
662 );
663 assert_eq!(
664 unsafe { ::core::ptr::addr_of!((*ptr).data) as usize - ptr as usize },
665 4usize,
666 concat!(
667 "Offset of field: ",
668 stringify!(TfLiteFloatArray),
669 "::",
670 stringify!(data)
671 )
672 );
673}
674extern "C" {
675 #[doc = " Given the size (number of elements) in a TfLiteFloatArray, calculate its\n size in bytes."]
676 pub fn TfLiteFloatArrayGetSizeInBytes(size: ::core::ffi::c_int) -> ::core::ffi::c_int;
677}
678extern "C" {
679 #[doc = " Create a array of a given `size` (uninitialized entries).\n This returns a pointer, that you must free using TfLiteFloatArrayFree()."]
680 pub fn TfLiteFloatArrayCreate(size: ::core::ffi::c_int) -> *mut TfLiteFloatArray;
681}
682extern "C" {
683 #[doc = " Create a copy of an array passed as `src`.\n You are expected to free memory with TfLiteFloatArrayFree."]
684 pub fn TfLiteFloatArrayCopy(src: *const TfLiteFloatArray) -> *mut TfLiteFloatArray;
685}
686extern "C" {
687 #[doc = " Free memory of array `a`."]
688 pub fn TfLiteFloatArrayFree(a: *mut TfLiteFloatArray);
689}
690#[doc = " Single-precision complex data type compatible with the C99 definition."]
691#[repr(C)]
692#[derive(Debug, Copy, Clone)]
693pub struct TfLiteComplex64 {
694 pub re: f32,
695 pub im: f32,
696}
697#[test]
698fn bindgen_test_layout_TfLiteComplex64() {
699 const UNINIT: ::core::mem::MaybeUninit<TfLiteComplex64> = ::core::mem::MaybeUninit::uninit();
700 let ptr = UNINIT.as_ptr();
701 assert_eq!(
702 ::core::mem::size_of::<TfLiteComplex64>(),
703 8usize,
704 concat!("Size of: ", stringify!(TfLiteComplex64))
705 );
706 assert_eq!(
707 ::core::mem::align_of::<TfLiteComplex64>(),
708 4usize,
709 concat!("Alignment of ", stringify!(TfLiteComplex64))
710 );
711 assert_eq!(
712 unsafe { ::core::ptr::addr_of!((*ptr).re) as usize - ptr as usize },
713 0usize,
714 concat!(
715 "Offset of field: ",
716 stringify!(TfLiteComplex64),
717 "::",
718 stringify!(re)
719 )
720 );
721 assert_eq!(
722 unsafe { ::core::ptr::addr_of!((*ptr).im) as usize - ptr as usize },
723 4usize,
724 concat!(
725 "Offset of field: ",
726 stringify!(TfLiteComplex64),
727 "::",
728 stringify!(im)
729 )
730 );
731}
732#[doc = " Double-precision complex data type compatible with the C99 definition."]
733#[repr(C)]
734#[derive(Debug, Copy, Clone)]
735pub struct TfLiteComplex128 {
736 pub re: f64,
737 pub im: f64,
738}
739#[test]
740fn bindgen_test_layout_TfLiteComplex128() {
741 const UNINIT: ::core::mem::MaybeUninit<TfLiteComplex128> = ::core::mem::MaybeUninit::uninit();
742 let ptr = UNINIT.as_ptr();
743 assert_eq!(
744 ::core::mem::size_of::<TfLiteComplex128>(),
745 16usize,
746 concat!("Size of: ", stringify!(TfLiteComplex128))
747 );
748 assert_eq!(
749 ::core::mem::align_of::<TfLiteComplex128>(),
750 8usize,
751 concat!("Alignment of ", stringify!(TfLiteComplex128))
752 );
753 assert_eq!(
754 unsafe { ::core::ptr::addr_of!((*ptr).re) as usize - ptr as usize },
755 0usize,
756 concat!(
757 "Offset of field: ",
758 stringify!(TfLiteComplex128),
759 "::",
760 stringify!(re)
761 )
762 );
763 assert_eq!(
764 unsafe { ::core::ptr::addr_of!((*ptr).im) as usize - ptr as usize },
765 8usize,
766 concat!(
767 "Offset of field: ",
768 stringify!(TfLiteComplex128),
769 "::",
770 stringify!(im)
771 )
772 );
773}
774#[doc = " Half precision data type compatible with the C99 definition."]
775#[repr(C)]
776#[derive(Debug, Copy, Clone)]
777pub struct TfLiteFloat16 {
778 pub data: u16,
779}
780#[test]
781fn bindgen_test_layout_TfLiteFloat16() {
782 const UNINIT: ::core::mem::MaybeUninit<TfLiteFloat16> = ::core::mem::MaybeUninit::uninit();
783 let ptr = UNINIT.as_ptr();
784 assert_eq!(
785 ::core::mem::size_of::<TfLiteFloat16>(),
786 2usize,
787 concat!("Size of: ", stringify!(TfLiteFloat16))
788 );
789 assert_eq!(
790 ::core::mem::align_of::<TfLiteFloat16>(),
791 2usize,
792 concat!("Alignment of ", stringify!(TfLiteFloat16))
793 );
794 assert_eq!(
795 unsafe { ::core::ptr::addr_of!((*ptr).data) as usize - ptr as usize },
796 0usize,
797 concat!(
798 "Offset of field: ",
799 stringify!(TfLiteFloat16),
800 "::",
801 stringify!(data)
802 )
803 );
804}
805#[doc = " bfloat16 data type compatible with the Google Brain definition.\n https://cloud.google.com/tpu/docs/bfloat16.\n This provides 1 bit of sign, 8 bits of exponent, and 7 bits of mantissa."]
806#[repr(C)]
807#[derive(Debug, Copy, Clone)]
808pub struct TfLiteBFloat16 {
809 pub data: u16,
810}
811#[test]
812fn bindgen_test_layout_TfLiteBFloat16() {
813 const UNINIT: ::core::mem::MaybeUninit<TfLiteBFloat16> = ::core::mem::MaybeUninit::uninit();
814 let ptr = UNINIT.as_ptr();
815 assert_eq!(
816 ::core::mem::size_of::<TfLiteBFloat16>(),
817 2usize,
818 concat!("Size of: ", stringify!(TfLiteBFloat16))
819 );
820 assert_eq!(
821 ::core::mem::align_of::<TfLiteBFloat16>(),
822 2usize,
823 concat!("Alignment of ", stringify!(TfLiteBFloat16))
824 );
825 assert_eq!(
826 unsafe { ::core::ptr::addr_of!((*ptr).data) as usize - ptr as usize },
827 0usize,
828 concat!(
829 "Offset of field: ",
830 stringify!(TfLiteBFloat16),
831 "::",
832 stringify!(data)
833 )
834 );
835}
836extern "C" {
837 #[doc = " Return the name of a given type, for error reporting purposes."]
838 pub fn TfLiteTypeGetName(type_: TfLiteType) -> *const ::core::ffi::c_char;
839}
840#[repr(u32)]
841#[doc = " SupportedQuantizationTypes."]
842#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
843pub enum TfLiteQuantizationType {
844 #[doc = " No quantization."]
845 kTfLiteNoQuantization = 0,
846 #[doc = " Affine quantization (with support for per-channel quantization).\n Corresponds to TfLiteAffineQuantization."]
847 kTfLiteAffineQuantization = 1,
848}
849#[doc = " Structure specifying the quantization used by the tensor, if-any."]
850#[repr(C)]
851#[derive(Debug, Copy, Clone)]
852pub struct TfLiteQuantization {
853 #[doc = " The type of quantization held by params."]
854 pub type_: TfLiteQuantizationType,
855 #[doc = " Holds an optional reference to a quantization param structure. The actual\n type depends on the value of the `type` field (see the comment there for\n the values and corresponding types)."]
856 pub params: *mut ::core::ffi::c_void,
857}
858#[test]
859fn bindgen_test_layout_TfLiteQuantization() {
860 const UNINIT: ::core::mem::MaybeUninit<TfLiteQuantization> = ::core::mem::MaybeUninit::uninit();
861 let ptr = UNINIT.as_ptr();
862 assert_eq!(
863 ::core::mem::size_of::<TfLiteQuantization>(),
864 16usize,
865 concat!("Size of: ", stringify!(TfLiteQuantization))
866 );
867 assert_eq!(
868 ::core::mem::align_of::<TfLiteQuantization>(),
869 8usize,
870 concat!("Alignment of ", stringify!(TfLiteQuantization))
871 );
872 assert_eq!(
873 unsafe { ::core::ptr::addr_of!((*ptr).type_) as usize - ptr as usize },
874 0usize,
875 concat!(
876 "Offset of field: ",
877 stringify!(TfLiteQuantization),
878 "::",
879 stringify!(type_)
880 )
881 );
882 assert_eq!(
883 unsafe { ::core::ptr::addr_of!((*ptr).params) as usize - ptr as usize },
884 8usize,
885 concat!(
886 "Offset of field: ",
887 stringify!(TfLiteQuantization),
888 "::",
889 stringify!(params)
890 )
891 );
892}
893#[doc = " Parameters for asymmetric quantization across a dimension (i.e per output\n channel quantization).\n quantized_dimension specifies which dimension the scales and zero_points\n correspond to.\n For a particular value in quantized_dimension, quantized values can be\n converted back to float using:\n `real_value = scale * (quantized_value - zero_point)`"]
894#[repr(C)]
895#[derive(Debug, Copy, Clone)]
896pub struct TfLiteAffineQuantization {
897 pub scale: *mut TfLiteFloatArray,
898 pub zero_point: *mut TfLiteIntArray,
899 pub quantized_dimension: i32,
900}
901#[test]
902fn bindgen_test_layout_TfLiteAffineQuantization() {
903 const UNINIT: ::core::mem::MaybeUninit<TfLiteAffineQuantization> =
904 ::core::mem::MaybeUninit::uninit();
905 let ptr = UNINIT.as_ptr();
906 assert_eq!(
907 ::core::mem::size_of::<TfLiteAffineQuantization>(),
908 24usize,
909 concat!("Size of: ", stringify!(TfLiteAffineQuantization))
910 );
911 assert_eq!(
912 ::core::mem::align_of::<TfLiteAffineQuantization>(),
913 8usize,
914 concat!("Alignment of ", stringify!(TfLiteAffineQuantization))
915 );
916 assert_eq!(
917 unsafe { ::core::ptr::addr_of!((*ptr).scale) as usize - ptr as usize },
918 0usize,
919 concat!(
920 "Offset of field: ",
921 stringify!(TfLiteAffineQuantization),
922 "::",
923 stringify!(scale)
924 )
925 );
926 assert_eq!(
927 unsafe { ::core::ptr::addr_of!((*ptr).zero_point) as usize - ptr as usize },
928 8usize,
929 concat!(
930 "Offset of field: ",
931 stringify!(TfLiteAffineQuantization),
932 "::",
933 stringify!(zero_point)
934 )
935 );
936 assert_eq!(
937 unsafe { ::core::ptr::addr_of!((*ptr).quantized_dimension) as usize - ptr as usize },
938 16usize,
939 concat!(
940 "Offset of field: ",
941 stringify!(TfLiteAffineQuantization),
942 "::",
943 stringify!(quantized_dimension)
944 )
945 );
946}
947#[doc = " A union of pointers that points to memory for a given tensor.\n\n Do not access these members directly, if possible, use\n `GetTensorData<TYPE>(tensor)` instead, otherwise only access `.data`, as\n other members are deprecated."]
948#[repr(C)]
949#[derive(Copy, Clone)]
950pub union TfLitePtrUnion {
951 pub i32_: *mut i32,
952 pub u32_: *mut u32,
953 pub i64_: *mut i64,
954 pub u64_: *mut u64,
955 pub f: *mut f32,
956 pub f16: *mut TfLiteFloat16,
957 pub f64_: *mut f64,
958 pub raw: *mut ::core::ffi::c_char,
959 pub raw_const: *const ::core::ffi::c_char,
960 pub uint8: *mut u8,
961 pub b: *mut bool,
962 pub i16_: *mut i16,
963 pub ui16: *mut u16,
964 pub c64: *mut TfLiteComplex64,
965 pub c128: *mut TfLiteComplex128,
966 pub int8: *mut i8,
967 #[doc = " Only use this member."]
968 pub data: *mut ::core::ffi::c_void,
969}
970#[test]
971fn bindgen_test_layout_TfLitePtrUnion() {
972 const UNINIT: ::core::mem::MaybeUninit<TfLitePtrUnion> = ::core::mem::MaybeUninit::uninit();
973 let ptr = UNINIT.as_ptr();
974 assert_eq!(
975 ::core::mem::size_of::<TfLitePtrUnion>(),
976 8usize,
977 concat!("Size of: ", stringify!(TfLitePtrUnion))
978 );
979 assert_eq!(
980 ::core::mem::align_of::<TfLitePtrUnion>(),
981 8usize,
982 concat!("Alignment of ", stringify!(TfLitePtrUnion))
983 );
984 assert_eq!(
985 unsafe { ::core::ptr::addr_of!((*ptr).i32_) as usize - ptr as usize },
986 0usize,
987 concat!(
988 "Offset of field: ",
989 stringify!(TfLitePtrUnion),
990 "::",
991 stringify!(i32_)
992 )
993 );
994 assert_eq!(
995 unsafe { ::core::ptr::addr_of!((*ptr).u32_) as usize - ptr as usize },
996 0usize,
997 concat!(
998 "Offset of field: ",
999 stringify!(TfLitePtrUnion),
1000 "::",
1001 stringify!(u32_)
1002 )
1003 );
1004 assert_eq!(
1005 unsafe { ::core::ptr::addr_of!((*ptr).i64_) as usize - ptr as usize },
1006 0usize,
1007 concat!(
1008 "Offset of field: ",
1009 stringify!(TfLitePtrUnion),
1010 "::",
1011 stringify!(i64_)
1012 )
1013 );
1014 assert_eq!(
1015 unsafe { ::core::ptr::addr_of!((*ptr).u64_) as usize - ptr as usize },
1016 0usize,
1017 concat!(
1018 "Offset of field: ",
1019 stringify!(TfLitePtrUnion),
1020 "::",
1021 stringify!(u64_)
1022 )
1023 );
1024 assert_eq!(
1025 unsafe { ::core::ptr::addr_of!((*ptr).f) as usize - ptr as usize },
1026 0usize,
1027 concat!(
1028 "Offset of field: ",
1029 stringify!(TfLitePtrUnion),
1030 "::",
1031 stringify!(f)
1032 )
1033 );
1034 assert_eq!(
1035 unsafe { ::core::ptr::addr_of!((*ptr).f16) as usize - ptr as usize },
1036 0usize,
1037 concat!(
1038 "Offset of field: ",
1039 stringify!(TfLitePtrUnion),
1040 "::",
1041 stringify!(f16)
1042 )
1043 );
1044 assert_eq!(
1045 unsafe { ::core::ptr::addr_of!((*ptr).f64_) as usize - ptr as usize },
1046 0usize,
1047 concat!(
1048 "Offset of field: ",
1049 stringify!(TfLitePtrUnion),
1050 "::",
1051 stringify!(f64_)
1052 )
1053 );
1054 assert_eq!(
1055 unsafe { ::core::ptr::addr_of!((*ptr).raw) as usize - ptr as usize },
1056 0usize,
1057 concat!(
1058 "Offset of field: ",
1059 stringify!(TfLitePtrUnion),
1060 "::",
1061 stringify!(raw)
1062 )
1063 );
1064 assert_eq!(
1065 unsafe { ::core::ptr::addr_of!((*ptr).raw_const) as usize - ptr as usize },
1066 0usize,
1067 concat!(
1068 "Offset of field: ",
1069 stringify!(TfLitePtrUnion),
1070 "::",
1071 stringify!(raw_const)
1072 )
1073 );
1074 assert_eq!(
1075 unsafe { ::core::ptr::addr_of!((*ptr).uint8) as usize - ptr as usize },
1076 0usize,
1077 concat!(
1078 "Offset of field: ",
1079 stringify!(TfLitePtrUnion),
1080 "::",
1081 stringify!(uint8)
1082 )
1083 );
1084 assert_eq!(
1085 unsafe { ::core::ptr::addr_of!((*ptr).b) as usize - ptr as usize },
1086 0usize,
1087 concat!(
1088 "Offset of field: ",
1089 stringify!(TfLitePtrUnion),
1090 "::",
1091 stringify!(b)
1092 )
1093 );
1094 assert_eq!(
1095 unsafe { ::core::ptr::addr_of!((*ptr).i16_) as usize - ptr as usize },
1096 0usize,
1097 concat!(
1098 "Offset of field: ",
1099 stringify!(TfLitePtrUnion),
1100 "::",
1101 stringify!(i16_)
1102 )
1103 );
1104 assert_eq!(
1105 unsafe { ::core::ptr::addr_of!((*ptr).ui16) as usize - ptr as usize },
1106 0usize,
1107 concat!(
1108 "Offset of field: ",
1109 stringify!(TfLitePtrUnion),
1110 "::",
1111 stringify!(ui16)
1112 )
1113 );
1114 assert_eq!(
1115 unsafe { ::core::ptr::addr_of!((*ptr).c64) as usize - ptr as usize },
1116 0usize,
1117 concat!(
1118 "Offset of field: ",
1119 stringify!(TfLitePtrUnion),
1120 "::",
1121 stringify!(c64)
1122 )
1123 );
1124 assert_eq!(
1125 unsafe { ::core::ptr::addr_of!((*ptr).c128) as usize - ptr as usize },
1126 0usize,
1127 concat!(
1128 "Offset of field: ",
1129 stringify!(TfLitePtrUnion),
1130 "::",
1131 stringify!(c128)
1132 )
1133 );
1134 assert_eq!(
1135 unsafe { ::core::ptr::addr_of!((*ptr).int8) as usize - ptr as usize },
1136 0usize,
1137 concat!(
1138 "Offset of field: ",
1139 stringify!(TfLitePtrUnion),
1140 "::",
1141 stringify!(int8)
1142 )
1143 );
1144 assert_eq!(
1145 unsafe { ::core::ptr::addr_of!((*ptr).data) as usize - ptr as usize },
1146 0usize,
1147 concat!(
1148 "Offset of field: ",
1149 stringify!(TfLitePtrUnion),
1150 "::",
1151 stringify!(data)
1152 )
1153 );
1154}
1155#[repr(u32)]
1156#[doc = " Memory allocation strategies.\n * `kTfLiteMmapRo`: Read-only memory-mapped data, or data externally\n allocated.\n * `kTfLiteArenaRw`: Arena allocated with no guarantees about persistence,\n and available during eval.\n * `kTfLiteArenaRwPersistent`: Arena allocated but persistent across eval,\n and only available during eval.\n * `kTfLiteDynamic`: Allocated during eval, or for string tensors.\n * `kTfLitePersistentRo`: Allocated and populated during prepare. This is\n useful for tensors that can be computed during prepare and treated\n as constant inputs for downstream ops (also in prepare).\n * `kTfLiteCustom`: Custom memory allocation provided by the user. See\n TfLiteCustomAllocation below.\n * `kTfLiteVariantObject`: Allocation is an arbitrary type-erased C++\n object.\n Allocation and deallocation are done through `new` and `delete`."]
1157#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
1158pub enum TfLiteAllocationType {
1159 kTfLiteMemNone = 0,
1160 kTfLiteMmapRo = 1,
1161 kTfLiteArenaRw = 2,
1162 kTfLiteArenaRwPersistent = 3,
1163 kTfLiteDynamic = 4,
1164 kTfLitePersistentRo = 5,
1165 kTfLiteCustom = 6,
1166 kTfLiteVariantObject = 7,
1167}
1168#[repr(u32)]
1169#[doc = " Memory allocation strategies.\n\n TfLiteAllocationType values have been overloaded to mean more than their\n original intent. This enum should only be used to document the allocation\n strategy used by a tensor for it data."]
1170#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
1171pub enum TfLiteAllocationStrategy {
1172 kTfLiteAllocationStrategyUnknown = 0,
1173 kTfLiteAllocationStrategyNone = 1,
1174 #[doc = " No data is allocated."]
1175 kTfLiteAllocationStrategyMMap = 2,
1176 #[doc = " Data is mmaped."]
1177 kTfLiteAllocationStrategyArena = 3,
1178 #[doc = " Handled by the arena."]
1179 kTfLiteAllocationStrategyMalloc = 4,
1180 #[doc = " Uses `malloc`/`free`."]
1181 kTfLiteAllocationStrategyNew = 5,
1182}
1183#[repr(u32)]
1184#[doc = " Describes how stable a tensor attribute is with regards to an interpreter\n runs."]
1185#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
1186pub enum TfLiteRunStability {
1187 kTfLiteRunStabilityUnknown = 0,
1188 kTfLiteRunStabilityUnstable = 1,
1189 #[doc = " May change at any time."]
1190 kTfLiteRunStabilitySingleRun = 2,
1191 #[doc = " Will stay the same for one run."]
1192 kTfLiteRunStabilityAcrossRuns = 3,
1193}
1194#[repr(u32)]
1195#[doc = " Describes the steps of a TFLite operation life cycle."]
1196#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
1197pub enum TfLiteRunStep {
1198 kTfLiteRunStepUnknown = 0,
1199 kTfLiteRunStepInit = 1,
1200 kTfLiteRunStepPrepare = 2,
1201 kTfLiteRunStepEval = 3,
1202}
1203#[doc = " The delegates should use zero or positive integers to represent handles.\n -1 is reserved from unallocated status."]
1204pub type TfLiteBufferHandle = ::core::ffi::c_int;
1205pub const kTfLiteNullBufferHandle: _bindgen_ty_1 = _bindgen_ty_1::kTfLiteNullBufferHandle;
1206#[repr(i32)]
1207#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
1208pub enum _bindgen_ty_1 {
1209 kTfLiteNullBufferHandle = -1,
1210}
1211#[repr(u32)]
1212#[doc = " Storage format of each dimension in a sparse tensor."]
1213#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
1214pub enum TfLiteDimensionType {
1215 kTfLiteDimDense = 0,
1216 kTfLiteDimSparseCSR = 1,
1217}
1218#[doc = " Metadata to encode each dimension in a sparse tensor."]
1219#[repr(C)]
1220#[derive(Debug, Copy, Clone)]
1221pub struct TfLiteDimensionMetadata {
1222 pub format: TfLiteDimensionType,
1223 pub dense_size: ::core::ffi::c_int,
1224 pub array_segments: *mut TfLiteIntArray,
1225 pub array_indices: *mut TfLiteIntArray,
1226}
1227#[test]
1228fn bindgen_test_layout_TfLiteDimensionMetadata() {
1229 const UNINIT: ::core::mem::MaybeUninit<TfLiteDimensionMetadata> =
1230 ::core::mem::MaybeUninit::uninit();
1231 let ptr = UNINIT.as_ptr();
1232 assert_eq!(
1233 ::core::mem::size_of::<TfLiteDimensionMetadata>(),
1234 24usize,
1235 concat!("Size of: ", stringify!(TfLiteDimensionMetadata))
1236 );
1237 assert_eq!(
1238 ::core::mem::align_of::<TfLiteDimensionMetadata>(),
1239 8usize,
1240 concat!("Alignment of ", stringify!(TfLiteDimensionMetadata))
1241 );
1242 assert_eq!(
1243 unsafe { ::core::ptr::addr_of!((*ptr).format) as usize - ptr as usize },
1244 0usize,
1245 concat!(
1246 "Offset of field: ",
1247 stringify!(TfLiteDimensionMetadata),
1248 "::",
1249 stringify!(format)
1250 )
1251 );
1252 assert_eq!(
1253 unsafe { ::core::ptr::addr_of!((*ptr).dense_size) as usize - ptr as usize },
1254 4usize,
1255 concat!(
1256 "Offset of field: ",
1257 stringify!(TfLiteDimensionMetadata),
1258 "::",
1259 stringify!(dense_size)
1260 )
1261 );
1262 assert_eq!(
1263 unsafe { ::core::ptr::addr_of!((*ptr).array_segments) as usize - ptr as usize },
1264 8usize,
1265 concat!(
1266 "Offset of field: ",
1267 stringify!(TfLiteDimensionMetadata),
1268 "::",
1269 stringify!(array_segments)
1270 )
1271 );
1272 assert_eq!(
1273 unsafe { ::core::ptr::addr_of!((*ptr).array_indices) as usize - ptr as usize },
1274 16usize,
1275 concat!(
1276 "Offset of field: ",
1277 stringify!(TfLiteDimensionMetadata),
1278 "::",
1279 stringify!(array_indices)
1280 )
1281 );
1282}
1283#[doc = " Parameters used to encode a sparse tensor. For detailed explanation of each\n field please refer to lite/schema/schema.fbs."]
1284#[repr(C)]
1285#[derive(Debug, Copy, Clone)]
1286pub struct TfLiteSparsity {
1287 pub traversal_order: *mut TfLiteIntArray,
1288 pub block_map: *mut TfLiteIntArray,
1289 pub dim_metadata: *mut TfLiteDimensionMetadata,
1290 pub dim_metadata_size: ::core::ffi::c_int,
1291}
1292#[test]
1293fn bindgen_test_layout_TfLiteSparsity() {
1294 const UNINIT: ::core::mem::MaybeUninit<TfLiteSparsity> = ::core::mem::MaybeUninit::uninit();
1295 let ptr = UNINIT.as_ptr();
1296 assert_eq!(
1297 ::core::mem::size_of::<TfLiteSparsity>(),
1298 32usize,
1299 concat!("Size of: ", stringify!(TfLiteSparsity))
1300 );
1301 assert_eq!(
1302 ::core::mem::align_of::<TfLiteSparsity>(),
1303 8usize,
1304 concat!("Alignment of ", stringify!(TfLiteSparsity))
1305 );
1306 assert_eq!(
1307 unsafe { ::core::ptr::addr_of!((*ptr).traversal_order) as usize - ptr as usize },
1308 0usize,
1309 concat!(
1310 "Offset of field: ",
1311 stringify!(TfLiteSparsity),
1312 "::",
1313 stringify!(traversal_order)
1314 )
1315 );
1316 assert_eq!(
1317 unsafe { ::core::ptr::addr_of!((*ptr).block_map) as usize - ptr as usize },
1318 8usize,
1319 concat!(
1320 "Offset of field: ",
1321 stringify!(TfLiteSparsity),
1322 "::",
1323 stringify!(block_map)
1324 )
1325 );
1326 assert_eq!(
1327 unsafe { ::core::ptr::addr_of!((*ptr).dim_metadata) as usize - ptr as usize },
1328 16usize,
1329 concat!(
1330 "Offset of field: ",
1331 stringify!(TfLiteSparsity),
1332 "::",
1333 stringify!(dim_metadata)
1334 )
1335 );
1336 assert_eq!(
1337 unsafe { ::core::ptr::addr_of!((*ptr).dim_metadata_size) as usize - ptr as usize },
1338 24usize,
1339 concat!(
1340 "Offset of field: ",
1341 stringify!(TfLiteSparsity),
1342 "::",
1343 stringify!(dim_metadata_size)
1344 )
1345 );
1346}
1347#[doc = " Defines a custom memory allocation not owned by the runtime.\n `data` should be aligned to kDefaultTensorAlignment defined in\n lite/util.h. (Currently 64 bytes)\n NOTE: See `Interpreter::SetCustomAllocationForTensor` for details on usage."]
1348#[repr(C)]
1349#[derive(Debug, Copy, Clone)]
1350pub struct TfLiteCustomAllocation {
1351 pub data: *mut ::core::ffi::c_void,
1352 pub bytes: usize,
1353}
1354#[test]
1355fn bindgen_test_layout_TfLiteCustomAllocation() {
1356 const UNINIT: ::core::mem::MaybeUninit<TfLiteCustomAllocation> =
1357 ::core::mem::MaybeUninit::uninit();
1358 let ptr = UNINIT.as_ptr();
1359 assert_eq!(
1360 ::core::mem::size_of::<TfLiteCustomAllocation>(),
1361 16usize,
1362 concat!("Size of: ", stringify!(TfLiteCustomAllocation))
1363 );
1364 assert_eq!(
1365 ::core::mem::align_of::<TfLiteCustomAllocation>(),
1366 8usize,
1367 concat!("Alignment of ", stringify!(TfLiteCustomAllocation))
1368 );
1369 assert_eq!(
1370 unsafe { ::core::ptr::addr_of!((*ptr).data) as usize - ptr as usize },
1371 0usize,
1372 concat!(
1373 "Offset of field: ",
1374 stringify!(TfLiteCustomAllocation),
1375 "::",
1376 stringify!(data)
1377 )
1378 );
1379 assert_eq!(
1380 unsafe { ::core::ptr::addr_of!((*ptr).bytes) as usize - ptr as usize },
1381 8usize,
1382 concat!(
1383 "Offset of field: ",
1384 stringify!(TfLiteCustomAllocation),
1385 "::",
1386 stringify!(bytes)
1387 )
1388 );
1389}
1390#[repr(u32)]
1391#[doc = " The flags used in `Interpreter::SetCustomAllocationForTensor`.\n Note that this is a bitmask, so the values should be 1, 2, 4, 8, ...etc."]
1392#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
1393pub enum TfLiteCustomAllocationFlags {
1394 kTfLiteCustomAllocationFlagsNone = 0,
1395 #[doc = " Skips checking whether allocation.data points to an aligned buffer as\n expected by the TFLite runtime.\n NOTE: Setting this flag can cause crashes when calling Invoke().\n Use with caution."]
1396 kTfLiteCustomAllocationFlagsSkipAlignCheck = 1,
1397}
1398pub const kTfLiteNoBufferIdentifier: _bindgen_ty_2 = _bindgen_ty_2::kTfLiteNoBufferIdentifier;
1399#[repr(u64)]
1400#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
1401pub enum _bindgen_ty_2 {
1402 kTfLiteNoBufferIdentifier = 18446744073709551615,
1403}
1404#[repr(C)]
1405#[derive(Copy, Clone)]
1406pub struct TfLiteTensor {
1407 #[doc = " The data type specification for data stored in `data`. This affects\n what member of `data` union should be used."]
1408 pub type_: TfLiteType,
1409 #[doc = " A union of data pointers. The appropriate type should be used for a typed\n tensor based on `type`."]
1410 pub data: TfLitePtrUnion,
1411 #[doc = " A pointer to a structure representing the dimensionality interpretation\n that the buffer should have. NOTE: the product of elements of `dims`\n and the element datatype size should be equal to `bytes` below."]
1412 pub dims: *mut TfLiteIntArray,
1413 #[doc = " Quantization information."]
1414 pub params: TfLiteQuantizationParams,
1415 #[doc = " How memory is mapped\n kTfLiteMmapRo: Memory mapped read only.\n i.e. weights\n kTfLiteArenaRw: Arena allocated read write memory\n (i.e. temporaries, outputs)."]
1416 pub allocation_type: TfLiteAllocationType,
1417 #[doc = " The number of bytes required to store the data of this Tensor. I.e.\n (bytes of each element) * dims[0] * ... * dims[n-1]. For example, if\n type is kTfLiteFloat32 and dims = {3, 2} then\n bytes = sizeof(float) * 3 * 2 = 4 * 3 * 2 = 24."]
1418 pub bytes: usize,
1419 #[doc = " An opaque pointer to a tflite::MMapAllocation"]
1420 pub allocation: *const ::core::ffi::c_void,
1421 #[doc = " Null-terminated name of this tensor."]
1422 pub name: *const ::core::ffi::c_char,
1423 #[doc = " The delegate which knows how to handle `buffer_handle`.\n\n WARNING: This is an experimental interface that is subject to change."]
1424 pub delegate: *mut TfLiteDelegate,
1425 #[doc = " An integer buffer handle that can be handled by `delegate`.\n The value is valid only when delegate is not null.\n\n WARNING: This is an experimental interface that is subject to change."]
1426 pub buffer_handle: TfLiteBufferHandle,
1427 #[doc = " If the delegate uses its own buffer (e.g. GPU memory), the delegate is\n responsible to set data_is_stale to true.\n `delegate->CopyFromBufferHandle` can be called to copy the data from\n delegate buffer.\n\n WARNING: This is an experimental interface that is subject to change."]
1428 pub data_is_stale: bool,
1429 #[doc = " True if the tensor is a variable."]
1430 pub is_variable: bool,
1431 #[doc = " Quantization information. Replaces params field above."]
1432 pub quantization: TfLiteQuantization,
1433 #[doc = " Parameters used to encode a sparse tensor.\n This is optional. The field is NULL if a tensor is dense.\n\n WARNING: This is an experimental interface that is subject to change."]
1434 pub sparsity: *mut TfLiteSparsity,
1435 #[doc = " Optional. Encodes shapes with unknown dimensions with -1. This field is\n only populated when unknown dimensions exist in a read-write tensor (i.e.\n an input or output tensor). (e.g. `dims` contains [1, 1, 1, 3] and\n `dims_signature` contains [1, -1, -1, 3]). If no unknown dimensions exist\n then `dims_signature` is either null, or set to an empty array. Note that\n this field only exists when TF_LITE_STATIC_MEMORY is not defined."]
1436 pub dims_signature: *const TfLiteIntArray,
1437}
1438#[test]
1439fn bindgen_test_layout_TfLiteTensor() {
1440 const UNINIT: ::core::mem::MaybeUninit<TfLiteTensor> = ::core::mem::MaybeUninit::uninit();
1441 let ptr = UNINIT.as_ptr();
1442 assert_eq!(
1443 ::core::mem::size_of::<TfLiteTensor>(),
1444 112usize,
1445 concat!("Size of: ", stringify!(TfLiteTensor))
1446 );
1447 assert_eq!(
1448 ::core::mem::align_of::<TfLiteTensor>(),
1449 8usize,
1450 concat!("Alignment of ", stringify!(TfLiteTensor))
1451 );
1452 assert_eq!(
1453 unsafe { ::core::ptr::addr_of!((*ptr).type_) as usize - ptr as usize },
1454 0usize,
1455 concat!(
1456 "Offset of field: ",
1457 stringify!(TfLiteTensor),
1458 "::",
1459 stringify!(type_)
1460 )
1461 );
1462 assert_eq!(
1463 unsafe { ::core::ptr::addr_of!((*ptr).data) as usize - ptr as usize },
1464 8usize,
1465 concat!(
1466 "Offset of field: ",
1467 stringify!(TfLiteTensor),
1468 "::",
1469 stringify!(data)
1470 )
1471 );
1472 assert_eq!(
1473 unsafe { ::core::ptr::addr_of!((*ptr).dims) as usize - ptr as usize },
1474 16usize,
1475 concat!(
1476 "Offset of field: ",
1477 stringify!(TfLiteTensor),
1478 "::",
1479 stringify!(dims)
1480 )
1481 );
1482 assert_eq!(
1483 unsafe { ::core::ptr::addr_of!((*ptr).params) as usize - ptr as usize },
1484 24usize,
1485 concat!(
1486 "Offset of field: ",
1487 stringify!(TfLiteTensor),
1488 "::",
1489 stringify!(params)
1490 )
1491 );
1492 assert_eq!(
1493 unsafe { ::core::ptr::addr_of!((*ptr).allocation_type) as usize - ptr as usize },
1494 32usize,
1495 concat!(
1496 "Offset of field: ",
1497 stringify!(TfLiteTensor),
1498 "::",
1499 stringify!(allocation_type)
1500 )
1501 );
1502 assert_eq!(
1503 unsafe { ::core::ptr::addr_of!((*ptr).bytes) as usize - ptr as usize },
1504 40usize,
1505 concat!(
1506 "Offset of field: ",
1507 stringify!(TfLiteTensor),
1508 "::",
1509 stringify!(bytes)
1510 )
1511 );
1512 assert_eq!(
1513 unsafe { ::core::ptr::addr_of!((*ptr).allocation) as usize - ptr as usize },
1514 48usize,
1515 concat!(
1516 "Offset of field: ",
1517 stringify!(TfLiteTensor),
1518 "::",
1519 stringify!(allocation)
1520 )
1521 );
1522 assert_eq!(
1523 unsafe { ::core::ptr::addr_of!((*ptr).name) as usize - ptr as usize },
1524 56usize,
1525 concat!(
1526 "Offset of field: ",
1527 stringify!(TfLiteTensor),
1528 "::",
1529 stringify!(name)
1530 )
1531 );
1532 assert_eq!(
1533 unsafe { ::core::ptr::addr_of!((*ptr).delegate) as usize - ptr as usize },
1534 64usize,
1535 concat!(
1536 "Offset of field: ",
1537 stringify!(TfLiteTensor),
1538 "::",
1539 stringify!(delegate)
1540 )
1541 );
1542 assert_eq!(
1543 unsafe { ::core::ptr::addr_of!((*ptr).buffer_handle) as usize - ptr as usize },
1544 72usize,
1545 concat!(
1546 "Offset of field: ",
1547 stringify!(TfLiteTensor),
1548 "::",
1549 stringify!(buffer_handle)
1550 )
1551 );
1552 assert_eq!(
1553 unsafe { ::core::ptr::addr_of!((*ptr).data_is_stale) as usize - ptr as usize },
1554 76usize,
1555 concat!(
1556 "Offset of field: ",
1557 stringify!(TfLiteTensor),
1558 "::",
1559 stringify!(data_is_stale)
1560 )
1561 );
1562 assert_eq!(
1563 unsafe { ::core::ptr::addr_of!((*ptr).is_variable) as usize - ptr as usize },
1564 77usize,
1565 concat!(
1566 "Offset of field: ",
1567 stringify!(TfLiteTensor),
1568 "::",
1569 stringify!(is_variable)
1570 )
1571 );
1572 assert_eq!(
1573 unsafe { ::core::ptr::addr_of!((*ptr).quantization) as usize - ptr as usize },
1574 80usize,
1575 concat!(
1576 "Offset of field: ",
1577 stringify!(TfLiteTensor),
1578 "::",
1579 stringify!(quantization)
1580 )
1581 );
1582 assert_eq!(
1583 unsafe { ::core::ptr::addr_of!((*ptr).sparsity) as usize - ptr as usize },
1584 96usize,
1585 concat!(
1586 "Offset of field: ",
1587 stringify!(TfLiteTensor),
1588 "::",
1589 stringify!(sparsity)
1590 )
1591 );
1592 assert_eq!(
1593 unsafe { ::core::ptr::addr_of!((*ptr).dims_signature) as usize - ptr as usize },
1594 104usize,
1595 concat!(
1596 "Offset of field: ",
1597 stringify!(TfLiteTensor),
1598 "::",
1599 stringify!(dims_signature)
1600 )
1601 );
1602}
1603#[doc = " A structure representing an instance of a node.\n This structure only exhibits the inputs, outputs, user defined data and some\n node properties (like statefulness), not other features like the type."]
1604#[repr(C)]
1605#[derive(Debug, Copy, Clone)]
1606pub struct TfLiteNode {
1607 #[doc = " Inputs to this node expressed as indices into the simulator's tensors."]
1608 pub inputs: *mut TfLiteIntArray,
1609 #[doc = " Outputs to this node expressed as indices into the simulator's tensors."]
1610 pub outputs: *mut TfLiteIntArray,
1611 #[doc = " intermediate tensors to this node expressed as indices into the\n simulator's tensors."]
1612 pub intermediates: *mut TfLiteIntArray,
1613 #[doc = " Temporary tensors uses during the computations. This usually contains no\n tensors, but ops are allowed to change that if they need scratch space of\n any sort."]
1614 pub temporaries: *mut TfLiteIntArray,
1615 #[doc = " Opaque data provided by the node implementer through `Registration.init`."]
1616 pub user_data: *mut ::core::ffi::c_void,
1617 #[doc = " Opaque data provided to the node if the node is a builtin. This is usually\n a structure defined in builtin_op_data.h"]
1618 pub builtin_data: *mut ::core::ffi::c_void,
1619 #[doc = " Custom initial data. This is the opaque data provided in the flatbuffer.\n\n WARNING: This is an experimental interface that is subject to change."]
1620 pub custom_initial_data: *const ::core::ffi::c_void,
1621 pub custom_initial_data_size: ::core::ffi::c_int,
1622 #[doc = " The pointer to the delegate. This is non-null only when the node is\n created by calling `interpreter.ModifyGraphWithDelegate`.\n\n WARNING: This is an experimental interface that is subject to change."]
1623 pub delegate: *mut TfLiteDelegate,
1624 #[doc = " Whether this op might have side effect (e.g. stateful op)."]
1625 pub might_have_side_effect: bool,
1626}
1627#[test]
1628fn bindgen_test_layout_TfLiteNode() {
1629 const UNINIT: ::core::mem::MaybeUninit<TfLiteNode> = ::core::mem::MaybeUninit::uninit();
1630 let ptr = UNINIT.as_ptr();
1631 assert_eq!(
1632 ::core::mem::size_of::<TfLiteNode>(),
1633 80usize,
1634 concat!("Size of: ", stringify!(TfLiteNode))
1635 );
1636 assert_eq!(
1637 ::core::mem::align_of::<TfLiteNode>(),
1638 8usize,
1639 concat!("Alignment of ", stringify!(TfLiteNode))
1640 );
1641 assert_eq!(
1642 unsafe { ::core::ptr::addr_of!((*ptr).inputs) as usize - ptr as usize },
1643 0usize,
1644 concat!(
1645 "Offset of field: ",
1646 stringify!(TfLiteNode),
1647 "::",
1648 stringify!(inputs)
1649 )
1650 );
1651 assert_eq!(
1652 unsafe { ::core::ptr::addr_of!((*ptr).outputs) as usize - ptr as usize },
1653 8usize,
1654 concat!(
1655 "Offset of field: ",
1656 stringify!(TfLiteNode),
1657 "::",
1658 stringify!(outputs)
1659 )
1660 );
1661 assert_eq!(
1662 unsafe { ::core::ptr::addr_of!((*ptr).intermediates) as usize - ptr as usize },
1663 16usize,
1664 concat!(
1665 "Offset of field: ",
1666 stringify!(TfLiteNode),
1667 "::",
1668 stringify!(intermediates)
1669 )
1670 );
1671 assert_eq!(
1672 unsafe { ::core::ptr::addr_of!((*ptr).temporaries) as usize - ptr as usize },
1673 24usize,
1674 concat!(
1675 "Offset of field: ",
1676 stringify!(TfLiteNode),
1677 "::",
1678 stringify!(temporaries)
1679 )
1680 );
1681 assert_eq!(
1682 unsafe { ::core::ptr::addr_of!((*ptr).user_data) as usize - ptr as usize },
1683 32usize,
1684 concat!(
1685 "Offset of field: ",
1686 stringify!(TfLiteNode),
1687 "::",
1688 stringify!(user_data)
1689 )
1690 );
1691 assert_eq!(
1692 unsafe { ::core::ptr::addr_of!((*ptr).builtin_data) as usize - ptr as usize },
1693 40usize,
1694 concat!(
1695 "Offset of field: ",
1696 stringify!(TfLiteNode),
1697 "::",
1698 stringify!(builtin_data)
1699 )
1700 );
1701 assert_eq!(
1702 unsafe { ::core::ptr::addr_of!((*ptr).custom_initial_data) as usize - ptr as usize },
1703 48usize,
1704 concat!(
1705 "Offset of field: ",
1706 stringify!(TfLiteNode),
1707 "::",
1708 stringify!(custom_initial_data)
1709 )
1710 );
1711 assert_eq!(
1712 unsafe { ::core::ptr::addr_of!((*ptr).custom_initial_data_size) as usize - ptr as usize },
1713 56usize,
1714 concat!(
1715 "Offset of field: ",
1716 stringify!(TfLiteNode),
1717 "::",
1718 stringify!(custom_initial_data_size)
1719 )
1720 );
1721 assert_eq!(
1722 unsafe { ::core::ptr::addr_of!((*ptr).delegate) as usize - ptr as usize },
1723 64usize,
1724 concat!(
1725 "Offset of field: ",
1726 stringify!(TfLiteNode),
1727 "::",
1728 stringify!(delegate)
1729 )
1730 );
1731 assert_eq!(
1732 unsafe { ::core::ptr::addr_of!((*ptr).might_have_side_effect) as usize - ptr as usize },
1733 72usize,
1734 concat!(
1735 "Offset of field: ",
1736 stringify!(TfLiteNode),
1737 "::",
1738 stringify!(might_have_side_effect)
1739 )
1740 );
1741}
1742#[doc = " Light-weight tensor struct for TF Micro runtime. Provides the minimal amount\n of information required for a kernel to run during TfLiteRegistration::Eval."]
1743#[repr(C)]
1744#[derive(Copy, Clone)]
1745pub struct TfLiteEvalTensor {
1746 #[doc = " A union of data pointers. The appropriate type should be used for a typed\n tensor based on `type`."]
1747 pub data: TfLitePtrUnion,
1748 #[doc = " A pointer to a structure representing the dimensionality interpretation\n that the buffer should have."]
1749 pub dims: *mut TfLiteIntArray,
1750 #[doc = " The data type specification for data stored in `data`. This affects\n what member of `data` union should be used."]
1751 pub type_: TfLiteType,
1752}
1753#[test]
1754fn bindgen_test_layout_TfLiteEvalTensor() {
1755 const UNINIT: ::core::mem::MaybeUninit<TfLiteEvalTensor> = ::core::mem::MaybeUninit::uninit();
1756 let ptr = UNINIT.as_ptr();
1757 assert_eq!(
1758 ::core::mem::size_of::<TfLiteEvalTensor>(),
1759 24usize,
1760 concat!("Size of: ", stringify!(TfLiteEvalTensor))
1761 );
1762 assert_eq!(
1763 ::core::mem::align_of::<TfLiteEvalTensor>(),
1764 8usize,
1765 concat!("Alignment of ", stringify!(TfLiteEvalTensor))
1766 );
1767 assert_eq!(
1768 unsafe { ::core::ptr::addr_of!((*ptr).data) as usize - ptr as usize },
1769 0usize,
1770 concat!(
1771 "Offset of field: ",
1772 stringify!(TfLiteEvalTensor),
1773 "::",
1774 stringify!(data)
1775 )
1776 );
1777 assert_eq!(
1778 unsafe { ::core::ptr::addr_of!((*ptr).dims) as usize - ptr as usize },
1779 8usize,
1780 concat!(
1781 "Offset of field: ",
1782 stringify!(TfLiteEvalTensor),
1783 "::",
1784 stringify!(dims)
1785 )
1786 );
1787 assert_eq!(
1788 unsafe { ::core::ptr::addr_of!((*ptr).type_) as usize - ptr as usize },
1789 16usize,
1790 concat!(
1791 "Offset of field: ",
1792 stringify!(TfLiteEvalTensor),
1793 "::",
1794 stringify!(type_)
1795 )
1796 );
1797}
1798extern "C" {
1799 #[doc = " Free data memory of tensor `t`."]
1800 pub fn TfLiteTensorDataFree(t: *mut TfLiteTensor);
1801}
1802extern "C" {
1803 #[doc = " Free quantization data."]
1804 pub fn TfLiteQuantizationFree(quantization: *mut TfLiteQuantization);
1805}
1806extern "C" {
1807 #[doc = " Free sparsity parameters."]
1808 pub fn TfLiteSparsityFree(sparsity: *mut TfLiteSparsity);
1809}
1810extern "C" {
1811 #[doc = " Free memory of tensor `t`."]
1812 pub fn TfLiteTensorFree(t: *mut TfLiteTensor);
1813}
1814extern "C" {
1815 #[doc = " Set all of a tensor's fields (and free any previously allocated data)."]
1816 pub fn TfLiteTensorReset(
1817 type_: TfLiteType,
1818 name: *const ::core::ffi::c_char,
1819 dims: *mut TfLiteIntArray,
1820 quantization: TfLiteQuantizationParams,
1821 buffer: *mut ::core::ffi::c_char,
1822 size: usize,
1823 allocation_type: TfLiteAllocationType,
1824 allocation: *const ::core::ffi::c_void,
1825 is_variable: bool,
1826 tensor: *mut TfLiteTensor,
1827 );
1828}
1829extern "C" {
1830 #[doc = " Copies the contents of `src` in `dst`.\n Function does nothing if either `src` or `dst` is passed as nullptr and\n return `kTfLiteOk`.\n Returns `kTfLiteError` if `src` and `dst` doesn't have matching data size.\n Note function copies contents, so it won't create new data pointer\n or change allocation type.\n All Tensor related properties will be copied from `src` to `dst` like\n quantization, sparsity, ..."]
1831 pub fn TfLiteTensorCopy(src: *const TfLiteTensor, dst: *mut TfLiteTensor) -> TfLiteStatus;
1832}
1833extern "C" {
1834 #[doc = " Change the size of the memory block owned by `tensor` to `num_bytes`.\n Tensors with allocation types other than `kTfLiteDynamic` will be ignored\n and a `kTfLiteOk` will be returned. `tensor`'s internal data buffer will be\n assigned a pointer which can safely be passed to free or realloc if\n `num_bytes` is zero. If `preserve_data` is true, tensor data will be\n unchanged in the range from the start of the region up to the minimum of the\n old and new sizes. In the case of NULL tensor, or an error allocating new\n memory, returns `kTfLiteError`."]
1835 pub fn TfLiteTensorResizeMaybeCopy(
1836 num_bytes: usize,
1837 tensor: *mut TfLiteTensor,
1838 preserve_data: bool,
1839 ) -> TfLiteStatus;
1840}
1841extern "C" {
1842 #[doc = " Change the size of the memory block owned by `tensor` to `num_bytes`.\n Tensors with allocation types other than `kTfLiteDynamic` will be ignored\n and a `kTfLiteOk` will be returned. `tensor`'s internal data buffer will be\n assigned a pointer which can safely be passed to free or realloc if\n `num_bytes` is zero. Tensor data will be unchanged in the range from the\n start of the region up to the minimum of the old and new sizes. In the case\n of NULL tensor, or an error allocating new memory, returns `kTfLiteError`."]
1843 pub fn TfLiteTensorRealloc(num_bytes: usize, tensor: *mut TfLiteTensor) -> TfLiteStatus;
1844}
1845#[doc = " WARNING: This is an experimental interface that is subject to change.\n\n Currently, TfLiteDelegateParams has to be allocated in a way that it's\n trivially destructable. It will be stored as `builtin_data` field in\n `TfLiteNode` of the delegate node.\n\n See also the `CreateDelegateParams` function in `interpreter.cc` details."]
1846#[repr(C)]
1847#[derive(Debug, Copy, Clone)]
1848pub struct TfLiteDelegateParams {
1849 pub delegate: *mut TfLiteDelegate,
1850 pub nodes_to_replace: *mut TfLiteIntArray,
1851 pub input_tensors: *mut TfLiteIntArray,
1852 pub output_tensors: *mut TfLiteIntArray,
1853}
1854#[test]
1855fn bindgen_test_layout_TfLiteDelegateParams() {
1856 const UNINIT: ::core::mem::MaybeUninit<TfLiteDelegateParams> =
1857 ::core::mem::MaybeUninit::uninit();
1858 let ptr = UNINIT.as_ptr();
1859 assert_eq!(
1860 ::core::mem::size_of::<TfLiteDelegateParams>(),
1861 32usize,
1862 concat!("Size of: ", stringify!(TfLiteDelegateParams))
1863 );
1864 assert_eq!(
1865 ::core::mem::align_of::<TfLiteDelegateParams>(),
1866 8usize,
1867 concat!("Alignment of ", stringify!(TfLiteDelegateParams))
1868 );
1869 assert_eq!(
1870 unsafe { ::core::ptr::addr_of!((*ptr).delegate) as usize - ptr as usize },
1871 0usize,
1872 concat!(
1873 "Offset of field: ",
1874 stringify!(TfLiteDelegateParams),
1875 "::",
1876 stringify!(delegate)
1877 )
1878 );
1879 assert_eq!(
1880 unsafe { ::core::ptr::addr_of!((*ptr).nodes_to_replace) as usize - ptr as usize },
1881 8usize,
1882 concat!(
1883 "Offset of field: ",
1884 stringify!(TfLiteDelegateParams),
1885 "::",
1886 stringify!(nodes_to_replace)
1887 )
1888 );
1889 assert_eq!(
1890 unsafe { ::core::ptr::addr_of!((*ptr).input_tensors) as usize - ptr as usize },
1891 16usize,
1892 concat!(
1893 "Offset of field: ",
1894 stringify!(TfLiteDelegateParams),
1895 "::",
1896 stringify!(input_tensors)
1897 )
1898 );
1899 assert_eq!(
1900 unsafe { ::core::ptr::addr_of!((*ptr).output_tensors) as usize - ptr as usize },
1901 24usize,
1902 concat!(
1903 "Offset of field: ",
1904 stringify!(TfLiteDelegateParams),
1905 "::",
1906 stringify!(output_tensors)
1907 )
1908 );
1909}
1910#[doc = " WARNING: This is an experimental interface that is subject to change.\n\n Currently, TfLiteOpaqueDelegateParams has to be allocated in a way that it's\n trivially destructable. It will be stored as `builtin_data` field in\n `TfLiteNode` of the delegate node.\n\n See also the `CreateOpaqueDelegateParams` function in `subgraph.cc`\n details."]
1911#[repr(C)]
1912#[derive(Debug, Copy, Clone)]
1913pub struct TfLiteOpaqueDelegateParams {
1914 pub delegate: *mut TfLiteOpaqueDelegate,
1915 pub delegate_data: *mut ::core::ffi::c_void,
1916 pub nodes_to_replace: *mut TfLiteIntArray,
1917 pub input_tensors: *mut TfLiteIntArray,
1918 pub output_tensors: *mut TfLiteIntArray,
1919}
1920#[test]
1921fn bindgen_test_layout_TfLiteOpaqueDelegateParams() {
1922 const UNINIT: ::core::mem::MaybeUninit<TfLiteOpaqueDelegateParams> =
1923 ::core::mem::MaybeUninit::uninit();
1924 let ptr = UNINIT.as_ptr();
1925 assert_eq!(
1926 ::core::mem::size_of::<TfLiteOpaqueDelegateParams>(),
1927 40usize,
1928 concat!("Size of: ", stringify!(TfLiteOpaqueDelegateParams))
1929 );
1930 assert_eq!(
1931 ::core::mem::align_of::<TfLiteOpaqueDelegateParams>(),
1932 8usize,
1933 concat!("Alignment of ", stringify!(TfLiteOpaqueDelegateParams))
1934 );
1935 assert_eq!(
1936 unsafe { ::core::ptr::addr_of!((*ptr).delegate) as usize - ptr as usize },
1937 0usize,
1938 concat!(
1939 "Offset of field: ",
1940 stringify!(TfLiteOpaqueDelegateParams),
1941 "::",
1942 stringify!(delegate)
1943 )
1944 );
1945 assert_eq!(
1946 unsafe { ::core::ptr::addr_of!((*ptr).delegate_data) as usize - ptr as usize },
1947 8usize,
1948 concat!(
1949 "Offset of field: ",
1950 stringify!(TfLiteOpaqueDelegateParams),
1951 "::",
1952 stringify!(delegate_data)
1953 )
1954 );
1955 assert_eq!(
1956 unsafe { ::core::ptr::addr_of!((*ptr).nodes_to_replace) as usize - ptr as usize },
1957 16usize,
1958 concat!(
1959 "Offset of field: ",
1960 stringify!(TfLiteOpaqueDelegateParams),
1961 "::",
1962 stringify!(nodes_to_replace)
1963 )
1964 );
1965 assert_eq!(
1966 unsafe { ::core::ptr::addr_of!((*ptr).input_tensors) as usize - ptr as usize },
1967 24usize,
1968 concat!(
1969 "Offset of field: ",
1970 stringify!(TfLiteOpaqueDelegateParams),
1971 "::",
1972 stringify!(input_tensors)
1973 )
1974 );
1975 assert_eq!(
1976 unsafe { ::core::ptr::addr_of!((*ptr).output_tensors) as usize - ptr as usize },
1977 32usize,
1978 concat!(
1979 "Offset of field: ",
1980 stringify!(TfLiteOpaqueDelegateParams),
1981 "::",
1982 stringify!(output_tensors)
1983 )
1984 );
1985}
1986#[doc = " `TfLiteContext` allows an op to access the tensors.\n\n `TfLiteContext` is a struct that is created by the TF Lite runtime\n and passed to the \"methods\" (C function pointers) in the\n `TfLiteRegistration` struct that are used to define custom ops and custom\n delegate kernels. It contains information and methods (C function pointers)\n that can be called by the code implementing a custom op or a custom delegate\n kernel. These methods provide access to the context in which that custom op\n or custom delegate kernel occurs, such as access to the input and output\n tensors for that op, as well as methods for allocating memory buffers\n and intermediate tensors, etc.\n\n See also `TfLiteOpaqueContext`, which is an more ABI-stable equivalent."]
1987#[repr(C)]
1988#[derive(Debug, Copy, Clone)]
1989pub struct TfLiteContext {
1990 #[doc = " Number of tensors in the context."]
1991 pub tensors_size: usize,
1992 #[doc = " The execution plan contains a list of the node indices in execution\n order. execution_plan->size is the current number of nodes. And,\n execution_plan->data[0] is the first node that needs to be run.\n TfLiteDelegates can traverse the current execution plan by iterating\n through each member of this array and using GetNodeAndRegistration() to\n access details about a node. i.e.\n\n\n TfLiteIntArray* execution_plan;\n TF_LITE_ENSURE_STATUS(context->GetExecutionPlan(context,\n &execution_plan));\n for (int exec_index = 0; exec_index < execution_plan->size;\n exec_index++) {\n int node_index = execution_plan->data[exec_index];\n TfLiteNode* node;\n TfLiteRegistration* reg;\n context->GetNodeAndRegistration(context, node_index, &node, ®);\n }\n\n Note: the memory pointed by '`*execution_plan` is OWNED by TfLite runtime.\n Future calls to GetExecutionPlan invalidates earlier outputs. The\n following code snippet shows the issue of such an invocation pattern.\n After calling CheckNode, subsequent access to `plan_1st` is undefined.\n\n void CheckNode(const TfLiteNode* node) {\n ...\n TfLiteIntArray* plan_2nd;\n TF_LITE_ENSURE_STATUS(\n context->GetExecutionPlan(context, &plan_2nd)\n );\n ...\n }\n\n TfLiteIntArray* plan_1st;\n TF_LITE_ENSURE_STATUS(context->GetExecutionPlan(context, &plan_1st));\n for (int exec_index = 0; exec_index < plan_1st->size; exec_index++) {\n int node_index = plan_1st->data[exec_index];\n TfLiteNode* node;\n TfLiteRegistration* reg;\n context->GetNodeAndRegistration(context, node_index, &node, ®);\n CheckNode(node);\n }\n\n WARNING: This is an experimental interface that is subject to change."]
1993 pub GetExecutionPlan: ::core::option::Option<
1994 unsafe extern "C" fn(
1995 context: *mut TfLiteContext,
1996 execution_plan: *mut *mut TfLiteIntArray,
1997 ) -> TfLiteStatus,
1998 >,
1999 #[doc = " An array of tensors in the interpreter context (of length `tensors_size`)"]
2000 pub tensors: *mut TfLiteTensor,
2001 #[doc = " opaque full context ptr (an opaque c++ data structure)"]
2002 pub impl_: *mut ::core::ffi::c_void,
2003 #[doc = " Request memory pointer be resized. Updates dimensions on the tensor.\n NOTE: ResizeTensor takes ownership of newSize."]
2004 pub ResizeTensor: ::core::option::Option<
2005 unsafe extern "C" fn(
2006 arg1: *mut TfLiteContext,
2007 tensor: *mut TfLiteTensor,
2008 new_size: *mut TfLiteIntArray,
2009 ) -> TfLiteStatus,
2010 >,
2011 #[doc = " Request that an error be reported with format string msg."]
2012 pub ReportError: ::core::option::Option<
2013 unsafe extern "C" fn(arg1: *mut TfLiteContext, msg: *const ::core::ffi::c_char, ...),
2014 >,
2015 #[doc = " Add `tensors_to_add` tensors, preserving pre-existing Tensor entries. If\n non-null, the value pointed to by `first_new_tensor_index` will be set to\n the index of the first new tensor."]
2016 pub AddTensors: ::core::option::Option<
2017 unsafe extern "C" fn(
2018 arg1: *mut TfLiteContext,
2019 tensors_to_add: ::core::ffi::c_int,
2020 first_new_tensor_index: *mut ::core::ffi::c_int,
2021 ) -> TfLiteStatus,
2022 >,
2023 #[doc = " Get a Tensor node by node_index.\n\n WARNING: This is an experimental interface that is subject to change."]
2024 pub GetNodeAndRegistration: ::core::option::Option<
2025 unsafe extern "C" fn(
2026 arg1: *mut TfLiteContext,
2027 node_index: ::core::ffi::c_int,
2028 node: *mut *mut TfLiteNode,
2029 registration: *mut *mut TfLiteRegistration,
2030 ) -> TfLiteStatus,
2031 >,
2032 #[doc = " Replace ops with one or more stub delegate operations. This function\n does not take ownership of `nodes_to_replace`."]
2033 pub ReplaceNodeSubsetsWithDelegateKernels: ::core::option::Option<
2034 unsafe extern "C" fn(
2035 arg1: *mut TfLiteContext,
2036 registration: TfLiteRegistration,
2037 nodes_to_replace: *const TfLiteIntArray,
2038 delegate: *mut TfLiteDelegate,
2039 ) -> TfLiteStatus,
2040 >,
2041 #[doc = " Number of threads that are recommended to subsystems like gemmlowp and\n eigen."]
2042 pub recommended_num_threads: ::core::ffi::c_int,
2043 #[doc = " Access external contexts by type.\n\n WARNING: This is an experimental interface that is subject to change."]
2044 pub GetExternalContext: ::core::option::Option<
2045 unsafe extern "C" fn(
2046 arg1: *mut TfLiteContext,
2047 arg2: TfLiteExternalContextType,
2048 ) -> *mut TfLiteExternalContext,
2049 >,
2050 #[doc = " Set the value of a external context. Does not take ownership of the\n pointer.\n\n WARNING: This is an experimental interface that is subject to change."]
2051 pub SetExternalContext: ::core::option::Option<
2052 unsafe extern "C" fn(
2053 arg1: *mut TfLiteContext,
2054 arg2: TfLiteExternalContextType,
2055 arg3: *mut TfLiteExternalContext,
2056 ),
2057 >,
2058 #[doc = " Flag for allowing float16 precision for FP32 calculation.\n default: false.\n\n WARNING: This is an experimental API and subject to change."]
2059 pub allow_fp32_relax_to_fp16: bool,
2060 #[doc = " Pointer to the op-level profiler, if set; nullptr otherwise."]
2061 pub profiler: *mut ::core::ffi::c_void,
2062 #[doc = " Allocate persistent buffer which has the same life time as the\n interpreter. Returns `nullptr` on failure. The memory is allocated from\n heap for TFL, and from tail in TFLM. This method is only available in\n `Init` or `Prepare` stage.\n\n WARNING: This is an experimental interface that is subject\n to change."]
2063 pub AllocatePersistentBuffer: ::core::option::Option<
2064 unsafe extern "C" fn(ctx: *mut TfLiteContext, bytes: usize) -> *mut ::core::ffi::c_void,
2065 >,
2066 #[doc = " Allocate a buffer which will be deallocated right after invoke phase.\n The memory is allocated from heap in TFL, and from volatile arena in TFLM.\n This method is only available in invoke stage.\n\n NOTE: If possible use `RequestScratchBufferInArena` method to avoid memory\n allocation during inference time.\n\n WARNING: This is an experimental interface that is subject to change."]
2067 pub AllocateBufferForEval: ::core::option::Option<
2068 unsafe extern "C" fn(
2069 ctx: *mut TfLiteContext,
2070 bytes: usize,
2071 ptr: *mut *mut ::core::ffi::c_void,
2072 ) -> TfLiteStatus,
2073 >,
2074 #[doc = " Request a scratch buffer in the arena through static memory planning.\n This method is only available in `Prepare` stage and the buffer is\n allocated by the interpreter between Prepare and Eval stage. In `Eval`\n stage, `GetScratchBuffer` API can be used to fetch the address.\n\n WARNING: This is an experimental interface that is subject to change."]
2075 pub RequestScratchBufferInArena: ::core::option::Option<
2076 unsafe extern "C" fn(
2077 ctx: *mut TfLiteContext,
2078 bytes: usize,
2079 buffer_idx: *mut ::core::ffi::c_int,
2080 ) -> TfLiteStatus,
2081 >,
2082 #[doc = " Get the scratch buffer pointer.\n This method is only available in Eval stage.\n\n WARNING: This is an experimental interface that is subject to change."]
2083 pub GetScratchBuffer: ::core::option::Option<
2084 unsafe extern "C" fn(
2085 ctx: *mut TfLiteContext,
2086 buffer_idx: ::core::ffi::c_int,
2087 ) -> *mut ::core::ffi::c_void,
2088 >,
2089 #[doc = " Resize the memory pointer of the `tensor`. This method behaves the same as\n `ResizeTensor`, except that it makes a copy of the shape array internally\n so the shape array could be deallocated right afterwards.\n\n WARNING: This is an experimental interface that is subject to change."]
2090 pub ResizeTensorExplicit: ::core::option::Option<
2091 unsafe extern "C" fn(
2092 ctx: *mut TfLiteContext,
2093 tensor: *mut TfLiteTensor,
2094 dims: ::core::ffi::c_int,
2095 shape: *const ::core::ffi::c_int,
2096 ) -> TfLiteStatus,
2097 >,
2098 #[doc = " This method provides a preview of post-delegation partitioning. Each\n TfLiteDelegateParams in the referenced array corresponds to one instance\n of the delegate kernel. Example usage:\n\n TfLiteIntArray* nodes_to_replace = ...;\n TfLiteDelegateParams* params_array;\n int num_partitions = 0;\n TF_LITE_ENSURE_STATUS(context->PreviewDelegatePartitioning(\n context, delegate, nodes_to_replace, ¶ms_array,\n &num_partitions));\n for (int idx = 0; idx < num_partitions; idx++) {\n const auto& partition_params = params_array[idx];\n ...\n }\n\n NOTE: The context owns the memory referenced by partition_params_array. It\n will be cleared with another call to PreviewDelegatePartitioning, or after\n TfLiteDelegateParams::Prepare returns.\n\n WARNING: This is an experimental interface that is subject to change."]
2099 pub PreviewDelegatePartitioning: ::core::option::Option<
2100 unsafe extern "C" fn(
2101 context: *mut TfLiteContext,
2102 nodes_to_replace: *const TfLiteIntArray,
2103 partition_params_array: *mut *mut TfLiteDelegateParams,
2104 num_partitions: *mut ::core::ffi::c_int,
2105 ) -> TfLiteStatus,
2106 >,
2107 #[doc = " Returns a TfLiteTensor struct for a given index.\n\n WARNING: This is an experimental interface that is subject to change.\n\n WARNING: This method may not be available on all platforms."]
2108 pub GetTensor: ::core::option::Option<
2109 unsafe extern "C" fn(
2110 context: *const TfLiteContext,
2111 tensor_idx: ::core::ffi::c_int,
2112 ) -> *mut TfLiteTensor,
2113 >,
2114 #[doc = " Returns a TfLiteEvalTensor struct for a given index.\n\n WARNING: This is an experimental interface that is subject to change.\n\n WARNING: This method may not be available on all platforms."]
2115 pub GetEvalTensor: ::core::option::Option<
2116 unsafe extern "C" fn(
2117 context: *const TfLiteContext,
2118 tensor_idx: ::core::ffi::c_int,
2119 ) -> *mut TfLiteEvalTensor,
2120 >,
2121 #[doc = " Retrieves named metadata buffer from the TFLite model.\n Returns kTfLiteOk if metadata is successfully obtained from the flatbuffer\n Model: that is, there exists a `metadata` entry with given `name` string.\n (see TFLite's schema.fbs).\n The corresponding `buffer` information is populated in `ptr` & `bytes`.\n The data from `ptr` is valid for the lifetime of the Interpreter.\n\n WARNING: This is an experimental interface that is subject to change."]
2122 pub GetModelMetadata: ::core::option::Option<
2123 unsafe extern "C" fn(
2124 context: *const TfLiteContext,
2125 name: *const ::core::ffi::c_char,
2126 ptr: *mut *const ::core::ffi::c_char,
2127 bytes: *mut usize,
2128 ) -> TfLiteStatus,
2129 >,
2130 #[doc = " Retrieves the corresponding TfLiteContext of a subgraph that the given\n subgraph_index points to and switches to the delegate context for that\n subgraph. If an invalid subgraph index is given, returns kTfLiteError.\n\n NOTE: This function is expected to be paired with ReleaseSubgraphContext()\n once the delegate preparation is done and/or the delegate context\n functions are no longer needed.\n\n WARNING: This is an experimental interface that is subject to change."]
2131 pub AcquireSubgraphContext: ::core::option::Option<
2132 unsafe extern "C" fn(
2133 context: *mut TfLiteContext,
2134 subgraph_index: ::core::ffi::c_int,
2135 acquired_context: *mut *mut TfLiteContext,
2136 ) -> TfLiteStatus,
2137 >,
2138 #[doc = " Releases the subgraph context by switching back to the TFLite kernel\n context for the subgraph that the given subgraph_index points to.\n\n NOTE: This function is expected to be used after AcquireSubgraphContext()\n once the delegate preparation is done and/or the delegate context\n functions are no longer needed.\n\n WARNING: This is an experimental interface that is subject to change."]
2139 pub ReleaseSubgraphContext: ::core::option::Option<
2140 unsafe extern "C" fn(
2141 context: *mut TfLiteContext,
2142 subgraph_index: ::core::ffi::c_int,
2143 ) -> TfLiteStatus,
2144 >,
2145}
2146#[test]
2147fn bindgen_test_layout_TfLiteContext() {
2148 const UNINIT: ::core::mem::MaybeUninit<TfLiteContext> = ::core::mem::MaybeUninit::uninit();
2149 let ptr = UNINIT.as_ptr();
2150 assert_eq!(
2151 ::core::mem::size_of::<TfLiteContext>(),
2152 200usize,
2153 concat!("Size of: ", stringify!(TfLiteContext))
2154 );
2155 assert_eq!(
2156 ::core::mem::align_of::<TfLiteContext>(),
2157 8usize,
2158 concat!("Alignment of ", stringify!(TfLiteContext))
2159 );
2160 assert_eq!(
2161 unsafe { ::core::ptr::addr_of!((*ptr).tensors_size) as usize - ptr as usize },
2162 0usize,
2163 concat!(
2164 "Offset of field: ",
2165 stringify!(TfLiteContext),
2166 "::",
2167 stringify!(tensors_size)
2168 )
2169 );
2170 assert_eq!(
2171 unsafe { ::core::ptr::addr_of!((*ptr).GetExecutionPlan) as usize - ptr as usize },
2172 8usize,
2173 concat!(
2174 "Offset of field: ",
2175 stringify!(TfLiteContext),
2176 "::",
2177 stringify!(GetExecutionPlan)
2178 )
2179 );
2180 assert_eq!(
2181 unsafe { ::core::ptr::addr_of!((*ptr).tensors) as usize - ptr as usize },
2182 16usize,
2183 concat!(
2184 "Offset of field: ",
2185 stringify!(TfLiteContext),
2186 "::",
2187 stringify!(tensors)
2188 )
2189 );
2190 assert_eq!(
2191 unsafe { ::core::ptr::addr_of!((*ptr).impl_) as usize - ptr as usize },
2192 24usize,
2193 concat!(
2194 "Offset of field: ",
2195 stringify!(TfLiteContext),
2196 "::",
2197 stringify!(impl_)
2198 )
2199 );
2200 assert_eq!(
2201 unsafe { ::core::ptr::addr_of!((*ptr).ResizeTensor) as usize - ptr as usize },
2202 32usize,
2203 concat!(
2204 "Offset of field: ",
2205 stringify!(TfLiteContext),
2206 "::",
2207 stringify!(ResizeTensor)
2208 )
2209 );
2210 assert_eq!(
2211 unsafe { ::core::ptr::addr_of!((*ptr).ReportError) as usize - ptr as usize },
2212 40usize,
2213 concat!(
2214 "Offset of field: ",
2215 stringify!(TfLiteContext),
2216 "::",
2217 stringify!(ReportError)
2218 )
2219 );
2220 assert_eq!(
2221 unsafe { ::core::ptr::addr_of!((*ptr).AddTensors) as usize - ptr as usize },
2222 48usize,
2223 concat!(
2224 "Offset of field: ",
2225 stringify!(TfLiteContext),
2226 "::",
2227 stringify!(AddTensors)
2228 )
2229 );
2230 assert_eq!(
2231 unsafe { ::core::ptr::addr_of!((*ptr).GetNodeAndRegistration) as usize - ptr as usize },
2232 56usize,
2233 concat!(
2234 "Offset of field: ",
2235 stringify!(TfLiteContext),
2236 "::",
2237 stringify!(GetNodeAndRegistration)
2238 )
2239 );
2240 assert_eq!(
2241 unsafe {
2242 ::core::ptr::addr_of!((*ptr).ReplaceNodeSubsetsWithDelegateKernels) as usize
2243 - ptr as usize
2244 },
2245 64usize,
2246 concat!(
2247 "Offset of field: ",
2248 stringify!(TfLiteContext),
2249 "::",
2250 stringify!(ReplaceNodeSubsetsWithDelegateKernels)
2251 )
2252 );
2253 assert_eq!(
2254 unsafe { ::core::ptr::addr_of!((*ptr).recommended_num_threads) as usize - ptr as usize },
2255 72usize,
2256 concat!(
2257 "Offset of field: ",
2258 stringify!(TfLiteContext),
2259 "::",
2260 stringify!(recommended_num_threads)
2261 )
2262 );
2263 assert_eq!(
2264 unsafe { ::core::ptr::addr_of!((*ptr).GetExternalContext) as usize - ptr as usize },
2265 80usize,
2266 concat!(
2267 "Offset of field: ",
2268 stringify!(TfLiteContext),
2269 "::",
2270 stringify!(GetExternalContext)
2271 )
2272 );
2273 assert_eq!(
2274 unsafe { ::core::ptr::addr_of!((*ptr).SetExternalContext) as usize - ptr as usize },
2275 88usize,
2276 concat!(
2277 "Offset of field: ",
2278 stringify!(TfLiteContext),
2279 "::",
2280 stringify!(SetExternalContext)
2281 )
2282 );
2283 assert_eq!(
2284 unsafe { ::core::ptr::addr_of!((*ptr).allow_fp32_relax_to_fp16) as usize - ptr as usize },
2285 96usize,
2286 concat!(
2287 "Offset of field: ",
2288 stringify!(TfLiteContext),
2289 "::",
2290 stringify!(allow_fp32_relax_to_fp16)
2291 )
2292 );
2293 assert_eq!(
2294 unsafe { ::core::ptr::addr_of!((*ptr).profiler) as usize - ptr as usize },
2295 104usize,
2296 concat!(
2297 "Offset of field: ",
2298 stringify!(TfLiteContext),
2299 "::",
2300 stringify!(profiler)
2301 )
2302 );
2303 assert_eq!(
2304 unsafe { ::core::ptr::addr_of!((*ptr).AllocatePersistentBuffer) as usize - ptr as usize },
2305 112usize,
2306 concat!(
2307 "Offset of field: ",
2308 stringify!(TfLiteContext),
2309 "::",
2310 stringify!(AllocatePersistentBuffer)
2311 )
2312 );
2313 assert_eq!(
2314 unsafe { ::core::ptr::addr_of!((*ptr).AllocateBufferForEval) as usize - ptr as usize },
2315 120usize,
2316 concat!(
2317 "Offset of field: ",
2318 stringify!(TfLiteContext),
2319 "::",
2320 stringify!(AllocateBufferForEval)
2321 )
2322 );
2323 assert_eq!(
2324 unsafe {
2325 ::core::ptr::addr_of!((*ptr).RequestScratchBufferInArena) as usize - ptr as usize
2326 },
2327 128usize,
2328 concat!(
2329 "Offset of field: ",
2330 stringify!(TfLiteContext),
2331 "::",
2332 stringify!(RequestScratchBufferInArena)
2333 )
2334 );
2335 assert_eq!(
2336 unsafe { ::core::ptr::addr_of!((*ptr).GetScratchBuffer) as usize - ptr as usize },
2337 136usize,
2338 concat!(
2339 "Offset of field: ",
2340 stringify!(TfLiteContext),
2341 "::",
2342 stringify!(GetScratchBuffer)
2343 )
2344 );
2345 assert_eq!(
2346 unsafe { ::core::ptr::addr_of!((*ptr).ResizeTensorExplicit) as usize - ptr as usize },
2347 144usize,
2348 concat!(
2349 "Offset of field: ",
2350 stringify!(TfLiteContext),
2351 "::",
2352 stringify!(ResizeTensorExplicit)
2353 )
2354 );
2355 assert_eq!(
2356 unsafe {
2357 ::core::ptr::addr_of!((*ptr).PreviewDelegatePartitioning) as usize - ptr as usize
2358 },
2359 152usize,
2360 concat!(
2361 "Offset of field: ",
2362 stringify!(TfLiteContext),
2363 "::",
2364 stringify!(PreviewDelegatePartitioning)
2365 )
2366 );
2367 assert_eq!(
2368 unsafe { ::core::ptr::addr_of!((*ptr).GetTensor) as usize - ptr as usize },
2369 160usize,
2370 concat!(
2371 "Offset of field: ",
2372 stringify!(TfLiteContext),
2373 "::",
2374 stringify!(GetTensor)
2375 )
2376 );
2377 assert_eq!(
2378 unsafe { ::core::ptr::addr_of!((*ptr).GetEvalTensor) as usize - ptr as usize },
2379 168usize,
2380 concat!(
2381 "Offset of field: ",
2382 stringify!(TfLiteContext),
2383 "::",
2384 stringify!(GetEvalTensor)
2385 )
2386 );
2387 assert_eq!(
2388 unsafe { ::core::ptr::addr_of!((*ptr).GetModelMetadata) as usize - ptr as usize },
2389 176usize,
2390 concat!(
2391 "Offset of field: ",
2392 stringify!(TfLiteContext),
2393 "::",
2394 stringify!(GetModelMetadata)
2395 )
2396 );
2397 assert_eq!(
2398 unsafe { ::core::ptr::addr_of!((*ptr).AcquireSubgraphContext) as usize - ptr as usize },
2399 184usize,
2400 concat!(
2401 "Offset of field: ",
2402 stringify!(TfLiteContext),
2403 "::",
2404 stringify!(AcquireSubgraphContext)
2405 )
2406 );
2407 assert_eq!(
2408 unsafe { ::core::ptr::addr_of!((*ptr).ReleaseSubgraphContext) as usize - ptr as usize },
2409 192usize,
2410 concat!(
2411 "Offset of field: ",
2412 stringify!(TfLiteContext),
2413 "::",
2414 stringify!(ReleaseSubgraphContext)
2415 )
2416 );
2417}
2418#[repr(C)]
2419#[derive(Debug, Copy, Clone)]
2420pub struct TfLiteOperator {
2421 _unused: [u8; 0],
2422}
2423pub type TfLiteRegistrationExternal = TfLiteOperator;
2424#[repr(u64)]
2425#[doc = " The valid values of the `inplace_operator` field in `TfLiteRegistration`.\n This allow an op to signal to the runtime that the same data pointer\n may be passed as an input and output without impacting the result.\n This does not mean that the memory can safely be reused, it is up to the\n runtime to determine this, e.g. if another op consumes the same input or not\n or if an input tensor has sufficient memory allocated to store the output\n data.\n\n Setting these flags authorizes the runtime to set the data pointers of an\n input and output tensor to the same value. In such cases, the memory\n required by the output must be less than or equal to that required by the\n shared input, never greater. If kTfLiteInplaceOpDataUnmodified is set, then\n the runtime can share the same input tensor with multiple operator's\n outputs, provided that kTfLiteInplaceOpDataUnmodified is set for all of\n them. Otherwise, if an input tensor is consumed by multiple operators, it\n may only be shared with the operator which is the last to consume it.\n\n Note that this is a bitmask, so the values should be 1, 2, 4, 8, ...etc."]
2426#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
2427pub enum TfLiteInPlaceOp {
2428 #[doc = " The default value. This indicates that the same data pointer cannot safely\n be passed as an op's input and output."]
2429 kTfLiteInplaceOpNone = 0,
2430 #[doc = " This indicates that an op's first output's data is identical to its first\n input's data, for example Reshape."]
2431 kTfLiteInplaceOpDataUnmodified = 1,
2432 #[doc = " Setting kTfLiteInplaceInputCanBeSharedWithCorrespondingOutput means\n that InputN may be shared with OutputN instead of with the first output.\n This flag requires one or more of kTfLiteInplaceOpInputNShared to be set."]
2433 kTfLiteInplaceInputCanBeSharedWithCorrespondingOutput = 2,
2434 #[doc = " kTfLiteInplaceOpInputNShared indicates that it is safe for an op to share\n InputN's data pointer with an output tensor. If\n kTfLiteInplaceInputCanBeSharedWithCorrespondingOutput is set then\n kTfLiteInplaceOpInputNShared indicates that InputN may be shared\n with OutputN, otherwise kTfLiteInplaceOpInputNShared indicates that InputN\n may be shared with the first output.\n\n Indicates that an op's first input may be shared with the first output\n tensor. kTfLiteInplaceInputCanBeSharedWithCorrespondingOutput has\n no impact on the behavior allowed by this flag."]
2435 kTfLiteInplaceOpInput0Shared = 4,
2436 #[doc = " Indicates that an op's second input may be shared with the first output\n if kTfLiteInplaceInputCanBeSharedWithCorrespondingOutput is not set\n or second output if kTfLiteInplaceInputCanBeSharedWithCorrespondingOutput\n is set."]
2437 kTfLiteInplaceOpInput1Shared = 8,
2438 #[doc = " Indicates that an op's third input may be shared with the first output\n if kTfLiteInplaceInputCanBeSharedWithCorrespondingOutput is not set\n or third output if kTfLiteInplaceInputCanBeSharedWithCorrespondingOutput\n is\n set."]
2439 kTfLiteInplaceOpInput2Shared = 16,
2440 #[doc = " Placeholder to ensure that enum can hold 64 bit values to accommodate\n future fields."]
2441 kTfLiteInplaceOpMaxValue = 18446744073709551615,
2442}
2443#[doc = " The number of shareable inputs supported."]
2444pub const kTfLiteMaxSharableOpInputs: ::core::ffi::c_int = 3;
2445#[doc = " `TfLiteRegistration` defines the implementation of an operation\n (a built-in op, custom op, or custom delegate kernel).\n\n It is a struct containing \"methods\" (C function pointers) that will be\n invoked by the TF Lite runtime to evaluate instances of the operation.\n\n See also `TfLiteOperator` which is a more ABI-stable equivalent."]
2446#[repr(C)]
2447#[derive(Debug, Copy, Clone)]
2448pub struct TfLiteRegistration {
2449 #[doc = " Initializes the op from serialized data.\n Called only *once* for the lifetime of the op, so any one-time allocations\n should be made here (unless they depend on tensor sizes).\n\n * If a built-in op:\n * `buffer` is the op's params data (TfLiteLSTMParams*).\n * `length` is zero.\n * If custom op:\n * `buffer` is the op's `custom_options`.\n * `length` is the size of the buffer.\n\n Returns a type-punned (i.e. void*) opaque data (e.g. a primitive pointer\n or an instance of a struct).\n\n The returned pointer will be stored with the node in the `user_data`\n field, accessible within prepare and invoke functions below.\n\n NOTE: if the data is already in the desired format, simply implement this\n function to return `nullptr` and implement the free function to be a\n no-op."]
2450 pub init: ::core::option::Option<
2451 unsafe extern "C" fn(
2452 context: *mut TfLiteContext,
2453 buffer: *const ::core::ffi::c_char,
2454 length: usize,
2455 ) -> *mut ::core::ffi::c_void,
2456 >,
2457 #[doc = " The pointer `buffer` is the data previously returned by an init\n invocation."]
2458 pub free: ::core::option::Option<
2459 unsafe extern "C" fn(context: *mut TfLiteContext, buffer: *mut ::core::ffi::c_void),
2460 >,
2461 #[doc = " prepare is called when the inputs this node depends on have been resized.\n `context->ResizeTensor()` can be called to request output tensors to be\n resized.\n Can be called multiple times for the lifetime of the op.\n\n Returns `kTfLiteOk` on success."]
2462 pub prepare: ::core::option::Option<
2463 unsafe extern "C" fn(context: *mut TfLiteContext, node: *mut TfLiteNode) -> TfLiteStatus,
2464 >,
2465 #[doc = " Execute the node (should read `node->inputs` and output to\n `node->outputs`).\n\n Returns `kTfLiteOk` on success."]
2466 pub invoke: ::core::option::Option<
2467 unsafe extern "C" fn(context: *mut TfLiteContext, node: *mut TfLiteNode) -> TfLiteStatus,
2468 >,
2469 #[doc = " `profiling_string` is called during summarization of profiling information\n in order to group executions together. Providing a value here will cause a\n given op to appear multiple times is the profiling report. This is\n particularly useful for custom ops that can perform significantly\n different calculations depending on their `user-data`."]
2470 pub profiling_string: ::core::option::Option<
2471 unsafe extern "C" fn(
2472 context: *const TfLiteContext,
2473 node: *const TfLiteNode,
2474 ) -> *const ::core::ffi::c_char,
2475 >,
2476 #[doc = " Builtin codes. If this kernel refers to a builtin this is the code\n of the builtin. This is so we can do marshaling to other frameworks like\n NN API.\n\n Note: It is the responsibility of the registration binder to set this\n properly."]
2477 pub builtin_code: i32,
2478 #[doc = " Custom op name. If the op is a builtin, this will be `null`.\n\n Note: It is the responsibility of the registration binder to set this\n properly.\n\n WARNING: This is an experimental interface that is subject to change."]
2479 pub custom_name: *const ::core::ffi::c_char,
2480 #[doc = " The version of the op.\n Note: It is the responsibility of the registration binder to set this\n properly."]
2481 pub version: ::core::ffi::c_int,
2482 #[doc = " The external (i.e. ABI-stable) version of `TfLiteRegistration`.\n Since we can't use internal types (such as `TfLiteContext`) for C API to\n maintain ABI stability. C API user will provide `TfLiteOperator` to\n implement custom ops. We keep it inside of `TfLiteRegistration` and use\n it to route callbacks properly."]
2483 pub registration_external: *mut TfLiteOperator,
2484 #[doc = " Retrieves asynchronous kernel.\n\n If the `async_kernel` field is nullptr, it means the operation described\n by this TfLiteRegistration object does not support asynchronous execution.\n Otherwise, the function that the field points to should only be called for\n delegate kernel nodes, i.e. `node` should be a delegate kernel node\n created by applying a delegate. If the function returns nullptr, that\n means that the underlying delegate does not support asynchronous execution\n for this `node`."]
2485 pub async_kernel: ::core::option::Option<
2486 unsafe extern "C" fn(
2487 context: *mut TfLiteContext,
2488 node: *mut TfLiteNode,
2489 ) -> *mut TfLiteAsyncKernel,
2490 >,
2491 #[doc = " Indicates if an operator's output may safely overwrite its inputs.\n See the comments in `TfLiteInPlaceOp`."]
2492 pub inplace_operator: u64,
2493}
2494#[test]
2495fn bindgen_test_layout_TfLiteRegistration() {
2496 const UNINIT: ::core::mem::MaybeUninit<TfLiteRegistration> = ::core::mem::MaybeUninit::uninit();
2497 let ptr = UNINIT.as_ptr();
2498 assert_eq!(
2499 ::core::mem::size_of::<TfLiteRegistration>(),
2500 88usize,
2501 concat!("Size of: ", stringify!(TfLiteRegistration))
2502 );
2503 assert_eq!(
2504 ::core::mem::align_of::<TfLiteRegistration>(),
2505 8usize,
2506 concat!("Alignment of ", stringify!(TfLiteRegistration))
2507 );
2508 assert_eq!(
2509 unsafe { ::core::ptr::addr_of!((*ptr).init) as usize - ptr as usize },
2510 0usize,
2511 concat!(
2512 "Offset of field: ",
2513 stringify!(TfLiteRegistration),
2514 "::",
2515 stringify!(init)
2516 )
2517 );
2518 assert_eq!(
2519 unsafe { ::core::ptr::addr_of!((*ptr).free) as usize - ptr as usize },
2520 8usize,
2521 concat!(
2522 "Offset of field: ",
2523 stringify!(TfLiteRegistration),
2524 "::",
2525 stringify!(free)
2526 )
2527 );
2528 assert_eq!(
2529 unsafe { ::core::ptr::addr_of!((*ptr).prepare) as usize - ptr as usize },
2530 16usize,
2531 concat!(
2532 "Offset of field: ",
2533 stringify!(TfLiteRegistration),
2534 "::",
2535 stringify!(prepare)
2536 )
2537 );
2538 assert_eq!(
2539 unsafe { ::core::ptr::addr_of!((*ptr).invoke) as usize - ptr as usize },
2540 24usize,
2541 concat!(
2542 "Offset of field: ",
2543 stringify!(TfLiteRegistration),
2544 "::",
2545 stringify!(invoke)
2546 )
2547 );
2548 assert_eq!(
2549 unsafe { ::core::ptr::addr_of!((*ptr).profiling_string) as usize - ptr as usize },
2550 32usize,
2551 concat!(
2552 "Offset of field: ",
2553 stringify!(TfLiteRegistration),
2554 "::",
2555 stringify!(profiling_string)
2556 )
2557 );
2558 assert_eq!(
2559 unsafe { ::core::ptr::addr_of!((*ptr).builtin_code) as usize - ptr as usize },
2560 40usize,
2561 concat!(
2562 "Offset of field: ",
2563 stringify!(TfLiteRegistration),
2564 "::",
2565 stringify!(builtin_code)
2566 )
2567 );
2568 assert_eq!(
2569 unsafe { ::core::ptr::addr_of!((*ptr).custom_name) as usize - ptr as usize },
2570 48usize,
2571 concat!(
2572 "Offset of field: ",
2573 stringify!(TfLiteRegistration),
2574 "::",
2575 stringify!(custom_name)
2576 )
2577 );
2578 assert_eq!(
2579 unsafe { ::core::ptr::addr_of!((*ptr).version) as usize - ptr as usize },
2580 56usize,
2581 concat!(
2582 "Offset of field: ",
2583 stringify!(TfLiteRegistration),
2584 "::",
2585 stringify!(version)
2586 )
2587 );
2588 assert_eq!(
2589 unsafe { ::core::ptr::addr_of!((*ptr).registration_external) as usize - ptr as usize },
2590 64usize,
2591 concat!(
2592 "Offset of field: ",
2593 stringify!(TfLiteRegistration),
2594 "::",
2595 stringify!(registration_external)
2596 )
2597 );
2598 assert_eq!(
2599 unsafe { ::core::ptr::addr_of!((*ptr).async_kernel) as usize - ptr as usize },
2600 72usize,
2601 concat!(
2602 "Offset of field: ",
2603 stringify!(TfLiteRegistration),
2604 "::",
2605 stringify!(async_kernel)
2606 )
2607 );
2608 assert_eq!(
2609 unsafe { ::core::ptr::addr_of!((*ptr).inplace_operator) as usize - ptr as usize },
2610 80usize,
2611 concat!(
2612 "Offset of field: ",
2613 stringify!(TfLiteRegistration),
2614 "::",
2615 stringify!(inplace_operator)
2616 )
2617 );
2618}
2619#[doc = " \\private\n Old version of `TfLiteRegistration` to maintain binary backward\n compatibility.\n The legacy registration type must be a POD struct type whose field types\n must be a prefix of the field types in TfLiteRegistration, and offset of the\n first field in TfLiteRegistration that is not present in the legacy\n registration type must be greater than or equal to the size of the legacy\n registration type.\n\n WARNING: This structure is deprecated / not an official part of the\n API. It should be only used for binary backward compatibility."]
2620#[repr(C)]
2621#[derive(Debug, Copy, Clone)]
2622pub struct TfLiteRegistration_V3 {
2623 pub init: ::core::option::Option<
2624 unsafe extern "C" fn(
2625 context: *mut TfLiteContext,
2626 buffer: *const ::core::ffi::c_char,
2627 length: usize,
2628 ) -> *mut ::core::ffi::c_void,
2629 >,
2630 pub free: ::core::option::Option<
2631 unsafe extern "C" fn(context: *mut TfLiteContext, buffer: *mut ::core::ffi::c_void),
2632 >,
2633 pub prepare: ::core::option::Option<
2634 unsafe extern "C" fn(context: *mut TfLiteContext, node: *mut TfLiteNode) -> TfLiteStatus,
2635 >,
2636 pub invoke: ::core::option::Option<
2637 unsafe extern "C" fn(context: *mut TfLiteContext, node: *mut TfLiteNode) -> TfLiteStatus,
2638 >,
2639 pub profiling_string: ::core::option::Option<
2640 unsafe extern "C" fn(
2641 context: *const TfLiteContext,
2642 node: *const TfLiteNode,
2643 ) -> *const ::core::ffi::c_char,
2644 >,
2645 pub builtin_code: i32,
2646 pub custom_name: *const ::core::ffi::c_char,
2647 pub version: ::core::ffi::c_int,
2648 pub registration_external: *mut TfLiteOperator,
2649 pub async_kernel: ::core::option::Option<
2650 unsafe extern "C" fn(
2651 context: *mut TfLiteContext,
2652 node: *mut TfLiteNode,
2653 ) -> *mut TfLiteAsyncKernel,
2654 >,
2655}
2656#[test]
2657fn bindgen_test_layout_TfLiteRegistration_V3() {
2658 const UNINIT: ::core::mem::MaybeUninit<TfLiteRegistration_V3> =
2659 ::core::mem::MaybeUninit::uninit();
2660 let ptr = UNINIT.as_ptr();
2661 assert_eq!(
2662 ::core::mem::size_of::<TfLiteRegistration_V3>(),
2663 80usize,
2664 concat!("Size of: ", stringify!(TfLiteRegistration_V3))
2665 );
2666 assert_eq!(
2667 ::core::mem::align_of::<TfLiteRegistration_V3>(),
2668 8usize,
2669 concat!("Alignment of ", stringify!(TfLiteRegistration_V3))
2670 );
2671 assert_eq!(
2672 unsafe { ::core::ptr::addr_of!((*ptr).init) as usize - ptr as usize },
2673 0usize,
2674 concat!(
2675 "Offset of field: ",
2676 stringify!(TfLiteRegistration_V3),
2677 "::",
2678 stringify!(init)
2679 )
2680 );
2681 assert_eq!(
2682 unsafe { ::core::ptr::addr_of!((*ptr).free) as usize - ptr as usize },
2683 8usize,
2684 concat!(
2685 "Offset of field: ",
2686 stringify!(TfLiteRegistration_V3),
2687 "::",
2688 stringify!(free)
2689 )
2690 );
2691 assert_eq!(
2692 unsafe { ::core::ptr::addr_of!((*ptr).prepare) as usize - ptr as usize },
2693 16usize,
2694 concat!(
2695 "Offset of field: ",
2696 stringify!(TfLiteRegistration_V3),
2697 "::",
2698 stringify!(prepare)
2699 )
2700 );
2701 assert_eq!(
2702 unsafe { ::core::ptr::addr_of!((*ptr).invoke) as usize - ptr as usize },
2703 24usize,
2704 concat!(
2705 "Offset of field: ",
2706 stringify!(TfLiteRegistration_V3),
2707 "::",
2708 stringify!(invoke)
2709 )
2710 );
2711 assert_eq!(
2712 unsafe { ::core::ptr::addr_of!((*ptr).profiling_string) as usize - ptr as usize },
2713 32usize,
2714 concat!(
2715 "Offset of field: ",
2716 stringify!(TfLiteRegistration_V3),
2717 "::",
2718 stringify!(profiling_string)
2719 )
2720 );
2721 assert_eq!(
2722 unsafe { ::core::ptr::addr_of!((*ptr).builtin_code) as usize - ptr as usize },
2723 40usize,
2724 concat!(
2725 "Offset of field: ",
2726 stringify!(TfLiteRegistration_V3),
2727 "::",
2728 stringify!(builtin_code)
2729 )
2730 );
2731 assert_eq!(
2732 unsafe { ::core::ptr::addr_of!((*ptr).custom_name) as usize - ptr as usize },
2733 48usize,
2734 concat!(
2735 "Offset of field: ",
2736 stringify!(TfLiteRegistration_V3),
2737 "::",
2738 stringify!(custom_name)
2739 )
2740 );
2741 assert_eq!(
2742 unsafe { ::core::ptr::addr_of!((*ptr).version) as usize - ptr as usize },
2743 56usize,
2744 concat!(
2745 "Offset of field: ",
2746 stringify!(TfLiteRegistration_V3),
2747 "::",
2748 stringify!(version)
2749 )
2750 );
2751 assert_eq!(
2752 unsafe { ::core::ptr::addr_of!((*ptr).registration_external) as usize - ptr as usize },
2753 64usize,
2754 concat!(
2755 "Offset of field: ",
2756 stringify!(TfLiteRegistration_V3),
2757 "::",
2758 stringify!(registration_external)
2759 )
2760 );
2761 assert_eq!(
2762 unsafe { ::core::ptr::addr_of!((*ptr).async_kernel) as usize - ptr as usize },
2763 72usize,
2764 concat!(
2765 "Offset of field: ",
2766 stringify!(TfLiteRegistration_V3),
2767 "::",
2768 stringify!(async_kernel)
2769 )
2770 );
2771}
2772#[doc = " \\private\n Old version of `TfLiteRegistration` to maintain binary backward\n compatibility.\n The legacy registration type must be a POD struct type whose field types\n must be a prefix of the field types in TfLiteRegistration, and offset of the\n first field in TfLiteRegistration that is not present in the legacy\n registration type must be greater than or equal to the size of the legacy\n registration type.\n\n WARNING: This structure is deprecated / not an official part of the\n API. It should be only used for binary backward compatibility."]
2773#[repr(C)]
2774#[derive(Debug, Copy, Clone)]
2775pub struct TfLiteRegistration_V2 {
2776 pub init: ::core::option::Option<
2777 unsafe extern "C" fn(
2778 context: *mut TfLiteContext,
2779 buffer: *const ::core::ffi::c_char,
2780 length: usize,
2781 ) -> *mut ::core::ffi::c_void,
2782 >,
2783 pub free: ::core::option::Option<
2784 unsafe extern "C" fn(context: *mut TfLiteContext, buffer: *mut ::core::ffi::c_void),
2785 >,
2786 pub prepare: ::core::option::Option<
2787 unsafe extern "C" fn(context: *mut TfLiteContext, node: *mut TfLiteNode) -> TfLiteStatus,
2788 >,
2789 pub invoke: ::core::option::Option<
2790 unsafe extern "C" fn(context: *mut TfLiteContext, node: *mut TfLiteNode) -> TfLiteStatus,
2791 >,
2792 pub profiling_string: ::core::option::Option<
2793 unsafe extern "C" fn(
2794 context: *const TfLiteContext,
2795 node: *const TfLiteNode,
2796 ) -> *const ::core::ffi::c_char,
2797 >,
2798 pub builtin_code: i32,
2799 pub custom_name: *const ::core::ffi::c_char,
2800 pub version: ::core::ffi::c_int,
2801 pub registration_external: *mut TfLiteOperator,
2802}
2803#[test]
2804fn bindgen_test_layout_TfLiteRegistration_V2() {
2805 const UNINIT: ::core::mem::MaybeUninit<TfLiteRegistration_V2> =
2806 ::core::mem::MaybeUninit::uninit();
2807 let ptr = UNINIT.as_ptr();
2808 assert_eq!(
2809 ::core::mem::size_of::<TfLiteRegistration_V2>(),
2810 72usize,
2811 concat!("Size of: ", stringify!(TfLiteRegistration_V2))
2812 );
2813 assert_eq!(
2814 ::core::mem::align_of::<TfLiteRegistration_V2>(),
2815 8usize,
2816 concat!("Alignment of ", stringify!(TfLiteRegistration_V2))
2817 );
2818 assert_eq!(
2819 unsafe { ::core::ptr::addr_of!((*ptr).init) as usize - ptr as usize },
2820 0usize,
2821 concat!(
2822 "Offset of field: ",
2823 stringify!(TfLiteRegistration_V2),
2824 "::",
2825 stringify!(init)
2826 )
2827 );
2828 assert_eq!(
2829 unsafe { ::core::ptr::addr_of!((*ptr).free) as usize - ptr as usize },
2830 8usize,
2831 concat!(
2832 "Offset of field: ",
2833 stringify!(TfLiteRegistration_V2),
2834 "::",
2835 stringify!(free)
2836 )
2837 );
2838 assert_eq!(
2839 unsafe { ::core::ptr::addr_of!((*ptr).prepare) as usize - ptr as usize },
2840 16usize,
2841 concat!(
2842 "Offset of field: ",
2843 stringify!(TfLiteRegistration_V2),
2844 "::",
2845 stringify!(prepare)
2846 )
2847 );
2848 assert_eq!(
2849 unsafe { ::core::ptr::addr_of!((*ptr).invoke) as usize - ptr as usize },
2850 24usize,
2851 concat!(
2852 "Offset of field: ",
2853 stringify!(TfLiteRegistration_V2),
2854 "::",
2855 stringify!(invoke)
2856 )
2857 );
2858 assert_eq!(
2859 unsafe { ::core::ptr::addr_of!((*ptr).profiling_string) as usize - ptr as usize },
2860 32usize,
2861 concat!(
2862 "Offset of field: ",
2863 stringify!(TfLiteRegistration_V2),
2864 "::",
2865 stringify!(profiling_string)
2866 )
2867 );
2868 assert_eq!(
2869 unsafe { ::core::ptr::addr_of!((*ptr).builtin_code) as usize - ptr as usize },
2870 40usize,
2871 concat!(
2872 "Offset of field: ",
2873 stringify!(TfLiteRegistration_V2),
2874 "::",
2875 stringify!(builtin_code)
2876 )
2877 );
2878 assert_eq!(
2879 unsafe { ::core::ptr::addr_of!((*ptr).custom_name) as usize - ptr as usize },
2880 48usize,
2881 concat!(
2882 "Offset of field: ",
2883 stringify!(TfLiteRegistration_V2),
2884 "::",
2885 stringify!(custom_name)
2886 )
2887 );
2888 assert_eq!(
2889 unsafe { ::core::ptr::addr_of!((*ptr).version) as usize - ptr as usize },
2890 56usize,
2891 concat!(
2892 "Offset of field: ",
2893 stringify!(TfLiteRegistration_V2),
2894 "::",
2895 stringify!(version)
2896 )
2897 );
2898 assert_eq!(
2899 unsafe { ::core::ptr::addr_of!((*ptr).registration_external) as usize - ptr as usize },
2900 64usize,
2901 concat!(
2902 "Offset of field: ",
2903 stringify!(TfLiteRegistration_V2),
2904 "::",
2905 stringify!(registration_external)
2906 )
2907 );
2908}
2909#[doc = " \\private\n Old version of `TfLiteRegistration` to maintain binary backward\n compatibility.\n The legacy registration type must be a POD struct type whose field types\n must be a prefix of the field types in TfLiteRegistration, and offset of the\n first field in TfLiteRegistration that is not present in the legacy\n registration type must be greater than or equal to the size of the legacy\n registration type.\n\n WARNING: This structure is deprecated / not an official part of the\n API. It should be only used for binary backward compatibility."]
2910#[repr(C)]
2911#[derive(Debug, Copy, Clone)]
2912pub struct TfLiteRegistration_V1 {
2913 pub init: ::core::option::Option<
2914 unsafe extern "C" fn(
2915 context: *mut TfLiteContext,
2916 buffer: *const ::core::ffi::c_char,
2917 length: usize,
2918 ) -> *mut ::core::ffi::c_void,
2919 >,
2920 pub free: ::core::option::Option<
2921 unsafe extern "C" fn(context: *mut TfLiteContext, buffer: *mut ::core::ffi::c_void),
2922 >,
2923 pub prepare: ::core::option::Option<
2924 unsafe extern "C" fn(context: *mut TfLiteContext, node: *mut TfLiteNode) -> TfLiteStatus,
2925 >,
2926 pub invoke: ::core::option::Option<
2927 unsafe extern "C" fn(context: *mut TfLiteContext, node: *mut TfLiteNode) -> TfLiteStatus,
2928 >,
2929 pub profiling_string: ::core::option::Option<
2930 unsafe extern "C" fn(
2931 context: *const TfLiteContext,
2932 node: *const TfLiteNode,
2933 ) -> *const ::core::ffi::c_char,
2934 >,
2935 pub builtin_code: i32,
2936 pub custom_name: *const ::core::ffi::c_char,
2937 pub version: ::core::ffi::c_int,
2938}
2939#[test]
2940fn bindgen_test_layout_TfLiteRegistration_V1() {
2941 const UNINIT: ::core::mem::MaybeUninit<TfLiteRegistration_V1> =
2942 ::core::mem::MaybeUninit::uninit();
2943 let ptr = UNINIT.as_ptr();
2944 assert_eq!(
2945 ::core::mem::size_of::<TfLiteRegistration_V1>(),
2946 64usize,
2947 concat!("Size of: ", stringify!(TfLiteRegistration_V1))
2948 );
2949 assert_eq!(
2950 ::core::mem::align_of::<TfLiteRegistration_V1>(),
2951 8usize,
2952 concat!("Alignment of ", stringify!(TfLiteRegistration_V1))
2953 );
2954 assert_eq!(
2955 unsafe { ::core::ptr::addr_of!((*ptr).init) as usize - ptr as usize },
2956 0usize,
2957 concat!(
2958 "Offset of field: ",
2959 stringify!(TfLiteRegistration_V1),
2960 "::",
2961 stringify!(init)
2962 )
2963 );
2964 assert_eq!(
2965 unsafe { ::core::ptr::addr_of!((*ptr).free) as usize - ptr as usize },
2966 8usize,
2967 concat!(
2968 "Offset of field: ",
2969 stringify!(TfLiteRegistration_V1),
2970 "::",
2971 stringify!(free)
2972 )
2973 );
2974 assert_eq!(
2975 unsafe { ::core::ptr::addr_of!((*ptr).prepare) as usize - ptr as usize },
2976 16usize,
2977 concat!(
2978 "Offset of field: ",
2979 stringify!(TfLiteRegistration_V1),
2980 "::",
2981 stringify!(prepare)
2982 )
2983 );
2984 assert_eq!(
2985 unsafe { ::core::ptr::addr_of!((*ptr).invoke) as usize - ptr as usize },
2986 24usize,
2987 concat!(
2988 "Offset of field: ",
2989 stringify!(TfLiteRegistration_V1),
2990 "::",
2991 stringify!(invoke)
2992 )
2993 );
2994 assert_eq!(
2995 unsafe { ::core::ptr::addr_of!((*ptr).profiling_string) as usize - ptr as usize },
2996 32usize,
2997 concat!(
2998 "Offset of field: ",
2999 stringify!(TfLiteRegistration_V1),
3000 "::",
3001 stringify!(profiling_string)
3002 )
3003 );
3004 assert_eq!(
3005 unsafe { ::core::ptr::addr_of!((*ptr).builtin_code) as usize - ptr as usize },
3006 40usize,
3007 concat!(
3008 "Offset of field: ",
3009 stringify!(TfLiteRegistration_V1),
3010 "::",
3011 stringify!(builtin_code)
3012 )
3013 );
3014 assert_eq!(
3015 unsafe { ::core::ptr::addr_of!((*ptr).custom_name) as usize - ptr as usize },
3016 48usize,
3017 concat!(
3018 "Offset of field: ",
3019 stringify!(TfLiteRegistration_V1),
3020 "::",
3021 stringify!(custom_name)
3022 )
3023 );
3024 assert_eq!(
3025 unsafe { ::core::ptr::addr_of!((*ptr).version) as usize - ptr as usize },
3026 56usize,
3027 concat!(
3028 "Offset of field: ",
3029 stringify!(TfLiteRegistration_V1),
3030 "::",
3031 stringify!(version)
3032 )
3033 );
3034}
3035#[repr(u32)]
3036#[doc = " The flags used in `TfLiteDelegate`. Note that this is a bitmask, so the\n values should be 1, 2, 4, 8, ...etc."]
3037#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
3038pub enum TfLiteDelegateFlags {
3039 kTfLiteDelegateFlagsNone = 0,
3040 #[doc = " The flag is set if the delegate can handle dynamic sized tensors.\n For example, the output shape of a `Resize` op with non-constant shape\n can only be inferred when the op is invoked.\n In this case, the Delegate is responsible for calling\n `SetTensorToDynamic` to mark the tensor as a dynamic tensor, and calling\n `ResizeTensor` when invoking the op.\n\n If the delegate isn't capable to handle dynamic tensors, this flag need\n to be set to false."]
3041 kTfLiteDelegateFlagsAllowDynamicTensors = 1,
3042 #[doc = " This flag can be used by delegates (that allow dynamic tensors) to ensure\n applicable tensor shapes are automatically propagated in the case of\n tensor resizing. This means that non-dynamic (allocation_type !=\n kTfLiteDynamic) I/O tensors of a delegate kernel will have correct shapes\n before its Prepare() method is called. The runtime leverages TFLite\n builtin ops in the original execution plan to propagate shapes.\n\n A few points to note:\n 1. This requires kTfLiteDelegateFlagsAllowDynamicTensors. If that flag is\n false, this one is redundant since the delegate kernels are re-initialized\n every time tensors are resized.\n 2. Enabling this flag adds some overhead to AllocateTensors(), since extra\n work is required to prepare the original execution plan.\n 3. This flag requires that the original execution plan only have ops with\n valid registrations (and not 'dummy' custom ops like with Flex).\n\n WARNING: This feature is experimental and subject to change."]
3043 kTfLiteDelegateFlagsRequirePropagatedShapes = 2,
3044 #[doc = " This flag can be used by delegates to request per-operator profiling. If a\n node is a delegate node, this flag will be checked before profiling. If\n set, then the node will not be profiled. The delegate will then add per\n operator information using `Profiler::EventType::OPERATOR_INVOKE_EVENT`\n and the results will appear in the operator-wise Profiling section and not\n in the Delegate internal section."]
3045 kTfLiteDelegateFlagsPerOperatorProfiling = 4,
3046}
3047#[doc = " WARNING: This is an experimental interface that is subject to change."]
3048#[repr(C)]
3049#[derive(Debug, Copy, Clone)]
3050pub struct TfLiteDelegate {
3051 #[doc = " Data that delegate needs to identify itself. This data is owned by the\n delegate. The delegate is owned in the user code, so the delegate is\n responsible for deallocating this when it is destroyed."]
3052 pub data_: *mut ::core::ffi::c_void,
3053 #[doc = " Invoked by `ModifyGraphWithDelegate`. This prepare is called, giving the\n delegate a view of the current graph through `TfLiteContext*`. It\n typically will look at the nodes and call\n `ReplaceNodeSubsetsWithDelegateKernels()` to ask the TensorFlow lite\n runtime to create macro-nodes to represent delegated subgraphs of the\n original graph."]
3054 pub Prepare: ::core::option::Option<
3055 unsafe extern "C" fn(
3056 context: *mut TfLiteContext,
3057 delegate: *mut TfLiteDelegate,
3058 ) -> TfLiteStatus,
3059 >,
3060 #[doc = " Copy the data from delegate buffer handle into raw memory of the given\n `tensor`. Note that the delegate is allowed to allocate the raw bytes as\n long as it follows the rules for `kTfLiteDynamic` tensors, in which case\n this cannot be null."]
3061 pub CopyFromBufferHandle: ::core::option::Option<
3062 unsafe extern "C" fn(
3063 context: *mut TfLiteContext,
3064 delegate: *mut TfLiteDelegate,
3065 buffer_handle: TfLiteBufferHandle,
3066 tensor: *mut TfLiteTensor,
3067 ) -> TfLiteStatus,
3068 >,
3069 #[doc = " Copy the data from raw memory of the given `tensor` to delegate buffer\n handle. This can be null if the delegate doesn't use its own buffer."]
3070 pub CopyToBufferHandle: ::core::option::Option<
3071 unsafe extern "C" fn(
3072 context: *mut TfLiteContext,
3073 delegate: *mut TfLiteDelegate,
3074 buffer_handle: TfLiteBufferHandle,
3075 tensor: *mut TfLiteTensor,
3076 ) -> TfLiteStatus,
3077 >,
3078 #[doc = " Free the Delegate Buffer Handle. Note: This only frees the handle, but\n this doesn't release the underlying resource (e.g. textures). The\n resources are either owned by application layer or the delegate.\n This can be null if the delegate doesn't use its own buffer."]
3079 pub FreeBufferHandle: ::core::option::Option<
3080 unsafe extern "C" fn(
3081 context: *mut TfLiteContext,
3082 delegate: *mut TfLiteDelegate,
3083 handle: *mut TfLiteBufferHandle,
3084 ),
3085 >,
3086 #[doc = " Bitmask flags. See the comments in `TfLiteDelegateFlags`."]
3087 pub flags: i64,
3088 #[doc = " The opaque delegate builder associated with this object. If set then the\n TF Lite runtime will give precedence to this field. E.g. instead of\n invoking `Prepare` via the function pointer inside the `TfLiteDelegate`\n object, the runtime will first check if the corresponding function\n pointer inside `opaque_delegate_builder` is set and if so invoke that.\n\n If this field is non-null, then the `Prepare` field (of the\n `TfLiteDelegate`) should be null."]
3089 pub opaque_delegate_builder: *mut TfLiteOpaqueDelegateBuilder,
3090}
3091#[test]
3092fn bindgen_test_layout_TfLiteDelegate() {
3093 const UNINIT: ::core::mem::MaybeUninit<TfLiteDelegate> = ::core::mem::MaybeUninit::uninit();
3094 let ptr = UNINIT.as_ptr();
3095 assert_eq!(
3096 ::core::mem::size_of::<TfLiteDelegate>(),
3097 56usize,
3098 concat!("Size of: ", stringify!(TfLiteDelegate))
3099 );
3100 assert_eq!(
3101 ::core::mem::align_of::<TfLiteDelegate>(),
3102 8usize,
3103 concat!("Alignment of ", stringify!(TfLiteDelegate))
3104 );
3105 assert_eq!(
3106 unsafe { ::core::ptr::addr_of!((*ptr).data_) as usize - ptr as usize },
3107 0usize,
3108 concat!(
3109 "Offset of field: ",
3110 stringify!(TfLiteDelegate),
3111 "::",
3112 stringify!(data_)
3113 )
3114 );
3115 assert_eq!(
3116 unsafe { ::core::ptr::addr_of!((*ptr).Prepare) as usize - ptr as usize },
3117 8usize,
3118 concat!(
3119 "Offset of field: ",
3120 stringify!(TfLiteDelegate),
3121 "::",
3122 stringify!(Prepare)
3123 )
3124 );
3125 assert_eq!(
3126 unsafe { ::core::ptr::addr_of!((*ptr).CopyFromBufferHandle) as usize - ptr as usize },
3127 16usize,
3128 concat!(
3129 "Offset of field: ",
3130 stringify!(TfLiteDelegate),
3131 "::",
3132 stringify!(CopyFromBufferHandle)
3133 )
3134 );
3135 assert_eq!(
3136 unsafe { ::core::ptr::addr_of!((*ptr).CopyToBufferHandle) as usize - ptr as usize },
3137 24usize,
3138 concat!(
3139 "Offset of field: ",
3140 stringify!(TfLiteDelegate),
3141 "::",
3142 stringify!(CopyToBufferHandle)
3143 )
3144 );
3145 assert_eq!(
3146 unsafe { ::core::ptr::addr_of!((*ptr).FreeBufferHandle) as usize - ptr as usize },
3147 32usize,
3148 concat!(
3149 "Offset of field: ",
3150 stringify!(TfLiteDelegate),
3151 "::",
3152 stringify!(FreeBufferHandle)
3153 )
3154 );
3155 assert_eq!(
3156 unsafe { ::core::ptr::addr_of!((*ptr).flags) as usize - ptr as usize },
3157 40usize,
3158 concat!(
3159 "Offset of field: ",
3160 stringify!(TfLiteDelegate),
3161 "::",
3162 stringify!(flags)
3163 )
3164 );
3165 assert_eq!(
3166 unsafe { ::core::ptr::addr_of!((*ptr).opaque_delegate_builder) as usize - ptr as usize },
3167 48usize,
3168 concat!(
3169 "Offset of field: ",
3170 stringify!(TfLiteDelegate),
3171 "::",
3172 stringify!(opaque_delegate_builder)
3173 )
3174 );
3175}
3176extern "C" {
3177 #[doc = " Build a `null` delegate, with all the fields properly set to their default\n values."]
3178 pub fn TfLiteDelegateCreate() -> TfLiteDelegate;
3179}
3180#[doc = " `TfLiteOpaqueDelegateBuilder` is used for constructing\n `TfLiteOpaqueDelegate`, see `TfLiteOpaqueDelegateCreate` in c_api_opaque.h.\n NOTE: This struct is not ABI stable.\n\n For forward source compatibility `TfLiteOpaqueDelegateBuilder` objects\n should be brace-initialized, so that all fields (including any that might be\n added in the future) get zero-initialized. The purpose of each field is\n exactly the same as with `TfLiteDelegate`.\n\n NOTE: This type is part of the TensorFlow Lite Extension APIs.\n We reserve the right to make changes to this API in future releases,\n potentially including non-backwards-compatible changes, on a different\n schedule than for the other TensorFlow Lite APIs. See\n https://www.tensorflow.org/guide/versions#separate_version_number_for_tensorflow_lite_extension_apis."]
3181#[repr(C)]
3182#[derive(Debug, Copy, Clone)]
3183pub struct TfLiteOpaqueDelegateBuilder {
3184 #[doc = " Data that delegate needs to identify itself. This data is owned by the\n delegate. The delegate is owned in the user code, so the delegate is\n responsible for deallocating this when it is destroyed."]
3185 pub data: *mut ::core::ffi::c_void,
3186 #[doc = " Invoked by ModifyGraphWithDelegate. This prepare is called, giving the\n delegate a view of the current graph through `TfLiteContext*`. It\n typically will look at the nodes and call\n `ReplaceNodeSubsetsWithDelegateKernels()` to ask the TensorFlow lite\n runtime to create macro-nodes to represent delegated subgraphs of the\n original graph."]
3187 pub Prepare: ::core::option::Option<
3188 unsafe extern "C" fn(
3189 context: *mut TfLiteOpaqueContext,
3190 delegate: *mut TfLiteOpaqueDelegate,
3191 data: *mut ::core::ffi::c_void,
3192 ) -> TfLiteStatus,
3193 >,
3194 #[doc = " Copies the data from delegate buffer handle into raw memory of the given\n `tensor`. Note that the delegate is allowed to allocate the raw bytes as\n long as it follows the rules for kTfLiteDynamic tensors, in which case\n this cannot be null."]
3195 pub CopyFromBufferHandle: ::core::option::Option<
3196 unsafe extern "C" fn(
3197 context: *mut TfLiteOpaqueContext,
3198 delegate: *mut TfLiteOpaqueDelegate,
3199 data: *mut ::core::ffi::c_void,
3200 buffer_handle: TfLiteBufferHandle,
3201 tensor: *mut TfLiteOpaqueTensor,
3202 ) -> TfLiteStatus,
3203 >,
3204 #[doc = " Copies the data from raw memory of the given `tensor` to delegate buffer\n handle. This can be null if the delegate doesn't use its own buffer."]
3205 pub CopyToBufferHandle: ::core::option::Option<
3206 unsafe extern "C" fn(
3207 context: *mut TfLiteOpaqueContext,
3208 delegate: *mut TfLiteOpaqueDelegate,
3209 data: *mut ::core::ffi::c_void,
3210 buffer_handle: TfLiteBufferHandle,
3211 tensor: *mut TfLiteOpaqueTensor,
3212 ) -> TfLiteStatus,
3213 >,
3214 #[doc = " Frees the Delegate Buffer Handle. Note: This only frees the handle, but\n this doesn't release the underlying resource (e.g. textures). The\n resources are either owned by application layer or the delegate.\n This can be null if the delegate doesn't use its own buffer."]
3215 pub FreeBufferHandle: ::core::option::Option<
3216 unsafe extern "C" fn(
3217 context: *mut TfLiteOpaqueContext,
3218 delegate: *mut TfLiteOpaqueDelegate,
3219 data: *mut ::core::ffi::c_void,
3220 handle: *mut TfLiteBufferHandle,
3221 ),
3222 >,
3223 #[doc = " Bitmask flags. See the comments in `TfLiteDelegateFlags`."]
3224 pub flags: i64,
3225}
3226#[test]
3227fn bindgen_test_layout_TfLiteOpaqueDelegateBuilder() {
3228 const UNINIT: ::core::mem::MaybeUninit<TfLiteOpaqueDelegateBuilder> =
3229 ::core::mem::MaybeUninit::uninit();
3230 let ptr = UNINIT.as_ptr();
3231 assert_eq!(
3232 ::core::mem::size_of::<TfLiteOpaqueDelegateBuilder>(),
3233 48usize,
3234 concat!("Size of: ", stringify!(TfLiteOpaqueDelegateBuilder))
3235 );
3236 assert_eq!(
3237 ::core::mem::align_of::<TfLiteOpaqueDelegateBuilder>(),
3238 8usize,
3239 concat!("Alignment of ", stringify!(TfLiteOpaqueDelegateBuilder))
3240 );
3241 assert_eq!(
3242 unsafe { ::core::ptr::addr_of!((*ptr).data) as usize - ptr as usize },
3243 0usize,
3244 concat!(
3245 "Offset of field: ",
3246 stringify!(TfLiteOpaqueDelegateBuilder),
3247 "::",
3248 stringify!(data)
3249 )
3250 );
3251 assert_eq!(
3252 unsafe { ::core::ptr::addr_of!((*ptr).Prepare) as usize - ptr as usize },
3253 8usize,
3254 concat!(
3255 "Offset of field: ",
3256 stringify!(TfLiteOpaqueDelegateBuilder),
3257 "::",
3258 stringify!(Prepare)
3259 )
3260 );
3261 assert_eq!(
3262 unsafe { ::core::ptr::addr_of!((*ptr).CopyFromBufferHandle) as usize - ptr as usize },
3263 16usize,
3264 concat!(
3265 "Offset of field: ",
3266 stringify!(TfLiteOpaqueDelegateBuilder),
3267 "::",
3268 stringify!(CopyFromBufferHandle)
3269 )
3270 );
3271 assert_eq!(
3272 unsafe { ::core::ptr::addr_of!((*ptr).CopyToBufferHandle) as usize - ptr as usize },
3273 24usize,
3274 concat!(
3275 "Offset of field: ",
3276 stringify!(TfLiteOpaqueDelegateBuilder),
3277 "::",
3278 stringify!(CopyToBufferHandle)
3279 )
3280 );
3281 assert_eq!(
3282 unsafe { ::core::ptr::addr_of!((*ptr).FreeBufferHandle) as usize - ptr as usize },
3283 32usize,
3284 concat!(
3285 "Offset of field: ",
3286 stringify!(TfLiteOpaqueDelegateBuilder),
3287 "::",
3288 stringify!(FreeBufferHandle)
3289 )
3290 );
3291 assert_eq!(
3292 unsafe { ::core::ptr::addr_of!((*ptr).flags) as usize - ptr as usize },
3293 40usize,
3294 concat!(
3295 "Offset of field: ",
3296 stringify!(TfLiteOpaqueDelegateBuilder),
3297 "::",
3298 stringify!(flags)
3299 )
3300 );
3301}
3302extern "C" {
3303 pub fn TfLiteOpaqueDelegateCreate(
3304 opaque_delegate_builder: *const TfLiteOpaqueDelegateBuilder,
3305 ) -> *mut TfLiteOpaqueDelegate;
3306}
3307extern "C" {
3308 pub fn TfLiteOpaqueDelegateDelete(delegate: *mut TfLiteOpaqueDelegate);
3309}
3310extern "C" {
3311 pub fn TfLiteOpaqueDelegateGetData(
3312 delegate: *const TfLiteOpaqueDelegate,
3313 ) -> *mut ::core::ffi::c_void;
3314}
3315extern "C" {
3316 #[doc = " Returns a tensor data allocation strategy."]
3317 pub fn TfLiteTensorGetAllocationStrategy(t: *const TfLiteTensor) -> TfLiteAllocationStrategy;
3318}
3319extern "C" {
3320 #[doc = " Returns how stable a tensor data buffer address is across runs."]
3321 pub fn TfLiteTensorGetBufferAddressStability(t: *const TfLiteTensor) -> TfLiteRunStability;
3322}
3323extern "C" {
3324 #[doc = " Returns how stable a tensor data values are across runs."]
3325 pub fn TfLiteTensorGetDataStability(t: *const TfLiteTensor) -> TfLiteRunStability;
3326}
3327extern "C" {
3328 #[doc = " Returns the operation step when the data of a tensor is populated.\n\n Some operations can precompute their results before the evaluation step.\n This makes the data available earlier for subsequent operations."]
3329 pub fn TfLiteTensorGetDataKnownStep(t: *const TfLiteTensor) -> TfLiteRunStep;
3330}
3331extern "C" {
3332 #[doc = " Returns the operation steop when the shape of a tensor is computed.\n\n Some operations can precompute the shape of their results before the\n evaluation step. This makes the shape available earlier for subsequent\n operations."]
3333 pub fn TfLiteTensorGetShapeKnownStep(t: *const TfLiteTensor) -> TfLiteRunStep;
3334}
3335#[repr(u32)]
3336#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
3337pub enum edgetpu_device_type {
3338 EDGETPU_APEX_PCI = 0,
3339 EDGETPU_APEX_USB = 1,
3340}
3341#[repr(C)]
3342#[derive(Debug, Copy, Clone)]
3343pub struct edgetpu_device {
3344 pub type_: edgetpu_device_type,
3345 pub path: *const ::core::ffi::c_char,
3346}
3347#[test]
3348fn bindgen_test_layout_edgetpu_device() {
3349 const UNINIT: ::core::mem::MaybeUninit<edgetpu_device> = ::core::mem::MaybeUninit::uninit();
3350 let ptr = UNINIT.as_ptr();
3351 assert_eq!(
3352 ::core::mem::size_of::<edgetpu_device>(),
3353 16usize,
3354 concat!("Size of: ", stringify!(edgetpu_device))
3355 );
3356 assert_eq!(
3357 ::core::mem::align_of::<edgetpu_device>(),
3358 8usize,
3359 concat!("Alignment of ", stringify!(edgetpu_device))
3360 );
3361 assert_eq!(
3362 unsafe { ::core::ptr::addr_of!((*ptr).type_) as usize - ptr as usize },
3363 0usize,
3364 concat!(
3365 "Offset of field: ",
3366 stringify!(edgetpu_device),
3367 "::",
3368 stringify!(type_)
3369 )
3370 );
3371 assert_eq!(
3372 unsafe { ::core::ptr::addr_of!((*ptr).path) as usize - ptr as usize },
3373 8usize,
3374 concat!(
3375 "Offset of field: ",
3376 stringify!(edgetpu_device),
3377 "::",
3378 stringify!(path)
3379 )
3380 );
3381}
3382#[repr(C)]
3383#[derive(Debug, Copy, Clone)]
3384pub struct edgetpu_option {
3385 pub name: *const ::core::ffi::c_char,
3386 pub value: *const ::core::ffi::c_char,
3387}
3388#[test]
3389fn bindgen_test_layout_edgetpu_option() {
3390 const UNINIT: ::core::mem::MaybeUninit<edgetpu_option> = ::core::mem::MaybeUninit::uninit();
3391 let ptr = UNINIT.as_ptr();
3392 assert_eq!(
3393 ::core::mem::size_of::<edgetpu_option>(),
3394 16usize,
3395 concat!("Size of: ", stringify!(edgetpu_option))
3396 );
3397 assert_eq!(
3398 ::core::mem::align_of::<edgetpu_option>(),
3399 8usize,
3400 concat!("Alignment of ", stringify!(edgetpu_option))
3401 );
3402 assert_eq!(
3403 unsafe { ::core::ptr::addr_of!((*ptr).name) as usize - ptr as usize },
3404 0usize,
3405 concat!(
3406 "Offset of field: ",
3407 stringify!(edgetpu_option),
3408 "::",
3409 stringify!(name)
3410 )
3411 );
3412 assert_eq!(
3413 unsafe { ::core::ptr::addr_of!((*ptr).value) as usize - ptr as usize },
3414 8usize,
3415 concat!(
3416 "Offset of field: ",
3417 stringify!(edgetpu_option),
3418 "::",
3419 stringify!(value)
3420 )
3421 );
3422}
3423extern "C" {
3424 pub fn edgetpu_list_devices(num_devices: *mut usize) -> *mut edgetpu_device;
3425}
3426extern "C" {
3427 pub fn edgetpu_free_devices(dev: *mut edgetpu_device);
3428}
3429extern "C" {
3430 pub fn edgetpu_create_delegate(
3431 type_: edgetpu_device_type,
3432 name: *const ::core::ffi::c_char,
3433 options: *const edgetpu_option,
3434 num_options: usize,
3435 ) -> *mut TfLiteDelegate;
3436}
3437extern "C" {
3438 pub fn edgetpu_free_delegate(delegate: *mut TfLiteDelegate);
3439}
3440extern "C" {
3441 pub fn edgetpu_verbosity(verbosity: ::core::ffi::c_int);
3442}
3443extern "C" {
3444 pub fn edgetpu_version() -> *const ::core::ffi::c_char;
3445}
3446pub type _Float32 = f32;
3447pub type _Float64 = f64;
3448pub type _Float32x = f64;
3449pub type _Float64x = u128;
3450#[repr(C)]
3451#[derive(Debug, Copy, Clone)]
3452pub struct div_t {
3453 pub quot: ::core::ffi::c_int,
3454 pub rem: ::core::ffi::c_int,
3455}
3456#[test]
3457fn bindgen_test_layout_div_t() {
3458 const UNINIT: ::core::mem::MaybeUninit<div_t> = ::core::mem::MaybeUninit::uninit();
3459 let ptr = UNINIT.as_ptr();
3460 assert_eq!(
3461 ::core::mem::size_of::<div_t>(),
3462 8usize,
3463 concat!("Size of: ", stringify!(div_t))
3464 );
3465 assert_eq!(
3466 ::core::mem::align_of::<div_t>(),
3467 4usize,
3468 concat!("Alignment of ", stringify!(div_t))
3469 );
3470 assert_eq!(
3471 unsafe { ::core::ptr::addr_of!((*ptr).quot) as usize - ptr as usize },
3472 0usize,
3473 concat!(
3474 "Offset of field: ",
3475 stringify!(div_t),
3476 "::",
3477 stringify!(quot)
3478 )
3479 );
3480 assert_eq!(
3481 unsafe { ::core::ptr::addr_of!((*ptr).rem) as usize - ptr as usize },
3482 4usize,
3483 concat!(
3484 "Offset of field: ",
3485 stringify!(div_t),
3486 "::",
3487 stringify!(rem)
3488 )
3489 );
3490}
3491#[repr(C)]
3492#[derive(Debug, Copy, Clone)]
3493pub struct ldiv_t {
3494 pub quot: ::core::ffi::c_long,
3495 pub rem: ::core::ffi::c_long,
3496}
3497#[test]
3498fn bindgen_test_layout_ldiv_t() {
3499 const UNINIT: ::core::mem::MaybeUninit<ldiv_t> = ::core::mem::MaybeUninit::uninit();
3500 let ptr = UNINIT.as_ptr();
3501 assert_eq!(
3502 ::core::mem::size_of::<ldiv_t>(),
3503 16usize,
3504 concat!("Size of: ", stringify!(ldiv_t))
3505 );
3506 assert_eq!(
3507 ::core::mem::align_of::<ldiv_t>(),
3508 8usize,
3509 concat!("Alignment of ", stringify!(ldiv_t))
3510 );
3511 assert_eq!(
3512 unsafe { ::core::ptr::addr_of!((*ptr).quot) as usize - ptr as usize },
3513 0usize,
3514 concat!(
3515 "Offset of field: ",
3516 stringify!(ldiv_t),
3517 "::",
3518 stringify!(quot)
3519 )
3520 );
3521 assert_eq!(
3522 unsafe { ::core::ptr::addr_of!((*ptr).rem) as usize - ptr as usize },
3523 8usize,
3524 concat!(
3525 "Offset of field: ",
3526 stringify!(ldiv_t),
3527 "::",
3528 stringify!(rem)
3529 )
3530 );
3531}
3532#[repr(C)]
3533#[derive(Debug, Copy, Clone)]
3534pub struct lldiv_t {
3535 pub quot: ::core::ffi::c_longlong,
3536 pub rem: ::core::ffi::c_longlong,
3537}
3538#[test]
3539fn bindgen_test_layout_lldiv_t() {
3540 const UNINIT: ::core::mem::MaybeUninit<lldiv_t> = ::core::mem::MaybeUninit::uninit();
3541 let ptr = UNINIT.as_ptr();
3542 assert_eq!(
3543 ::core::mem::size_of::<lldiv_t>(),
3544 16usize,
3545 concat!("Size of: ", stringify!(lldiv_t))
3546 );
3547 assert_eq!(
3548 ::core::mem::align_of::<lldiv_t>(),
3549 8usize,
3550 concat!("Alignment of ", stringify!(lldiv_t))
3551 );
3552 assert_eq!(
3553 unsafe { ::core::ptr::addr_of!((*ptr).quot) as usize - ptr as usize },
3554 0usize,
3555 concat!(
3556 "Offset of field: ",
3557 stringify!(lldiv_t),
3558 "::",
3559 stringify!(quot)
3560 )
3561 );
3562 assert_eq!(
3563 unsafe { ::core::ptr::addr_of!((*ptr).rem) as usize - ptr as usize },
3564 8usize,
3565 concat!(
3566 "Offset of field: ",
3567 stringify!(lldiv_t),
3568 "::",
3569 stringify!(rem)
3570 )
3571 );
3572}
3573extern "C" {
3574 pub fn __ctype_get_mb_cur_max() -> usize;
3575}
3576extern "C" {
3577 pub fn atof(__nptr: *const ::core::ffi::c_char) -> f64;
3578}
3579extern "C" {
3580 pub fn atoi(__nptr: *const ::core::ffi::c_char) -> ::core::ffi::c_int;
3581}
3582extern "C" {
3583 pub fn atol(__nptr: *const ::core::ffi::c_char) -> ::core::ffi::c_long;
3584}
3585extern "C" {
3586 pub fn atoll(__nptr: *const ::core::ffi::c_char) -> ::core::ffi::c_longlong;
3587}
3588extern "C" {
3589 pub fn strtod(
3590 __nptr: *const ::core::ffi::c_char,
3591 __endptr: *mut *mut ::core::ffi::c_char,
3592 ) -> f64;
3593}
3594extern "C" {
3595 pub fn strtof(
3596 __nptr: *const ::core::ffi::c_char,
3597 __endptr: *mut *mut ::core::ffi::c_char,
3598 ) -> f32;
3599}
3600extern "C" {
3601 pub fn strtold(
3602 __nptr: *const ::core::ffi::c_char,
3603 __endptr: *mut *mut ::core::ffi::c_char,
3604 ) -> u128;
3605}
3606extern "C" {
3607 pub fn strtol(
3608 __nptr: *const ::core::ffi::c_char,
3609 __endptr: *mut *mut ::core::ffi::c_char,
3610 __base: ::core::ffi::c_int,
3611 ) -> ::core::ffi::c_long;
3612}
3613extern "C" {
3614 pub fn strtoul(
3615 __nptr: *const ::core::ffi::c_char,
3616 __endptr: *mut *mut ::core::ffi::c_char,
3617 __base: ::core::ffi::c_int,
3618 ) -> ::core::ffi::c_ulong;
3619}
3620extern "C" {
3621 pub fn strtoq(
3622 __nptr: *const ::core::ffi::c_char,
3623 __endptr: *mut *mut ::core::ffi::c_char,
3624 __base: ::core::ffi::c_int,
3625 ) -> ::core::ffi::c_longlong;
3626}
3627extern "C" {
3628 pub fn strtouq(
3629 __nptr: *const ::core::ffi::c_char,
3630 __endptr: *mut *mut ::core::ffi::c_char,
3631 __base: ::core::ffi::c_int,
3632 ) -> ::core::ffi::c_ulonglong;
3633}
3634extern "C" {
3635 pub fn strtoll(
3636 __nptr: *const ::core::ffi::c_char,
3637 __endptr: *mut *mut ::core::ffi::c_char,
3638 __base: ::core::ffi::c_int,
3639 ) -> ::core::ffi::c_longlong;
3640}
3641extern "C" {
3642 pub fn strtoull(
3643 __nptr: *const ::core::ffi::c_char,
3644 __endptr: *mut *mut ::core::ffi::c_char,
3645 __base: ::core::ffi::c_int,
3646 ) -> ::core::ffi::c_ulonglong;
3647}
3648extern "C" {
3649 pub fn l64a(__n: ::core::ffi::c_long) -> *mut ::core::ffi::c_char;
3650}
3651extern "C" {
3652 pub fn a64l(__s: *const ::core::ffi::c_char) -> ::core::ffi::c_long;
3653}
3654pub type u_char = __u_char;
3655pub type u_short = __u_short;
3656pub type u_int = __u_int;
3657pub type u_long = __u_long;
3658pub type quad_t = __quad_t;
3659pub type u_quad_t = __u_quad_t;
3660pub type fsid_t = __fsid_t;
3661pub type loff_t = __loff_t;
3662pub type ino_t = __ino_t;
3663pub type dev_t = __dev_t;
3664pub type gid_t = __gid_t;
3665pub type mode_t = __mode_t;
3666pub type nlink_t = __nlink_t;
3667pub type uid_t = __uid_t;
3668pub type off_t = __off_t;
3669pub type pid_t = __pid_t;
3670pub type id_t = __id_t;
3671pub type daddr_t = __daddr_t;
3672pub type caddr_t = __caddr_t;
3673pub type key_t = __key_t;
3674pub type clock_t = __clock_t;
3675pub type clockid_t = __clockid_t;
3676pub type time_t = __time_t;
3677pub type timer_t = __timer_t;
3678pub type ulong = ::core::ffi::c_ulong;
3679pub type ushort = ::core::ffi::c_ushort;
3680pub type uint = ::core::ffi::c_uint;
3681pub type u_int8_t = __uint8_t;
3682pub type u_int16_t = __uint16_t;
3683pub type u_int32_t = __uint32_t;
3684pub type u_int64_t = __uint64_t;
3685pub type register_t = ::core::ffi::c_long;
3686#[repr(C)]
3687#[derive(Debug, Copy, Clone)]
3688pub struct __sigset_t {
3689 pub __val: [::core::ffi::c_ulong; 16usize],
3690}
3691#[test]
3692fn bindgen_test_layout___sigset_t() {
3693 const UNINIT: ::core::mem::MaybeUninit<__sigset_t> = ::core::mem::MaybeUninit::uninit();
3694 let ptr = UNINIT.as_ptr();
3695 assert_eq!(
3696 ::core::mem::size_of::<__sigset_t>(),
3697 128usize,
3698 concat!("Size of: ", stringify!(__sigset_t))
3699 );
3700 assert_eq!(
3701 ::core::mem::align_of::<__sigset_t>(),
3702 8usize,
3703 concat!("Alignment of ", stringify!(__sigset_t))
3704 );
3705 assert_eq!(
3706 unsafe { ::core::ptr::addr_of!((*ptr).__val) as usize - ptr as usize },
3707 0usize,
3708 concat!(
3709 "Offset of field: ",
3710 stringify!(__sigset_t),
3711 "::",
3712 stringify!(__val)
3713 )
3714 );
3715}
3716pub type sigset_t = __sigset_t;
3717#[repr(C)]
3718#[derive(Debug, Copy, Clone)]
3719pub struct timeval {
3720 pub tv_sec: __time_t,
3721 pub tv_usec: __suseconds_t,
3722}
3723#[test]
3724fn bindgen_test_layout_timeval() {
3725 const UNINIT: ::core::mem::MaybeUninit<timeval> = ::core::mem::MaybeUninit::uninit();
3726 let ptr = UNINIT.as_ptr();
3727 assert_eq!(
3728 ::core::mem::size_of::<timeval>(),
3729 16usize,
3730 concat!("Size of: ", stringify!(timeval))
3731 );
3732 assert_eq!(
3733 ::core::mem::align_of::<timeval>(),
3734 8usize,
3735 concat!("Alignment of ", stringify!(timeval))
3736 );
3737 assert_eq!(
3738 unsafe { ::core::ptr::addr_of!((*ptr).tv_sec) as usize - ptr as usize },
3739 0usize,
3740 concat!(
3741 "Offset of field: ",
3742 stringify!(timeval),
3743 "::",
3744 stringify!(tv_sec)
3745 )
3746 );
3747 assert_eq!(
3748 unsafe { ::core::ptr::addr_of!((*ptr).tv_usec) as usize - ptr as usize },
3749 8usize,
3750 concat!(
3751 "Offset of field: ",
3752 stringify!(timeval),
3753 "::",
3754 stringify!(tv_usec)
3755 )
3756 );
3757}
3758#[repr(C)]
3759#[derive(Debug, Copy, Clone)]
3760pub struct timespec {
3761 pub tv_sec: __time_t,
3762 pub tv_nsec: __syscall_slong_t,
3763}
3764#[test]
3765fn bindgen_test_layout_timespec() {
3766 const UNINIT: ::core::mem::MaybeUninit<timespec> = ::core::mem::MaybeUninit::uninit();
3767 let ptr = UNINIT.as_ptr();
3768 assert_eq!(
3769 ::core::mem::size_of::<timespec>(),
3770 16usize,
3771 concat!("Size of: ", stringify!(timespec))
3772 );
3773 assert_eq!(
3774 ::core::mem::align_of::<timespec>(),
3775 8usize,
3776 concat!("Alignment of ", stringify!(timespec))
3777 );
3778 assert_eq!(
3779 unsafe { ::core::ptr::addr_of!((*ptr).tv_sec) as usize - ptr as usize },
3780 0usize,
3781 concat!(
3782 "Offset of field: ",
3783 stringify!(timespec),
3784 "::",
3785 stringify!(tv_sec)
3786 )
3787 );
3788 assert_eq!(
3789 unsafe { ::core::ptr::addr_of!((*ptr).tv_nsec) as usize - ptr as usize },
3790 8usize,
3791 concat!(
3792 "Offset of field: ",
3793 stringify!(timespec),
3794 "::",
3795 stringify!(tv_nsec)
3796 )
3797 );
3798}
3799pub type suseconds_t = __suseconds_t;
3800pub type __fd_mask = ::core::ffi::c_long;
3801#[repr(C)]
3802#[derive(Debug, Copy, Clone)]
3803pub struct fd_set {
3804 pub __fds_bits: [__fd_mask; 16usize],
3805}
3806#[test]
3807fn bindgen_test_layout_fd_set() {
3808 const UNINIT: ::core::mem::MaybeUninit<fd_set> = ::core::mem::MaybeUninit::uninit();
3809 let ptr = UNINIT.as_ptr();
3810 assert_eq!(
3811 ::core::mem::size_of::<fd_set>(),
3812 128usize,
3813 concat!("Size of: ", stringify!(fd_set))
3814 );
3815 assert_eq!(
3816 ::core::mem::align_of::<fd_set>(),
3817 8usize,
3818 concat!("Alignment of ", stringify!(fd_set))
3819 );
3820 assert_eq!(
3821 unsafe { ::core::ptr::addr_of!((*ptr).__fds_bits) as usize - ptr as usize },
3822 0usize,
3823 concat!(
3824 "Offset of field: ",
3825 stringify!(fd_set),
3826 "::",
3827 stringify!(__fds_bits)
3828 )
3829 );
3830}
3831pub type fd_mask = __fd_mask;
3832extern "C" {
3833 pub fn select(
3834 __nfds: ::core::ffi::c_int,
3835 __readfds: *mut fd_set,
3836 __writefds: *mut fd_set,
3837 __exceptfds: *mut fd_set,
3838 __timeout: *mut timeval,
3839 ) -> ::core::ffi::c_int;
3840}
3841extern "C" {
3842 pub fn pselect(
3843 __nfds: ::core::ffi::c_int,
3844 __readfds: *mut fd_set,
3845 __writefds: *mut fd_set,
3846 __exceptfds: *mut fd_set,
3847 __timeout: *const timespec,
3848 __sigmask: *const __sigset_t,
3849 ) -> ::core::ffi::c_int;
3850}
3851pub type blksize_t = __blksize_t;
3852pub type blkcnt_t = __blkcnt_t;
3853pub type fsblkcnt_t = __fsblkcnt_t;
3854pub type fsfilcnt_t = __fsfilcnt_t;
3855#[repr(C)]
3856#[derive(Copy, Clone)]
3857pub union __atomic_wide_counter {
3858 pub __value64: ::core::ffi::c_ulonglong,
3859 pub __value32: __atomic_wide_counter__bindgen_ty_1,
3860}
3861#[repr(C)]
3862#[derive(Debug, Copy, Clone)]
3863pub struct __atomic_wide_counter__bindgen_ty_1 {
3864 pub __low: ::core::ffi::c_uint,
3865 pub __high: ::core::ffi::c_uint,
3866}
3867#[test]
3868fn bindgen_test_layout___atomic_wide_counter__bindgen_ty_1() {
3869 const UNINIT: ::core::mem::MaybeUninit<__atomic_wide_counter__bindgen_ty_1> =
3870 ::core::mem::MaybeUninit::uninit();
3871 let ptr = UNINIT.as_ptr();
3872 assert_eq!(
3873 ::core::mem::size_of::<__atomic_wide_counter__bindgen_ty_1>(),
3874 8usize,
3875 concat!("Size of: ", stringify!(__atomic_wide_counter__bindgen_ty_1))
3876 );
3877 assert_eq!(
3878 ::core::mem::align_of::<__atomic_wide_counter__bindgen_ty_1>(),
3879 4usize,
3880 concat!(
3881 "Alignment of ",
3882 stringify!(__atomic_wide_counter__bindgen_ty_1)
3883 )
3884 );
3885 assert_eq!(
3886 unsafe { ::core::ptr::addr_of!((*ptr).__low) as usize - ptr as usize },
3887 0usize,
3888 concat!(
3889 "Offset of field: ",
3890 stringify!(__atomic_wide_counter__bindgen_ty_1),
3891 "::",
3892 stringify!(__low)
3893 )
3894 );
3895 assert_eq!(
3896 unsafe { ::core::ptr::addr_of!((*ptr).__high) as usize - ptr as usize },
3897 4usize,
3898 concat!(
3899 "Offset of field: ",
3900 stringify!(__atomic_wide_counter__bindgen_ty_1),
3901 "::",
3902 stringify!(__high)
3903 )
3904 );
3905}
3906#[test]
3907fn bindgen_test_layout___atomic_wide_counter() {
3908 const UNINIT: ::core::mem::MaybeUninit<__atomic_wide_counter> =
3909 ::core::mem::MaybeUninit::uninit();
3910 let ptr = UNINIT.as_ptr();
3911 assert_eq!(
3912 ::core::mem::size_of::<__atomic_wide_counter>(),
3913 8usize,
3914 concat!("Size of: ", stringify!(__atomic_wide_counter))
3915 );
3916 assert_eq!(
3917 ::core::mem::align_of::<__atomic_wide_counter>(),
3918 8usize,
3919 concat!("Alignment of ", stringify!(__atomic_wide_counter))
3920 );
3921 assert_eq!(
3922 unsafe { ::core::ptr::addr_of!((*ptr).__value64) as usize - ptr as usize },
3923 0usize,
3924 concat!(
3925 "Offset of field: ",
3926 stringify!(__atomic_wide_counter),
3927 "::",
3928 stringify!(__value64)
3929 )
3930 );
3931 assert_eq!(
3932 unsafe { ::core::ptr::addr_of!((*ptr).__value32) as usize - ptr as usize },
3933 0usize,
3934 concat!(
3935 "Offset of field: ",
3936 stringify!(__atomic_wide_counter),
3937 "::",
3938 stringify!(__value32)
3939 )
3940 );
3941}
3942#[repr(C)]
3943#[derive(Debug, Copy, Clone)]
3944pub struct __pthread_internal_list {
3945 pub __prev: *mut __pthread_internal_list,
3946 pub __next: *mut __pthread_internal_list,
3947}
3948#[test]
3949fn bindgen_test_layout___pthread_internal_list() {
3950 const UNINIT: ::core::mem::MaybeUninit<__pthread_internal_list> =
3951 ::core::mem::MaybeUninit::uninit();
3952 let ptr = UNINIT.as_ptr();
3953 assert_eq!(
3954 ::core::mem::size_of::<__pthread_internal_list>(),
3955 16usize,
3956 concat!("Size of: ", stringify!(__pthread_internal_list))
3957 );
3958 assert_eq!(
3959 ::core::mem::align_of::<__pthread_internal_list>(),
3960 8usize,
3961 concat!("Alignment of ", stringify!(__pthread_internal_list))
3962 );
3963 assert_eq!(
3964 unsafe { ::core::ptr::addr_of!((*ptr).__prev) as usize - ptr as usize },
3965 0usize,
3966 concat!(
3967 "Offset of field: ",
3968 stringify!(__pthread_internal_list),
3969 "::",
3970 stringify!(__prev)
3971 )
3972 );
3973 assert_eq!(
3974 unsafe { ::core::ptr::addr_of!((*ptr).__next) as usize - ptr as usize },
3975 8usize,
3976 concat!(
3977 "Offset of field: ",
3978 stringify!(__pthread_internal_list),
3979 "::",
3980 stringify!(__next)
3981 )
3982 );
3983}
3984pub type __pthread_list_t = __pthread_internal_list;
3985#[repr(C)]
3986#[derive(Debug, Copy, Clone)]
3987pub struct __pthread_internal_slist {
3988 pub __next: *mut __pthread_internal_slist,
3989}
3990#[test]
3991fn bindgen_test_layout___pthread_internal_slist() {
3992 const UNINIT: ::core::mem::MaybeUninit<__pthread_internal_slist> =
3993 ::core::mem::MaybeUninit::uninit();
3994 let ptr = UNINIT.as_ptr();
3995 assert_eq!(
3996 ::core::mem::size_of::<__pthread_internal_slist>(),
3997 8usize,
3998 concat!("Size of: ", stringify!(__pthread_internal_slist))
3999 );
4000 assert_eq!(
4001 ::core::mem::align_of::<__pthread_internal_slist>(),
4002 8usize,
4003 concat!("Alignment of ", stringify!(__pthread_internal_slist))
4004 );
4005 assert_eq!(
4006 unsafe { ::core::ptr::addr_of!((*ptr).__next) as usize - ptr as usize },
4007 0usize,
4008 concat!(
4009 "Offset of field: ",
4010 stringify!(__pthread_internal_slist),
4011 "::",
4012 stringify!(__next)
4013 )
4014 );
4015}
4016pub type __pthread_slist_t = __pthread_internal_slist;
4017#[repr(C)]
4018#[derive(Debug, Copy, Clone)]
4019pub struct __pthread_mutex_s {
4020 pub __lock: ::core::ffi::c_int,
4021 pub __count: ::core::ffi::c_uint,
4022 pub __owner: ::core::ffi::c_int,
4023 pub __nusers: ::core::ffi::c_uint,
4024 pub __kind: ::core::ffi::c_int,
4025 pub __spins: ::core::ffi::c_short,
4026 pub __elision: ::core::ffi::c_short,
4027 pub __list: __pthread_list_t,
4028}
4029#[test]
4030fn bindgen_test_layout___pthread_mutex_s() {
4031 const UNINIT: ::core::mem::MaybeUninit<__pthread_mutex_s> = ::core::mem::MaybeUninit::uninit();
4032 let ptr = UNINIT.as_ptr();
4033 assert_eq!(
4034 ::core::mem::size_of::<__pthread_mutex_s>(),
4035 40usize,
4036 concat!("Size of: ", stringify!(__pthread_mutex_s))
4037 );
4038 assert_eq!(
4039 ::core::mem::align_of::<__pthread_mutex_s>(),
4040 8usize,
4041 concat!("Alignment of ", stringify!(__pthread_mutex_s))
4042 );
4043 assert_eq!(
4044 unsafe { ::core::ptr::addr_of!((*ptr).__lock) as usize - ptr as usize },
4045 0usize,
4046 concat!(
4047 "Offset of field: ",
4048 stringify!(__pthread_mutex_s),
4049 "::",
4050 stringify!(__lock)
4051 )
4052 );
4053 assert_eq!(
4054 unsafe { ::core::ptr::addr_of!((*ptr).__count) as usize - ptr as usize },
4055 4usize,
4056 concat!(
4057 "Offset of field: ",
4058 stringify!(__pthread_mutex_s),
4059 "::",
4060 stringify!(__count)
4061 )
4062 );
4063 assert_eq!(
4064 unsafe { ::core::ptr::addr_of!((*ptr).__owner) as usize - ptr as usize },
4065 8usize,
4066 concat!(
4067 "Offset of field: ",
4068 stringify!(__pthread_mutex_s),
4069 "::",
4070 stringify!(__owner)
4071 )
4072 );
4073 assert_eq!(
4074 unsafe { ::core::ptr::addr_of!((*ptr).__nusers) as usize - ptr as usize },
4075 12usize,
4076 concat!(
4077 "Offset of field: ",
4078 stringify!(__pthread_mutex_s),
4079 "::",
4080 stringify!(__nusers)
4081 )
4082 );
4083 assert_eq!(
4084 unsafe { ::core::ptr::addr_of!((*ptr).__kind) as usize - ptr as usize },
4085 16usize,
4086 concat!(
4087 "Offset of field: ",
4088 stringify!(__pthread_mutex_s),
4089 "::",
4090 stringify!(__kind)
4091 )
4092 );
4093 assert_eq!(
4094 unsafe { ::core::ptr::addr_of!((*ptr).__spins) as usize - ptr as usize },
4095 20usize,
4096 concat!(
4097 "Offset of field: ",
4098 stringify!(__pthread_mutex_s),
4099 "::",
4100 stringify!(__spins)
4101 )
4102 );
4103 assert_eq!(
4104 unsafe { ::core::ptr::addr_of!((*ptr).__elision) as usize - ptr as usize },
4105 22usize,
4106 concat!(
4107 "Offset of field: ",
4108 stringify!(__pthread_mutex_s),
4109 "::",
4110 stringify!(__elision)
4111 )
4112 );
4113 assert_eq!(
4114 unsafe { ::core::ptr::addr_of!((*ptr).__list) as usize - ptr as usize },
4115 24usize,
4116 concat!(
4117 "Offset of field: ",
4118 stringify!(__pthread_mutex_s),
4119 "::",
4120 stringify!(__list)
4121 )
4122 );
4123}
4124#[repr(C)]
4125#[derive(Debug, Copy, Clone)]
4126pub struct __pthread_rwlock_arch_t {
4127 pub __readers: ::core::ffi::c_uint,
4128 pub __writers: ::core::ffi::c_uint,
4129 pub __wrphase_futex: ::core::ffi::c_uint,
4130 pub __writers_futex: ::core::ffi::c_uint,
4131 pub __pad3: ::core::ffi::c_uint,
4132 pub __pad4: ::core::ffi::c_uint,
4133 pub __cur_writer: ::core::ffi::c_int,
4134 pub __shared: ::core::ffi::c_int,
4135 pub __rwelision: ::core::ffi::c_schar,
4136 pub __pad1: [::core::ffi::c_uchar; 7usize],
4137 pub __pad2: ::core::ffi::c_ulong,
4138 pub __flags: ::core::ffi::c_uint,
4139}
4140#[test]
4141fn bindgen_test_layout___pthread_rwlock_arch_t() {
4142 const UNINIT: ::core::mem::MaybeUninit<__pthread_rwlock_arch_t> =
4143 ::core::mem::MaybeUninit::uninit();
4144 let ptr = UNINIT.as_ptr();
4145 assert_eq!(
4146 ::core::mem::size_of::<__pthread_rwlock_arch_t>(),
4147 56usize,
4148 concat!("Size of: ", stringify!(__pthread_rwlock_arch_t))
4149 );
4150 assert_eq!(
4151 ::core::mem::align_of::<__pthread_rwlock_arch_t>(),
4152 8usize,
4153 concat!("Alignment of ", stringify!(__pthread_rwlock_arch_t))
4154 );
4155 assert_eq!(
4156 unsafe { ::core::ptr::addr_of!((*ptr).__readers) as usize - ptr as usize },
4157 0usize,
4158 concat!(
4159 "Offset of field: ",
4160 stringify!(__pthread_rwlock_arch_t),
4161 "::",
4162 stringify!(__readers)
4163 )
4164 );
4165 assert_eq!(
4166 unsafe { ::core::ptr::addr_of!((*ptr).__writers) as usize - ptr as usize },
4167 4usize,
4168 concat!(
4169 "Offset of field: ",
4170 stringify!(__pthread_rwlock_arch_t),
4171 "::",
4172 stringify!(__writers)
4173 )
4174 );
4175 assert_eq!(
4176 unsafe { ::core::ptr::addr_of!((*ptr).__wrphase_futex) as usize - ptr as usize },
4177 8usize,
4178 concat!(
4179 "Offset of field: ",
4180 stringify!(__pthread_rwlock_arch_t),
4181 "::",
4182 stringify!(__wrphase_futex)
4183 )
4184 );
4185 assert_eq!(
4186 unsafe { ::core::ptr::addr_of!((*ptr).__writers_futex) as usize - ptr as usize },
4187 12usize,
4188 concat!(
4189 "Offset of field: ",
4190 stringify!(__pthread_rwlock_arch_t),
4191 "::",
4192 stringify!(__writers_futex)
4193 )
4194 );
4195 assert_eq!(
4196 unsafe { ::core::ptr::addr_of!((*ptr).__pad3) as usize - ptr as usize },
4197 16usize,
4198 concat!(
4199 "Offset of field: ",
4200 stringify!(__pthread_rwlock_arch_t),
4201 "::",
4202 stringify!(__pad3)
4203 )
4204 );
4205 assert_eq!(
4206 unsafe { ::core::ptr::addr_of!((*ptr).__pad4) as usize - ptr as usize },
4207 20usize,
4208 concat!(
4209 "Offset of field: ",
4210 stringify!(__pthread_rwlock_arch_t),
4211 "::",
4212 stringify!(__pad4)
4213 )
4214 );
4215 assert_eq!(
4216 unsafe { ::core::ptr::addr_of!((*ptr).__cur_writer) as usize - ptr as usize },
4217 24usize,
4218 concat!(
4219 "Offset of field: ",
4220 stringify!(__pthread_rwlock_arch_t),
4221 "::",
4222 stringify!(__cur_writer)
4223 )
4224 );
4225 assert_eq!(
4226 unsafe { ::core::ptr::addr_of!((*ptr).__shared) as usize - ptr as usize },
4227 28usize,
4228 concat!(
4229 "Offset of field: ",
4230 stringify!(__pthread_rwlock_arch_t),
4231 "::",
4232 stringify!(__shared)
4233 )
4234 );
4235 assert_eq!(
4236 unsafe { ::core::ptr::addr_of!((*ptr).__rwelision) as usize - ptr as usize },
4237 32usize,
4238 concat!(
4239 "Offset of field: ",
4240 stringify!(__pthread_rwlock_arch_t),
4241 "::",
4242 stringify!(__rwelision)
4243 )
4244 );
4245 assert_eq!(
4246 unsafe { ::core::ptr::addr_of!((*ptr).__pad1) as usize - ptr as usize },
4247 33usize,
4248 concat!(
4249 "Offset of field: ",
4250 stringify!(__pthread_rwlock_arch_t),
4251 "::",
4252 stringify!(__pad1)
4253 )
4254 );
4255 assert_eq!(
4256 unsafe { ::core::ptr::addr_of!((*ptr).__pad2) as usize - ptr as usize },
4257 40usize,
4258 concat!(
4259 "Offset of field: ",
4260 stringify!(__pthread_rwlock_arch_t),
4261 "::",
4262 stringify!(__pad2)
4263 )
4264 );
4265 assert_eq!(
4266 unsafe { ::core::ptr::addr_of!((*ptr).__flags) as usize - ptr as usize },
4267 48usize,
4268 concat!(
4269 "Offset of field: ",
4270 stringify!(__pthread_rwlock_arch_t),
4271 "::",
4272 stringify!(__flags)
4273 )
4274 );
4275}
4276#[repr(C)]
4277#[derive(Copy, Clone)]
4278pub struct __pthread_cond_s {
4279 pub __wseq: __atomic_wide_counter,
4280 pub __g1_start: __atomic_wide_counter,
4281 pub __g_refs: [::core::ffi::c_uint; 2usize],
4282 pub __g_size: [::core::ffi::c_uint; 2usize],
4283 pub __g1_orig_size: ::core::ffi::c_uint,
4284 pub __wrefs: ::core::ffi::c_uint,
4285 pub __g_signals: [::core::ffi::c_uint; 2usize],
4286}
4287#[test]
4288fn bindgen_test_layout___pthread_cond_s() {
4289 const UNINIT: ::core::mem::MaybeUninit<__pthread_cond_s> = ::core::mem::MaybeUninit::uninit();
4290 let ptr = UNINIT.as_ptr();
4291 assert_eq!(
4292 ::core::mem::size_of::<__pthread_cond_s>(),
4293 48usize,
4294 concat!("Size of: ", stringify!(__pthread_cond_s))
4295 );
4296 assert_eq!(
4297 ::core::mem::align_of::<__pthread_cond_s>(),
4298 8usize,
4299 concat!("Alignment of ", stringify!(__pthread_cond_s))
4300 );
4301 assert_eq!(
4302 unsafe { ::core::ptr::addr_of!((*ptr).__wseq) as usize - ptr as usize },
4303 0usize,
4304 concat!(
4305 "Offset of field: ",
4306 stringify!(__pthread_cond_s),
4307 "::",
4308 stringify!(__wseq)
4309 )
4310 );
4311 assert_eq!(
4312 unsafe { ::core::ptr::addr_of!((*ptr).__g1_start) as usize - ptr as usize },
4313 8usize,
4314 concat!(
4315 "Offset of field: ",
4316 stringify!(__pthread_cond_s),
4317 "::",
4318 stringify!(__g1_start)
4319 )
4320 );
4321 assert_eq!(
4322 unsafe { ::core::ptr::addr_of!((*ptr).__g_refs) as usize - ptr as usize },
4323 16usize,
4324 concat!(
4325 "Offset of field: ",
4326 stringify!(__pthread_cond_s),
4327 "::",
4328 stringify!(__g_refs)
4329 )
4330 );
4331 assert_eq!(
4332 unsafe { ::core::ptr::addr_of!((*ptr).__g_size) as usize - ptr as usize },
4333 24usize,
4334 concat!(
4335 "Offset of field: ",
4336 stringify!(__pthread_cond_s),
4337 "::",
4338 stringify!(__g_size)
4339 )
4340 );
4341 assert_eq!(
4342 unsafe { ::core::ptr::addr_of!((*ptr).__g1_orig_size) as usize - ptr as usize },
4343 32usize,
4344 concat!(
4345 "Offset of field: ",
4346 stringify!(__pthread_cond_s),
4347 "::",
4348 stringify!(__g1_orig_size)
4349 )
4350 );
4351 assert_eq!(
4352 unsafe { ::core::ptr::addr_of!((*ptr).__wrefs) as usize - ptr as usize },
4353 36usize,
4354 concat!(
4355 "Offset of field: ",
4356 stringify!(__pthread_cond_s),
4357 "::",
4358 stringify!(__wrefs)
4359 )
4360 );
4361 assert_eq!(
4362 unsafe { ::core::ptr::addr_of!((*ptr).__g_signals) as usize - ptr as usize },
4363 40usize,
4364 concat!(
4365 "Offset of field: ",
4366 stringify!(__pthread_cond_s),
4367 "::",
4368 stringify!(__g_signals)
4369 )
4370 );
4371}
4372pub type __tss_t = ::core::ffi::c_uint;
4373pub type __thrd_t = ::core::ffi::c_ulong;
4374#[repr(C)]
4375#[derive(Debug, Copy, Clone)]
4376pub struct __once_flag {
4377 pub __data: ::core::ffi::c_int,
4378}
4379#[test]
4380fn bindgen_test_layout___once_flag() {
4381 const UNINIT: ::core::mem::MaybeUninit<__once_flag> = ::core::mem::MaybeUninit::uninit();
4382 let ptr = UNINIT.as_ptr();
4383 assert_eq!(
4384 ::core::mem::size_of::<__once_flag>(),
4385 4usize,
4386 concat!("Size of: ", stringify!(__once_flag))
4387 );
4388 assert_eq!(
4389 ::core::mem::align_of::<__once_flag>(),
4390 4usize,
4391 concat!("Alignment of ", stringify!(__once_flag))
4392 );
4393 assert_eq!(
4394 unsafe { ::core::ptr::addr_of!((*ptr).__data) as usize - ptr as usize },
4395 0usize,
4396 concat!(
4397 "Offset of field: ",
4398 stringify!(__once_flag),
4399 "::",
4400 stringify!(__data)
4401 )
4402 );
4403}
4404pub type pthread_t = ::core::ffi::c_ulong;
4405#[repr(C)]
4406#[derive(Copy, Clone)]
4407pub union pthread_mutexattr_t {
4408 pub __size: [::core::ffi::c_char; 4usize],
4409 pub __align: ::core::ffi::c_int,
4410}
4411#[test]
4412fn bindgen_test_layout_pthread_mutexattr_t() {
4413 const UNINIT: ::core::mem::MaybeUninit<pthread_mutexattr_t> =
4414 ::core::mem::MaybeUninit::uninit();
4415 let ptr = UNINIT.as_ptr();
4416 assert_eq!(
4417 ::core::mem::size_of::<pthread_mutexattr_t>(),
4418 4usize,
4419 concat!("Size of: ", stringify!(pthread_mutexattr_t))
4420 );
4421 assert_eq!(
4422 ::core::mem::align_of::<pthread_mutexattr_t>(),
4423 4usize,
4424 concat!("Alignment of ", stringify!(pthread_mutexattr_t))
4425 );
4426 assert_eq!(
4427 unsafe { ::core::ptr::addr_of!((*ptr).__size) as usize - ptr as usize },
4428 0usize,
4429 concat!(
4430 "Offset of field: ",
4431 stringify!(pthread_mutexattr_t),
4432 "::",
4433 stringify!(__size)
4434 )
4435 );
4436 assert_eq!(
4437 unsafe { ::core::ptr::addr_of!((*ptr).__align) as usize - ptr as usize },
4438 0usize,
4439 concat!(
4440 "Offset of field: ",
4441 stringify!(pthread_mutexattr_t),
4442 "::",
4443 stringify!(__align)
4444 )
4445 );
4446}
4447#[repr(C)]
4448#[derive(Copy, Clone)]
4449pub union pthread_condattr_t {
4450 pub __size: [::core::ffi::c_char; 4usize],
4451 pub __align: ::core::ffi::c_int,
4452}
4453#[test]
4454fn bindgen_test_layout_pthread_condattr_t() {
4455 const UNINIT: ::core::mem::MaybeUninit<pthread_condattr_t> = ::core::mem::MaybeUninit::uninit();
4456 let ptr = UNINIT.as_ptr();
4457 assert_eq!(
4458 ::core::mem::size_of::<pthread_condattr_t>(),
4459 4usize,
4460 concat!("Size of: ", stringify!(pthread_condattr_t))
4461 );
4462 assert_eq!(
4463 ::core::mem::align_of::<pthread_condattr_t>(),
4464 4usize,
4465 concat!("Alignment of ", stringify!(pthread_condattr_t))
4466 );
4467 assert_eq!(
4468 unsafe { ::core::ptr::addr_of!((*ptr).__size) as usize - ptr as usize },
4469 0usize,
4470 concat!(
4471 "Offset of field: ",
4472 stringify!(pthread_condattr_t),
4473 "::",
4474 stringify!(__size)
4475 )
4476 );
4477 assert_eq!(
4478 unsafe { ::core::ptr::addr_of!((*ptr).__align) as usize - ptr as usize },
4479 0usize,
4480 concat!(
4481 "Offset of field: ",
4482 stringify!(pthread_condattr_t),
4483 "::",
4484 stringify!(__align)
4485 )
4486 );
4487}
4488pub type pthread_key_t = ::core::ffi::c_uint;
4489pub type pthread_once_t = ::core::ffi::c_int;
4490#[repr(C)]
4491#[derive(Copy, Clone)]
4492pub union pthread_attr_t {
4493 pub __size: [::core::ffi::c_char; 56usize],
4494 pub __align: ::core::ffi::c_long,
4495}
4496#[test]
4497fn bindgen_test_layout_pthread_attr_t() {
4498 const UNINIT: ::core::mem::MaybeUninit<pthread_attr_t> = ::core::mem::MaybeUninit::uninit();
4499 let ptr = UNINIT.as_ptr();
4500 assert_eq!(
4501 ::core::mem::size_of::<pthread_attr_t>(),
4502 56usize,
4503 concat!("Size of: ", stringify!(pthread_attr_t))
4504 );
4505 assert_eq!(
4506 ::core::mem::align_of::<pthread_attr_t>(),
4507 8usize,
4508 concat!("Alignment of ", stringify!(pthread_attr_t))
4509 );
4510 assert_eq!(
4511 unsafe { ::core::ptr::addr_of!((*ptr).__size) as usize - ptr as usize },
4512 0usize,
4513 concat!(
4514 "Offset of field: ",
4515 stringify!(pthread_attr_t),
4516 "::",
4517 stringify!(__size)
4518 )
4519 );
4520 assert_eq!(
4521 unsafe { ::core::ptr::addr_of!((*ptr).__align) as usize - ptr as usize },
4522 0usize,
4523 concat!(
4524 "Offset of field: ",
4525 stringify!(pthread_attr_t),
4526 "::",
4527 stringify!(__align)
4528 )
4529 );
4530}
4531#[repr(C)]
4532#[derive(Copy, Clone)]
4533pub union pthread_mutex_t {
4534 pub __data: __pthread_mutex_s,
4535 pub __size: [::core::ffi::c_char; 40usize],
4536 pub __align: ::core::ffi::c_long,
4537}
4538#[test]
4539fn bindgen_test_layout_pthread_mutex_t() {
4540 const UNINIT: ::core::mem::MaybeUninit<pthread_mutex_t> = ::core::mem::MaybeUninit::uninit();
4541 let ptr = UNINIT.as_ptr();
4542 assert_eq!(
4543 ::core::mem::size_of::<pthread_mutex_t>(),
4544 40usize,
4545 concat!("Size of: ", stringify!(pthread_mutex_t))
4546 );
4547 assert_eq!(
4548 ::core::mem::align_of::<pthread_mutex_t>(),
4549 8usize,
4550 concat!("Alignment of ", stringify!(pthread_mutex_t))
4551 );
4552 assert_eq!(
4553 unsafe { ::core::ptr::addr_of!((*ptr).__data) as usize - ptr as usize },
4554 0usize,
4555 concat!(
4556 "Offset of field: ",
4557 stringify!(pthread_mutex_t),
4558 "::",
4559 stringify!(__data)
4560 )
4561 );
4562 assert_eq!(
4563 unsafe { ::core::ptr::addr_of!((*ptr).__size) as usize - ptr as usize },
4564 0usize,
4565 concat!(
4566 "Offset of field: ",
4567 stringify!(pthread_mutex_t),
4568 "::",
4569 stringify!(__size)
4570 )
4571 );
4572 assert_eq!(
4573 unsafe { ::core::ptr::addr_of!((*ptr).__align) as usize - ptr as usize },
4574 0usize,
4575 concat!(
4576 "Offset of field: ",
4577 stringify!(pthread_mutex_t),
4578 "::",
4579 stringify!(__align)
4580 )
4581 );
4582}
4583#[repr(C)]
4584#[derive(Copy, Clone)]
4585pub union pthread_cond_t {
4586 pub __data: __pthread_cond_s,
4587 pub __size: [::core::ffi::c_char; 48usize],
4588 pub __align: ::core::ffi::c_longlong,
4589}
4590#[test]
4591fn bindgen_test_layout_pthread_cond_t() {
4592 const UNINIT: ::core::mem::MaybeUninit<pthread_cond_t> = ::core::mem::MaybeUninit::uninit();
4593 let ptr = UNINIT.as_ptr();
4594 assert_eq!(
4595 ::core::mem::size_of::<pthread_cond_t>(),
4596 48usize,
4597 concat!("Size of: ", stringify!(pthread_cond_t))
4598 );
4599 assert_eq!(
4600 ::core::mem::align_of::<pthread_cond_t>(),
4601 8usize,
4602 concat!("Alignment of ", stringify!(pthread_cond_t))
4603 );
4604 assert_eq!(
4605 unsafe { ::core::ptr::addr_of!((*ptr).__data) as usize - ptr as usize },
4606 0usize,
4607 concat!(
4608 "Offset of field: ",
4609 stringify!(pthread_cond_t),
4610 "::",
4611 stringify!(__data)
4612 )
4613 );
4614 assert_eq!(
4615 unsafe { ::core::ptr::addr_of!((*ptr).__size) as usize - ptr as usize },
4616 0usize,
4617 concat!(
4618 "Offset of field: ",
4619 stringify!(pthread_cond_t),
4620 "::",
4621 stringify!(__size)
4622 )
4623 );
4624 assert_eq!(
4625 unsafe { ::core::ptr::addr_of!((*ptr).__align) as usize - ptr as usize },
4626 0usize,
4627 concat!(
4628 "Offset of field: ",
4629 stringify!(pthread_cond_t),
4630 "::",
4631 stringify!(__align)
4632 )
4633 );
4634}
4635#[repr(C)]
4636#[derive(Copy, Clone)]
4637pub union pthread_rwlock_t {
4638 pub __data: __pthread_rwlock_arch_t,
4639 pub __size: [::core::ffi::c_char; 56usize],
4640 pub __align: ::core::ffi::c_long,
4641}
4642#[test]
4643fn bindgen_test_layout_pthread_rwlock_t() {
4644 const UNINIT: ::core::mem::MaybeUninit<pthread_rwlock_t> = ::core::mem::MaybeUninit::uninit();
4645 let ptr = UNINIT.as_ptr();
4646 assert_eq!(
4647 ::core::mem::size_of::<pthread_rwlock_t>(),
4648 56usize,
4649 concat!("Size of: ", stringify!(pthread_rwlock_t))
4650 );
4651 assert_eq!(
4652 ::core::mem::align_of::<pthread_rwlock_t>(),
4653 8usize,
4654 concat!("Alignment of ", stringify!(pthread_rwlock_t))
4655 );
4656 assert_eq!(
4657 unsafe { ::core::ptr::addr_of!((*ptr).__data) as usize - ptr as usize },
4658 0usize,
4659 concat!(
4660 "Offset of field: ",
4661 stringify!(pthread_rwlock_t),
4662 "::",
4663 stringify!(__data)
4664 )
4665 );
4666 assert_eq!(
4667 unsafe { ::core::ptr::addr_of!((*ptr).__size) as usize - ptr as usize },
4668 0usize,
4669 concat!(
4670 "Offset of field: ",
4671 stringify!(pthread_rwlock_t),
4672 "::",
4673 stringify!(__size)
4674 )
4675 );
4676 assert_eq!(
4677 unsafe { ::core::ptr::addr_of!((*ptr).__align) as usize - ptr as usize },
4678 0usize,
4679 concat!(
4680 "Offset of field: ",
4681 stringify!(pthread_rwlock_t),
4682 "::",
4683 stringify!(__align)
4684 )
4685 );
4686}
4687#[repr(C)]
4688#[derive(Copy, Clone)]
4689pub union pthread_rwlockattr_t {
4690 pub __size: [::core::ffi::c_char; 8usize],
4691 pub __align: ::core::ffi::c_long,
4692}
4693#[test]
4694fn bindgen_test_layout_pthread_rwlockattr_t() {
4695 const UNINIT: ::core::mem::MaybeUninit<pthread_rwlockattr_t> =
4696 ::core::mem::MaybeUninit::uninit();
4697 let ptr = UNINIT.as_ptr();
4698 assert_eq!(
4699 ::core::mem::size_of::<pthread_rwlockattr_t>(),
4700 8usize,
4701 concat!("Size of: ", stringify!(pthread_rwlockattr_t))
4702 );
4703 assert_eq!(
4704 ::core::mem::align_of::<pthread_rwlockattr_t>(),
4705 8usize,
4706 concat!("Alignment of ", stringify!(pthread_rwlockattr_t))
4707 );
4708 assert_eq!(
4709 unsafe { ::core::ptr::addr_of!((*ptr).__size) as usize - ptr as usize },
4710 0usize,
4711 concat!(
4712 "Offset of field: ",
4713 stringify!(pthread_rwlockattr_t),
4714 "::",
4715 stringify!(__size)
4716 )
4717 );
4718 assert_eq!(
4719 unsafe { ::core::ptr::addr_of!((*ptr).__align) as usize - ptr as usize },
4720 0usize,
4721 concat!(
4722 "Offset of field: ",
4723 stringify!(pthread_rwlockattr_t),
4724 "::",
4725 stringify!(__align)
4726 )
4727 );
4728}
4729pub type pthread_spinlock_t = ::core::ffi::c_int;
4730#[repr(C)]
4731#[derive(Copy, Clone)]
4732pub union pthread_barrier_t {
4733 pub __size: [::core::ffi::c_char; 32usize],
4734 pub __align: ::core::ffi::c_long,
4735}
4736#[test]
4737fn bindgen_test_layout_pthread_barrier_t() {
4738 const UNINIT: ::core::mem::MaybeUninit<pthread_barrier_t> = ::core::mem::MaybeUninit::uninit();
4739 let ptr = UNINIT.as_ptr();
4740 assert_eq!(
4741 ::core::mem::size_of::<pthread_barrier_t>(),
4742 32usize,
4743 concat!("Size of: ", stringify!(pthread_barrier_t))
4744 );
4745 assert_eq!(
4746 ::core::mem::align_of::<pthread_barrier_t>(),
4747 8usize,
4748 concat!("Alignment of ", stringify!(pthread_barrier_t))
4749 );
4750 assert_eq!(
4751 unsafe { ::core::ptr::addr_of!((*ptr).__size) as usize - ptr as usize },
4752 0usize,
4753 concat!(
4754 "Offset of field: ",
4755 stringify!(pthread_barrier_t),
4756 "::",
4757 stringify!(__size)
4758 )
4759 );
4760 assert_eq!(
4761 unsafe { ::core::ptr::addr_of!((*ptr).__align) as usize - ptr as usize },
4762 0usize,
4763 concat!(
4764 "Offset of field: ",
4765 stringify!(pthread_barrier_t),
4766 "::",
4767 stringify!(__align)
4768 )
4769 );
4770}
4771#[repr(C)]
4772#[derive(Copy, Clone)]
4773pub union pthread_barrierattr_t {
4774 pub __size: [::core::ffi::c_char; 4usize],
4775 pub __align: ::core::ffi::c_int,
4776}
4777#[test]
4778fn bindgen_test_layout_pthread_barrierattr_t() {
4779 const UNINIT: ::core::mem::MaybeUninit<pthread_barrierattr_t> =
4780 ::core::mem::MaybeUninit::uninit();
4781 let ptr = UNINIT.as_ptr();
4782 assert_eq!(
4783 ::core::mem::size_of::<pthread_barrierattr_t>(),
4784 4usize,
4785 concat!("Size of: ", stringify!(pthread_barrierattr_t))
4786 );
4787 assert_eq!(
4788 ::core::mem::align_of::<pthread_barrierattr_t>(),
4789 4usize,
4790 concat!("Alignment of ", stringify!(pthread_barrierattr_t))
4791 );
4792 assert_eq!(
4793 unsafe { ::core::ptr::addr_of!((*ptr).__size) as usize - ptr as usize },
4794 0usize,
4795 concat!(
4796 "Offset of field: ",
4797 stringify!(pthread_barrierattr_t),
4798 "::",
4799 stringify!(__size)
4800 )
4801 );
4802 assert_eq!(
4803 unsafe { ::core::ptr::addr_of!((*ptr).__align) as usize - ptr as usize },
4804 0usize,
4805 concat!(
4806 "Offset of field: ",
4807 stringify!(pthread_barrierattr_t),
4808 "::",
4809 stringify!(__align)
4810 )
4811 );
4812}
4813extern "C" {
4814 pub fn random() -> ::core::ffi::c_long;
4815}
4816extern "C" {
4817 pub fn srandom(__seed: ::core::ffi::c_uint);
4818}
4819extern "C" {
4820 pub fn initstate(
4821 __seed: ::core::ffi::c_uint,
4822 __statebuf: *mut ::core::ffi::c_char,
4823 __statelen: usize,
4824 ) -> *mut ::core::ffi::c_char;
4825}
4826extern "C" {
4827 pub fn setstate(__statebuf: *mut ::core::ffi::c_char) -> *mut ::core::ffi::c_char;
4828}
4829#[repr(C)]
4830#[derive(Debug, Copy, Clone)]
4831pub struct random_data {
4832 pub fptr: *mut i32,
4833 pub rptr: *mut i32,
4834 pub state: *mut i32,
4835 pub rand_type: ::core::ffi::c_int,
4836 pub rand_deg: ::core::ffi::c_int,
4837 pub rand_sep: ::core::ffi::c_int,
4838 pub end_ptr: *mut i32,
4839}
4840#[test]
4841fn bindgen_test_layout_random_data() {
4842 const UNINIT: ::core::mem::MaybeUninit<random_data> = ::core::mem::MaybeUninit::uninit();
4843 let ptr = UNINIT.as_ptr();
4844 assert_eq!(
4845 ::core::mem::size_of::<random_data>(),
4846 48usize,
4847 concat!("Size of: ", stringify!(random_data))
4848 );
4849 assert_eq!(
4850 ::core::mem::align_of::<random_data>(),
4851 8usize,
4852 concat!("Alignment of ", stringify!(random_data))
4853 );
4854 assert_eq!(
4855 unsafe { ::core::ptr::addr_of!((*ptr).fptr) as usize - ptr as usize },
4856 0usize,
4857 concat!(
4858 "Offset of field: ",
4859 stringify!(random_data),
4860 "::",
4861 stringify!(fptr)
4862 )
4863 );
4864 assert_eq!(
4865 unsafe { ::core::ptr::addr_of!((*ptr).rptr) as usize - ptr as usize },
4866 8usize,
4867 concat!(
4868 "Offset of field: ",
4869 stringify!(random_data),
4870 "::",
4871 stringify!(rptr)
4872 )
4873 );
4874 assert_eq!(
4875 unsafe { ::core::ptr::addr_of!((*ptr).state) as usize - ptr as usize },
4876 16usize,
4877 concat!(
4878 "Offset of field: ",
4879 stringify!(random_data),
4880 "::",
4881 stringify!(state)
4882 )
4883 );
4884 assert_eq!(
4885 unsafe { ::core::ptr::addr_of!((*ptr).rand_type) as usize - ptr as usize },
4886 24usize,
4887 concat!(
4888 "Offset of field: ",
4889 stringify!(random_data),
4890 "::",
4891 stringify!(rand_type)
4892 )
4893 );
4894 assert_eq!(
4895 unsafe { ::core::ptr::addr_of!((*ptr).rand_deg) as usize - ptr as usize },
4896 28usize,
4897 concat!(
4898 "Offset of field: ",
4899 stringify!(random_data),
4900 "::",
4901 stringify!(rand_deg)
4902 )
4903 );
4904 assert_eq!(
4905 unsafe { ::core::ptr::addr_of!((*ptr).rand_sep) as usize - ptr as usize },
4906 32usize,
4907 concat!(
4908 "Offset of field: ",
4909 stringify!(random_data),
4910 "::",
4911 stringify!(rand_sep)
4912 )
4913 );
4914 assert_eq!(
4915 unsafe { ::core::ptr::addr_of!((*ptr).end_ptr) as usize - ptr as usize },
4916 40usize,
4917 concat!(
4918 "Offset of field: ",
4919 stringify!(random_data),
4920 "::",
4921 stringify!(end_ptr)
4922 )
4923 );
4924}
4925extern "C" {
4926 pub fn random_r(__buf: *mut random_data, __result: *mut i32) -> ::core::ffi::c_int;
4927}
4928extern "C" {
4929 pub fn srandom_r(__seed: ::core::ffi::c_uint, __buf: *mut random_data) -> ::core::ffi::c_int;
4930}
4931extern "C" {
4932 pub fn initstate_r(
4933 __seed: ::core::ffi::c_uint,
4934 __statebuf: *mut ::core::ffi::c_char,
4935 __statelen: usize,
4936 __buf: *mut random_data,
4937 ) -> ::core::ffi::c_int;
4938}
4939extern "C" {
4940 pub fn setstate_r(
4941 __statebuf: *mut ::core::ffi::c_char,
4942 __buf: *mut random_data,
4943 ) -> ::core::ffi::c_int;
4944}
4945extern "C" {
4946 pub fn rand() -> ::core::ffi::c_int;
4947}
4948extern "C" {
4949 pub fn srand(__seed: ::core::ffi::c_uint);
4950}
4951extern "C" {
4952 pub fn rand_r(__seed: *mut ::core::ffi::c_uint) -> ::core::ffi::c_int;
4953}
4954extern "C" {
4955 pub fn drand48() -> f64;
4956}
4957extern "C" {
4958 pub fn erand48(__xsubi: *mut ::core::ffi::c_ushort) -> f64;
4959}
4960extern "C" {
4961 pub fn lrand48() -> ::core::ffi::c_long;
4962}
4963extern "C" {
4964 pub fn nrand48(__xsubi: *mut ::core::ffi::c_ushort) -> ::core::ffi::c_long;
4965}
4966extern "C" {
4967 pub fn mrand48() -> ::core::ffi::c_long;
4968}
4969extern "C" {
4970 pub fn jrand48(__xsubi: *mut ::core::ffi::c_ushort) -> ::core::ffi::c_long;
4971}
4972extern "C" {
4973 pub fn srand48(__seedval: ::core::ffi::c_long);
4974}
4975extern "C" {
4976 pub fn seed48(__seed16v: *mut ::core::ffi::c_ushort) -> *mut ::core::ffi::c_ushort;
4977}
4978extern "C" {
4979 pub fn lcong48(__param: *mut ::core::ffi::c_ushort);
4980}
4981#[repr(C)]
4982#[derive(Debug, Copy, Clone)]
4983pub struct drand48_data {
4984 pub __x: [::core::ffi::c_ushort; 3usize],
4985 pub __old_x: [::core::ffi::c_ushort; 3usize],
4986 pub __c: ::core::ffi::c_ushort,
4987 pub __init: ::core::ffi::c_ushort,
4988 pub __a: ::core::ffi::c_ulonglong,
4989}
4990#[test]
4991fn bindgen_test_layout_drand48_data() {
4992 const UNINIT: ::core::mem::MaybeUninit<drand48_data> = ::core::mem::MaybeUninit::uninit();
4993 let ptr = UNINIT.as_ptr();
4994 assert_eq!(
4995 ::core::mem::size_of::<drand48_data>(),
4996 24usize,
4997 concat!("Size of: ", stringify!(drand48_data))
4998 );
4999 assert_eq!(
5000 ::core::mem::align_of::<drand48_data>(),
5001 8usize,
5002 concat!("Alignment of ", stringify!(drand48_data))
5003 );
5004 assert_eq!(
5005 unsafe { ::core::ptr::addr_of!((*ptr).__x) as usize - ptr as usize },
5006 0usize,
5007 concat!(
5008 "Offset of field: ",
5009 stringify!(drand48_data),
5010 "::",
5011 stringify!(__x)
5012 )
5013 );
5014 assert_eq!(
5015 unsafe { ::core::ptr::addr_of!((*ptr).__old_x) as usize - ptr as usize },
5016 6usize,
5017 concat!(
5018 "Offset of field: ",
5019 stringify!(drand48_data),
5020 "::",
5021 stringify!(__old_x)
5022 )
5023 );
5024 assert_eq!(
5025 unsafe { ::core::ptr::addr_of!((*ptr).__c) as usize - ptr as usize },
5026 12usize,
5027 concat!(
5028 "Offset of field: ",
5029 stringify!(drand48_data),
5030 "::",
5031 stringify!(__c)
5032 )
5033 );
5034 assert_eq!(
5035 unsafe { ::core::ptr::addr_of!((*ptr).__init) as usize - ptr as usize },
5036 14usize,
5037 concat!(
5038 "Offset of field: ",
5039 stringify!(drand48_data),
5040 "::",
5041 stringify!(__init)
5042 )
5043 );
5044 assert_eq!(
5045 unsafe { ::core::ptr::addr_of!((*ptr).__a) as usize - ptr as usize },
5046 16usize,
5047 concat!(
5048 "Offset of field: ",
5049 stringify!(drand48_data),
5050 "::",
5051 stringify!(__a)
5052 )
5053 );
5054}
5055extern "C" {
5056 pub fn drand48_r(__buffer: *mut drand48_data, __result: *mut f64) -> ::core::ffi::c_int;
5057}
5058extern "C" {
5059 pub fn erand48_r(
5060 __xsubi: *mut ::core::ffi::c_ushort,
5061 __buffer: *mut drand48_data,
5062 __result: *mut f64,
5063 ) -> ::core::ffi::c_int;
5064}
5065extern "C" {
5066 pub fn lrand48_r(
5067 __buffer: *mut drand48_data,
5068 __result: *mut ::core::ffi::c_long,
5069 ) -> ::core::ffi::c_int;
5070}
5071extern "C" {
5072 pub fn nrand48_r(
5073 __xsubi: *mut ::core::ffi::c_ushort,
5074 __buffer: *mut drand48_data,
5075 __result: *mut ::core::ffi::c_long,
5076 ) -> ::core::ffi::c_int;
5077}
5078extern "C" {
5079 pub fn mrand48_r(
5080 __buffer: *mut drand48_data,
5081 __result: *mut ::core::ffi::c_long,
5082 ) -> ::core::ffi::c_int;
5083}
5084extern "C" {
5085 pub fn jrand48_r(
5086 __xsubi: *mut ::core::ffi::c_ushort,
5087 __buffer: *mut drand48_data,
5088 __result: *mut ::core::ffi::c_long,
5089 ) -> ::core::ffi::c_int;
5090}
5091extern "C" {
5092 pub fn srand48_r(
5093 __seedval: ::core::ffi::c_long,
5094 __buffer: *mut drand48_data,
5095 ) -> ::core::ffi::c_int;
5096}
5097extern "C" {
5098 pub fn seed48_r(
5099 __seed16v: *mut ::core::ffi::c_ushort,
5100 __buffer: *mut drand48_data,
5101 ) -> ::core::ffi::c_int;
5102}
5103extern "C" {
5104 pub fn lcong48_r(
5105 __param: *mut ::core::ffi::c_ushort,
5106 __buffer: *mut drand48_data,
5107 ) -> ::core::ffi::c_int;
5108}
5109extern "C" {
5110 pub fn arc4random() -> __uint32_t;
5111}
5112extern "C" {
5113 pub fn arc4random_buf(__buf: *mut ::core::ffi::c_void, __size: usize);
5114}
5115extern "C" {
5116 pub fn arc4random_uniform(__upper_bound: __uint32_t) -> __uint32_t;
5117}
5118extern "C" {
5119 pub fn malloc(__size: ::core::ffi::c_ulong) -> *mut ::core::ffi::c_void;
5120}
5121extern "C" {
5122 pub fn calloc(
5123 __nmemb: ::core::ffi::c_ulong,
5124 __size: ::core::ffi::c_ulong,
5125 ) -> *mut ::core::ffi::c_void;
5126}
5127extern "C" {
5128 pub fn realloc(
5129 __ptr: *mut ::core::ffi::c_void,
5130 __size: ::core::ffi::c_ulong,
5131 ) -> *mut ::core::ffi::c_void;
5132}
5133extern "C" {
5134 pub fn free(__ptr: *mut ::core::ffi::c_void);
5135}
5136extern "C" {
5137 pub fn reallocarray(
5138 __ptr: *mut ::core::ffi::c_void,
5139 __nmemb: usize,
5140 __size: usize,
5141 ) -> *mut ::core::ffi::c_void;
5142}
5143extern "C" {
5144 pub fn alloca(__size: ::core::ffi::c_ulong) -> *mut ::core::ffi::c_void;
5145}
5146extern "C" {
5147 pub fn valloc(__size: usize) -> *mut ::core::ffi::c_void;
5148}
5149extern "C" {
5150 pub fn posix_memalign(
5151 __memptr: *mut *mut ::core::ffi::c_void,
5152 __alignment: usize,
5153 __size: usize,
5154 ) -> ::core::ffi::c_int;
5155}
5156extern "C" {
5157 pub fn aligned_alloc(
5158 __alignment: ::core::ffi::c_ulong,
5159 __size: ::core::ffi::c_ulong,
5160 ) -> *mut ::core::ffi::c_void;
5161}
5162extern "C" {
5163 pub fn abort() -> !;
5164}
5165extern "C" {
5166 pub fn atexit(__func: ::core::option::Option<unsafe extern "C" fn()>) -> ::core::ffi::c_int;
5167}
5168extern "C" {
5169 pub fn at_quick_exit(
5170 __func: ::core::option::Option<unsafe extern "C" fn()>,
5171 ) -> ::core::ffi::c_int;
5172}
5173extern "C" {
5174 pub fn on_exit(
5175 __func: ::core::option::Option<
5176 unsafe extern "C" fn(__status: ::core::ffi::c_int, __arg: *mut ::core::ffi::c_void),
5177 >,
5178 __arg: *mut ::core::ffi::c_void,
5179 ) -> ::core::ffi::c_int;
5180}
5181extern "C" {
5182 pub fn exit(__status: ::core::ffi::c_int) -> !;
5183}
5184extern "C" {
5185 pub fn quick_exit(__status: ::core::ffi::c_int) -> !;
5186}
5187extern "C" {
5188 pub fn _Exit(__status: ::core::ffi::c_int) -> !;
5189}
5190extern "C" {
5191 pub fn getenv(__name: *const ::core::ffi::c_char) -> *mut ::core::ffi::c_char;
5192}
5193extern "C" {
5194 pub fn putenv(__string: *mut ::core::ffi::c_char) -> ::core::ffi::c_int;
5195}
5196extern "C" {
5197 pub fn setenv(
5198 __name: *const ::core::ffi::c_char,
5199 __value: *const ::core::ffi::c_char,
5200 __replace: ::core::ffi::c_int,
5201 ) -> ::core::ffi::c_int;
5202}
5203extern "C" {
5204 pub fn unsetenv(__name: *const ::core::ffi::c_char) -> ::core::ffi::c_int;
5205}
5206extern "C" {
5207 pub fn clearenv() -> ::core::ffi::c_int;
5208}
5209extern "C" {
5210 pub fn mktemp(__template: *mut ::core::ffi::c_char) -> *mut ::core::ffi::c_char;
5211}
5212extern "C" {
5213 pub fn mkstemp(__template: *mut ::core::ffi::c_char) -> ::core::ffi::c_int;
5214}
5215extern "C" {
5216 pub fn mkstemps(
5217 __template: *mut ::core::ffi::c_char,
5218 __suffixlen: ::core::ffi::c_int,
5219 ) -> ::core::ffi::c_int;
5220}
5221extern "C" {
5222 pub fn mkdtemp(__template: *mut ::core::ffi::c_char) -> *mut ::core::ffi::c_char;
5223}
5224extern "C" {
5225 pub fn system(__command: *const ::core::ffi::c_char) -> ::core::ffi::c_int;
5226}
5227extern "C" {
5228 pub fn realpath(
5229 __name: *const ::core::ffi::c_char,
5230 __resolved: *mut ::core::ffi::c_char,
5231 ) -> *mut ::core::ffi::c_char;
5232}
5233pub type __compar_fn_t = ::core::option::Option<
5234 unsafe extern "C" fn(
5235 arg1: *const ::core::ffi::c_void,
5236 arg2: *const ::core::ffi::c_void,
5237 ) -> ::core::ffi::c_int,
5238>;
5239extern "C" {
5240 pub fn bsearch(
5241 __key: *const ::core::ffi::c_void,
5242 __base: *const ::core::ffi::c_void,
5243 __nmemb: usize,
5244 __size: usize,
5245 __compar: __compar_fn_t,
5246 ) -> *mut ::core::ffi::c_void;
5247}
5248extern "C" {
5249 pub fn qsort(
5250 __base: *mut ::core::ffi::c_void,
5251 __nmemb: usize,
5252 __size: usize,
5253 __compar: __compar_fn_t,
5254 );
5255}
5256extern "C" {
5257 pub fn abs(__x: ::core::ffi::c_int) -> ::core::ffi::c_int;
5258}
5259extern "C" {
5260 pub fn labs(__x: ::core::ffi::c_long) -> ::core::ffi::c_long;
5261}
5262extern "C" {
5263 pub fn llabs(__x: ::core::ffi::c_longlong) -> ::core::ffi::c_longlong;
5264}
5265extern "C" {
5266 pub fn div(__numer: ::core::ffi::c_int, __denom: ::core::ffi::c_int) -> div_t;
5267}
5268extern "C" {
5269 pub fn ldiv(__numer: ::core::ffi::c_long, __denom: ::core::ffi::c_long) -> ldiv_t;
5270}
5271extern "C" {
5272 pub fn lldiv(__numer: ::core::ffi::c_longlong, __denom: ::core::ffi::c_longlong) -> lldiv_t;
5273}
5274extern "C" {
5275 pub fn ecvt(
5276 __value: f64,
5277 __ndigit: ::core::ffi::c_int,
5278 __decpt: *mut ::core::ffi::c_int,
5279 __sign: *mut ::core::ffi::c_int,
5280 ) -> *mut ::core::ffi::c_char;
5281}
5282extern "C" {
5283 pub fn fcvt(
5284 __value: f64,
5285 __ndigit: ::core::ffi::c_int,
5286 __decpt: *mut ::core::ffi::c_int,
5287 __sign: *mut ::core::ffi::c_int,
5288 ) -> *mut ::core::ffi::c_char;
5289}
5290extern "C" {
5291 pub fn gcvt(
5292 __value: f64,
5293 __ndigit: ::core::ffi::c_int,
5294 __buf: *mut ::core::ffi::c_char,
5295 ) -> *mut ::core::ffi::c_char;
5296}
5297extern "C" {
5298 pub fn qecvt(
5299 __value: u128,
5300 __ndigit: ::core::ffi::c_int,
5301 __decpt: *mut ::core::ffi::c_int,
5302 __sign: *mut ::core::ffi::c_int,
5303 ) -> *mut ::core::ffi::c_char;
5304}
5305extern "C" {
5306 pub fn qfcvt(
5307 __value: u128,
5308 __ndigit: ::core::ffi::c_int,
5309 __decpt: *mut ::core::ffi::c_int,
5310 __sign: *mut ::core::ffi::c_int,
5311 ) -> *mut ::core::ffi::c_char;
5312}
5313extern "C" {
5314 pub fn qgcvt(
5315 __value: u128,
5316 __ndigit: ::core::ffi::c_int,
5317 __buf: *mut ::core::ffi::c_char,
5318 ) -> *mut ::core::ffi::c_char;
5319}
5320extern "C" {
5321 pub fn ecvt_r(
5322 __value: f64,
5323 __ndigit: ::core::ffi::c_int,
5324 __decpt: *mut ::core::ffi::c_int,
5325 __sign: *mut ::core::ffi::c_int,
5326 __buf: *mut ::core::ffi::c_char,
5327 __len: usize,
5328 ) -> ::core::ffi::c_int;
5329}
5330extern "C" {
5331 pub fn fcvt_r(
5332 __value: f64,
5333 __ndigit: ::core::ffi::c_int,
5334 __decpt: *mut ::core::ffi::c_int,
5335 __sign: *mut ::core::ffi::c_int,
5336 __buf: *mut ::core::ffi::c_char,
5337 __len: usize,
5338 ) -> ::core::ffi::c_int;
5339}
5340extern "C" {
5341 pub fn qecvt_r(
5342 __value: u128,
5343 __ndigit: ::core::ffi::c_int,
5344 __decpt: *mut ::core::ffi::c_int,
5345 __sign: *mut ::core::ffi::c_int,
5346 __buf: *mut ::core::ffi::c_char,
5347 __len: usize,
5348 ) -> ::core::ffi::c_int;
5349}
5350extern "C" {
5351 pub fn qfcvt_r(
5352 __value: u128,
5353 __ndigit: ::core::ffi::c_int,
5354 __decpt: *mut ::core::ffi::c_int,
5355 __sign: *mut ::core::ffi::c_int,
5356 __buf: *mut ::core::ffi::c_char,
5357 __len: usize,
5358 ) -> ::core::ffi::c_int;
5359}
5360extern "C" {
5361 pub fn mblen(__s: *const ::core::ffi::c_char, __n: usize) -> ::core::ffi::c_int;
5362}
5363extern "C" {
5364 pub fn mbtowc(
5365 __pwc: *mut wchar_t,
5366 __s: *const ::core::ffi::c_char,
5367 __n: usize,
5368 ) -> ::core::ffi::c_int;
5369}
5370extern "C" {
5371 pub fn wctomb(__s: *mut ::core::ffi::c_char, __wchar: wchar_t) -> ::core::ffi::c_int;
5372}
5373extern "C" {
5374 pub fn mbstowcs(__pwcs: *mut wchar_t, __s: *const ::core::ffi::c_char, __n: usize) -> usize;
5375}
5376extern "C" {
5377 pub fn wcstombs(__s: *mut ::core::ffi::c_char, __pwcs: *const wchar_t, __n: usize) -> usize;
5378}
5379extern "C" {
5380 pub fn rpmatch(__response: *const ::core::ffi::c_char) -> ::core::ffi::c_int;
5381}
5382extern "C" {
5383 pub fn getsubopt(
5384 __optionp: *mut *mut ::core::ffi::c_char,
5385 __tokens: *const *mut ::core::ffi::c_char,
5386 __valuep: *mut *mut ::core::ffi::c_char,
5387 ) -> ::core::ffi::c_int;
5388}
5389extern "C" {
5390 pub fn getloadavg(__loadavg: *mut f64, __nelem: ::core::ffi::c_int) -> ::core::ffi::c_int;
5391}
5392#[repr(u32)]
5393#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
5394pub enum TfLiteBuiltinOperator {
5395 kTfLiteBuiltinAdd = 0,
5396 kTfLiteBuiltinAveragePool2d = 1,
5397 kTfLiteBuiltinConcatenation = 2,
5398 kTfLiteBuiltinConv2d = 3,
5399 kTfLiteBuiltinDepthwiseConv2d = 4,
5400 kTfLiteBuiltinDepthToSpace = 5,
5401 kTfLiteBuiltinDequantize = 6,
5402 kTfLiteBuiltinEmbeddingLookup = 7,
5403 kTfLiteBuiltinFloor = 8,
5404 kTfLiteBuiltinFullyConnected = 9,
5405 kTfLiteBuiltinHashtableLookup = 10,
5406 kTfLiteBuiltinL2Normalization = 11,
5407 kTfLiteBuiltinL2Pool2d = 12,
5408 kTfLiteBuiltinLocalResponseNormalization = 13,
5409 kTfLiteBuiltinLogistic = 14,
5410 kTfLiteBuiltinLshProjection = 15,
5411 kTfLiteBuiltinLstm = 16,
5412 kTfLiteBuiltinMaxPool2d = 17,
5413 kTfLiteBuiltinMul = 18,
5414 kTfLiteBuiltinRelu = 19,
5415 kTfLiteBuiltinReluN1To1 = 20,
5416 kTfLiteBuiltinRelu6 = 21,
5417 kTfLiteBuiltinReshape = 22,
5418 kTfLiteBuiltinResizeBilinear = 23,
5419 kTfLiteBuiltinRnn = 24,
5420 kTfLiteBuiltinSoftmax = 25,
5421 kTfLiteBuiltinSpaceToDepth = 26,
5422 kTfLiteBuiltinSvdf = 27,
5423 kTfLiteBuiltinTanh = 28,
5424 kTfLiteBuiltinConcatEmbeddings = 29,
5425 kTfLiteBuiltinSkipGram = 30,
5426 kTfLiteBuiltinCall = 31,
5427 kTfLiteBuiltinCustom = 32,
5428 kTfLiteBuiltinEmbeddingLookupSparse = 33,
5429 kTfLiteBuiltinPad = 34,
5430 kTfLiteBuiltinUnidirectionalSequenceRnn = 35,
5431 kTfLiteBuiltinGather = 36,
5432 kTfLiteBuiltinBatchToSpaceNd = 37,
5433 kTfLiteBuiltinSpaceToBatchNd = 38,
5434 kTfLiteBuiltinTranspose = 39,
5435 kTfLiteBuiltinMean = 40,
5436 kTfLiteBuiltinSub = 41,
5437 kTfLiteBuiltinDiv = 42,
5438 kTfLiteBuiltinSqueeze = 43,
5439 kTfLiteBuiltinUnidirectionalSequenceLstm = 44,
5440 kTfLiteBuiltinStridedSlice = 45,
5441 kTfLiteBuiltinBidirectionalSequenceRnn = 46,
5442 kTfLiteBuiltinExp = 47,
5443 kTfLiteBuiltinTopkV2 = 48,
5444 kTfLiteBuiltinSplit = 49,
5445 kTfLiteBuiltinLogSoftmax = 50,
5446 kTfLiteBuiltinDelegate = 51,
5447 kTfLiteBuiltinBidirectionalSequenceLstm = 52,
5448 kTfLiteBuiltinCast = 53,
5449 kTfLiteBuiltinPrelu = 54,
5450 kTfLiteBuiltinMaximum = 55,
5451 kTfLiteBuiltinArgMax = 56,
5452 kTfLiteBuiltinMinimum = 57,
5453 kTfLiteBuiltinLess = 58,
5454 kTfLiteBuiltinNeg = 59,
5455 kTfLiteBuiltinPadv2 = 60,
5456 kTfLiteBuiltinGreater = 61,
5457 kTfLiteBuiltinGreaterEqual = 62,
5458 kTfLiteBuiltinLessEqual = 63,
5459 kTfLiteBuiltinSelect = 64,
5460 kTfLiteBuiltinSlice = 65,
5461 kTfLiteBuiltinSin = 66,
5462 kTfLiteBuiltinTransposeConv = 67,
5463 kTfLiteBuiltinSparseToDense = 68,
5464 kTfLiteBuiltinTile = 69,
5465 kTfLiteBuiltinExpandDims = 70,
5466 kTfLiteBuiltinEqual = 71,
5467 kTfLiteBuiltinNotEqual = 72,
5468 kTfLiteBuiltinLog = 73,
5469 kTfLiteBuiltinSum = 74,
5470 kTfLiteBuiltinSqrt = 75,
5471 kTfLiteBuiltinRsqrt = 76,
5472 kTfLiteBuiltinShape = 77,
5473 kTfLiteBuiltinPow = 78,
5474 kTfLiteBuiltinArgMin = 79,
5475 kTfLiteBuiltinFakeQuant = 80,
5476 kTfLiteBuiltinReduceProd = 81,
5477 kTfLiteBuiltinReduceMax = 82,
5478 kTfLiteBuiltinPack = 83,
5479 kTfLiteBuiltinLogicalOr = 84,
5480 kTfLiteBuiltinOneHot = 85,
5481 kTfLiteBuiltinLogicalAnd = 86,
5482 kTfLiteBuiltinLogicalNot = 87,
5483 kTfLiteBuiltinUnpack = 88,
5484 kTfLiteBuiltinReduceMin = 89,
5485 kTfLiteBuiltinFloorDiv = 90,
5486 kTfLiteBuiltinReduceAny = 91,
5487 kTfLiteBuiltinSquare = 92,
5488 kTfLiteBuiltinZerosLike = 93,
5489 kTfLiteBuiltinFill = 94,
5490 kTfLiteBuiltinFloorMod = 95,
5491 kTfLiteBuiltinRange = 96,
5492 kTfLiteBuiltinResizeNearestNeighbor = 97,
5493 kTfLiteBuiltinLeakyRelu = 98,
5494 kTfLiteBuiltinSquaredDifference = 99,
5495 kTfLiteBuiltinMirrorPad = 100,
5496 kTfLiteBuiltinAbs = 101,
5497 kTfLiteBuiltinSplitV = 102,
5498 kTfLiteBuiltinUnique = 103,
5499 kTfLiteBuiltinCeil = 104,
5500 kTfLiteBuiltinReverseV2 = 105,
5501 kTfLiteBuiltinAddN = 106,
5502 kTfLiteBuiltinGatherNd = 107,
5503 kTfLiteBuiltinCos = 108,
5504 kTfLiteBuiltinWhere = 109,
5505 kTfLiteBuiltinRank = 110,
5506 kTfLiteBuiltinElu = 111,
5507 kTfLiteBuiltinReverseSequence = 112,
5508 kTfLiteBuiltinMatrixDiag = 113,
5509 kTfLiteBuiltinQuantize = 114,
5510 kTfLiteBuiltinMatrixSetDiag = 115,
5511 kTfLiteBuiltinRound = 116,
5512 kTfLiteBuiltinHardSwish = 117,
5513 kTfLiteBuiltinIf = 118,
5514 kTfLiteBuiltinWhile = 119,
5515 kTfLiteBuiltinNonMaxSuppressionV4 = 120,
5516 kTfLiteBuiltinNonMaxSuppressionV5 = 121,
5517 kTfLiteBuiltinScatterNd = 122,
5518 kTfLiteBuiltinSelectV2 = 123,
5519 kTfLiteBuiltinDensify = 124,
5520 kTfLiteBuiltinSegmentSum = 125,
5521 kTfLiteBuiltinBatchMatmul = 126,
5522 kTfLiteBuiltinPlaceholderForGreaterOpCodes = 127,
5523 kTfLiteBuiltinCumsum = 128,
5524 kTfLiteBuiltinCallOnce = 129,
5525 kTfLiteBuiltinBroadcastTo = 130,
5526 kTfLiteBuiltinRfft2d = 131,
5527 kTfLiteBuiltinConv3d = 132,
5528 kTfLiteBuiltinImag = 133,
5529 kTfLiteBuiltinReal = 134,
5530 kTfLiteBuiltinComplexAbs = 135,
5531 kTfLiteBuiltinHashtable = 136,
5532 kTfLiteBuiltinHashtableFind = 137,
5533 kTfLiteBuiltinHashtableImport = 138,
5534 kTfLiteBuiltinHashtableSize = 139,
5535 kTfLiteBuiltinReduceAll = 140,
5536 kTfLiteBuiltinConv3dTranspose = 141,
5537 kTfLiteBuiltinVarHandle = 142,
5538 kTfLiteBuiltinReadVariable = 143,
5539 kTfLiteBuiltinAssignVariable = 144,
5540 kTfLiteBuiltinBroadcastArgs = 145,
5541 kTfLiteBuiltinRandomStandardNormal = 146,
5542 kTfLiteBuiltinBucketize = 147,
5543 kTfLiteBuiltinRandomUniform = 148,
5544 kTfLiteBuiltinMultinomial = 149,
5545 kTfLiteBuiltinGelu = 150,
5546 kTfLiteBuiltinDynamicUpdateSlice = 151,
5547 kTfLiteBuiltinRelu0To1 = 152,
5548 kTfLiteBuiltinUnsortedSegmentProd = 153,
5549 kTfLiteBuiltinUnsortedSegmentMax = 154,
5550 kTfLiteBuiltinUnsortedSegmentSum = 155,
5551 kTfLiteBuiltinAtan2 = 156,
5552 kTfLiteBuiltinUnsortedSegmentMin = 157,
5553 kTfLiteBuiltinSign = 158,
5554 kTfLiteBuiltinBitcast = 159,
5555 kTfLiteBuiltinBitwiseXor = 160,
5556 kTfLiteBuiltinRightShift = 161,
5557 kTfLiteBuiltinStablehloLogistic = 162,
5558 kTfLiteBuiltinStablehloAdd = 163,
5559 kTfLiteBuiltinStablehloDivide = 164,
5560 kTfLiteBuiltinStablehloMultiply = 165,
5561 kTfLiteBuiltinStablehloMaximum = 166,
5562 kTfLiteBuiltinStablehloReshape = 167,
5563 kTfLiteBuiltinStablehloClamp = 168,
5564 kTfLiteBuiltinStablehloConcatenate = 169,
5565 kTfLiteBuiltinStablehloBroadcastInDim = 170,
5566 kTfLiteBuiltinStablehloConvolution = 171,
5567 kTfLiteBuiltinStablehloSlice = 172,
5568 kTfLiteBuiltinStablehloCustomCall = 173,
5569 kTfLiteBuiltinStablehloReduce = 174,
5570 kTfLiteBuiltinStablehloAbs = 175,
5571 kTfLiteBuiltinStablehloAnd = 176,
5572 kTfLiteBuiltinStablehloCosine = 177,
5573 kTfLiteBuiltinStablehloExponential = 178,
5574 kTfLiteBuiltinStablehloFloor = 179,
5575 kTfLiteBuiltinStablehloLog = 180,
5576 kTfLiteBuiltinStablehloMinimum = 181,
5577 kTfLiteBuiltinStablehloNegate = 182,
5578 kTfLiteBuiltinStablehloOr = 183,
5579 kTfLiteBuiltinStablehloPower = 184,
5580 kTfLiteBuiltinStablehloRemainder = 185,
5581 kTfLiteBuiltinStablehloRsqrt = 186,
5582 kTfLiteBuiltinStablehloSelect = 187,
5583 kTfLiteBuiltinStablehloSubtract = 188,
5584 kTfLiteBuiltinStablehloTanh = 189,
5585 kTfLiteBuiltinStablehloScatter = 190,
5586 kTfLiteBuiltinStablehloCompare = 191,
5587 kTfLiteBuiltinStablehloConvert = 192,
5588 kTfLiteBuiltinStablehloDynamicSlice = 193,
5589 kTfLiteBuiltinStablehloDynamicUpdateSlice = 194,
5590 kTfLiteBuiltinStablehloPad = 195,
5591 kTfLiteBuiltinStablehloIota = 196,
5592 kTfLiteBuiltinStablehloDotGeneral = 197,
5593 kTfLiteBuiltinStablehloReduceWindow = 198,
5594 kTfLiteBuiltinStablehloSort = 199,
5595 kTfLiteBuiltinStablehloWhile = 200,
5596 kTfLiteBuiltinStablehloGather = 201,
5597 kTfLiteBuiltinStablehloTranspose = 202,
5598 kTfLiteBuiltinDilate = 203,
5599 kTfLiteBuiltinStablehloRngBitGenerator = 204,
5600 kTfLiteBuiltinReduceWindow = 205,
5601 kTfLiteBuiltinStablehloComposite = 206,
5602}
5603#[repr(C)]
5604#[derive(Debug, Copy, Clone)]
5605pub struct TfLiteExecutionTask {
5606 _unused: [u8; 0],
5607}
5608#[repr(u32)]
5609#[doc = " Enum tag for specifying whether a tensor is the input or output to the\n model."]
5610#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
5611pub enum TfLiteIoType {
5612 kTfLiteIoTypeUnknown = 0,
5613 kTfLiteIoTypeInput = 1,
5614 kTfLiteIoTypeOutput = 2,
5615}
5616extern "C" {
5617 pub fn TfLiteOperatorCreate(
5618 builtin_code: TfLiteBuiltinOperator,
5619 custom_name: *const ::core::ffi::c_char,
5620 version: ::core::ffi::c_int,
5621 ) -> *mut TfLiteOperator;
5622}
5623extern "C" {
5624 pub fn TfLiteOperatorDelete(registration: *mut TfLiteOperator);
5625}
5626extern "C" {
5627 pub fn TfLiteOperatorGetBuiltInCode(
5628 registration: *const TfLiteOperator,
5629 ) -> TfLiteBuiltinOperator;
5630}
5631extern "C" {
5632 #[doc = " Returns the custom name of the provided 'registration'. The returned pointer\n will be non-null iff the op is a custom op.\n"]
5633 pub fn TfLiteOperatorGetCustomName(
5634 registration: *const TfLiteOperator,
5635 ) -> *const ::core::ffi::c_char;
5636}
5637extern "C" {
5638 #[doc = " Return the OP version of the provided external 'registration'. Return -1\n in case of error, or if the provided address is null.\n"]
5639 pub fn TfLiteOperatorGetVersion(registration: *const TfLiteOperator) -> ::core::ffi::c_int;
5640}
5641extern "C" {
5642 pub fn TfLiteOperatorSetInit(
5643 registration: *mut TfLiteOperator,
5644 init: ::core::option::Option<
5645 unsafe extern "C" fn(
5646 context: *mut TfLiteOpaqueContext,
5647 buffer: *const ::core::ffi::c_char,
5648 length: usize,
5649 ) -> *mut ::core::ffi::c_void,
5650 >,
5651 );
5652}
5653extern "C" {
5654 pub fn TfLiteOperatorSetFree(
5655 registration: *mut TfLiteOperator,
5656 free: ::core::option::Option<
5657 unsafe extern "C" fn(context: *mut TfLiteOpaqueContext, data: *mut ::core::ffi::c_void),
5658 >,
5659 );
5660}
5661extern "C" {
5662 pub fn TfLiteOperatorSetPrepare(
5663 registration: *mut TfLiteOperator,
5664 prepare: ::core::option::Option<
5665 unsafe extern "C" fn(
5666 context: *mut TfLiteOpaqueContext,
5667 node: *mut TfLiteOpaqueNode,
5668 ) -> TfLiteStatus,
5669 >,
5670 );
5671}
5672extern "C" {
5673 pub fn TfLiteOperatorSetInvoke(
5674 registration: *mut TfLiteOperator,
5675 invoke: ::core::option::Option<
5676 unsafe extern "C" fn(
5677 context: *mut TfLiteOpaqueContext,
5678 node: *mut TfLiteOpaqueNode,
5679 ) -> TfLiteStatus,
5680 >,
5681 );
5682}
5683extern "C" {
5684 #[doc = " Sets the async kernel accessor callback for the registration.\n\n The callback is called to retrieve the async kernel if the delegate supports\n it. If the delegate does not support async execution, either this function\n should not be called, or `async_kernel` needs to be nullptr.\n `node` is the delegate TfLiteNode created by `ModifyGraphWithDelegate`.\n Please refer `async_kernel` of `TfLiteRegistration` for the detail.\n \\warning This is an experimental API and subject to change."]
5685 pub fn TfLiteOperatorSetAsyncKernel(
5686 registration: *mut TfLiteOperator,
5687 async_kernel: ::core::option::Option<
5688 unsafe extern "C" fn(
5689 context: *mut TfLiteOpaqueContext,
5690 node: *mut TfLiteOpaqueNode,
5691 ) -> *mut TfLiteAsyncKernel,
5692 >,
5693 );
5694}
5695extern "C" {
5696 #[doc = " Sets the inplace_operator field of the external registration.\n\n This is a bitmask. Please refer to `inplace_operator` field of\n `TfLiteRegistration` for details.\n"]
5697 pub fn TfLiteOperatorSetInplaceOperator(
5698 registration: *mut TfLiteOperator,
5699 inplace_operator: u64,
5700 );
5701}
5702#[repr(C)]
5703#[derive(Debug, Copy, Clone)]
5704pub struct TfLiteModel {
5705 _unused: [u8; 0],
5706}
5707#[repr(C)]
5708#[derive(Debug, Copy, Clone)]
5709pub struct TfLiteInterpreterOptions {
5710 _unused: [u8; 0],
5711}
5712#[repr(C)]
5713#[derive(Debug, Copy, Clone)]
5714pub struct TfLiteInterpreter {
5715 _unused: [u8; 0],
5716}
5717#[repr(C)]
5718#[derive(Debug, Copy, Clone)]
5719pub struct TfLiteSignatureRunner {
5720 _unused: [u8; 0],
5721}
5722extern "C" {
5723 #[doc = " The TensorFlow Lite Runtime version.\n\n Returns a pointer to a statically allocated string that is the version\n number of the (potentially dynamically loaded) TF Lite Runtime library.\n TensorFlow Lite uses semantic versioning, and the return value should be\n in semver 2 format <http://semver.org>, starting with MAJOR.MINOR.PATCH,\n e.g. \"2.12.0\" or \"2.13.0-rc2\"."]
5724 pub fn TfLiteVersion() -> *const ::core::ffi::c_char;
5725}
5726extern "C" {
5727 #[doc = " The TensorFlow Lite Extension APIs version.\n\n Returns a pointer to a statically allocated string that is the version\n number of the TF Lite Extension APIs supported by the (potentially\n dynamically loaded) TF Lite Runtime library. The TF Lite \"Extension APIs\"\n are the APIs for extending TF Lite with custom ops and delegates.\n More specifically, this version number covers the (non-experimental)\n functionality documented in the following header files:\n\n * lite/c/c_api_opaque.h\n * lite/c/common.h\n * lite/c/builtin_op_data.h\n * lite/builtin_ops.h\n\n This version number uses semantic versioning, and the return value should\n be in semver 2 format <http://semver.org>, starting with MAJOR.MINOR.PATCH,\n e.g. \"2.14.0\" or \"2.15.0-rc2\"."]
5728 pub fn TfLiteExtensionApisVersion() -> *const ::core::ffi::c_char;
5729}
5730extern "C" {
5731 #[doc = " The supported TensorFlow Lite model file Schema version.\n\n Returns the (major) version number of the Schema used for model\n files that is supported by the (potentially dynamically loaded)\n TensorFlow Lite Runtime.\n\n Model files using schema versions different to this may not be supported by\n the current version of the TF Lite Runtime."]
5732 pub fn TfLiteSchemaVersion() -> ::core::ffi::c_int;
5733}
5734extern "C" {
5735 #[doc = " Returns a model from the provided buffer, or null on failure.\n\n \\note The caller retains ownership of the `model_data` buffer and should\n ensure that the lifetime of the `model_data` buffer must be at least as long\n as the lifetime of the `TfLiteModel` and of any `TfLiteInterpreter` objects\n created from that `TfLiteModel`, and furthermore the contents of the\n `model_data` buffer must not be modified during that time.\""]
5736 pub fn TfLiteModelCreate(
5737 model_data: *const ::core::ffi::c_void,
5738 model_size: usize,
5739 ) -> *mut TfLiteModel;
5740}
5741extern "C" {
5742 #[doc = " Same as `TfLiteModelCreate` with customizble error reporter.\n * `reporter` takes the provided `user_data` object, as well as a C-style\n format string and arg list (see also vprintf).\n * `user_data` is optional. If non-null, it is owned by the client and must\n remain valid for the duration of the interpreter lifetime."]
5743 pub fn TfLiteModelCreateWithErrorReporter(
5744 model_data: *const ::core::ffi::c_void,
5745 model_size: usize,
5746 reporter: ::core::option::Option<
5747 unsafe extern "C" fn(
5748 user_data: *mut ::core::ffi::c_void,
5749 format: *const ::core::ffi::c_char,
5750 args: *mut __va_list_tag,
5751 ),
5752 >,
5753 user_data: *mut ::core::ffi::c_void,
5754 ) -> *mut TfLiteModel;
5755}
5756extern "C" {
5757 #[doc = " Returns a model from the provided file, or null on failure.\n\n \\note The file's contents must not be modified during the lifetime of the\n `TfLiteModel` or of any `TfLiteInterpreter` objects created from that\n `TfLiteModel`."]
5758 pub fn TfLiteModelCreateFromFile(model_path: *const ::core::ffi::c_char) -> *mut TfLiteModel;
5759}
5760extern "C" {
5761 #[doc = " Same as `TfLiteModelCreateFromFile` with customizble error reporter.\n * `reporter` takes the provided `user_data` object, as well as a C-style\n format string and arg list (see also vprintf).\n * `user_data` is optional. If non-null, it is owned by the client and must\n remain valid for the duration of the interpreter lifetime."]
5762 pub fn TfLiteModelCreateFromFileWithErrorReporter(
5763 model_path: *const ::core::ffi::c_char,
5764 reporter: ::core::option::Option<
5765 unsafe extern "C" fn(
5766 user_data: *mut ::core::ffi::c_void,
5767 format: *const ::core::ffi::c_char,
5768 args: *mut __va_list_tag,
5769 ),
5770 >,
5771 user_data: *mut ::core::ffi::c_void,
5772 ) -> *mut TfLiteModel;
5773}
5774extern "C" {
5775 #[doc = " Destroys the model instance."]
5776 pub fn TfLiteModelDelete(model: *mut TfLiteModel);
5777}
5778extern "C" {
5779 #[doc = " Returns a new interpreter options instances."]
5780 pub fn TfLiteInterpreterOptionsCreate() -> *mut TfLiteInterpreterOptions;
5781}
5782extern "C" {
5783 #[doc = " Creates and returns a shallow copy of an options object.\n\n The caller is responsible for calling `TfLiteInterpreterOptionsDelete` to\n deallocate the object pointed to by the returned pointer."]
5784 pub fn TfLiteInterpreterOptionsCopy(
5785 from: *const TfLiteInterpreterOptions,
5786 ) -> *mut TfLiteInterpreterOptions;
5787}
5788extern "C" {
5789 #[doc = " Destroys the interpreter options instance."]
5790 pub fn TfLiteInterpreterOptionsDelete(options: *mut TfLiteInterpreterOptions);
5791}
5792extern "C" {
5793 #[doc = " Sets the number of CPU threads to use for the interpreter."]
5794 pub fn TfLiteInterpreterOptionsSetNumThreads(
5795 options: *mut TfLiteInterpreterOptions,
5796 num_threads: i32,
5797 );
5798}
5799extern "C" {
5800 #[doc = " Adds a delegate to be applied during `TfLiteInterpreter` creation.\n\n If delegate application fails, interpreter creation will also fail with an\n associated error logged.\n\n \\note The caller retains ownership of the delegate and should ensure that it\n remains valid for the duration of any created interpreter's lifetime.\n\n If you are NOT using \"TensorFlow Lite in Play Services\", and NOT building\n with `TFLITE_WITH_STABLE_ABI` or `TFLITE_USE_OPAQUE_DELEGATE` macros\n enabled, it is possible to pass a `TfLiteDelegate*` rather than a\n `TfLiteOpaqueDelegate*` to this function, since in those cases,\n `TfLiteOpaqueDelegate` is just a typedef alias for `TfLiteDelegate`.\n This is for compatibility with existing source code\n and existing delegates. For new delegates, it is recommended to\n use `TfLiteOpaqueDelegate` rather than `TfLiteDelegate`. (See\n `TfLiteOpaqueDelegate` in tensorflow/lite/core/c/c_api_types.h.)"]
5801 pub fn TfLiteInterpreterOptionsAddDelegate(
5802 options: *mut TfLiteInterpreterOptions,
5803 delegate: *mut TfLiteOpaqueDelegate,
5804 );
5805}
5806extern "C" {
5807 #[doc = " Sets a custom error reporter for interpreter execution.\n\n * `reporter` takes the provided `user_data` object, as well as a C-style\n format string and arg list (see also vprintf).\n * `user_data` is optional. If non-null, it is owned by the client and must\n remain valid for the duration of the interpreter lifetime."]
5808 pub fn TfLiteInterpreterOptionsSetErrorReporter(
5809 options: *mut TfLiteInterpreterOptions,
5810 reporter: ::core::option::Option<
5811 unsafe extern "C" fn(
5812 user_data: *mut ::core::ffi::c_void,
5813 format: *const ::core::ffi::c_char,
5814 args: *mut __va_list_tag,
5815 ),
5816 >,
5817 user_data: *mut ::core::ffi::c_void,
5818 );
5819}
5820extern "C" {
5821 #[doc = " Adds an op registration to be applied during `TfLiteInterpreter` creation.\n\n The `TfLiteOperator` object is needed to implement custom op of\n TFLite Interpreter via C API. Calling this function ensures that any\n `TfLiteInterpreter` created with the specified `options` can execute models\n that use the custom operator specified in `registration`.\n Please refer https://www.tensorflow.org/lite/guide/ops_custom for custom op\n support.\n \\note The caller retains ownership of the TfLiteOperator object\n and should ensure that it remains valid for the duration of any created\n interpreter's lifetime.\n \\warning This is an experimental API and subject to change."]
5822 pub fn TfLiteInterpreterOptionsAddOperator(
5823 options: *mut TfLiteInterpreterOptions,
5824 registration: *mut TfLiteOperator,
5825 );
5826}
5827extern "C" {
5828 #[doc = " Enables users to cancel in-flight invocations with\n `TfLiteInterpreterCancel`.\n\n By default it is disabled and calling to `TfLiteInterpreterCancel` will\n return kTfLiteError. See `TfLiteInterpreterCancel`."]
5829 pub fn TfLiteInterpreterOptionsEnableCancellation(
5830 options: *mut TfLiteInterpreterOptions,
5831 enable: bool,
5832 ) -> TfLiteStatus;
5833}
5834extern "C" {
5835 #[doc = " Returns a new interpreter using the provided model and options, or null on\n failure.\n\n * `model` must be a valid model instance. The caller retains ownership of\n the object, and may destroy it (via TfLiteModelDelete) immediately after\n creating the interpreter. However, if the TfLiteModel was allocated with\n TfLiteModelCreate, then the `model_data` buffer that was passed to\n TfLiteModelCreate must outlive the lifetime of the TfLiteInterpreter\n object that this function returns, and must not be modified during that\n time; and if the TfLiteModel was allocated with TfLiteModelCreateFromFile,\n then the contents of the model file must not be modified during the\n lifetime of the TfLiteInterpreter object that this function returns.\n * `optional_options` may be null. The caller retains ownership of the\n object, and can safely destroy it (via TfLiteInterpreterOptionsDelete)\n immediately after creating the interpreter.\n\n \\note The client *must* explicitly allocate tensors before attempting to\n access input tensor data or invoke the interpreter."]
5836 pub fn TfLiteInterpreterCreate(
5837 model: *const TfLiteModel,
5838 optional_options: *const TfLiteInterpreterOptions,
5839 ) -> *mut TfLiteInterpreter;
5840}
5841extern "C" {
5842 #[doc = " Destroys the interpreter."]
5843 pub fn TfLiteInterpreterDelete(interpreter: *mut TfLiteInterpreter);
5844}
5845extern "C" {
5846 #[doc = " Returns the number of input tensors associated with the model."]
5847 pub fn TfLiteInterpreterGetInputTensorCount(interpreter: *const TfLiteInterpreter) -> i32;
5848}
5849extern "C" {
5850 #[doc = " Returns a pointer to an array of input tensor indices. The length of the\n array can be obtained via a call to `TfLiteInterpreterGetInputTensorCount`.\n\n Typically the input tensors associated with an `interpreter` would be set\n during the initialization of the `interpreter`, through a mechanism like the\n `InterpreterBuilder`, and remain unchanged throughout the lifetime of the\n interpreter. However, there are some circumstances in which the pointer may\n not remain valid throughout the lifetime of the interpreter, because calls\n to `SetInputs` on the interpreter invalidate the returned pointer.\n\n The ownership of the array remains with the TFLite runtime."]
5851 pub fn TfLiteInterpreterInputTensorIndices(
5852 interpreter: *const TfLiteInterpreter,
5853 ) -> *const ::core::ffi::c_int;
5854}
5855extern "C" {
5856 #[doc = " Returns the tensor associated with the input index.\n REQUIRES: 0 <= input_index < TfLiteInterpreterGetInputTensorCount(tensor)"]
5857 pub fn TfLiteInterpreterGetInputTensor(
5858 interpreter: *const TfLiteInterpreter,
5859 input_index: i32,
5860 ) -> *mut TfLiteTensor;
5861}
5862extern "C" {
5863 #[doc = " Resizes the specified input tensor.\n\n \\note After a resize, the client *must* explicitly allocate tensors before\n attempting to access the resized tensor data or invoke the interpreter.\n\n REQUIRES: 0 <= input_index < TfLiteInterpreterGetInputTensorCount(tensor)\n\n This function makes a copy of the input dimensions, so the client can safely\n deallocate `input_dims` immediately after this function returns."]
5864 pub fn TfLiteInterpreterResizeInputTensor(
5865 interpreter: *mut TfLiteInterpreter,
5866 input_index: i32,
5867 input_dims: *const ::core::ffi::c_int,
5868 input_dims_size: i32,
5869 ) -> TfLiteStatus;
5870}
5871extern "C" {
5872 #[doc = " Updates allocations for all tensors, resizing dependent tensors using the\n specified input tensor dimensionality.\n\n This is a relatively expensive operation, and need only be called after\n creating the graph and/or resizing any inputs."]
5873 pub fn TfLiteInterpreterAllocateTensors(interpreter: *mut TfLiteInterpreter) -> TfLiteStatus;
5874}
5875extern "C" {
5876 #[doc = " Runs inference for the loaded graph.\n\n Before calling this function, the caller should first invoke\n TfLiteInterpreterAllocateTensors() and should also set the values for the\n input tensors. After successfully calling this function, the values for the\n output tensors will be set.\n\n \\note It is possible that the interpreter is not in a ready state to\n evaluate (e.g., if AllocateTensors() hasn't been called, or if a\n ResizeInputTensor() has been performed without a subsequent call to\n AllocateTensors()).\n\n If the (experimental!) delegate fallback option was enabled in the\n interpreter options, then the interpreter will automatically fall back to\n not using any delegates if execution with delegates fails. For details,\n see TfLiteInterpreterOptionsSetEnableDelegateFallback in\n c_api_experimental.h.\n\n Returns one of the following status codes:\n - kTfLiteOk: Success. Output is valid.\n - kTfLiteDelegateError: Execution with delegates failed, due to a problem\n with the delegate(s). If fallback was not enabled, output is invalid.\n If fallback was enabled, this return value indicates that fallback\n succeeded, the output is valid, and all delegates previously applied to\n the interpreter have been undone.\n - kTfLiteApplicationError: Same as for kTfLiteDelegateError, except that\n the problem was not with the delegate itself, but rather was\n due to an incompatibility between the delegate(s) and the\n interpreter or model.\n - kTfLiteError: Unexpected/runtime failure. Output is invalid."]
5877 pub fn TfLiteInterpreterInvoke(interpreter: *mut TfLiteInterpreter) -> TfLiteStatus;
5878}
5879extern "C" {
5880 #[doc = " Returns the number of output tensors associated with the model."]
5881 pub fn TfLiteInterpreterGetOutputTensorCount(interpreter: *const TfLiteInterpreter) -> i32;
5882}
5883extern "C" {
5884 #[doc = " Returns a pointer to an array of output tensor indices. The length of the\n array can be obtained via a call to `TfLiteInterpreterGetOutputTensorCount`.\n\n Typically the output tensors associated with an `interpreter` would be set\n during the initialization of the `interpreter`, through a mechanism like the\n `InterpreterBuilder`, and remain unchanged throughout the lifetime of the\n interpreter. However, there are some circumstances in which the pointer may\n not remain valid throughout the lifetime of the interpreter, because calls\n to `SetOutputs` on the interpreter invalidate the returned pointer.\n\n The ownership of the array remains with the TFLite runtime."]
5885 pub fn TfLiteInterpreterOutputTensorIndices(
5886 interpreter: *const TfLiteInterpreter,
5887 ) -> *const ::core::ffi::c_int;
5888}
5889extern "C" {
5890 #[doc = " Returns the tensor associated with the output index.\n REQUIRES: 0 <= output_index < TfLiteInterpreterGetOutputTensorCount(tensor)\n\n \\note The shape and underlying data buffer for output tensors may be not\n be available until after the output tensor has been both sized and\n allocated.\n In general, best practice is to interact with the output tensor *after*\n calling TfLiteInterpreterInvoke()."]
5891 pub fn TfLiteInterpreterGetOutputTensor(
5892 interpreter: *const TfLiteInterpreter,
5893 output_index: i32,
5894 ) -> *const TfLiteTensor;
5895}
5896extern "C" {
5897 #[doc = " Returns modifiable access to the tensor that corresponds to the\n specified `index` and is associated with the provided `interpreter`.\n\n This requires the `index` to be between 0 and N - 1, where N is the\n number of tensors in the model.\n\n Typically the tensors associated with the `interpreter` would be set during\n the `interpreter` initialization, through a mechanism like the\n `InterpreterBuilder`, and remain unchanged throughout the lifetime of the\n interpreter. However, there are some circumstances in which the pointer may\n not remain valid throughout the lifetime of the interpreter, because calls\n to `AddTensors` on the interpreter invalidate the returned pointer.\n\n Note the difference between this function and\n `TfLiteInterpreterGetInputTensor` (or `TfLiteInterpreterGetOutputTensor` for\n that matter): `TfLiteInterpreterGetTensor` takes an index into the array of\n all tensors associated with the `interpreter`'s model, whereas\n `TfLiteInterpreterGetInputTensor` takes an index into the array of input\n tensors.\n\n The ownership of the tensor remains with the TFLite runtime, meaning the\n caller should not deallocate the pointer."]
5898 pub fn TfLiteInterpreterGetTensor(
5899 interpreter: *const TfLiteInterpreter,
5900 index: ::core::ffi::c_int,
5901 ) -> *mut TfLiteTensor;
5902}
5903extern "C" {
5904 #[doc = " Tries to cancel any in-flight invocation.\n\n \\note This only cancels `TfLiteInterpreterInvoke` calls that happen before\n calling this and it does not cancel subsequent invocations.\n \\note Calling this function will also cancel any in-flight invocations of\n SignatureRunners constructed from this interpreter.\n Non-blocking and thread safe.\n\n Returns kTfLiteError if cancellation is not enabled via\n `TfLiteInterpreterOptionsEnableCancellation`."]
5905 pub fn TfLiteInterpreterCancel(interpreter: *const TfLiteInterpreter) -> TfLiteStatus;
5906}
5907extern "C" {
5908 #[doc = " Returns the number of signatures defined in the model."]
5909 pub fn TfLiteInterpreterGetSignatureCount(interpreter: *const TfLiteInterpreter) -> i32;
5910}
5911extern "C" {
5912 #[doc = " Returns the key of the Nth signature in the model, where N is specified as\n `signature_index`.\n\n NOTE: The lifetime of the returned key is the same as (and depends on) the\n lifetime of `interpreter`."]
5913 pub fn TfLiteInterpreterGetSignatureKey(
5914 interpreter: *const TfLiteInterpreter,
5915 signature_index: i32,
5916 ) -> *const ::core::ffi::c_char;
5917}
5918extern "C" {
5919 #[doc = " Returns a new signature runner using the provided interpreter and signature\n key, or nullptr on failure.\n\n NOTE: `signature_key` is a null-terminated C string that must match the\n key of a signature in the interpreter's model.\n\n NOTE: The returned signature runner should be destroyed, by calling\n TfLiteSignatureRunnerDelete(), before the interpreter is destroyed."]
5920 pub fn TfLiteInterpreterGetSignatureRunner(
5921 interpreter: *const TfLiteInterpreter,
5922 signature_key: *const ::core::ffi::c_char,
5923 ) -> *mut TfLiteSignatureRunner;
5924}
5925extern "C" {
5926 #[doc = " Returns the number of inputs associated with a signature."]
5927 pub fn TfLiteSignatureRunnerGetInputCount(
5928 signature_runner: *const TfLiteSignatureRunner,
5929 ) -> usize;
5930}
5931extern "C" {
5932 #[doc = " Returns the (null-terminated) name of the Nth input in a signature, where N\n is specified as `input_index`.\n\n NOTE: The lifetime of the returned name is the same as (and depends on) the\n lifetime of `signature_runner`."]
5933 pub fn TfLiteSignatureRunnerGetInputName(
5934 signature_runner: *const TfLiteSignatureRunner,
5935 input_index: i32,
5936 ) -> *const ::core::ffi::c_char;
5937}
5938extern "C" {
5939 #[doc = " Resizes the input tensor identified as `input_name` to be the dimensions\n specified by `input_dims` and `input_dims_size`. Only unknown dimensions can\n be resized with this function. Unknown dimensions are indicated as `-1` in\n the `dims_signature` attribute of a TfLiteTensor.\n\n Returns status of failure or success. Note that this doesn't actually resize\n any existing buffers. A call to TfLiteSignatureRunnerAllocateTensors() is\n required to change the tensor input buffer.\n\n NOTE: This function is similar to TfLiteInterpreterResizeInputTensorStrict()\n and not TfLiteInterpreterResizeInputTensor().\n\n NOTE: `input_name` must match the name of an input in the signature.\n\n NOTE: This function makes a copy of the input dimensions, so the caller can\n safely deallocate `input_dims` immediately after this function returns."]
5940 pub fn TfLiteSignatureRunnerResizeInputTensor(
5941 signature_runner: *mut TfLiteSignatureRunner,
5942 input_name: *const ::core::ffi::c_char,
5943 input_dims: *const ::core::ffi::c_int,
5944 input_dims_size: i32,
5945 ) -> TfLiteStatus;
5946}
5947extern "C" {
5948 #[doc = " Updates allocations for tensors associated with a signature and resizes\n dependent tensors using the specified input tensor dimensionality.\n This is a relatively expensive operation and hence should only be called\n after initializing the signature runner object and/or resizing any inputs."]
5949 pub fn TfLiteSignatureRunnerAllocateTensors(
5950 signature_runner: *mut TfLiteSignatureRunner,
5951 ) -> TfLiteStatus;
5952}
5953extern "C" {
5954 #[doc = " Returns the input tensor identified by `input_name` in the given signature.\n Returns nullptr if the given name is not valid.\n\n NOTE: The lifetime of the returned tensor is the same as (and depends on)\n the lifetime of `signature_runner`."]
5955 pub fn TfLiteSignatureRunnerGetInputTensor(
5956 signature_runner: *mut TfLiteSignatureRunner,
5957 input_name: *const ::core::ffi::c_char,
5958 ) -> *mut TfLiteTensor;
5959}
5960extern "C" {
5961 #[doc = " Runs inference on a given signature.\n\n Before calling this function, the caller should first invoke\n TfLiteSignatureRunnerAllocateTensors() and should also set the values for\n the input tensors. After successfully calling this function, the values for\n the output tensors will be set."]
5962 pub fn TfLiteSignatureRunnerInvoke(
5963 signature_runner: *mut TfLiteSignatureRunner,
5964 ) -> TfLiteStatus;
5965}
5966extern "C" {
5967 #[doc = " Returns the number of output tensors associated with the signature."]
5968 pub fn TfLiteSignatureRunnerGetOutputCount(
5969 signature_runner: *const TfLiteSignatureRunner,
5970 ) -> usize;
5971}
5972extern "C" {
5973 #[doc = " Returns the (null-terminated) name of the Nth output in a signature, where\n N is specified as `output_index`.\n\n NOTE: The lifetime of the returned name is the same as (and depends on) the\n lifetime of `signature_runner`."]
5974 pub fn TfLiteSignatureRunnerGetOutputName(
5975 signature_runner: *const TfLiteSignatureRunner,
5976 output_index: i32,
5977 ) -> *const ::core::ffi::c_char;
5978}
5979extern "C" {
5980 #[doc = " Returns the output tensor identified by `output_name` in the given\n signature. Returns nullptr if the given name is not valid.\n\n NOTE: The lifetime of the returned tensor is the same as (and depends on)\n the lifetime of `signature_runner`."]
5981 pub fn TfLiteSignatureRunnerGetOutputTensor(
5982 signature_runner: *const TfLiteSignatureRunner,
5983 output_name: *const ::core::ffi::c_char,
5984 ) -> *const TfLiteTensor;
5985}
5986extern "C" {
5987 #[doc = " Returns the type of a tensor element."]
5988 pub fn TfLiteTensorType(tensor: *const TfLiteTensor) -> TfLiteType;
5989}
5990extern "C" {
5991 #[doc = " Returns the number of dimensions that the tensor has. Returns -1 in case\n the 'opaque_tensor' does not have its dimensions property set."]
5992 pub fn TfLiteTensorNumDims(tensor: *const TfLiteTensor) -> i32;
5993}
5994extern "C" {
5995 #[doc = " Returns the length of the tensor in the \"dim_index\" dimension.\n REQUIRES: 0 <= dim_index < TFLiteTensorNumDims(tensor)"]
5996 pub fn TfLiteTensorDim(tensor: *const TfLiteTensor, dim_index: i32) -> i32;
5997}
5998extern "C" {
5999 #[doc = " Returns the size of the underlying data in bytes."]
6000 pub fn TfLiteTensorByteSize(tensor: *const TfLiteTensor) -> usize;
6001}
6002extern "C" {
6003 #[doc = " Returns a pointer to the underlying data buffer.\n\n \\note The result may be null if tensors have not yet been allocated, e.g.,\n if the Tensor has just been created or resized and `TfLiteAllocateTensors()`\n has yet to be called, or if the output tensor is dynamically sized and the\n interpreter hasn't been invoked."]
6004 pub fn TfLiteTensorData(tensor: *const TfLiteTensor) -> *mut ::core::ffi::c_void;
6005}
6006extern "C" {
6007 #[doc = " Returns the (null-terminated) name of the tensor."]
6008 pub fn TfLiteTensorName(tensor: *const TfLiteTensor) -> *const ::core::ffi::c_char;
6009}
6010extern "C" {
6011 #[doc = " Returns the parameters for asymmetric quantization. The quantization\n parameters are only valid when the tensor type is `kTfLiteUInt8` and the\n `scale != 0`. Quantized values can be converted back to float using:\n real_value = scale * (quantized_value - zero_point);"]
6012 pub fn TfLiteTensorQuantizationParams(tensor: *const TfLiteTensor) -> TfLiteQuantizationParams;
6013}
6014extern "C" {
6015 #[doc = " Copies from the provided input buffer into the tensor's buffer.\n REQUIRES: input_data_size == TfLiteTensorByteSize(tensor)"]
6016 pub fn TfLiteTensorCopyFromBuffer(
6017 tensor: *mut TfLiteTensor,
6018 input_data: *const ::core::ffi::c_void,
6019 input_data_size: usize,
6020 ) -> TfLiteStatus;
6021}
6022extern "C" {
6023 #[doc = " Copies to the provided output buffer from the tensor's buffer.\n REQUIRES: output_data_size == TfLiteTensorByteSize(tensor)"]
6024 pub fn TfLiteTensorCopyToBuffer(
6025 output_tensor: *const TfLiteTensor,
6026 output_data: *mut ::core::ffi::c_void,
6027 output_data_size: usize,
6028 ) -> TfLiteStatus;
6029}
6030extern "C" {
6031 #[doc = " Destroys the signature runner."]
6032 pub fn TfLiteSignatureRunnerDelete(signature_runner: *mut TfLiteSignatureRunner);
6033}
6034#[repr(C)]
6035#[derive(Debug, Copy, Clone)]
6036pub struct TfLiteBackendBuffer {
6037 _unused: [u8; 0],
6038}
6039extern "C" {
6040 #[doc = " Creates an empty TfLiteBackendBuffer that does not contain any hardware\n buffers object.\n Returned object is owned by the caller."]
6041 pub fn TfLiteBackendBufferCreate() -> *mut TfLiteBackendBuffer;
6042}
6043extern "C" {
6044 #[doc = " Destroys a TfLiteBackendBuffer.\n Calling this function will not release the buffer object stored underneath."]
6045 pub fn TfLiteBackendBufferDelete(buf: *mut TfLiteBackendBuffer);
6046}
6047extern "C" {
6048 #[doc = " Stores a type puned buffer object to TfLiteBackendBuffer.\n `buf` will not own or control the lifecycle of `ptr`.\n Callers needs to ensure lifetime of *ptr exceeds `buf`."]
6049 pub fn TfLiteBackendBufferSetPtr(buf: *mut TfLiteBackendBuffer, ptr: *mut ::core::ffi::c_void);
6050}
6051extern "C" {
6052 #[doc = " Retrieves the buffer object from TfLiteBackendBuffer.\n Callers can use TfLiteAttributeMap buffer type name to interpret returned\n pointer."]
6053 pub fn TfLiteBackendBufferGetPtr(buf: *const TfLiteBackendBuffer) -> *mut ::core::ffi::c_void;
6054}
6055#[repr(C)]
6056#[derive(Debug, Copy, Clone)]
6057pub struct TfLiteSynchronization {
6058 _unused: [u8; 0],
6059}
6060extern "C" {
6061 #[doc = " Creates an empty TfLiteSynchronization.\n Returned object is owned by the caller."]
6062 pub fn TfLiteSynchronizationCreate() -> *mut TfLiteSynchronization;
6063}
6064extern "C" {
6065 #[doc = " Destroys a TfLiteSynchronization.\n Calling this function will not release the synchronization object stored."]
6066 pub fn TfLiteSynchronizationDelete(sync: *mut TfLiteSynchronization);
6067}
6068extern "C" {
6069 #[doc = " Stores a type-punned pointer to a platform-specific synchronization object.\n `sync` will not own or control the lifecycle of `ptr`.\n Callers needs to ensure lifetime of *ptr exceeds `sync`."]
6070 pub fn TfLiteSynchronizationSetPtr(
6071 sync: *mut TfLiteSynchronization,
6072 ptr: *mut ::core::ffi::c_void,
6073 );
6074}
6075extern "C" {
6076 #[doc = " Retrieves the sync object from TfLiteSynchronization.\n Callers can use TfLiteAttributeMap sync type name to interpret returned\n pointer."]
6077 pub fn TfLiteSynchronizationGetPtr(
6078 sync: *const TfLiteSynchronization,
6079 ) -> *mut ::core::ffi::c_void;
6080}
6081#[repr(u32)]
6082#[doc = " Type of the attribute map.\n An attribute map can either describe the properties of backend buffers\n or synchronizations.\n The value of the TfLiteAttrMapType determines the interpretation of\n attribute keys. See comments below."]
6083#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
6084pub enum TfLiteAttrMapType {
6085 #[doc = " Unknown type."]
6086 kTfLiteAttrMapTypeUnknown = 0,
6087 #[doc = " The attributes describes a platform-specific hardware buffer object (e.g.\n AHardwareBuffer for Android).\n Keys are of TfLiteBufferAttrKey type."]
6088 kTfLiteAttrMapTypeBuffer = 1,
6089 #[doc = " The attributes describes a sync object (e.g. a file descriptor as sync\n fence).\n Keys are of TfLiteSynchronizationAttrKey type."]
6090 kTfLiteAttrMapTypeSync = 2,
6091}
6092#[repr(u32)]
6093#[doc = " General hardware buffer attribute keys that are recognizable by TFLite."]
6094#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
6095pub enum TfLiteBufferAttrKey {
6096 kTfLiteBufferAttrKeyUnknown = 0,
6097 #[doc = " Backing buffer resource. const char*\n e.g. \"AHardwareBuffer\"."]
6098 kTfLiteBufferAttrKeyResourceTypeName = 1,
6099 #[doc = " Buffer alignment, size_t"]
6100 kTfLiteBufferAttrKeyAlignment = 2,
6101 #[doc = " Buffer padding, size_t"]
6102 kTfLiteBufferAttrKeyPadding = 3,
6103 #[doc = " Buffer offset, size_t"]
6104 kTfLiteBufferAttrKeyOffset = 4,
6105 #[doc = " Buffer size (padded size if applicable), size_t"]
6106 kTfLiteBufferAttrKeySize = 5,
6107 #[doc = " Buffer current host coherency state, bool"]
6108 kTfLiteBufferAttrKeyCurrentHostCoherencyState = 6,
6109 #[doc = " Buffer preferred host coherency state, bool"]
6110 kTfLiteBufferAttrKeyPreferredHostCoherencyState = 7,
6111 #[doc = " Buffer current host cache state, bool"]
6112 kTfLiteBufferAttrKeyCurrentHostCacheState = 8,
6113 #[doc = " Buffer preferred cache state, bool"]
6114 kTfLiteBufferAttrKeyPreferredHostCacheState = 9,
6115}
6116#[repr(u32)]
6117#[doc = " General synchronization attribute keys that are recognizable by TFLite."]
6118#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
6119pub enum TfLiteSynchronizationAttrKey {
6120 kTfLiteSynchronizationAttrKeyUnknown = 0,
6121 #[doc = " Synchronization type name. const char*\n e.g. \"sync_fence_fd\""]
6122 kTfLiteSynchronizationAttrKeyObjectTypeName = 1,
6123}
6124#[repr(C)]
6125#[derive(Debug, Copy, Clone)]
6126pub struct TfLiteAttributeMap {
6127 _unused: [u8; 0],
6128}
6129extern "C" {
6130 #[doc = " Creates an attribute map.\n `type` argument determines what the attribute map is describing\n (e.g. buffer, or sync object).\n Returned object is owned by the caller."]
6131 pub fn TfLiteAttributeMapCreate(type_: TfLiteAttrMapType) -> *mut TfLiteAttributeMap;
6132}
6133extern "C" {
6134 #[doc = " Destroys the attribute map.\n Do nothing if `attrs` is nullptr."]
6135 pub fn TfLiteAttributeMapDelete(attrs: *mut TfLiteAttributeMap);
6136}
6137extern "C" {
6138 #[doc = " Returns true if `attrs` is a buffer attribute map.\n If `attrs` is nullptr, returns false."]
6139 pub fn TfLiteAttributeMapIsBufferAttributeMap(attrs: *const TfLiteAttributeMap) -> bool;
6140}
6141extern "C" {
6142 #[doc = " Returns true if `attrs` is a sync object attribute map.\n If `attrs` is nullptr, returns false."]
6143 pub fn TfLiteAttributeMapIsSyncAttributeMap(attrs: *const TfLiteAttributeMap) -> bool;
6144}
6145extern "C" {
6146 #[doc = " Copies all attributes from `src` to `dst`. Any existing attributes in `dst`\n will be cleared.\n If `src` or `dst` is null, does nothing."]
6147 pub fn TfLiteAttributeMapCopy(src: *const TfLiteAttributeMap, dst: *mut TfLiteAttributeMap);
6148}
6149extern "C" {
6150 #[doc = " Gets the int buffer attribute value for the given `key`.\n Returns false if the key is not set, `attrs` is not a buffer attribute map,\n or the value is not of type `size_t`."]
6151 pub fn TfLiteAttributeMapGetSizeTBufferAttr(
6152 attrs: *const TfLiteAttributeMap,
6153 key: TfLiteBufferAttrKey,
6154 val: *mut usize,
6155 ) -> bool;
6156}
6157extern "C" {
6158 #[doc = " Sets the `key` buffer attribute as `val`.\n Returns false if `attrs` is not a buffer attribute map."]
6159 pub fn TfLiteAttributeMapSetSizeTBufferAttr(
6160 attrs: *mut TfLiteAttributeMap,
6161 key: TfLiteBufferAttrKey,
6162 val: usize,
6163 ) -> bool;
6164}
6165extern "C" {
6166 #[doc = " Gets the C string buffer attribute value for the given `key`.\n Returns false if the key is not set, `attrs` is not a buffer attribute map,\n or the value is not of type `size_t`.\n Returned C string's lifespan is determined by the setter of that value.\n Neither `attrs` nor the caller maintains the lifespan of the string."]
6167 pub fn TfLiteAttributeMapGetStringBufferAttr(
6168 attrs: *const TfLiteAttributeMap,
6169 key: TfLiteBufferAttrKey,
6170 val: *mut *const ::core::ffi::c_char,
6171 ) -> bool;
6172}
6173extern "C" {
6174 #[doc = " Sets the `key` buffer attribute as `val`.\n Returns false if `attrs` is not a buffer attribute map.\n `attrs` does not own the `val` C string."]
6175 pub fn TfLiteAttributeMapSetStringBufferAttr(
6176 attrs: *mut TfLiteAttributeMap,
6177 key: TfLiteBufferAttrKey,
6178 val: *const ::core::ffi::c_char,
6179 ) -> bool;
6180}
6181extern "C" {
6182 #[doc = " Gets the bool buffer attribute value for the given `key`.\n Returns false if the key is not set, `attrs` is not a buffer attribute map,\n or the value is not of type `bool`."]
6183 pub fn TfLiteAttributeMapGetBoolBufferAttr(
6184 attrs: *const TfLiteAttributeMap,
6185 key: TfLiteBufferAttrKey,
6186 val: *mut bool,
6187 ) -> bool;
6188}
6189extern "C" {
6190 #[doc = " Sets the `key` buffer attribute as `val`.\n Returns false if `attrs` is not a sync attribute map.\n `attrs` does not own the `val` C string."]
6191 pub fn TfLiteAttributeMapSetBoolBufferAttr(
6192 attrs: *mut TfLiteAttributeMap,
6193 key: TfLiteBufferAttrKey,
6194 val: bool,
6195 ) -> bool;
6196}
6197extern "C" {
6198 #[doc = " Gets the C string synchronization attribute value for the given `key`.\n Returns false if the key is not set, `attrs` is not a sync attribute map,\n or the value is not of type `size_t`.\n Returned C string's lifespan is determined by the setter of that value.\n Neither `attrs` nor the caller maintains the lifespan of the string."]
6199 pub fn TfLiteAttributeMapGetStringSyncAttr(
6200 attrs: *const TfLiteAttributeMap,
6201 key: TfLiteSynchronizationAttrKey,
6202 val: *mut *const ::core::ffi::c_char,
6203 ) -> bool;
6204}
6205extern "C" {
6206 #[doc = " Sets the `key` buffer attribute as `val`.\n Returns false if `attrs` is not a sync attribute map.\n `attrs` does not own the `val` C string."]
6207 pub fn TfLiteAttributeMapSetStringSyncAttr(
6208 attrs: *mut TfLiteAttributeMap,
6209 key: TfLiteSynchronizationAttrKey,
6210 val: *const ::core::ffi::c_char,
6211 ) -> bool;
6212}
6213extern "C" {
6214 pub fn TfLiteAttributeMapGetIntAttr(
6215 attrs: *const TfLiteAttributeMap,
6216 key: u32,
6217 val: *mut ::core::ffi::c_int,
6218 ) -> bool;
6219}
6220extern "C" {
6221 pub fn TfLiteAttributeMapSetIntAttr(
6222 attrs: *mut TfLiteAttributeMap,
6223 key: u32,
6224 val: ::core::ffi::c_int,
6225 );
6226}
6227extern "C" {
6228 pub fn TfLiteAttributeMapGetCustomIntAttr(
6229 attrs: *const TfLiteAttributeMap,
6230 key: *const ::core::ffi::c_char,
6231 val: *mut ::core::ffi::c_int,
6232 ) -> bool;
6233}
6234extern "C" {
6235 pub fn TfLiteAttributeMapSetCustomIntAttr(
6236 attrs: *mut TfLiteAttributeMap,
6237 key: *const ::core::ffi::c_char,
6238 val: ::core::ffi::c_int,
6239 );
6240}
6241extern "C" {
6242 pub fn TfLiteAttributeMapGetSizeTAttr(
6243 attrs: *const TfLiteAttributeMap,
6244 key: u32,
6245 val: *mut usize,
6246 ) -> bool;
6247}
6248extern "C" {
6249 pub fn TfLiteAttributeMapSetSizeTAttr(attrs: *mut TfLiteAttributeMap, key: u32, val: usize);
6250}
6251extern "C" {
6252 pub fn TfLiteAttributeMapGetCustomSizeTAttr(
6253 attrs: *const TfLiteAttributeMap,
6254 key: *const ::core::ffi::c_char,
6255 val: *mut usize,
6256 ) -> bool;
6257}
6258extern "C" {
6259 pub fn TfLiteAttributeMapSetCustomSizeTAttr(
6260 attrs: *mut TfLiteAttributeMap,
6261 key: *const ::core::ffi::c_char,
6262 val: usize,
6263 );
6264}
6265extern "C" {
6266 pub fn TfLiteAttributeMapGetStringAttr(
6267 attrs: *const TfLiteAttributeMap,
6268 key: u32,
6269 val: *mut *const ::core::ffi::c_char,
6270 ) -> bool;
6271}
6272extern "C" {
6273 pub fn TfLiteAttributeMapSetStringAttr(
6274 attrs: *mut TfLiteAttributeMap,
6275 key: u32,
6276 val: *const ::core::ffi::c_char,
6277 );
6278}
6279extern "C" {
6280 pub fn TfLiteAttributeMapGetCustomStringAttr(
6281 attrs: *const TfLiteAttributeMap,
6282 key: *const ::core::ffi::c_char,
6283 val: *mut *const ::core::ffi::c_char,
6284 ) -> bool;
6285}
6286extern "C" {
6287 pub fn TfLiteAttributeMapSetCustomStringAttr(
6288 attrs: *mut TfLiteAttributeMap,
6289 key: *const ::core::ffi::c_char,
6290 val: *const ::core::ffi::c_char,
6291 );
6292}
6293extern "C" {
6294 pub fn TfLiteAttributeMapGetBoolAttr(
6295 attrs: *const TfLiteAttributeMap,
6296 key: u32,
6297 val: *mut bool,
6298 ) -> bool;
6299}
6300extern "C" {
6301 pub fn TfLiteAttributeMapSetBoolAttr(attrs: *mut TfLiteAttributeMap, key: u32, val: bool);
6302}
6303extern "C" {
6304 pub fn TfLiteAttributeMapGetCustomBoolAttr(
6305 attrs: *const TfLiteAttributeMap,
6306 key: *const ::core::ffi::c_char,
6307 val: *mut bool,
6308 ) -> bool;
6309}
6310extern "C" {
6311 pub fn TfLiteAttributeMapSetCustomBoolAttr(
6312 attrs: *mut TfLiteAttributeMap,
6313 key: *const ::core::ffi::c_char,
6314 val: bool,
6315 );
6316}
6317extern "C" {
6318 #[doc = " Creates an async kernel to be initialized.\n `kernel_data` is the arbitrary data for identifying the async kernel itself\n and can be retrieved using `TfLiteAsyncKernelGetKernelData`.\n NOTE: TfLiteAsyncKernel does not own `kernel_data` and callers should\n ensure `kernel_data` out-lives the returned `TfLiteAsyncKernel`."]
6319 pub fn TfLiteAsyncKernelCreate(kernel_data: *mut ::core::ffi::c_void)
6320 -> *mut TfLiteAsyncKernel;
6321}
6322extern "C" {
6323 #[doc = " Retrieves the kernel data for identifying the async kernel itself."]
6324 pub fn TfLiteAsyncKernelGetKernelData(
6325 async_kernel: *const TfLiteAsyncKernel,
6326 ) -> *mut ::core::ffi::c_void;
6327}
6328extern "C" {
6329 #[doc = " Sets the callback for registering a piece of platform-specific hardware\n buffer object.\n `kernel_data` will be the same value supplied by `TfLiteAsyncKernelCreate`.\n\n `register_buffer`:\n Registers the buffer to `handle`.\n `buffer` and `attrs` lifespan is not guaranteed after the function call\n returns.\n kernels should save the stored attributes instead of caching the\n attribute map object itself.\n `io_type` specifies whether this buffer is used as an input buffer\n or an output buffer.\n `attrs` describes the attributes of the buffer object. It's guaranteed to be\n of kTfLiteBufferAttrMap type and not null. The application must provide\n `kTfLiteBufferAttrKeyResourceTypeName` attribute. When additional attributes\n (e.g. padding, size) are provided, the backend is responsible for validating\n those attributes to be compatible.\n Once its registered, TfLite runtime will assign and populate `handle` as\n the buffer handle.\n The backend will not own the actual buffer object, but the\n backend can choose to increase the ref count if underlying implementation\n supports that."]
6330 pub fn TfLiteAsyncKernelSetRegisterBuffer(
6331 async_kernel: *mut TfLiteAsyncKernel,
6332 register_buffer: ::core::option::Option<
6333 unsafe extern "C" fn(
6334 async_kernel: *mut TfLiteAsyncKernel,
6335 context: *mut TfLiteOpaqueContext,
6336 io_type: TfLiteIoType,
6337 buffer: *const TfLiteBackendBuffer,
6338 attrs: *const TfLiteAttributeMap,
6339 handle: TfLiteBufferHandle,
6340 ) -> TfLiteStatus,
6341 >,
6342 );
6343}
6344extern "C" {
6345 #[doc = " Sets the callback for registering a buffer slice from previously registered\n hardware buffer object.\n\n `register_buffer_slice`:\n Registers a buffer slice from a previously registered buffer object.\n `buffer_pool` is the handle of the buffer pool previously registered.\n `attrs` contains the information of the buffer slice.\n Once its registered, TfLite runtime will assign and populate `handle` as\n the buffer handle.\n NOTE: The backend is responsible to validate the slicing is \"valid\":\n * The slicing is not nested from another slice. (i.e. the `buffer_pool` is\n a handle returned by `RegisterBuffer`.)\n * The attributes of the slice (e.g. size, offset) is of valid values\n from the buffer pool."]
6346 pub fn TfLiteAsyncKernelSetRegisterBufferSlice(
6347 async_kernel: *mut TfLiteAsyncKernel,
6348 register_buffer_slice: ::core::option::Option<
6349 unsafe extern "C" fn(
6350 async_kernel: *mut TfLiteAsyncKernel,
6351 context: *mut TfLiteOpaqueContext,
6352 buffer_pool: TfLiteBufferHandle,
6353 attrs: *const TfLiteAttributeMap,
6354 handle: TfLiteBufferHandle,
6355 ) -> TfLiteStatus,
6356 >,
6357 );
6358}
6359extern "C" {
6360 #[doc = " Sets the callback for unregistering a buffer handle.\n\n `unregister_buffer`:\n Unregisters a buffer or a buffer slice.\n `handle` is a buffer handle previously assigned via register_* calls.\n If the `handle` is not recognized, returns error.\n NOTE: Unregistering the buffer does not mean deallocating the buffer object.\n But the backend need to reduce the ref-count if ref counting is performed\n during buffer registration calls."]
6361 pub fn TfLiteAsyncKernelSetUnregisterBuffer(
6362 async_kernel: *mut TfLiteAsyncKernel,
6363 unregister_buffer: ::core::option::Option<
6364 unsafe extern "C" fn(
6365 async_kernel: *mut TfLiteAsyncKernel,
6366 context: *mut TfLiteOpaqueContext,
6367 handle: TfLiteBufferHandle,
6368 ) -> TfLiteStatus,
6369 >,
6370 );
6371}
6372extern "C" {
6373 #[doc = " Sets the callback for the backend reporting supported hardware buffer object\n type names."]
6374 pub fn TfLiteAsyncKernelSetSupportedBufferTypes(
6375 async_kernel: *mut TfLiteAsyncKernel,
6376 supported_buffer_types: ::core::option::Option<
6377 unsafe extern "C" fn(
6378 async_kernel: *const TfLiteAsyncKernel,
6379 io_type: TfLiteIoType,
6380 types: *mut *const *const ::core::ffi::c_char,
6381 n_types: *mut usize,
6382 ),
6383 >,
6384 );
6385}
6386extern "C" {
6387 #[doc = " Sets the callback for the backend reporting supported synchronization object\n type names."]
6388 pub fn TfLiteAsyncKernelSetSupportedSynchronizations(
6389 async_kernel: *mut TfLiteAsyncKernel,
6390 supported_synchronizations: ::core::option::Option<
6391 unsafe extern "C" fn(
6392 async_kernel: *const TfLiteAsyncKernel,
6393 io_type: TfLiteIoType,
6394 types: *mut *const *const ::core::ffi::c_char,
6395 n_types: *mut usize,
6396 ),
6397 >,
6398 );
6399}
6400extern "C" {
6401 #[doc = " Sets the callback for the backend to reconcile execution environment\n attributes (e.g. buffer / synchronization object properties).\n\n `reconcile_restrictions`:\n Reconciles buffer or sync attributes for tensor at `tensor_index`.\n Fills `merged` with reconciled attributes.\n If `conflict` is provided, conflicting attributes should be provided there.\n If the type of the `user_provided_attributes` is not recognizable, returns\n error.\n If any of the attribute in the `user_provided_attributes` is not\n recognizable skip this attribute.\n Returns true if the attribute map type is recognizable and there's no\n conflicting attribute."]
6402 pub fn TfLiteAsyncKernelSetReconcileRestrictions(
6403 async_kernel: *mut TfLiteAsyncKernel,
6404 reconcile_restrictions: ::core::option::Option<
6405 unsafe extern "C" fn(
6406 async_kernel: *const TfLiteAsyncKernel,
6407 context: *const TfLiteOpaqueContext,
6408 node: *const TfLiteOpaqueNode,
6409 tensor_index: ::core::ffi::c_int,
6410 user_provided_attributes: *const TfLiteAttributeMap,
6411 merged: *mut TfLiteAttributeMap,
6412 conflict: *mut TfLiteAttributeMap,
6413 ) -> bool,
6414 >,
6415 );
6416}
6417extern "C" {
6418 #[doc = " Sets the callback for the backend to set buffer / synchronization\n attributes.\n\n `set_attributes`:\n Sets the input / output buffer / synchronization object attributes.\n Backend kernel will check the attributes covers all the requirements.\n A typical workflow is for callers call Reconcile*Restrictions method\n above to have a merged attribute list, check all restrictions are met\n and set input / output attribute here.\n Returns kTfLiteOk if provided `attrs` covers all requirements."]
6419 pub fn TfLiteAsyncKernelSetSetAttributes(
6420 async_kernel: *mut TfLiteAsyncKernel,
6421 set_attributes: ::core::option::Option<
6422 unsafe extern "C" fn(
6423 async_kernel: *mut TfLiteAsyncKernel,
6424 context: *mut TfLiteOpaqueContext,
6425 node: *mut TfLiteOpaqueNode,
6426 tensor_index: ::core::ffi::c_int,
6427 attrs: *const TfLiteAttributeMap,
6428 ) -> TfLiteStatus,
6429 >,
6430 );
6431}
6432extern "C" {
6433 #[doc = " Sets the callback for the backend to set buffer attributes.\n\n `set_buffer_attributes`:\n Sets the attributes of the buffers.\n Backend kernel will check if the provided buffer has been registered, and\n update the map in the backend, so that the callers can retrieve specific\n buffer's attributes. `attrs` should be initialized\n before calling this function and could be constructed by calling\n TfLiteAttributeMapCreate(). The attributes will be sent to backend kernels\n and stored in the map with the buffer. `buffer` and `attrs` should not be\n nullptr. The buffer needs to be registered before calling this\n function. Returns kTfLiteOk if the buffer has been registered and\n callers can successfully set the attributes for a buffer."]
6434 pub fn TfLiteAsyncKernelSetSetBufferAttributes(
6435 async_kernel: *mut TfLiteAsyncKernel,
6436 set_buffer_attributes: ::core::option::Option<
6437 unsafe extern "C" fn(
6438 async_kernel: *mut TfLiteAsyncKernel,
6439 buffer: *const TfLiteBackendBuffer,
6440 attrs: *const TfLiteAttributeMap,
6441 ) -> TfLiteStatus,
6442 >,
6443 );
6444}
6445extern "C" {
6446 #[doc = " Sets the callback for the backend to get buffer attributes.\n\n `get_buffer_attributes`:\n Gets the attributes of the buffers.\n Backend kernel will check if the provided buffer has been registered, and\n get the corresponding attributes from the map. `attrs` should be initialized\n before calling this function and could be constructed by calling\n TfLiteAttributeMapCreate(). `attrs` will be used to store the attributes\n obtained from the backend kernel. If `attrs` is a non-empty map, it will be\n overwritten by the attributes of the buffer. `buffer` and `attrs` should not\n be nullptr. The buffer needs to be registered before calling this function.\n Returns kTfLiteOk if the buffer has been registered and callers can\n successfully get the attributes for a buffer."]
6447 pub fn TfLiteAsyncKernelSetGetBufferAttributes(
6448 async_kernel: *mut TfLiteAsyncKernel,
6449 get_buffer_attributes: ::core::option::Option<
6450 unsafe extern "C" fn(
6451 async_kernel: *mut TfLiteAsyncKernel,
6452 buffer: *const TfLiteBackendBuffer,
6453 attrs: *mut TfLiteAttributeMap,
6454 ) -> TfLiteStatus,
6455 >,
6456 );
6457}
6458extern "C" {
6459 #[doc = " Sets the callback to prepare the kernels using the information from\n `set_attributes` calls."]
6460 pub fn TfLiteAsyncKernelSetPrepare(
6461 async_kernel: *mut TfLiteAsyncKernel,
6462 prepare: ::core::option::Option<
6463 unsafe extern "C" fn(
6464 async_kernel: *mut TfLiteAsyncKernel,
6465 context: *mut TfLiteOpaqueContext,
6466 node: *mut TfLiteOpaqueNode,
6467 ) -> TfLiteStatus,
6468 >,
6469 );
6470}
6471extern "C" {
6472 #[doc = " Sets the callback for the backend to schedule an execution.\n\n `eval`:\n Schedules an execution with the information provided in task.\n The application is responsible for filling out buffer and sync mappings\n to tensors.\n Backend will set the sync ptr for related tensors if requested.\n i.e. SetOutputAttributes has sync implementation requested, and\n the TfLiteSynchronization is not null for the tensor in `task`.\n\n TfLite runtime guarantees that the task is in ready state (i.e. no\n un-ended execution for this task).\n\n Input synchronizations:\n If the synchronization of a input tensor is `kTfLiteSyncTypeNoSyncObj`\n type or it's nullptr, it means the data is ready during Eval call.\n If not, data will be available when the synchronization signals and the\n backend is responsible for closing the underlying synchronization.\n The backend is responsible for dedupping the input sync.\n\n Output synchronizations:\n If the synchronization type is `kTfLiteSyncTypeNoSyncObj` or is nullptr,\n the backend does not need to provide synchronization objects to the user.\n Otherwise, the backend need to provide the sync according to the sync type\n provided. The underlying sync object will be closed by the app (or\n downstream components).\n If there are multiple non-nullptr kTfLiteSynchronization provided for\n different output tensors, the backend is responsible for duplicating the\n synchronization."]
6473 pub fn TfLiteAsyncKernelSetEval(
6474 async_kernel: *mut TfLiteAsyncKernel,
6475 eval: ::core::option::Option<
6476 unsafe extern "C" fn(
6477 async_kernel: *mut TfLiteAsyncKernel,
6478 context: *mut TfLiteOpaqueContext,
6479 node: *mut TfLiteOpaqueNode,
6480 task: *mut TfLiteExecutionTask,
6481 ) -> TfLiteStatus,
6482 >,
6483 );
6484}
6485extern "C" {
6486 #[doc = " Sets the callback for the backend to wait for a specific execution.\n\n `wait`:\n Waits on the execution scheduled using the task to finish.\n TfLite runtime guarantees that the task has an un-ended execution.\n Callers should be able to call `Wait` on the same task from multiple\n threads, and those calls should return the same status (i.e. if the backend\n failed to successfully wait on the task, all `Wait` to the task should\n return the same error before a new invocation is scheduled). Returns\n kTfLiteOk if the task is finished (w/ or w/o blocking)."]
6487 pub fn TfLiteAsyncKernelSetWait(
6488 async_kernel: *mut TfLiteAsyncKernel,
6489 wait: ::core::option::Option<
6490 unsafe extern "C" fn(
6491 async_kernel: *mut TfLiteAsyncKernel,
6492 context: *mut TfLiteOpaqueContext,
6493 task: *mut TfLiteExecutionTask,
6494 ) -> TfLiteStatus,
6495 >,
6496 );
6497}
6498extern "C" {
6499 #[doc = " Sets the callback for the backend to finish an execution and release all\n intermediate resources.\n\n `finish`:\n Finishes the task and clean up allocated resources for the task.\n May block if there's pending executions.\n This function will be called once and only once for individual task.\n Returns kTfLiteOk if there's no error. The backend is responsible to\n clean up task resources regardless there's error or not."]
6500 pub fn TfLiteAsyncKernelSetFinish(
6501 async_kernel: *mut TfLiteAsyncKernel,
6502 finish: ::core::option::Option<
6503 unsafe extern "C" fn(
6504 async_kernel: *mut TfLiteAsyncKernel,
6505 context: *mut TfLiteOpaqueContext,
6506 task: *mut TfLiteExecutionTask,
6507 ) -> TfLiteStatus,
6508 >,
6509 );
6510}
6511extern "C" {
6512 #[doc = " Releases `kernel`.\n Does not release `kernel_data`."]
6513 pub fn TfLiteAsyncKernelDelete(kernel: *mut TfLiteAsyncKernel);
6514}
6515extern "C" {
6516 #[doc = " Sets the buffer handle to the input / output tensor associated with\n `tensor_signature_name`.\n `task` and `tensor_signature_name` must not be nullptr.\n Returns kTfLiteError if the tensor is not found or nullptr args."]
6517 pub fn TfLiteExecutionTaskSetBuffer(
6518 task: *mut TfLiteExecutionTask,
6519 io_type: TfLiteIoType,
6520 tensor_signature_name: *const ::core::ffi::c_char,
6521 handle: TfLiteBufferHandle,
6522 ) -> TfLiteStatus;
6523}
6524extern "C" {
6525 #[doc = " Sets the buffer handle to the input / output tensor associated with the\n tensor index.\n NOTE: This method does not check tensor index is pointing to a valid tensor.\n Caller need to make sure the tensor_index points to a valid tensor by\n using the element from AsyncSignatureRunner inputs / outputs array."]
6526 pub fn TfLiteExecutionTaskSetBufferByIndex(
6527 task: *mut TfLiteExecutionTask,
6528 tensor_index: ::core::ffi::c_int,
6529 handle: TfLiteBufferHandle,
6530 ) -> TfLiteStatus;
6531}
6532extern "C" {
6533 #[doc = " Returns the buffer handle of the input / output tensor associated with\n `tensor_signature_name`.\n `task` and `tensor_signature_name` must not be nullptr.\n Returns kTfLiteNullBufferHandle if the tensor is not found or null input."]
6534 pub fn TfLiteExecutionTaskGetBufferByName(
6535 task: *const TfLiteExecutionTask,
6536 io_type: TfLiteIoType,
6537 tensor_signature_name: *const ::core::ffi::c_char,
6538 ) -> TfLiteBufferHandle;
6539}
6540extern "C" {
6541 #[doc = " The same as `TfLiteExecutionTaskGetBufferByName` but takes tensor index\n instead of the name from signature."]
6542 pub fn TfLiteExecutionTaskGetBufferByIndex(
6543 task: *const TfLiteExecutionTask,
6544 tensor_index: ::core::ffi::c_int,
6545 ) -> TfLiteBufferHandle;
6546}
6547extern "C" {
6548 #[doc = " Sets the opaque sync object to the input / output tensor associated with\n `tensor_signature_name`.\n `task` and `tensor_signature_name` must not be nullptr.\n A nullptr `sync` esentially means the tensor data does not need\n synchronization.\n `task` does not take the ownership of `sync`, so caller needs to release\n `sync` when destroying the `task` with AsyncSignatureRunner::Finish.\n Returns kTfLiteError if the tensor is not found."]
6549 pub fn TfLiteExecutionTaskSetSync(
6550 task: *mut TfLiteExecutionTask,
6551 io_type: TfLiteIoType,
6552 tensor_signature_name: *const ::core::ffi::c_char,
6553 sync: *mut TfLiteSynchronization,
6554 ) -> TfLiteStatus;
6555}
6556extern "C" {
6557 #[doc = " Sets the opaque sync object to the input / output tensor associated with the\n tensor index.\n NOTE: This method does not check tensor index is pointing to a\n valid tensor. Caller need to make sure the tensor_index points to a valid\n tensor by using the element from AsyncSignatureRunner inputs / outputs\n array."]
6558 pub fn TfLiteExecutionTaskSetSyncByIndex(
6559 task: *mut TfLiteExecutionTask,
6560 tensor_index: ::core::ffi::c_int,
6561 sync: *mut TfLiteSynchronization,
6562 ) -> TfLiteStatus;
6563}
6564extern "C" {
6565 #[doc = " Returns the sync object of the input / output tensor associated with\n `tensor_signature_name`.\n `task` and `tensor_signature_name` must not be nullptr.\n Returns nullptr if the tensor is not found or null input."]
6566 pub fn TfLiteExecutionTaskGetSyncByName(
6567 task: *const TfLiteExecutionTask,
6568 io_type: TfLiteIoType,
6569 tensor_signature_name: *const ::core::ffi::c_char,
6570 ) -> *mut TfLiteSynchronization;
6571}
6572extern "C" {
6573 #[doc = " The same as `TfLiteExecutionTaskGetSyncByName` but takes tensor index\n instead of the name from signature."]
6574 pub fn TfLiteExecutionTaskGetSyncByIndex(
6575 task: *const TfLiteExecutionTask,
6576 tensor_index: ::core::ffi::c_int,
6577 ) -> *mut TfLiteSynchronization;
6578}
6579extern "C" {
6580 #[doc = " Task execution data\n Backends may store task specific data for executions. This ease the burden\n for backends to maintain the mapping across different tasks."]
6581 pub fn TfLiteExecutionTaskGetDelegateExecutionData(
6582 task: *const TfLiteExecutionTask,
6583 kernel: *mut TfLiteAsyncKernel,
6584 ) -> *mut ::core::ffi::c_void;
6585}
6586extern "C" {
6587 pub fn TfLiteExecutionTaskSetDelegateExecutionData(
6588 task: *mut TfLiteExecutionTask,
6589 kernel: *mut TfLiteAsyncKernel,
6590 data: *mut ::core::ffi::c_void,
6591 );
6592}
6593extern "C" {
6594 #[doc = " Task status\n Thread safe accessors for the latest status of the task."]
6595 pub fn TfLiteExecutionTaskGetStatus(task: *const TfLiteExecutionTask) -> TfLiteStatus;
6596}
6597extern "C" {
6598 pub fn TfLiteExecutionTaskSetStatus(task: *mut TfLiteExecutionTask, status: TfLiteStatus);
6599}
6600#[repr(C)]
6601#[derive(Debug, Copy, Clone)]
6602pub struct TfLiteAsyncSignatureRunner {
6603 _unused: [u8; 0],
6604}
6605extern "C" {
6606 #[doc = " Returns a new async signature runner using the provided interpreter and\n signature key, or nullptr on failure.\n\n NOTE: `signature_key` is a null-terminated C string that must match the\n key of a signature in the interpreter's model.\n\n NOTE: The returned signature runner should be destroyed, by calling\n TfLiteAsyncSignatureRunnerDelete(), before the interpreter is destroyed.\n\n WARNING: This is an experimental API and subject to change."]
6607 pub fn TfLiteInterpreterGetAsyncSignatureRunner(
6608 interpreter: *const TfLiteInterpreter,
6609 signature_key: *const ::core::ffi::c_char,
6610 ) -> *mut TfLiteAsyncSignatureRunner;
6611}
6612extern "C" {
6613 #[doc = " Registers a TfLiteBackendBuffer to the backend.\n `async_signature_runner`, `buffer`, `attrs` and `handle` should be non-null.\n If the hardware buffer wrapped in `buffer` is successfully registered,\n `handle` will be filled with a new buffer handle. Caller can use the buffer\n handle as input / output buffer in `TfLiteExecutionTask`.\n Returns kTfLiteError if the registration failed."]
6614 pub fn TfLiteAsyncSignatureRunnerRegisterBuffer(
6615 async_signature_runner: *mut TfLiteAsyncSignatureRunner,
6616 io_type: TfLiteIoType,
6617 buffer: *const TfLiteBackendBuffer,
6618 attrs: *const TfLiteAttributeMap,
6619 handle: *mut TfLiteBufferHandle,
6620 ) -> TfLiteStatus;
6621}
6622extern "C" {
6623 #[doc = " Registers a buffer slice from a previously registered handle `buffer_pool`.\n `async_signature_runner`, `attrs` and `handle` should be non-null.\n If the buffer slice described by `attrs` is successfully registered,\n output `handle` will be filled with a new buffer handle value.\n NOTE: `attrs` should contain the information about the buffer slice,\n e.g. offset and size of the size (if applicable).\n Returns kTfLiteError if the registration failed."]
6624 pub fn TfLiteAsyncSignatureRunnerRegisterBufferSlice(
6625 async_signature_runner: *mut TfLiteAsyncSignatureRunner,
6626 buffer_pool: TfLiteBufferHandle,
6627 attrs: *const TfLiteAttributeMap,
6628 handle: *mut TfLiteBufferHandle,
6629 ) -> TfLiteStatus;
6630}
6631extern "C" {
6632 #[doc = " Unregisters a hardware buffer object (or buffer slice) with `handle`.\n Buffer slices should be unregistered before unregistering the buffer pool\n it belongs to.\n Returns kTfLiteError if `handle` is not recognized."]
6633 pub fn TfLiteAsyncSignatureRunnerUnregisterBuffer(
6634 async_signature_runner: *mut TfLiteAsyncSignatureRunner,
6635 handle: TfLiteBufferHandle,
6636 ) -> TfLiteStatus;
6637}
6638extern "C" {
6639 #[doc = " Returns supported platform-specific hardware buffer types.\n\n Output `types` will be a array of C strings that can be used as the\n value of `kTfLiteBufferAttrKeyResourceTypeName`.\n Output `num_types` is the size of the `types` array, and can be used to\n access elements in `types`.\n\n NOTE: The lifetime of the returned array is the same as (and depends on) the\n lifetime of `signature_runner`."]
6640 pub fn TfLiteAsyncSignatureRunnerGetSupportedBufferTypes(
6641 async_signature_runner: *const TfLiteAsyncSignatureRunner,
6642 io_type: TfLiteIoType,
6643 types: *mut *const *const ::core::ffi::c_char,
6644 num_types: *mut usize,
6645 ) -> TfLiteStatus;
6646}
6647extern "C" {
6648 #[doc = " Returns supported platform-specific synchronization object types.\n\n Output `types` will be a array of C strings that can be used as the\n value of `kTfLiteSynchronizationAttrKeyObjectTypeName`.\n Output `num_types` is the size of the `types` array, and can be used to\n access elements in `types`.\n\n NOTE: The lifetime of the returned array is the same as (and depends on) the\n lifetime of `signature_runner`."]
6649 pub fn TfLiteAsyncSignatureRunnerGetSupportedSynchronizationTypes(
6650 async_signature_runner: *const TfLiteAsyncSignatureRunner,
6651 io_type: TfLiteIoType,
6652 types: *mut *const *const ::core::ffi::c_char,
6653 num_types: *mut usize,
6654 ) -> TfLiteStatus;
6655}
6656extern "C" {
6657 #[doc = " Reconciles restrictions with the backend for I/O tensor called `name`.\n The backend will read `user_provided_attributes` and tries to reconcile\n those attributes. The backend will also populate its own restrictions\n back to the caller.\n The merged attributes will be populated to `merged`. For attributes that\n the backend does not know or not care about, those will also be copied to\n `merged` attributes.\n If there's a conflicting attribute, it will be populated to `conflict` if\n it's provided.\n `user_provided_attributes` and `merged` should not be nullptr.\n Returns true if the reconcilation succeeded and there's no\n conflicting attributes."]
6658 pub fn TfLiteAsyncSignatureRunnerReconcileRestrictions(
6659 async_signature_runner: *const TfLiteAsyncSignatureRunner,
6660 io_type: TfLiteIoType,
6661 name: *const ::core::ffi::c_char,
6662 user_provided_attributes: *const TfLiteAttributeMap,
6663 merged: *mut TfLiteAttributeMap,
6664 conflict: *mut TfLiteAttributeMap,
6665 ) -> bool;
6666}
6667extern "C" {
6668 #[doc = " Reconciles restrictions with the backend for I/O tensor at `tensor_index`.\n The backend will read `user_provided_attributes` and tries to reconcile\n those attributes. The backend will also populate its own restrictions\n back to the caller.\n The merged attributes will be populated to `merged`. For attributes that\n the backend does not know or not care about, those will also be copied to\n `merged` attributes.\n If there's a conflicting attribute, it will be populated to `conflict` if\n it's provided.\n `user_provided_attributes` and `merged` should not be nullptr.\n Returns true if the reconcilation succeeded and there's no\n conflicting attributes."]
6669 pub fn TfLiteAsyncSignatureRunnerReconcileRestrictionsByIndex(
6670 async_signature_runner: *const TfLiteAsyncSignatureRunner,
6671 tensor_index: ::core::ffi::c_int,
6672 user_provided_attributes: *const TfLiteAttributeMap,
6673 merged: *mut TfLiteAttributeMap,
6674 conflict: *mut TfLiteAttributeMap,
6675 ) -> bool;
6676}
6677extern "C" {
6678 #[doc = " Finalizes I/O tensor `name`'s attributes with `attrs`.\n The attributes will be forwarded to all backend kernels that depends on\n tensor. Must call `TfLiteAsyncSignatureRunnerPrepareBackends` after setting\n new attributes.\n Callers needs to ensure the lifetime of `name` and `attrs` before this\n function returns, and those may be deallocated afterwards.\n Returns true if all backends accept the `attrs`."]
6679 pub fn TfLiteAsyncSignatureRunnerSetAttributes(
6680 async_signature_runner: *mut TfLiteAsyncSignatureRunner,
6681 io_type: TfLiteIoType,
6682 name: *const ::core::ffi::c_char,
6683 attrs: *const TfLiteAttributeMap,
6684 ) -> TfLiteStatus;
6685}
6686extern "C" {
6687 #[doc = " Finalizes I/O tensor at `tensor_index`'s attributes with `attrs`.\n The attributes will be forwarded to all backend kernels that depends on\n tensor. Must call `TfLiteAsyncSignatureRunnerPrepareBackends` after setting\n new attributes.\n Callers needs to ensure the lifetime of `name` and `attrs` before this\n function returns, and those may be deallocated afterwards.\n Returns true if all backends accept the `attrs`."]
6688 pub fn TfLiteAsyncSignatureRunnerSetAttributesByIndex(
6689 async_signature_runner: *mut TfLiteAsyncSignatureRunner,
6690 tensor_index: ::core::ffi::c_int,
6691 attrs: *const TfLiteAttributeMap,
6692 ) -> TfLiteStatus;
6693}
6694extern "C" {
6695 #[doc = " Prepares delegate backends for execution.\n Must be called after `TfLiteAsyncSignatureRunnerSetAttributes` and before\n `TfLiteAsyncSignatureRunnerCreateTask`."]
6696 pub fn TfLiteAsyncSignatureRunnerPrepareBackends(
6697 async_signature_runner: *mut TfLiteAsyncSignatureRunner,
6698 ) -> TfLiteStatus;
6699}
6700extern "C" {
6701 #[doc = " Creates an execution task for this signature.\n Must be called after `TfLiteAsyncSignatureRunnerPrepareBackends` otherwise\n returns nullptr.\n When creating a task, all intermediate resources will be allocated\n for this task.\n Caller owns the returned task and must release it by calling\n `TfLiteAsyncSignatureRunnerFinish`.\n Returns nullptr if the task allocation failed."]
6702 pub fn TfLiteAsyncSignatureRunnerCreateTask(
6703 async_signature_runner: *mut TfLiteAsyncSignatureRunner,
6704 ) -> *mut TfLiteExecutionTask;
6705}
6706extern "C" {
6707 #[doc = " Schedules an asynchronous execution with I/O information\n provided in `task`.\n `task` should not be nullptr.\n\n NOTE: For the same `task`,\n `Wait` and `InvokeAsync` should be called in pairs, unless `Finish(task)` is\n called and `task` is freed. The application is responsible\n to call `Wait` after `InvokeAsync` even if all output tensors are associated\n with synchronizations.\n\n Returns kTfLiteError if any backend kernels failed to schedule\n the execution."]
6708 pub fn TfLiteAsyncSignatureRunnerInvokeAsync(
6709 async_signature_runner: *mut TfLiteAsyncSignatureRunner,
6710 task: *mut TfLiteExecutionTask,
6711 ) -> TfLiteStatus;
6712}
6713extern "C" {
6714 #[doc = " Blocks and wait for execution tied to `task` to finish.\n `task` should not be nullptr.\n Can be called from multiple threads. All calls will block until the\n task finishes execution.\n\n NOTE: For the same `task`,\n `Wait` and `InvokeAsync` should be called in pairs, unless `Finish(task)` is\n called and `task` is freed. The application is responsible\n to call `Wait` after `InvokeAsync` even if all output tensors are associated\n with synchronizations.\n If `TfLiteAsyncSignatureRunnerWait` is called without a matching call to\n `TfLiteAsyncSignatureRunnerInvokeAsync`, returns the latest status code (by\n default `kTfLiteOk`).\n\n Returns kTfLiteError if any backends failed to finish the execution.\n If the task is currently idle, it will return its latest status code."]
6715 pub fn TfLiteAsyncSignatureRunnerWait(
6716 async_signature_runner: *mut TfLiteAsyncSignatureRunner,
6717 task: *mut TfLiteExecutionTask,
6718 ) -> TfLiteStatus;
6719}
6720extern "C" {
6721 #[doc = " Finishes the task and release all intermediate resources tied to\n this task. Must be called exactly once for each `task` object.\n If there's ongoing execution, this will block wait for the execution\n to finish.\n `task` should not be nullptr and will be deleted.\n NOTE: Caller needs to ensure `Finish` is not called concurrently with\n `InvokeAsync` or `Wait`.\n Returns kTfLiteError if fails to release the task. The task will be\n destroyed regardless of error or not."]
6722 pub fn TfLiteAsyncSignatureRunnerFinish(
6723 async_signature_runner: *mut TfLiteAsyncSignatureRunner,
6724 task: *mut TfLiteExecutionTask,
6725 ) -> TfLiteStatus;
6726}
6727extern "C" {
6728 #[doc = " Returns the number of input tensors associated with the signature."]
6729 pub fn TfLiteAsyncSignatureRunnerGetInputCount(
6730 async_signature_runner: *const TfLiteAsyncSignatureRunner,
6731 ) -> usize;
6732}
6733extern "C" {
6734 #[doc = " Returns the (null-terminated) name of the Nth input in a signature, where N\n is specified as `input_index`.\n\n NOTE: The lifetime of the returned name is the same as (and depends on) the\n lifetime of `async_signature_runner`."]
6735 pub fn TfLiteAsyncSignatureRunnerGetInputName(
6736 async_signature_runner: *const TfLiteAsyncSignatureRunner,
6737 input_index: i32,
6738 ) -> *const ::core::ffi::c_char;
6739}
6740extern "C" {
6741 #[doc = " Returns the number of output tensors associated with the signature."]
6742 pub fn TfLiteAsyncSignatureRunnerGetOutputCount(
6743 async_signature_runner: *const TfLiteAsyncSignatureRunner,
6744 ) -> usize;
6745}
6746extern "C" {
6747 #[doc = " Returns the (null-terminated) name of the Nth output in a signature, where\n N is specified as `output_index`.\n\n NOTE: The lifetime of the returned name is the same as (and depends on) the\n lifetime of `async_signature_runner`."]
6748 pub fn TfLiteAsyncSignatureRunnerGetOutputName(
6749 async_signature_runner: *const TfLiteAsyncSignatureRunner,
6750 output_index: i32,
6751 ) -> *const ::core::ffi::c_char;
6752}
6753extern "C" {
6754 #[doc = " Returns the input tensor metadata identified by `input_name` in the given\n signature.\n Returns nullptr if the given name is not valid.\n\n NOTE: For AsyncSignatureRunner, tensor data are not stored within\n `TfLiteOpaqueTensors` but in platform-specific hardware buffer objects.\n This method is only used for accessing the metadata like shape and data type\n of the input tensors.\n\n NOTE: The lifetime of the returned tensor is the same as (and depends on)\n the lifetime of `async_signature_runner`."]
6755 pub fn TfLiteAsyncSignatureRunnerGetInputTensor(
6756 async_signature_runner: *mut TfLiteAsyncSignatureRunner,
6757 input_name: *const ::core::ffi::c_char,
6758 ) -> *const TfLiteOpaqueTensor;
6759}
6760extern "C" {
6761 #[doc = " Returns the output tensor metadata identified by `output_name` in the given\n signature.\n Returns nullptr if the given name is not valid.\n\n Note: For AsyncSignatureRunner, tensor data are not stored within\n `TfLiteOpaqueTensors` but in platform-specific hardware buffer objects.\n This method is only used for accessing the metadata like shape and data type\n of the output tensors.\n\n NOTE: The lifetime of the returned tensor is the same as (and depends on)\n the lifetime of `async_signature_runner`.\n\n NOTE: The lifetime of the returned tensor is the same as (and depends on)\n the lifetime of `async_signature_runner`."]
6762 pub fn TfLiteAsyncSignatureRunnerGetOutputTensor(
6763 async_signature_runner: *const TfLiteAsyncSignatureRunner,
6764 output_name: *const ::core::ffi::c_char,
6765 ) -> *const TfLiteOpaqueTensor;
6766}
6767extern "C" {
6768 #[doc = " Destroys the async signature runner."]
6769 pub fn TfLiteAsyncSignatureRunnerDelete(signature_runner: *mut TfLiteAsyncSignatureRunner);
6770}
6771extern "C" {
6772 #[doc = " Returns a pointer to an array of input tensor indices. The length of the\n array can be obtained via a call to\n `TfLiteAsyncSignatureRunnerGetInputCount`.\n\n NOTE: The lifetime of the returned tensor is the same as (and depends on)\n the lifetime of `async_signature_runner`."]
6773 pub fn TfLiteAsyncSignatureRunnerInputTensorIndices(
6774 async_signature_runner: *const TfLiteAsyncSignatureRunner,
6775 ) -> *const ::core::ffi::c_int;
6776}
6777extern "C" {
6778 #[doc = " Returns a pointer to an array of output tensor indices. The length of the\n array can be obtained via a call to\n `TfLiteAsyncSignatureRunnerGetOutputCount`.\n\n NOTE: The lifetime of the returned tensor is the same as (and depends on)\n the lifetime of `async_signature_runner`."]
6779 pub fn TfLiteAsyncSignatureRunnerOutputTensorIndices(
6780 async_signature_runner: *const TfLiteAsyncSignatureRunner,
6781 ) -> *const ::core::ffi::c_int;
6782}
6783extern "C" {
6784 #[doc = " Returns the tensor metadata identified by `index` in the given\n signature.\n Returns nullptr if the given index is not valid or out of bound.\n\n NOTE: For AsyncSignatureRunner, tensor data are not stored within\n `TfLiteOpaqueTensors` but in platform-specific hardware buffer objects.\n This method is only used for accessing the metadata like shape and data type\n of the input tensors.\n\n NOTE: The lifetime of the returned tensor is the same as (and depends on)\n the lifetime of `async_signature_runner`."]
6785 pub fn TfLiteAsyncSignatureRunnerGetTensor(
6786 async_signature_runner: *const TfLiteAsyncSignatureRunner,
6787 index: ::core::ffi::c_int,
6788 ) -> *const TfLiteOpaqueTensor;
6789}
6790#[repr(C)]
6791#[derive(Copy, Clone)]
6792pub struct __mbstate_t {
6793 pub __count: ::core::ffi::c_int,
6794 pub __value: __mbstate_t__bindgen_ty_1,
6795}
6796#[repr(C)]
6797#[derive(Copy, Clone)]
6798pub union __mbstate_t__bindgen_ty_1 {
6799 pub __wch: ::core::ffi::c_uint,
6800 pub __wchb: [::core::ffi::c_char; 4usize],
6801}
6802#[test]
6803fn bindgen_test_layout___mbstate_t__bindgen_ty_1() {
6804 const UNINIT: ::core::mem::MaybeUninit<__mbstate_t__bindgen_ty_1> =
6805 ::core::mem::MaybeUninit::uninit();
6806 let ptr = UNINIT.as_ptr();
6807 assert_eq!(
6808 ::core::mem::size_of::<__mbstate_t__bindgen_ty_1>(),
6809 4usize,
6810 concat!("Size of: ", stringify!(__mbstate_t__bindgen_ty_1))
6811 );
6812 assert_eq!(
6813 ::core::mem::align_of::<__mbstate_t__bindgen_ty_1>(),
6814 4usize,
6815 concat!("Alignment of ", stringify!(__mbstate_t__bindgen_ty_1))
6816 );
6817 assert_eq!(
6818 unsafe { ::core::ptr::addr_of!((*ptr).__wch) as usize - ptr as usize },
6819 0usize,
6820 concat!(
6821 "Offset of field: ",
6822 stringify!(__mbstate_t__bindgen_ty_1),
6823 "::",
6824 stringify!(__wch)
6825 )
6826 );
6827 assert_eq!(
6828 unsafe { ::core::ptr::addr_of!((*ptr).__wchb) as usize - ptr as usize },
6829 0usize,
6830 concat!(
6831 "Offset of field: ",
6832 stringify!(__mbstate_t__bindgen_ty_1),
6833 "::",
6834 stringify!(__wchb)
6835 )
6836 );
6837}
6838#[test]
6839fn bindgen_test_layout___mbstate_t() {
6840 const UNINIT: ::core::mem::MaybeUninit<__mbstate_t> = ::core::mem::MaybeUninit::uninit();
6841 let ptr = UNINIT.as_ptr();
6842 assert_eq!(
6843 ::core::mem::size_of::<__mbstate_t>(),
6844 8usize,
6845 concat!("Size of: ", stringify!(__mbstate_t))
6846 );
6847 assert_eq!(
6848 ::core::mem::align_of::<__mbstate_t>(),
6849 4usize,
6850 concat!("Alignment of ", stringify!(__mbstate_t))
6851 );
6852 assert_eq!(
6853 unsafe { ::core::ptr::addr_of!((*ptr).__count) as usize - ptr as usize },
6854 0usize,
6855 concat!(
6856 "Offset of field: ",
6857 stringify!(__mbstate_t),
6858 "::",
6859 stringify!(__count)
6860 )
6861 );
6862 assert_eq!(
6863 unsafe { ::core::ptr::addr_of!((*ptr).__value) as usize - ptr as usize },
6864 4usize,
6865 concat!(
6866 "Offset of field: ",
6867 stringify!(__mbstate_t),
6868 "::",
6869 stringify!(__value)
6870 )
6871 );
6872}
6873#[repr(C)]
6874#[derive(Copy, Clone)]
6875pub struct _G_fpos_t {
6876 pub __pos: __off_t,
6877 pub __state: __mbstate_t,
6878}
6879#[test]
6880fn bindgen_test_layout__G_fpos_t() {
6881 const UNINIT: ::core::mem::MaybeUninit<_G_fpos_t> = ::core::mem::MaybeUninit::uninit();
6882 let ptr = UNINIT.as_ptr();
6883 assert_eq!(
6884 ::core::mem::size_of::<_G_fpos_t>(),
6885 16usize,
6886 concat!("Size of: ", stringify!(_G_fpos_t))
6887 );
6888 assert_eq!(
6889 ::core::mem::align_of::<_G_fpos_t>(),
6890 8usize,
6891 concat!("Alignment of ", stringify!(_G_fpos_t))
6892 );
6893 assert_eq!(
6894 unsafe { ::core::ptr::addr_of!((*ptr).__pos) as usize - ptr as usize },
6895 0usize,
6896 concat!(
6897 "Offset of field: ",
6898 stringify!(_G_fpos_t),
6899 "::",
6900 stringify!(__pos)
6901 )
6902 );
6903 assert_eq!(
6904 unsafe { ::core::ptr::addr_of!((*ptr).__state) as usize - ptr as usize },
6905 8usize,
6906 concat!(
6907 "Offset of field: ",
6908 stringify!(_G_fpos_t),
6909 "::",
6910 stringify!(__state)
6911 )
6912 );
6913}
6914pub type __fpos_t = _G_fpos_t;
6915#[repr(C)]
6916#[derive(Copy, Clone)]
6917pub struct _G_fpos64_t {
6918 pub __pos: __off64_t,
6919 pub __state: __mbstate_t,
6920}
6921#[test]
6922fn bindgen_test_layout__G_fpos64_t() {
6923 const UNINIT: ::core::mem::MaybeUninit<_G_fpos64_t> = ::core::mem::MaybeUninit::uninit();
6924 let ptr = UNINIT.as_ptr();
6925 assert_eq!(
6926 ::core::mem::size_of::<_G_fpos64_t>(),
6927 16usize,
6928 concat!("Size of: ", stringify!(_G_fpos64_t))
6929 );
6930 assert_eq!(
6931 ::core::mem::align_of::<_G_fpos64_t>(),
6932 8usize,
6933 concat!("Alignment of ", stringify!(_G_fpos64_t))
6934 );
6935 assert_eq!(
6936 unsafe { ::core::ptr::addr_of!((*ptr).__pos) as usize - ptr as usize },
6937 0usize,
6938 concat!(
6939 "Offset of field: ",
6940 stringify!(_G_fpos64_t),
6941 "::",
6942 stringify!(__pos)
6943 )
6944 );
6945 assert_eq!(
6946 unsafe { ::core::ptr::addr_of!((*ptr).__state) as usize - ptr as usize },
6947 8usize,
6948 concat!(
6949 "Offset of field: ",
6950 stringify!(_G_fpos64_t),
6951 "::",
6952 stringify!(__state)
6953 )
6954 );
6955}
6956pub type __fpos64_t = _G_fpos64_t;
6957pub type __FILE = _IO_FILE;
6958pub type FILE = _IO_FILE;
6959#[repr(C)]
6960#[derive(Debug, Copy, Clone)]
6961pub struct _IO_marker {
6962 _unused: [u8; 0],
6963}
6964#[repr(C)]
6965#[derive(Debug, Copy, Clone)]
6966pub struct _IO_codecvt {
6967 _unused: [u8; 0],
6968}
6969#[repr(C)]
6970#[derive(Debug, Copy, Clone)]
6971pub struct _IO_wide_data {
6972 _unused: [u8; 0],
6973}
6974pub type _IO_lock_t = ::core::ffi::c_void;
6975#[repr(C)]
6976#[derive(Debug, Copy, Clone)]
6977pub struct _IO_FILE {
6978 pub _flags: ::core::ffi::c_int,
6979 pub _IO_read_ptr: *mut ::core::ffi::c_char,
6980 pub _IO_read_end: *mut ::core::ffi::c_char,
6981 pub _IO_read_base: *mut ::core::ffi::c_char,
6982 pub _IO_write_base: *mut ::core::ffi::c_char,
6983 pub _IO_write_ptr: *mut ::core::ffi::c_char,
6984 pub _IO_write_end: *mut ::core::ffi::c_char,
6985 pub _IO_buf_base: *mut ::core::ffi::c_char,
6986 pub _IO_buf_end: *mut ::core::ffi::c_char,
6987 pub _IO_save_base: *mut ::core::ffi::c_char,
6988 pub _IO_backup_base: *mut ::core::ffi::c_char,
6989 pub _IO_save_end: *mut ::core::ffi::c_char,
6990 pub _markers: *mut _IO_marker,
6991 pub _chain: *mut _IO_FILE,
6992 pub _fileno: ::core::ffi::c_int,
6993 pub _flags2: ::core::ffi::c_int,
6994 pub _old_offset: __off_t,
6995 pub _cur_column: ::core::ffi::c_ushort,
6996 pub _vtable_offset: ::core::ffi::c_schar,
6997 pub _shortbuf: [::core::ffi::c_char; 1usize],
6998 pub _lock: *mut _IO_lock_t,
6999 pub _offset: __off64_t,
7000 pub _codecvt: *mut _IO_codecvt,
7001 pub _wide_data: *mut _IO_wide_data,
7002 pub _freeres_list: *mut _IO_FILE,
7003 pub _freeres_buf: *mut ::core::ffi::c_void,
7004 pub __pad5: usize,
7005 pub _mode: ::core::ffi::c_int,
7006 pub _unused2: [::core::ffi::c_char; 20usize],
7007}
7008#[test]
7009fn bindgen_test_layout__IO_FILE() {
7010 const UNINIT: ::core::mem::MaybeUninit<_IO_FILE> = ::core::mem::MaybeUninit::uninit();
7011 let ptr = UNINIT.as_ptr();
7012 assert_eq!(
7013 ::core::mem::size_of::<_IO_FILE>(),
7014 216usize,
7015 concat!("Size of: ", stringify!(_IO_FILE))
7016 );
7017 assert_eq!(
7018 ::core::mem::align_of::<_IO_FILE>(),
7019 8usize,
7020 concat!("Alignment of ", stringify!(_IO_FILE))
7021 );
7022 assert_eq!(
7023 unsafe { ::core::ptr::addr_of!((*ptr)._flags) as usize - ptr as usize },
7024 0usize,
7025 concat!(
7026 "Offset of field: ",
7027 stringify!(_IO_FILE),
7028 "::",
7029 stringify!(_flags)
7030 )
7031 );
7032 assert_eq!(
7033 unsafe { ::core::ptr::addr_of!((*ptr)._IO_read_ptr) as usize - ptr as usize },
7034 8usize,
7035 concat!(
7036 "Offset of field: ",
7037 stringify!(_IO_FILE),
7038 "::",
7039 stringify!(_IO_read_ptr)
7040 )
7041 );
7042 assert_eq!(
7043 unsafe { ::core::ptr::addr_of!((*ptr)._IO_read_end) as usize - ptr as usize },
7044 16usize,
7045 concat!(
7046 "Offset of field: ",
7047 stringify!(_IO_FILE),
7048 "::",
7049 stringify!(_IO_read_end)
7050 )
7051 );
7052 assert_eq!(
7053 unsafe { ::core::ptr::addr_of!((*ptr)._IO_read_base) as usize - ptr as usize },
7054 24usize,
7055 concat!(
7056 "Offset of field: ",
7057 stringify!(_IO_FILE),
7058 "::",
7059 stringify!(_IO_read_base)
7060 )
7061 );
7062 assert_eq!(
7063 unsafe { ::core::ptr::addr_of!((*ptr)._IO_write_base) as usize - ptr as usize },
7064 32usize,
7065 concat!(
7066 "Offset of field: ",
7067 stringify!(_IO_FILE),
7068 "::",
7069 stringify!(_IO_write_base)
7070 )
7071 );
7072 assert_eq!(
7073 unsafe { ::core::ptr::addr_of!((*ptr)._IO_write_ptr) as usize - ptr as usize },
7074 40usize,
7075 concat!(
7076 "Offset of field: ",
7077 stringify!(_IO_FILE),
7078 "::",
7079 stringify!(_IO_write_ptr)
7080 )
7081 );
7082 assert_eq!(
7083 unsafe { ::core::ptr::addr_of!((*ptr)._IO_write_end) as usize - ptr as usize },
7084 48usize,
7085 concat!(
7086 "Offset of field: ",
7087 stringify!(_IO_FILE),
7088 "::",
7089 stringify!(_IO_write_end)
7090 )
7091 );
7092 assert_eq!(
7093 unsafe { ::core::ptr::addr_of!((*ptr)._IO_buf_base) as usize - ptr as usize },
7094 56usize,
7095 concat!(
7096 "Offset of field: ",
7097 stringify!(_IO_FILE),
7098 "::",
7099 stringify!(_IO_buf_base)
7100 )
7101 );
7102 assert_eq!(
7103 unsafe { ::core::ptr::addr_of!((*ptr)._IO_buf_end) as usize - ptr as usize },
7104 64usize,
7105 concat!(
7106 "Offset of field: ",
7107 stringify!(_IO_FILE),
7108 "::",
7109 stringify!(_IO_buf_end)
7110 )
7111 );
7112 assert_eq!(
7113 unsafe { ::core::ptr::addr_of!((*ptr)._IO_save_base) as usize - ptr as usize },
7114 72usize,
7115 concat!(
7116 "Offset of field: ",
7117 stringify!(_IO_FILE),
7118 "::",
7119 stringify!(_IO_save_base)
7120 )
7121 );
7122 assert_eq!(
7123 unsafe { ::core::ptr::addr_of!((*ptr)._IO_backup_base) as usize - ptr as usize },
7124 80usize,
7125 concat!(
7126 "Offset of field: ",
7127 stringify!(_IO_FILE),
7128 "::",
7129 stringify!(_IO_backup_base)
7130 )
7131 );
7132 assert_eq!(
7133 unsafe { ::core::ptr::addr_of!((*ptr)._IO_save_end) as usize - ptr as usize },
7134 88usize,
7135 concat!(
7136 "Offset of field: ",
7137 stringify!(_IO_FILE),
7138 "::",
7139 stringify!(_IO_save_end)
7140 )
7141 );
7142 assert_eq!(
7143 unsafe { ::core::ptr::addr_of!((*ptr)._markers) as usize - ptr as usize },
7144 96usize,
7145 concat!(
7146 "Offset of field: ",
7147 stringify!(_IO_FILE),
7148 "::",
7149 stringify!(_markers)
7150 )
7151 );
7152 assert_eq!(
7153 unsafe { ::core::ptr::addr_of!((*ptr)._chain) as usize - ptr as usize },
7154 104usize,
7155 concat!(
7156 "Offset of field: ",
7157 stringify!(_IO_FILE),
7158 "::",
7159 stringify!(_chain)
7160 )
7161 );
7162 assert_eq!(
7163 unsafe { ::core::ptr::addr_of!((*ptr)._fileno) as usize - ptr as usize },
7164 112usize,
7165 concat!(
7166 "Offset of field: ",
7167 stringify!(_IO_FILE),
7168 "::",
7169 stringify!(_fileno)
7170 )
7171 );
7172 assert_eq!(
7173 unsafe { ::core::ptr::addr_of!((*ptr)._flags2) as usize - ptr as usize },
7174 116usize,
7175 concat!(
7176 "Offset of field: ",
7177 stringify!(_IO_FILE),
7178 "::",
7179 stringify!(_flags2)
7180 )
7181 );
7182 assert_eq!(
7183 unsafe { ::core::ptr::addr_of!((*ptr)._old_offset) as usize - ptr as usize },
7184 120usize,
7185 concat!(
7186 "Offset of field: ",
7187 stringify!(_IO_FILE),
7188 "::",
7189 stringify!(_old_offset)
7190 )
7191 );
7192 assert_eq!(
7193 unsafe { ::core::ptr::addr_of!((*ptr)._cur_column) as usize - ptr as usize },
7194 128usize,
7195 concat!(
7196 "Offset of field: ",
7197 stringify!(_IO_FILE),
7198 "::",
7199 stringify!(_cur_column)
7200 )
7201 );
7202 assert_eq!(
7203 unsafe { ::core::ptr::addr_of!((*ptr)._vtable_offset) as usize - ptr as usize },
7204 130usize,
7205 concat!(
7206 "Offset of field: ",
7207 stringify!(_IO_FILE),
7208 "::",
7209 stringify!(_vtable_offset)
7210 )
7211 );
7212 assert_eq!(
7213 unsafe { ::core::ptr::addr_of!((*ptr)._shortbuf) as usize - ptr as usize },
7214 131usize,
7215 concat!(
7216 "Offset of field: ",
7217 stringify!(_IO_FILE),
7218 "::",
7219 stringify!(_shortbuf)
7220 )
7221 );
7222 assert_eq!(
7223 unsafe { ::core::ptr::addr_of!((*ptr)._lock) as usize - ptr as usize },
7224 136usize,
7225 concat!(
7226 "Offset of field: ",
7227 stringify!(_IO_FILE),
7228 "::",
7229 stringify!(_lock)
7230 )
7231 );
7232 assert_eq!(
7233 unsafe { ::core::ptr::addr_of!((*ptr)._offset) as usize - ptr as usize },
7234 144usize,
7235 concat!(
7236 "Offset of field: ",
7237 stringify!(_IO_FILE),
7238 "::",
7239 stringify!(_offset)
7240 )
7241 );
7242 assert_eq!(
7243 unsafe { ::core::ptr::addr_of!((*ptr)._codecvt) as usize - ptr as usize },
7244 152usize,
7245 concat!(
7246 "Offset of field: ",
7247 stringify!(_IO_FILE),
7248 "::",
7249 stringify!(_codecvt)
7250 )
7251 );
7252 assert_eq!(
7253 unsafe { ::core::ptr::addr_of!((*ptr)._wide_data) as usize - ptr as usize },
7254 160usize,
7255 concat!(
7256 "Offset of field: ",
7257 stringify!(_IO_FILE),
7258 "::",
7259 stringify!(_wide_data)
7260 )
7261 );
7262 assert_eq!(
7263 unsafe { ::core::ptr::addr_of!((*ptr)._freeres_list) as usize - ptr as usize },
7264 168usize,
7265 concat!(
7266 "Offset of field: ",
7267 stringify!(_IO_FILE),
7268 "::",
7269 stringify!(_freeres_list)
7270 )
7271 );
7272 assert_eq!(
7273 unsafe { ::core::ptr::addr_of!((*ptr)._freeres_buf) as usize - ptr as usize },
7274 176usize,
7275 concat!(
7276 "Offset of field: ",
7277 stringify!(_IO_FILE),
7278 "::",
7279 stringify!(_freeres_buf)
7280 )
7281 );
7282 assert_eq!(
7283 unsafe { ::core::ptr::addr_of!((*ptr).__pad5) as usize - ptr as usize },
7284 184usize,
7285 concat!(
7286 "Offset of field: ",
7287 stringify!(_IO_FILE),
7288 "::",
7289 stringify!(__pad5)
7290 )
7291 );
7292 assert_eq!(
7293 unsafe { ::core::ptr::addr_of!((*ptr)._mode) as usize - ptr as usize },
7294 192usize,
7295 concat!(
7296 "Offset of field: ",
7297 stringify!(_IO_FILE),
7298 "::",
7299 stringify!(_mode)
7300 )
7301 );
7302 assert_eq!(
7303 unsafe { ::core::ptr::addr_of!((*ptr)._unused2) as usize - ptr as usize },
7304 196usize,
7305 concat!(
7306 "Offset of field: ",
7307 stringify!(_IO_FILE),
7308 "::",
7309 stringify!(_unused2)
7310 )
7311 );
7312}
7313pub type fpos_t = __fpos_t;
7314extern "C" {
7315 pub static mut stdin: *mut FILE;
7316}
7317extern "C" {
7318 pub static mut stdout: *mut FILE;
7319}
7320extern "C" {
7321 pub static mut stderr: *mut FILE;
7322}
7323extern "C" {
7324 pub fn remove(__filename: *const ::core::ffi::c_char) -> ::core::ffi::c_int;
7325}
7326extern "C" {
7327 pub fn rename(
7328 __old: *const ::core::ffi::c_char,
7329 __new: *const ::core::ffi::c_char,
7330 ) -> ::core::ffi::c_int;
7331}
7332extern "C" {
7333 pub fn renameat(
7334 __oldfd: ::core::ffi::c_int,
7335 __old: *const ::core::ffi::c_char,
7336 __newfd: ::core::ffi::c_int,
7337 __new: *const ::core::ffi::c_char,
7338 ) -> ::core::ffi::c_int;
7339}
7340extern "C" {
7341 pub fn fclose(__stream: *mut FILE) -> ::core::ffi::c_int;
7342}
7343extern "C" {
7344 pub fn tmpfile() -> *mut FILE;
7345}
7346extern "C" {
7347 pub fn tmpnam(arg1: *mut ::core::ffi::c_char) -> *mut ::core::ffi::c_char;
7348}
7349extern "C" {
7350 pub fn tmpnam_r(__s: *mut ::core::ffi::c_char) -> *mut ::core::ffi::c_char;
7351}
7352extern "C" {
7353 pub fn tempnam(
7354 __dir: *const ::core::ffi::c_char,
7355 __pfx: *const ::core::ffi::c_char,
7356 ) -> *mut ::core::ffi::c_char;
7357}
7358extern "C" {
7359 pub fn fflush(__stream: *mut FILE) -> ::core::ffi::c_int;
7360}
7361extern "C" {
7362 pub fn fflush_unlocked(__stream: *mut FILE) -> ::core::ffi::c_int;
7363}
7364extern "C" {
7365 pub fn fopen(
7366 __filename: *const ::core::ffi::c_char,
7367 __modes: *const ::core::ffi::c_char,
7368 ) -> *mut FILE;
7369}
7370extern "C" {
7371 pub fn freopen(
7372 __filename: *const ::core::ffi::c_char,
7373 __modes: *const ::core::ffi::c_char,
7374 __stream: *mut FILE,
7375 ) -> *mut FILE;
7376}
7377extern "C" {
7378 pub fn fdopen(__fd: ::core::ffi::c_int, __modes: *const ::core::ffi::c_char) -> *mut FILE;
7379}
7380extern "C" {
7381 pub fn fmemopen(
7382 __s: *mut ::core::ffi::c_void,
7383 __len: usize,
7384 __modes: *const ::core::ffi::c_char,
7385 ) -> *mut FILE;
7386}
7387extern "C" {
7388 pub fn open_memstream(
7389 __bufloc: *mut *mut ::core::ffi::c_char,
7390 __sizeloc: *mut usize,
7391 ) -> *mut FILE;
7392}
7393extern "C" {
7394 pub fn setbuf(__stream: *mut FILE, __buf: *mut ::core::ffi::c_char);
7395}
7396extern "C" {
7397 pub fn setvbuf(
7398 __stream: *mut FILE,
7399 __buf: *mut ::core::ffi::c_char,
7400 __modes: ::core::ffi::c_int,
7401 __n: usize,
7402 ) -> ::core::ffi::c_int;
7403}
7404extern "C" {
7405 pub fn setbuffer(__stream: *mut FILE, __buf: *mut ::core::ffi::c_char, __size: usize);
7406}
7407extern "C" {
7408 pub fn setlinebuf(__stream: *mut FILE);
7409}
7410extern "C" {
7411 pub fn fprintf(
7412 __stream: *mut FILE,
7413 __format: *const ::core::ffi::c_char,
7414 ...
7415 ) -> ::core::ffi::c_int;
7416}
7417extern "C" {
7418 pub fn printf(__format: *const ::core::ffi::c_char, ...) -> ::core::ffi::c_int;
7419}
7420extern "C" {
7421 pub fn sprintf(
7422 __s: *mut ::core::ffi::c_char,
7423 __format: *const ::core::ffi::c_char,
7424 ...
7425 ) -> ::core::ffi::c_int;
7426}
7427extern "C" {
7428 pub fn vfprintf(
7429 __s: *mut FILE,
7430 __format: *const ::core::ffi::c_char,
7431 __arg: *mut __va_list_tag,
7432 ) -> ::core::ffi::c_int;
7433}
7434extern "C" {
7435 pub fn vprintf(
7436 __format: *const ::core::ffi::c_char,
7437 __arg: *mut __va_list_tag,
7438 ) -> ::core::ffi::c_int;
7439}
7440extern "C" {
7441 pub fn vsprintf(
7442 __s: *mut ::core::ffi::c_char,
7443 __format: *const ::core::ffi::c_char,
7444 __arg: *mut __va_list_tag,
7445 ) -> ::core::ffi::c_int;
7446}
7447extern "C" {
7448 pub fn snprintf(
7449 __s: *mut ::core::ffi::c_char,
7450 __maxlen: ::core::ffi::c_ulong,
7451 __format: *const ::core::ffi::c_char,
7452 ...
7453 ) -> ::core::ffi::c_int;
7454}
7455extern "C" {
7456 pub fn vsnprintf(
7457 __s: *mut ::core::ffi::c_char,
7458 __maxlen: ::core::ffi::c_ulong,
7459 __format: *const ::core::ffi::c_char,
7460 __arg: *mut __va_list_tag,
7461 ) -> ::core::ffi::c_int;
7462}
7463extern "C" {
7464 pub fn vdprintf(
7465 __fd: ::core::ffi::c_int,
7466 __fmt: *const ::core::ffi::c_char,
7467 __arg: *mut __va_list_tag,
7468 ) -> ::core::ffi::c_int;
7469}
7470extern "C" {
7471 pub fn dprintf(
7472 __fd: ::core::ffi::c_int,
7473 __fmt: *const ::core::ffi::c_char,
7474 ...
7475 ) -> ::core::ffi::c_int;
7476}
7477extern "C" {
7478 pub fn fscanf(
7479 __stream: *mut FILE,
7480 __format: *const ::core::ffi::c_char,
7481 ...
7482 ) -> ::core::ffi::c_int;
7483}
7484extern "C" {
7485 pub fn scanf(__format: *const ::core::ffi::c_char, ...) -> ::core::ffi::c_int;
7486}
7487extern "C" {
7488 pub fn sscanf(
7489 __s: *const ::core::ffi::c_char,
7490 __format: *const ::core::ffi::c_char,
7491 ...
7492 ) -> ::core::ffi::c_int;
7493}
7494extern "C" {
7495 #[link_name = "\u{1}__isoc99_fscanf"]
7496 pub fn fscanf1(
7497 __stream: *mut FILE,
7498 __format: *const ::core::ffi::c_char,
7499 ...
7500 ) -> ::core::ffi::c_int;
7501}
7502extern "C" {
7503 #[link_name = "\u{1}__isoc99_scanf"]
7504 pub fn scanf1(__format: *const ::core::ffi::c_char, ...) -> ::core::ffi::c_int;
7505}
7506extern "C" {
7507 #[link_name = "\u{1}__isoc99_sscanf"]
7508 pub fn sscanf1(
7509 __s: *const ::core::ffi::c_char,
7510 __format: *const ::core::ffi::c_char,
7511 ...
7512 ) -> ::core::ffi::c_int;
7513}
7514extern "C" {
7515 pub fn vfscanf(
7516 __s: *mut FILE,
7517 __format: *const ::core::ffi::c_char,
7518 __arg: *mut __va_list_tag,
7519 ) -> ::core::ffi::c_int;
7520}
7521extern "C" {
7522 pub fn vscanf(
7523 __format: *const ::core::ffi::c_char,
7524 __arg: *mut __va_list_tag,
7525 ) -> ::core::ffi::c_int;
7526}
7527extern "C" {
7528 pub fn vsscanf(
7529 __s: *const ::core::ffi::c_char,
7530 __format: *const ::core::ffi::c_char,
7531 __arg: *mut __va_list_tag,
7532 ) -> ::core::ffi::c_int;
7533}
7534extern "C" {
7535 #[link_name = "\u{1}__isoc99_vfscanf"]
7536 pub fn vfscanf1(
7537 __s: *mut FILE,
7538 __format: *const ::core::ffi::c_char,
7539 __arg: *mut __va_list_tag,
7540 ) -> ::core::ffi::c_int;
7541}
7542extern "C" {
7543 #[link_name = "\u{1}__isoc99_vscanf"]
7544 pub fn vscanf1(
7545 __format: *const ::core::ffi::c_char,
7546 __arg: *mut __va_list_tag,
7547 ) -> ::core::ffi::c_int;
7548}
7549extern "C" {
7550 #[link_name = "\u{1}__isoc99_vsscanf"]
7551 pub fn vsscanf1(
7552 __s: *const ::core::ffi::c_char,
7553 __format: *const ::core::ffi::c_char,
7554 __arg: *mut __va_list_tag,
7555 ) -> ::core::ffi::c_int;
7556}
7557extern "C" {
7558 pub fn fgetc(__stream: *mut FILE) -> ::core::ffi::c_int;
7559}
7560extern "C" {
7561 pub fn getc(__stream: *mut FILE) -> ::core::ffi::c_int;
7562}
7563extern "C" {
7564 pub fn getchar() -> ::core::ffi::c_int;
7565}
7566extern "C" {
7567 pub fn getc_unlocked(__stream: *mut FILE) -> ::core::ffi::c_int;
7568}
7569extern "C" {
7570 pub fn getchar_unlocked() -> ::core::ffi::c_int;
7571}
7572extern "C" {
7573 pub fn fgetc_unlocked(__stream: *mut FILE) -> ::core::ffi::c_int;
7574}
7575extern "C" {
7576 pub fn fputc(__c: ::core::ffi::c_int, __stream: *mut FILE) -> ::core::ffi::c_int;
7577}
7578extern "C" {
7579 pub fn putc(__c: ::core::ffi::c_int, __stream: *mut FILE) -> ::core::ffi::c_int;
7580}
7581extern "C" {
7582 pub fn putchar(__c: ::core::ffi::c_int) -> ::core::ffi::c_int;
7583}
7584extern "C" {
7585 pub fn fputc_unlocked(__c: ::core::ffi::c_int, __stream: *mut FILE) -> ::core::ffi::c_int;
7586}
7587extern "C" {
7588 pub fn putc_unlocked(__c: ::core::ffi::c_int, __stream: *mut FILE) -> ::core::ffi::c_int;
7589}
7590extern "C" {
7591 pub fn putchar_unlocked(__c: ::core::ffi::c_int) -> ::core::ffi::c_int;
7592}
7593extern "C" {
7594 pub fn getw(__stream: *mut FILE) -> ::core::ffi::c_int;
7595}
7596extern "C" {
7597 pub fn putw(__w: ::core::ffi::c_int, __stream: *mut FILE) -> ::core::ffi::c_int;
7598}
7599extern "C" {
7600 pub fn fgets(
7601 __s: *mut ::core::ffi::c_char,
7602 __n: ::core::ffi::c_int,
7603 __stream: *mut FILE,
7604 ) -> *mut ::core::ffi::c_char;
7605}
7606extern "C" {
7607 pub fn __getdelim(
7608 __lineptr: *mut *mut ::core::ffi::c_char,
7609 __n: *mut usize,
7610 __delimiter: ::core::ffi::c_int,
7611 __stream: *mut FILE,
7612 ) -> __ssize_t;
7613}
7614extern "C" {
7615 pub fn getdelim(
7616 __lineptr: *mut *mut ::core::ffi::c_char,
7617 __n: *mut usize,
7618 __delimiter: ::core::ffi::c_int,
7619 __stream: *mut FILE,
7620 ) -> __ssize_t;
7621}
7622extern "C" {
7623 pub fn getline(
7624 __lineptr: *mut *mut ::core::ffi::c_char,
7625 __n: *mut usize,
7626 __stream: *mut FILE,
7627 ) -> __ssize_t;
7628}
7629extern "C" {
7630 pub fn fputs(__s: *const ::core::ffi::c_char, __stream: *mut FILE) -> ::core::ffi::c_int;
7631}
7632extern "C" {
7633 pub fn puts(__s: *const ::core::ffi::c_char) -> ::core::ffi::c_int;
7634}
7635extern "C" {
7636 pub fn ungetc(__c: ::core::ffi::c_int, __stream: *mut FILE) -> ::core::ffi::c_int;
7637}
7638extern "C" {
7639 pub fn fread(
7640 __ptr: *mut ::core::ffi::c_void,
7641 __size: ::core::ffi::c_ulong,
7642 __n: ::core::ffi::c_ulong,
7643 __stream: *mut FILE,
7644 ) -> ::core::ffi::c_ulong;
7645}
7646extern "C" {
7647 pub fn fwrite(
7648 __ptr: *const ::core::ffi::c_void,
7649 __size: ::core::ffi::c_ulong,
7650 __n: ::core::ffi::c_ulong,
7651 __s: *mut FILE,
7652 ) -> ::core::ffi::c_ulong;
7653}
7654extern "C" {
7655 pub fn fread_unlocked(
7656 __ptr: *mut ::core::ffi::c_void,
7657 __size: usize,
7658 __n: usize,
7659 __stream: *mut FILE,
7660 ) -> usize;
7661}
7662extern "C" {
7663 pub fn fwrite_unlocked(
7664 __ptr: *const ::core::ffi::c_void,
7665 __size: usize,
7666 __n: usize,
7667 __stream: *mut FILE,
7668 ) -> usize;
7669}
7670extern "C" {
7671 pub fn fseek(
7672 __stream: *mut FILE,
7673 __off: ::core::ffi::c_long,
7674 __whence: ::core::ffi::c_int,
7675 ) -> ::core::ffi::c_int;
7676}
7677extern "C" {
7678 pub fn ftell(__stream: *mut FILE) -> ::core::ffi::c_long;
7679}
7680extern "C" {
7681 pub fn rewind(__stream: *mut FILE);
7682}
7683extern "C" {
7684 pub fn fseeko(
7685 __stream: *mut FILE,
7686 __off: __off_t,
7687 __whence: ::core::ffi::c_int,
7688 ) -> ::core::ffi::c_int;
7689}
7690extern "C" {
7691 pub fn ftello(__stream: *mut FILE) -> __off_t;
7692}
7693extern "C" {
7694 pub fn fgetpos(__stream: *mut FILE, __pos: *mut fpos_t) -> ::core::ffi::c_int;
7695}
7696extern "C" {
7697 pub fn fsetpos(__stream: *mut FILE, __pos: *const fpos_t) -> ::core::ffi::c_int;
7698}
7699extern "C" {
7700 pub fn clearerr(__stream: *mut FILE);
7701}
7702extern "C" {
7703 pub fn feof(__stream: *mut FILE) -> ::core::ffi::c_int;
7704}
7705extern "C" {
7706 pub fn ferror(__stream: *mut FILE) -> ::core::ffi::c_int;
7707}
7708extern "C" {
7709 pub fn clearerr_unlocked(__stream: *mut FILE);
7710}
7711extern "C" {
7712 pub fn feof_unlocked(__stream: *mut FILE) -> ::core::ffi::c_int;
7713}
7714extern "C" {
7715 pub fn ferror_unlocked(__stream: *mut FILE) -> ::core::ffi::c_int;
7716}
7717extern "C" {
7718 pub fn perror(__s: *const ::core::ffi::c_char);
7719}
7720extern "C" {
7721 pub fn fileno(__stream: *mut FILE) -> ::core::ffi::c_int;
7722}
7723extern "C" {
7724 pub fn fileno_unlocked(__stream: *mut FILE) -> ::core::ffi::c_int;
7725}
7726extern "C" {
7727 pub fn pclose(__stream: *mut FILE) -> ::core::ffi::c_int;
7728}
7729extern "C" {
7730 pub fn popen(
7731 __command: *const ::core::ffi::c_char,
7732 __modes: *const ::core::ffi::c_char,
7733 ) -> *mut FILE;
7734}
7735extern "C" {
7736 pub fn ctermid(__s: *mut ::core::ffi::c_char) -> *mut ::core::ffi::c_char;
7737}
7738extern "C" {
7739 pub fn flockfile(__stream: *mut FILE);
7740}
7741extern "C" {
7742 pub fn ftrylockfile(__stream: *mut FILE) -> ::core::ffi::c_int;
7743}
7744extern "C" {
7745 pub fn funlockfile(__stream: *mut FILE);
7746}
7747extern "C" {
7748 pub fn __uflow(arg1: *mut FILE) -> ::core::ffi::c_int;
7749}
7750extern "C" {
7751 pub fn __overflow(arg1: *mut FILE, arg2: ::core::ffi::c_int) -> ::core::ffi::c_int;
7752}
7753pub type __builtin_va_list = [__va_list_tag; 1usize];
7754#[repr(C)]
7755#[derive(Debug, Copy, Clone)]
7756pub struct __va_list_tag {
7757 pub gp_offset: ::core::ffi::c_uint,
7758 pub fp_offset: ::core::ffi::c_uint,
7759 pub overflow_arg_area: *mut ::core::ffi::c_void,
7760 pub reg_save_area: *mut ::core::ffi::c_void,
7761}
7762#[test]
7763fn bindgen_test_layout___va_list_tag() {
7764 const UNINIT: ::core::mem::MaybeUninit<__va_list_tag> = ::core::mem::MaybeUninit::uninit();
7765 let ptr = UNINIT.as_ptr();
7766 assert_eq!(
7767 ::core::mem::size_of::<__va_list_tag>(),
7768 24usize,
7769 concat!("Size of: ", stringify!(__va_list_tag))
7770 );
7771 assert_eq!(
7772 ::core::mem::align_of::<__va_list_tag>(),
7773 8usize,
7774 concat!("Alignment of ", stringify!(__va_list_tag))
7775 );
7776 assert_eq!(
7777 unsafe { ::core::ptr::addr_of!((*ptr).gp_offset) as usize - ptr as usize },
7778 0usize,
7779 concat!(
7780 "Offset of field: ",
7781 stringify!(__va_list_tag),
7782 "::",
7783 stringify!(gp_offset)
7784 )
7785 );
7786 assert_eq!(
7787 unsafe { ::core::ptr::addr_of!((*ptr).fp_offset) as usize - ptr as usize },
7788 4usize,
7789 concat!(
7790 "Offset of field: ",
7791 stringify!(__va_list_tag),
7792 "::",
7793 stringify!(fp_offset)
7794 )
7795 );
7796 assert_eq!(
7797 unsafe { ::core::ptr::addr_of!((*ptr).overflow_arg_area) as usize - ptr as usize },
7798 8usize,
7799 concat!(
7800 "Offset of field: ",
7801 stringify!(__va_list_tag),
7802 "::",
7803 stringify!(overflow_arg_area)
7804 )
7805 );
7806 assert_eq!(
7807 unsafe { ::core::ptr::addr_of!((*ptr).reg_save_area) as usize - ptr as usize },
7808 16usize,
7809 concat!(
7810 "Offset of field: ",
7811 stringify!(__va_list_tag),
7812 "::",
7813 stringify!(reg_save_area)
7814 )
7815 );
7816}
7817#[doc = " Retrieves asynchronous kernel.\n\n If the `async_kernel` field is nullptr, it means the operation described\n by this TfLiteRegistration object does not support asynchronous execution.\n Otherwise, the function that the field points to should only be called for\n delegate kernel nodes, i.e. `node` should be a delegate kernel node\n created by applying a delegate. If the function returns nullptr, that\n means that the underlying delegate does not support asynchronous execution\n for this `node`."]
7818#[repr(C)]
7819#[derive(Debug, Copy, Clone)]
7820pub struct TfLiteAsyncKernel {
7821 pub _address: u8,
7822}