diff --git a/sys/src/bindings.rs b/sys/src/bindings.rs index 1ad5245..34ab674 100644 --- a/sys/src/bindings.rs +++ b/sys/src/bindings.rs @@ -1,4 +1,4 @@ -/* automatically generated by rust-bindgen 0.69.4 */ +/* automatically generated by rust-bindgen 0.70.1 */ pub const __bool_true_false_are_defined: u32 = 1; pub const true_: u32 = 1; @@ -6,7 +6,7 @@ pub const false_: u32 = 0; pub const _STDINT_H: u32 = 1; pub const _FEATURES_H: u32 = 1; pub const _DEFAULT_SOURCE: u32 = 1; -pub const __GLIBC_USE_ISOC2X: u32 = 0; +pub const __GLIBC_USE_ISOC23: u32 = 0; pub const __USE_ISOC11: u32 = 1; pub const __USE_ISOC99: u32 = 1; pub const __USE_ISOC95: u32 = 1; @@ -24,12 +24,13 @@ pub const __WORDSIZE: u32 = 64; pub const __WORDSIZE_TIME64_COMPAT32: u32 = 1; pub const __SYSCALL_WORDSIZE: u32 = 64; pub const __TIMESIZE: u32 = 64; +pub const __USE_TIME_BITS64: u32 = 1; pub const __USE_MISC: u32 = 1; pub const __USE_ATFILE: u32 = 1; pub const __USE_FORTIFY_LEVEL: u32 = 0; pub const __GLIBC_USE_DEPRECATED_GETS: u32 = 0; pub const __GLIBC_USE_DEPRECATED_SCANF: u32 = 0; -pub const __GLIBC_USE_C2X_STRTOL: u32 = 0; +pub const __GLIBC_USE_C23_STRTOL: u32 = 0; pub const _STDC_PREDEF_H: u32 = 1; pub const __STDC_IEC_559__: u32 = 1; pub const __STDC_IEC_60559_BFP__: u32 = 201404; @@ -38,17 +39,17 @@ pub const __STDC_IEC_60559_COMPLEX__: u32 = 201404; pub const __STDC_ISO_10646__: u32 = 201706; pub const __GNU_LIBRARY__: u32 = 6; pub const __GLIBC__: u32 = 2; -pub const __GLIBC_MINOR__: u32 = 39; +pub const __GLIBC_MINOR__: u32 = 40; pub const _SYS_CDEFS_H: u32 = 1; pub const __glibc_c99_flexarr_available: u32 = 1; pub const __LDOUBLE_REDIRECTS_TO_FLOAT128_ABI: u32 = 0; pub const __HAVE_GENERIC_SELECTION: u32 = 1; pub const __GLIBC_USE_LIB_EXT2: u32 = 0; pub const __GLIBC_USE_IEC_60559_BFP_EXT: u32 = 0; -pub const __GLIBC_USE_IEC_60559_BFP_EXT_C2X: u32 = 0; +pub const __GLIBC_USE_IEC_60559_BFP_EXT_C23: u32 = 0; pub const __GLIBC_USE_IEC_60559_EXT: u32 = 0; pub const __GLIBC_USE_IEC_60559_FUNCS_EXT: u32 = 0; -pub const __GLIBC_USE_IEC_60559_FUNCS_EXT_C2X: u32 = 0; +pub const __GLIBC_USE_IEC_60559_FUNCS_EXT_C23: u32 = 0; pub const __GLIBC_USE_IEC_60559_TYPES_EXT: u32 = 0; pub const _BITS_TYPES_H: u32 = 1; pub const _BITS_TYPESIZES_H: u32 = 1; @@ -148,7 +149,6 @@ pub const GGML_QNT_VERSION: u32 = 2; pub const GGML_QNT_VERSION_FACTOR: u32 = 1000; pub const GGML_MAX_DIMS: u32 = 4; pub const GGML_MAX_PARAMS: u32 = 2048; -pub const GGML_MAX_CONTEXTS: u32 = 64; pub const GGML_MAX_SRC: u32 = 10; pub const GGML_MAX_N_THREADS: u32 = 512; pub const GGML_MAX_OP_PARAMS: u32 = 64; @@ -177,41 +177,15 @@ pub struct max_align_t { pub __bindgen_padding_0: u64, pub __clang_max_align_nonce2: u128, } -#[test] -fn bindgen_test_layout_max_align_t() { - const UNINIT: ::std::mem::MaybeUninit = ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::(), - 32usize, - concat!("Size of: ", stringify!(max_align_t)) - ); - assert_eq!( - ::std::mem::align_of::(), - 16usize, - concat!("Alignment of ", stringify!(max_align_t)) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).__clang_max_align_nonce1) as usize - ptr as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(max_align_t), - "::", - stringify!(__clang_max_align_nonce1) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).__clang_max_align_nonce2) as usize - ptr as usize }, - 16usize, - concat!( - "Offset of field: ", - stringify!(max_align_t), - "::", - stringify!(__clang_max_align_nonce2) - ) - ); -} +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of max_align_t"][::std::mem::size_of::() - 32usize]; + ["Alignment of max_align_t"][::std::mem::align_of::() - 16usize]; + ["Offset of field: max_align_t::__clang_max_align_nonce1"] + [::std::mem::offset_of!(max_align_t, __clang_max_align_nonce1) - 0usize]; + ["Offset of field: max_align_t::__clang_max_align_nonce2"] + [::std::mem::offset_of!(max_align_t, __clang_max_align_nonce2) - 16usize]; +}; pub type __u_char = ::std::os::raw::c_uchar; pub type __u_short = ::std::os::raw::c_ushort; pub type __u_int = ::std::os::raw::c_uint; @@ -251,31 +225,12 @@ pub type __pid_t = ::std::os::raw::c_int; pub struct __fsid_t { pub __val: [::std::os::raw::c_int; 2usize], } -#[test] -fn bindgen_test_layout___fsid_t() { - const UNINIT: ::std::mem::MaybeUninit<__fsid_t> = ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::<__fsid_t>(), - 8usize, - concat!("Size of: ", stringify!(__fsid_t)) - ); - assert_eq!( - ::std::mem::align_of::<__fsid_t>(), - 4usize, - concat!("Alignment of ", stringify!(__fsid_t)) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).__val) as usize - ptr as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(__fsid_t), - "::", - stringify!(__val) - ) - ); -} +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of __fsid_t"][::std::mem::size_of::<__fsid_t>() - 8usize]; + ["Alignment of __fsid_t"][::std::mem::align_of::<__fsid_t>() - 4usize]; + ["Offset of field: __fsid_t::__val"][::std::mem::offset_of!(__fsid_t, __val) - 0usize]; +}; pub type __clock_t = ::std::os::raw::c_long; pub type __rlim_t = ::std::os::raw::c_ulong; pub type __rlim64_t = ::std::os::raw::c_ulong; @@ -335,118 +290,39 @@ pub union __mbstate_t__bindgen_ty_1 { pub __wch: ::std::os::raw::c_uint, pub __wchb: [::std::os::raw::c_char; 4usize], } -#[test] -fn bindgen_test_layout___mbstate_t__bindgen_ty_1() { - const UNINIT: ::std::mem::MaybeUninit<__mbstate_t__bindgen_ty_1> = - ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::<__mbstate_t__bindgen_ty_1>(), - 4usize, - concat!("Size of: ", stringify!(__mbstate_t__bindgen_ty_1)) - ); - assert_eq!( - ::std::mem::align_of::<__mbstate_t__bindgen_ty_1>(), - 4usize, - concat!("Alignment of ", stringify!(__mbstate_t__bindgen_ty_1)) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).__wch) as usize - ptr as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(__mbstate_t__bindgen_ty_1), - "::", - stringify!(__wch) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).__wchb) as usize - ptr as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(__mbstate_t__bindgen_ty_1), - "::", - stringify!(__wchb) - ) - ); -} -#[test] -fn bindgen_test_layout___mbstate_t() { - const UNINIT: ::std::mem::MaybeUninit<__mbstate_t> = ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::<__mbstate_t>(), - 8usize, - concat!("Size of: ", stringify!(__mbstate_t)) - ); - assert_eq!( - ::std::mem::align_of::<__mbstate_t>(), - 4usize, - concat!("Alignment of ", stringify!(__mbstate_t)) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).__count) as usize - ptr as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(__mbstate_t), - "::", - stringify!(__count) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).__value) as usize - ptr as usize }, - 4usize, - concat!( - "Offset of field: ", - stringify!(__mbstate_t), - "::", - stringify!(__value) - ) - ); -} +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of __mbstate_t__bindgen_ty_1"] + [::std::mem::size_of::<__mbstate_t__bindgen_ty_1>() - 4usize]; + ["Alignment of __mbstate_t__bindgen_ty_1"] + [::std::mem::align_of::<__mbstate_t__bindgen_ty_1>() - 4usize]; + ["Offset of field: __mbstate_t__bindgen_ty_1::__wch"] + [::std::mem::offset_of!(__mbstate_t__bindgen_ty_1, __wch) - 0usize]; + ["Offset of field: __mbstate_t__bindgen_ty_1::__wchb"] + [::std::mem::offset_of!(__mbstate_t__bindgen_ty_1, __wchb) - 0usize]; +}; +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of __mbstate_t"][::std::mem::size_of::<__mbstate_t>() - 8usize]; + ["Alignment of __mbstate_t"][::std::mem::align_of::<__mbstate_t>() - 4usize]; + ["Offset of field: __mbstate_t::__count"] + [::std::mem::offset_of!(__mbstate_t, __count) - 0usize]; + ["Offset of field: __mbstate_t::__value"] + [::std::mem::offset_of!(__mbstate_t, __value) - 4usize]; +}; #[repr(C)] #[derive(Copy, Clone)] pub struct _G_fpos_t { pub __pos: __off_t, pub __state: __mbstate_t, } -#[test] -fn bindgen_test_layout__G_fpos_t() { - const UNINIT: ::std::mem::MaybeUninit<_G_fpos_t> = ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::<_G_fpos_t>(), - 16usize, - concat!("Size of: ", stringify!(_G_fpos_t)) - ); - assert_eq!( - ::std::mem::align_of::<_G_fpos_t>(), - 8usize, - concat!("Alignment of ", stringify!(_G_fpos_t)) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).__pos) as usize - ptr as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(_G_fpos_t), - "::", - stringify!(__pos) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).__state) as usize - ptr as usize }, - 8usize, - concat!( - "Offset of field: ", - stringify!(_G_fpos_t), - "::", - stringify!(__state) - ) - ); -} +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of _G_fpos_t"][::std::mem::size_of::<_G_fpos_t>() - 16usize]; + ["Alignment of _G_fpos_t"][::std::mem::align_of::<_G_fpos_t>() - 8usize]; + ["Offset of field: _G_fpos_t::__pos"][::std::mem::offset_of!(_G_fpos_t, __pos) - 0usize]; + ["Offset of field: _G_fpos_t::__state"][::std::mem::offset_of!(_G_fpos_t, __state) - 8usize]; +}; pub type __fpos_t = _G_fpos_t; #[repr(C)] #[derive(Copy, Clone)] @@ -454,41 +330,14 @@ pub struct _G_fpos64_t { pub __pos: __off64_t, pub __state: __mbstate_t, } -#[test] -fn bindgen_test_layout__G_fpos64_t() { - const UNINIT: ::std::mem::MaybeUninit<_G_fpos64_t> = ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::<_G_fpos64_t>(), - 16usize, - concat!("Size of: ", stringify!(_G_fpos64_t)) - ); - assert_eq!( - ::std::mem::align_of::<_G_fpos64_t>(), - 8usize, - concat!("Alignment of ", stringify!(_G_fpos64_t)) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).__pos) as usize - ptr as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(_G_fpos64_t), - "::", - stringify!(__pos) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).__state) as usize - ptr as usize }, - 8usize, - concat!( - "Offset of field: ", - stringify!(_G_fpos64_t), - "::", - stringify!(__state) - ) - ); -} +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of _G_fpos64_t"][::std::mem::size_of::<_G_fpos64_t>() - 16usize]; + ["Alignment of _G_fpos64_t"][::std::mem::align_of::<_G_fpos64_t>() - 8usize]; + ["Offset of field: _G_fpos64_t::__pos"][::std::mem::offset_of!(_G_fpos64_t, __pos) - 0usize]; + ["Offset of field: _G_fpos64_t::__state"] + [::std::mem::offset_of!(_G_fpos64_t, __state) - 8usize]; +}; pub type __fpos64_t = _G_fpos64_t; pub type __FILE = _IO_FILE; pub type FILE = _IO_FILE; @@ -537,315 +386,63 @@ pub struct _IO_FILE { pub _wide_data: *mut _IO_wide_data, pub _freeres_list: *mut _IO_FILE, pub _freeres_buf: *mut ::std::os::raw::c_void, - pub __pad5: usize, + pub _prevchain: *mut *mut _IO_FILE, pub _mode: ::std::os::raw::c_int, pub _unused2: [::std::os::raw::c_char; 20usize], } -#[test] -fn bindgen_test_layout__IO_FILE() { - const UNINIT: ::std::mem::MaybeUninit<_IO_FILE> = ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::<_IO_FILE>(), - 216usize, - concat!("Size of: ", stringify!(_IO_FILE)) - ); - assert_eq!( - ::std::mem::align_of::<_IO_FILE>(), - 8usize, - concat!("Alignment of ", stringify!(_IO_FILE)) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr)._flags) as usize - ptr as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(_IO_FILE), - "::", - stringify!(_flags) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr)._IO_read_ptr) as usize - ptr as usize }, - 8usize, - concat!( - "Offset of field: ", - stringify!(_IO_FILE), - "::", - stringify!(_IO_read_ptr) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr)._IO_read_end) as usize - ptr as usize }, - 16usize, - concat!( - "Offset of field: ", - stringify!(_IO_FILE), - "::", - stringify!(_IO_read_end) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr)._IO_read_base) as usize - ptr as usize }, - 24usize, - concat!( - "Offset of field: ", - stringify!(_IO_FILE), - "::", - stringify!(_IO_read_base) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr)._IO_write_base) as usize - ptr as usize }, - 32usize, - concat!( - "Offset of field: ", - stringify!(_IO_FILE), - "::", - stringify!(_IO_write_base) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr)._IO_write_ptr) as usize - ptr as usize }, - 40usize, - concat!( - "Offset of field: ", - stringify!(_IO_FILE), - "::", - stringify!(_IO_write_ptr) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr)._IO_write_end) as usize - ptr as usize }, - 48usize, - concat!( - "Offset of field: ", - stringify!(_IO_FILE), - "::", - stringify!(_IO_write_end) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr)._IO_buf_base) as usize - ptr as usize }, - 56usize, - concat!( - "Offset of field: ", - stringify!(_IO_FILE), - "::", - stringify!(_IO_buf_base) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr)._IO_buf_end) as usize - ptr as usize }, - 64usize, - concat!( - "Offset of field: ", - stringify!(_IO_FILE), - "::", - stringify!(_IO_buf_end) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr)._IO_save_base) as usize - ptr as usize }, - 72usize, - concat!( - "Offset of field: ", - stringify!(_IO_FILE), - "::", - stringify!(_IO_save_base) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr)._IO_backup_base) as usize - ptr as usize }, - 80usize, - concat!( - "Offset of field: ", - stringify!(_IO_FILE), - "::", - stringify!(_IO_backup_base) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr)._IO_save_end) as usize - ptr as usize }, - 88usize, - concat!( - "Offset of field: ", - stringify!(_IO_FILE), - "::", - stringify!(_IO_save_end) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr)._markers) as usize - ptr as usize }, - 96usize, - concat!( - "Offset of field: ", - stringify!(_IO_FILE), - "::", - stringify!(_markers) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr)._chain) as usize - ptr as usize }, - 104usize, - concat!( - "Offset of field: ", - stringify!(_IO_FILE), - "::", - stringify!(_chain) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr)._fileno) as usize - ptr as usize }, - 112usize, - concat!( - "Offset of field: ", - stringify!(_IO_FILE), - "::", - stringify!(_fileno) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr)._flags2) as usize - ptr as usize }, - 116usize, - concat!( - "Offset of field: ", - stringify!(_IO_FILE), - "::", - stringify!(_flags2) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr)._old_offset) as usize - ptr as usize }, - 120usize, - concat!( - "Offset of field: ", - stringify!(_IO_FILE), - "::", - stringify!(_old_offset) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr)._cur_column) as usize - ptr as usize }, - 128usize, - concat!( - "Offset of field: ", - stringify!(_IO_FILE), - "::", - stringify!(_cur_column) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr)._vtable_offset) as usize - ptr as usize }, - 130usize, - concat!( - "Offset of field: ", - stringify!(_IO_FILE), - "::", - stringify!(_vtable_offset) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr)._shortbuf) as usize - ptr as usize }, - 131usize, - concat!( - "Offset of field: ", - stringify!(_IO_FILE), - "::", - stringify!(_shortbuf) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr)._lock) as usize - ptr as usize }, - 136usize, - concat!( - "Offset of field: ", - stringify!(_IO_FILE), - "::", - stringify!(_lock) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr)._offset) as usize - ptr as usize }, - 144usize, - concat!( - "Offset of field: ", - stringify!(_IO_FILE), - "::", - stringify!(_offset) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr)._codecvt) as usize - ptr as usize }, - 152usize, - concat!( - "Offset of field: ", - stringify!(_IO_FILE), - "::", - stringify!(_codecvt) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr)._wide_data) as usize - ptr as usize }, - 160usize, - concat!( - "Offset of field: ", - stringify!(_IO_FILE), - "::", - stringify!(_wide_data) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr)._freeres_list) as usize - ptr as usize }, - 168usize, - concat!( - "Offset of field: ", - stringify!(_IO_FILE), - "::", - stringify!(_freeres_list) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr)._freeres_buf) as usize - ptr as usize }, - 176usize, - concat!( - "Offset of field: ", - stringify!(_IO_FILE), - "::", - stringify!(_freeres_buf) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).__pad5) as usize - ptr as usize }, - 184usize, - concat!( - "Offset of field: ", - stringify!(_IO_FILE), - "::", - stringify!(__pad5) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr)._mode) as usize - ptr as usize }, - 192usize, - concat!( - "Offset of field: ", - stringify!(_IO_FILE), - "::", - stringify!(_mode) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr)._unused2) as usize - ptr as usize }, - 196usize, - concat!( - "Offset of field: ", - stringify!(_IO_FILE), - "::", - stringify!(_unused2) - ) - ); -} +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of _IO_FILE"][::std::mem::size_of::<_IO_FILE>() - 216usize]; + ["Alignment of _IO_FILE"][::std::mem::align_of::<_IO_FILE>() - 8usize]; + ["Offset of field: _IO_FILE::_flags"][::std::mem::offset_of!(_IO_FILE, _flags) - 0usize]; + ["Offset of field: _IO_FILE::_IO_read_ptr"] + [::std::mem::offset_of!(_IO_FILE, _IO_read_ptr) - 8usize]; + ["Offset of field: _IO_FILE::_IO_read_end"] + [::std::mem::offset_of!(_IO_FILE, _IO_read_end) - 16usize]; + ["Offset of field: _IO_FILE::_IO_read_base"] + [::std::mem::offset_of!(_IO_FILE, _IO_read_base) - 24usize]; + ["Offset of field: _IO_FILE::_IO_write_base"] + [::std::mem::offset_of!(_IO_FILE, _IO_write_base) - 32usize]; + ["Offset of field: _IO_FILE::_IO_write_ptr"] + [::std::mem::offset_of!(_IO_FILE, _IO_write_ptr) - 40usize]; + ["Offset of field: _IO_FILE::_IO_write_end"] + [::std::mem::offset_of!(_IO_FILE, _IO_write_end) - 48usize]; + ["Offset of field: _IO_FILE::_IO_buf_base"] + [::std::mem::offset_of!(_IO_FILE, _IO_buf_base) - 56usize]; + ["Offset of field: _IO_FILE::_IO_buf_end"] + [::std::mem::offset_of!(_IO_FILE, _IO_buf_end) - 64usize]; + ["Offset of field: _IO_FILE::_IO_save_base"] + [::std::mem::offset_of!(_IO_FILE, _IO_save_base) - 72usize]; + ["Offset of field: _IO_FILE::_IO_backup_base"] + [::std::mem::offset_of!(_IO_FILE, _IO_backup_base) - 80usize]; + ["Offset of field: _IO_FILE::_IO_save_end"] + [::std::mem::offset_of!(_IO_FILE, _IO_save_end) - 88usize]; + ["Offset of field: _IO_FILE::_markers"][::std::mem::offset_of!(_IO_FILE, _markers) - 96usize]; + ["Offset of field: _IO_FILE::_chain"][::std::mem::offset_of!(_IO_FILE, _chain) - 104usize]; + ["Offset of field: _IO_FILE::_fileno"][::std::mem::offset_of!(_IO_FILE, _fileno) - 112usize]; + ["Offset of field: _IO_FILE::_flags2"][::std::mem::offset_of!(_IO_FILE, _flags2) - 116usize]; + ["Offset of field: _IO_FILE::_old_offset"] + [::std::mem::offset_of!(_IO_FILE, _old_offset) - 120usize]; + ["Offset of field: _IO_FILE::_cur_column"] + [::std::mem::offset_of!(_IO_FILE, _cur_column) - 128usize]; + ["Offset of field: _IO_FILE::_vtable_offset"] + [::std::mem::offset_of!(_IO_FILE, _vtable_offset) - 130usize]; + ["Offset of field: _IO_FILE::_shortbuf"] + [::std::mem::offset_of!(_IO_FILE, _shortbuf) - 131usize]; + ["Offset of field: _IO_FILE::_lock"][::std::mem::offset_of!(_IO_FILE, _lock) - 136usize]; + ["Offset of field: _IO_FILE::_offset"][::std::mem::offset_of!(_IO_FILE, _offset) - 144usize]; + ["Offset of field: _IO_FILE::_codecvt"][::std::mem::offset_of!(_IO_FILE, _codecvt) - 152usize]; + ["Offset of field: _IO_FILE::_wide_data"] + [::std::mem::offset_of!(_IO_FILE, _wide_data) - 160usize]; + ["Offset of field: _IO_FILE::_freeres_list"] + [::std::mem::offset_of!(_IO_FILE, _freeres_list) - 168usize]; + ["Offset of field: _IO_FILE::_freeres_buf"] + [::std::mem::offset_of!(_IO_FILE, _freeres_buf) - 176usize]; + ["Offset of field: _IO_FILE::_prevchain"] + [::std::mem::offset_of!(_IO_FILE, _prevchain) - 184usize]; + ["Offset of field: _IO_FILE::_mode"][::std::mem::offset_of!(_IO_FILE, _mode) - 192usize]; + ["Offset of field: _IO_FILE::_unused2"][::std::mem::offset_of!(_IO_FILE, _unused2) - 196usize]; +}; pub type cookie_read_function_t = ::std::option::Option< unsafe extern "C" fn( __cookie: *mut ::std::os::raw::c_void, @@ -878,62 +475,21 @@ pub struct _IO_cookie_io_functions_t { pub seek: cookie_seek_function_t, pub close: cookie_close_function_t, } -#[test] -fn bindgen_test_layout__IO_cookie_io_functions_t() { - const UNINIT: ::std::mem::MaybeUninit<_IO_cookie_io_functions_t> = - ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::<_IO_cookie_io_functions_t>(), - 32usize, - concat!("Size of: ", stringify!(_IO_cookie_io_functions_t)) - ); - assert_eq!( - ::std::mem::align_of::<_IO_cookie_io_functions_t>(), - 8usize, - concat!("Alignment of ", stringify!(_IO_cookie_io_functions_t)) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).read) as usize - ptr as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(_IO_cookie_io_functions_t), - "::", - stringify!(read) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).write) as usize - ptr as usize }, - 8usize, - concat!( - "Offset of field: ", - stringify!(_IO_cookie_io_functions_t), - "::", - stringify!(write) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).seek) as usize - ptr as usize }, - 16usize, - concat!( - "Offset of field: ", - stringify!(_IO_cookie_io_functions_t), - "::", - stringify!(seek) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).close) as usize - ptr as usize }, - 24usize, - concat!( - "Offset of field: ", - stringify!(_IO_cookie_io_functions_t), - "::", - stringify!(close) - ) - ); -} +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of _IO_cookie_io_functions_t"] + [::std::mem::size_of::<_IO_cookie_io_functions_t>() - 32usize]; + ["Alignment of _IO_cookie_io_functions_t"] + [::std::mem::align_of::<_IO_cookie_io_functions_t>() - 8usize]; + ["Offset of field: _IO_cookie_io_functions_t::read"] + [::std::mem::offset_of!(_IO_cookie_io_functions_t, read) - 0usize]; + ["Offset of field: _IO_cookie_io_functions_t::write"] + [::std::mem::offset_of!(_IO_cookie_io_functions_t, write) - 8usize]; + ["Offset of field: _IO_cookie_io_functions_t::seek"] + [::std::mem::offset_of!(_IO_cookie_io_functions_t, seek) - 16usize]; + ["Offset of field: _IO_cookie_io_functions_t::close"] + [::std::mem::offset_of!(_IO_cookie_io_functions_t, close) - 24usize]; +}; pub type cookie_io_functions_t = _IO_cookie_io_functions_t; pub type va_list = __gnuc_va_list; pub type off_t = __off_t; @@ -1445,31 +1001,12 @@ extern "C" { pub struct ggml_bf16_t { pub bits: u16, } -#[test] -fn bindgen_test_layout_ggml_bf16_t() { - const UNINIT: ::std::mem::MaybeUninit = ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::(), - 2usize, - concat!("Size of: ", stringify!(ggml_bf16_t)) - ); - assert_eq!( - ::std::mem::align_of::(), - 2usize, - concat!("Alignment of ", stringify!(ggml_bf16_t)) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).bits) as usize - ptr as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(ggml_bf16_t), - "::", - stringify!(bits) - ) - ); -} +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of ggml_bf16_t"][::std::mem::size_of::() - 2usize]; + ["Alignment of ggml_bf16_t"][::std::mem::align_of::() - 2usize]; + ["Offset of field: ggml_bf16_t::bits"][::std::mem::offset_of!(ggml_bf16_t, bits) - 0usize]; +}; extern "C" { pub fn ggml_fp32_to_bf16(arg1: f32) -> ggml_bf16_t; } @@ -1705,171 +1242,30 @@ pub struct ggml_tensor { pub name: [::std::os::raw::c_char; 64usize], pub extra: *mut ::std::os::raw::c_void, } -#[test] -fn bindgen_test_layout_ggml_tensor() { - const UNINIT: ::std::mem::MaybeUninit = ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::(), - 336usize, - concat!("Size of: ", stringify!(ggml_tensor)) - ); - assert_eq!( - ::std::mem::align_of::(), - 8usize, - concat!("Alignment of ", stringify!(ggml_tensor)) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).type_) as usize - ptr as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(ggml_tensor), - "::", - stringify!(type_) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).backend) as usize - ptr as usize }, - 4usize, - concat!( - "Offset of field: ", - stringify!(ggml_tensor), - "::", - stringify!(backend) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).buffer) as usize - ptr as usize }, - 8usize, - concat!( - "Offset of field: ", - stringify!(ggml_tensor), - "::", - stringify!(buffer) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).ne) as usize - ptr as usize }, - 16usize, - concat!( - "Offset of field: ", - stringify!(ggml_tensor), - "::", - stringify!(ne) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).nb) as usize - ptr as usize }, - 48usize, - concat!( - "Offset of field: ", - stringify!(ggml_tensor), - "::", - stringify!(nb) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).op) as usize - ptr as usize }, - 80usize, - concat!( - "Offset of field: ", - stringify!(ggml_tensor), - "::", - stringify!(op) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).op_params) as usize - ptr as usize }, - 84usize, - concat!( - "Offset of field: ", - stringify!(ggml_tensor), - "::", - stringify!(op_params) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).flags) as usize - ptr as usize }, - 148usize, - concat!( - "Offset of field: ", - stringify!(ggml_tensor), - "::", - stringify!(flags) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).grad) as usize - ptr as usize }, - 152usize, - concat!( - "Offset of field: ", - stringify!(ggml_tensor), - "::", - stringify!(grad) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).src) as usize - ptr as usize }, - 160usize, - concat!( - "Offset of field: ", - stringify!(ggml_tensor), - "::", - stringify!(src) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).view_src) as usize - ptr as usize }, - 240usize, - concat!( - "Offset of field: ", - stringify!(ggml_tensor), - "::", - stringify!(view_src) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).view_offs) as usize - ptr as usize }, - 248usize, - concat!( - "Offset of field: ", - stringify!(ggml_tensor), - "::", - stringify!(view_offs) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).data) as usize - ptr as usize }, - 256usize, - concat!( - "Offset of field: ", - stringify!(ggml_tensor), - "::", - stringify!(data) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).name) as usize - ptr as usize }, - 264usize, - concat!( - "Offset of field: ", - stringify!(ggml_tensor), - "::", - stringify!(name) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).extra) as usize - ptr as usize }, - 328usize, - concat!( - "Offset of field: ", - stringify!(ggml_tensor), - "::", - stringify!(extra) - ) - ); -} +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of ggml_tensor"][::std::mem::size_of::() - 336usize]; + ["Alignment of ggml_tensor"][::std::mem::align_of::() - 8usize]; + ["Offset of field: ggml_tensor::type_"][::std::mem::offset_of!(ggml_tensor, type_) - 0usize]; + ["Offset of field: ggml_tensor::backend"] + [::std::mem::offset_of!(ggml_tensor, backend) - 4usize]; + ["Offset of field: ggml_tensor::buffer"][::std::mem::offset_of!(ggml_tensor, buffer) - 8usize]; + ["Offset of field: ggml_tensor::ne"][::std::mem::offset_of!(ggml_tensor, ne) - 16usize]; + ["Offset of field: ggml_tensor::nb"][::std::mem::offset_of!(ggml_tensor, nb) - 48usize]; + ["Offset of field: ggml_tensor::op"][::std::mem::offset_of!(ggml_tensor, op) - 80usize]; + ["Offset of field: ggml_tensor::op_params"] + [::std::mem::offset_of!(ggml_tensor, op_params) - 84usize]; + ["Offset of field: ggml_tensor::flags"][::std::mem::offset_of!(ggml_tensor, flags) - 148usize]; + ["Offset of field: ggml_tensor::grad"][::std::mem::offset_of!(ggml_tensor, grad) - 152usize]; + ["Offset of field: ggml_tensor::src"][::std::mem::offset_of!(ggml_tensor, src) - 160usize]; + ["Offset of field: ggml_tensor::view_src"] + [::std::mem::offset_of!(ggml_tensor, view_src) - 240usize]; + ["Offset of field: ggml_tensor::view_offs"] + [::std::mem::offset_of!(ggml_tensor, view_offs) - 248usize]; + ["Offset of field: ggml_tensor::data"][::std::mem::offset_of!(ggml_tensor, data) - 256usize]; + ["Offset of field: ggml_tensor::name"][::std::mem::offset_of!(ggml_tensor, name) - 264usize]; + ["Offset of field: ggml_tensor::extra"][::std::mem::offset_of!(ggml_tensor, extra) - 328usize]; +}; pub const GGML_TENSOR_SIZE: usize = 336; pub type ggml_abort_callback = ::std::option::Option bool>; @@ -1888,82 +1284,24 @@ pub struct ggml_threadpool_params { pub strict_cpu: bool, pub paused: bool, } -#[test] -fn bindgen_test_layout_ggml_threadpool_params() { - const UNINIT: ::std::mem::MaybeUninit = - ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::(), - 528usize, - concat!("Size of: ", stringify!(ggml_threadpool_params)) - ); - assert_eq!( - ::std::mem::align_of::(), - 4usize, - concat!("Alignment of ", stringify!(ggml_threadpool_params)) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).cpumask) as usize - ptr as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(ggml_threadpool_params), - "::", - stringify!(cpumask) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).n_threads) as usize - ptr as usize }, - 512usize, - concat!( - "Offset of field: ", - stringify!(ggml_threadpool_params), - "::", - stringify!(n_threads) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).prio) as usize - ptr as usize }, - 516usize, - concat!( - "Offset of field: ", - stringify!(ggml_threadpool_params), - "::", - stringify!(prio) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).poll) as usize - ptr as usize }, - 520usize, - concat!( - "Offset of field: ", - stringify!(ggml_threadpool_params), - "::", - stringify!(poll) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).strict_cpu) as usize - ptr as usize }, - 524usize, - concat!( - "Offset of field: ", - stringify!(ggml_threadpool_params), - "::", - stringify!(strict_cpu) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).paused) as usize - ptr as usize }, - 525usize, - concat!( - "Offset of field: ", - stringify!(ggml_threadpool_params), - "::", - stringify!(paused) - ) - ); -} +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of ggml_threadpool_params"][::std::mem::size_of::() - 528usize]; + ["Alignment of ggml_threadpool_params"] + [::std::mem::align_of::() - 4usize]; + ["Offset of field: ggml_threadpool_params::cpumask"] + [::std::mem::offset_of!(ggml_threadpool_params, cpumask) - 0usize]; + ["Offset of field: ggml_threadpool_params::n_threads"] + [::std::mem::offset_of!(ggml_threadpool_params, n_threads) - 512usize]; + ["Offset of field: ggml_threadpool_params::prio"] + [::std::mem::offset_of!(ggml_threadpool_params, prio) - 516usize]; + ["Offset of field: ggml_threadpool_params::poll"] + [::std::mem::offset_of!(ggml_threadpool_params, poll) - 520usize]; + ["Offset of field: ggml_threadpool_params::strict_cpu"] + [::std::mem::offset_of!(ggml_threadpool_params, strict_cpu) - 524usize]; + ["Offset of field: ggml_threadpool_params::paused"] + [::std::mem::offset_of!(ggml_threadpool_params, paused) - 525usize]; +}; #[repr(C)] #[derive(Debug, Copy, Clone)] pub struct ggml_threadpool { @@ -1980,81 +1318,23 @@ pub struct ggml_cplan { pub abort_callback: ggml_abort_callback, pub abort_callback_data: *mut ::std::os::raw::c_void, } -#[test] -fn bindgen_test_layout_ggml_cplan() { - const UNINIT: ::std::mem::MaybeUninit = ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::(), - 48usize, - concat!("Size of: ", stringify!(ggml_cplan)) - ); - assert_eq!( - ::std::mem::align_of::(), - 8usize, - concat!("Alignment of ", stringify!(ggml_cplan)) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).work_size) as usize - ptr as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(ggml_cplan), - "::", - stringify!(work_size) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).work_data) as usize - ptr as usize }, - 8usize, - concat!( - "Offset of field: ", - stringify!(ggml_cplan), - "::", - stringify!(work_data) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).n_threads) as usize - ptr as usize }, - 16usize, - concat!( - "Offset of field: ", - stringify!(ggml_cplan), - "::", - stringify!(n_threads) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).threadpool) as usize - ptr as usize }, - 24usize, - concat!( - "Offset of field: ", - stringify!(ggml_cplan), - "::", - stringify!(threadpool) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).abort_callback) as usize - ptr as usize }, - 32usize, - concat!( - "Offset of field: ", - stringify!(ggml_cplan), - "::", - stringify!(abort_callback) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).abort_callback_data) as usize - ptr as usize }, - 40usize, - concat!( - "Offset of field: ", - stringify!(ggml_cplan), - "::", - stringify!(abort_callback_data) - ) - ); -} +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of ggml_cplan"][::std::mem::size_of::() - 48usize]; + ["Alignment of ggml_cplan"][::std::mem::align_of::() - 8usize]; + ["Offset of field: ggml_cplan::work_size"] + [::std::mem::offset_of!(ggml_cplan, work_size) - 0usize]; + ["Offset of field: ggml_cplan::work_data"] + [::std::mem::offset_of!(ggml_cplan, work_data) - 8usize]; + ["Offset of field: ggml_cplan::n_threads"] + [::std::mem::offset_of!(ggml_cplan, n_threads) - 16usize]; + ["Offset of field: ggml_cplan::threadpool"] + [::std::mem::offset_of!(ggml_cplan, threadpool) - 24usize]; + ["Offset of field: ggml_cplan::abort_callback"] + [::std::mem::offset_of!(ggml_cplan, abort_callback) - 32usize]; + ["Offset of field: ggml_cplan::abort_callback_data"] + [::std::mem::offset_of!(ggml_cplan, abort_callback_data) - 40usize]; +}; #[repr(C)] #[derive(Debug, Copy, Clone)] pub struct ggml_scratch { @@ -2062,51 +1342,14 @@ pub struct ggml_scratch { pub size: usize, pub data: *mut ::std::os::raw::c_void, } -#[test] -fn bindgen_test_layout_ggml_scratch() { - const UNINIT: ::std::mem::MaybeUninit = ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::(), - 24usize, - concat!("Size of: ", stringify!(ggml_scratch)) - ); - assert_eq!( - ::std::mem::align_of::(), - 8usize, - concat!("Alignment of ", stringify!(ggml_scratch)) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).offs) as usize - ptr as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(ggml_scratch), - "::", - stringify!(offs) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).size) as usize - ptr as usize }, - 8usize, - concat!( - "Offset of field: ", - stringify!(ggml_scratch), - "::", - stringify!(size) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).data) as usize - ptr as usize }, - 16usize, - concat!( - "Offset of field: ", - stringify!(ggml_scratch), - "::", - stringify!(data) - ) - ); -} +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of ggml_scratch"][::std::mem::size_of::() - 24usize]; + ["Alignment of ggml_scratch"][::std::mem::align_of::() - 8usize]; + ["Offset of field: ggml_scratch::offs"][::std::mem::offset_of!(ggml_scratch, offs) - 0usize]; + ["Offset of field: ggml_scratch::size"][::std::mem::offset_of!(ggml_scratch, size) - 8usize]; + ["Offset of field: ggml_scratch::data"][::std::mem::offset_of!(ggml_scratch, data) - 16usize]; +}; #[repr(C)] #[derive(Debug, Copy, Clone)] pub struct ggml_init_params { @@ -2114,51 +1357,17 @@ pub struct ggml_init_params { pub mem_buffer: *mut ::std::os::raw::c_void, pub no_alloc: bool, } -#[test] -fn bindgen_test_layout_ggml_init_params() { - const UNINIT: ::std::mem::MaybeUninit = ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::(), - 24usize, - concat!("Size of: ", stringify!(ggml_init_params)) - ); - assert_eq!( - ::std::mem::align_of::(), - 8usize, - concat!("Alignment of ", stringify!(ggml_init_params)) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).mem_size) as usize - ptr as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(ggml_init_params), - "::", - stringify!(mem_size) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).mem_buffer) as usize - ptr as usize }, - 8usize, - concat!( - "Offset of field: ", - stringify!(ggml_init_params), - "::", - stringify!(mem_buffer) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).no_alloc) as usize - ptr as usize }, - 16usize, - concat!( - "Offset of field: ", - stringify!(ggml_init_params), - "::", - stringify!(no_alloc) - ) - ); -} +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of ggml_init_params"][::std::mem::size_of::() - 24usize]; + ["Alignment of ggml_init_params"][::std::mem::align_of::() - 8usize]; + ["Offset of field: ggml_init_params::mem_size"] + [::std::mem::offset_of!(ggml_init_params, mem_size) - 0usize]; + ["Offset of field: ggml_init_params::mem_buffer"] + [::std::mem::offset_of!(ggml_init_params, mem_buffer) - 8usize]; + ["Offset of field: ggml_init_params::no_alloc"] + [::std::mem::offset_of!(ggml_init_params, no_alloc) - 16usize]; +}; pub const ggml_numa_strategy_GGML_NUMA_STRATEGY_DISABLED: ggml_numa_strategy = 0; pub const ggml_numa_strategy_GGML_NUMA_STRATEGY_DISTRIBUTE: ggml_numa_strategy = 1; pub const ggml_numa_strategy_GGML_NUMA_STRATEGY_ISOLATE: ggml_numa_strategy = 2; @@ -2310,6 +1519,9 @@ extern "C" { extern "C" { pub fn ggml_init(params: ggml_init_params) -> *mut ggml_context; } +extern "C" { + pub fn ggml_reset(ctx: *mut ggml_context); +} extern "C" { pub fn ggml_free(ctx: *mut ggml_context); } @@ -4008,132 +3220,35 @@ pub struct ggml_opt_params__bindgen_ty_1 { pub eps_g: f32, pub gclip: f32, } -#[test] -fn bindgen_test_layout_ggml_opt_params__bindgen_ty_1() { - const UNINIT: ::std::mem::MaybeUninit = - ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::(), - 44usize, - concat!("Size of: ", stringify!(ggml_opt_params__bindgen_ty_1)) - ); - assert_eq!( - ::std::mem::align_of::(), - 4usize, - concat!("Alignment of ", stringify!(ggml_opt_params__bindgen_ty_1)) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).n_iter) as usize - ptr as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(ggml_opt_params__bindgen_ty_1), - "::", - stringify!(n_iter) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).sched) as usize - ptr as usize }, - 4usize, - concat!( - "Offset of field: ", - stringify!(ggml_opt_params__bindgen_ty_1), - "::", - stringify!(sched) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).decay) as usize - ptr as usize }, - 8usize, - concat!( - "Offset of field: ", - stringify!(ggml_opt_params__bindgen_ty_1), - "::", - stringify!(decay) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).decay_min_ndim) as usize - ptr as usize }, - 12usize, - concat!( - "Offset of field: ", - stringify!(ggml_opt_params__bindgen_ty_1), - "::", - stringify!(decay_min_ndim) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).alpha) as usize - ptr as usize }, - 16usize, - concat!( - "Offset of field: ", - stringify!(ggml_opt_params__bindgen_ty_1), - "::", - stringify!(alpha) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).beta1) as usize - ptr as usize }, - 20usize, - concat!( - "Offset of field: ", - stringify!(ggml_opt_params__bindgen_ty_1), - "::", - stringify!(beta1) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).beta2) as usize - ptr as usize }, - 24usize, - concat!( - "Offset of field: ", - stringify!(ggml_opt_params__bindgen_ty_1), - "::", - stringify!(beta2) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).eps) as usize - ptr as usize }, - 28usize, - concat!( - "Offset of field: ", - stringify!(ggml_opt_params__bindgen_ty_1), - "::", - stringify!(eps) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).eps_f) as usize - ptr as usize }, - 32usize, - concat!( - "Offset of field: ", - stringify!(ggml_opt_params__bindgen_ty_1), - "::", - stringify!(eps_f) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).eps_g) as usize - ptr as usize }, - 36usize, - concat!( - "Offset of field: ", - stringify!(ggml_opt_params__bindgen_ty_1), - "::", - stringify!(eps_g) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).gclip) as usize - ptr as usize }, - 40usize, - concat!( - "Offset of field: ", - stringify!(ggml_opt_params__bindgen_ty_1), - "::", - stringify!(gclip) - ) - ); -} +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of ggml_opt_params__bindgen_ty_1"] + [::std::mem::size_of::() - 44usize]; + ["Alignment of ggml_opt_params__bindgen_ty_1"] + [::std::mem::align_of::() - 4usize]; + ["Offset of field: ggml_opt_params__bindgen_ty_1::n_iter"] + [::std::mem::offset_of!(ggml_opt_params__bindgen_ty_1, n_iter) - 0usize]; + ["Offset of field: ggml_opt_params__bindgen_ty_1::sched"] + [::std::mem::offset_of!(ggml_opt_params__bindgen_ty_1, sched) - 4usize]; + ["Offset of field: ggml_opt_params__bindgen_ty_1::decay"] + [::std::mem::offset_of!(ggml_opt_params__bindgen_ty_1, decay) - 8usize]; + ["Offset of field: ggml_opt_params__bindgen_ty_1::decay_min_ndim"] + [::std::mem::offset_of!(ggml_opt_params__bindgen_ty_1, decay_min_ndim) - 12usize]; + ["Offset of field: ggml_opt_params__bindgen_ty_1::alpha"] + [::std::mem::offset_of!(ggml_opt_params__bindgen_ty_1, alpha) - 16usize]; + ["Offset of field: ggml_opt_params__bindgen_ty_1::beta1"] + [::std::mem::offset_of!(ggml_opt_params__bindgen_ty_1, beta1) - 20usize]; + ["Offset of field: ggml_opt_params__bindgen_ty_1::beta2"] + [::std::mem::offset_of!(ggml_opt_params__bindgen_ty_1, beta2) - 24usize]; + ["Offset of field: ggml_opt_params__bindgen_ty_1::eps"] + [::std::mem::offset_of!(ggml_opt_params__bindgen_ty_1, eps) - 28usize]; + ["Offset of field: ggml_opt_params__bindgen_ty_1::eps_f"] + [::std::mem::offset_of!(ggml_opt_params__bindgen_ty_1, eps_f) - 32usize]; + ["Offset of field: ggml_opt_params__bindgen_ty_1::eps_g"] + [::std::mem::offset_of!(ggml_opt_params__bindgen_ty_1, eps_g) - 36usize]; + ["Offset of field: ggml_opt_params__bindgen_ty_1::gclip"] + [::std::mem::offset_of!(ggml_opt_params__bindgen_ty_1, gclip) - 40usize]; +}; #[repr(C)] #[derive(Debug, Copy, Clone)] pub struct ggml_opt_params__bindgen_ty_2 { @@ -4147,237 +3262,58 @@ pub struct ggml_opt_params__bindgen_ty_2 { pub max_step: f32, pub linesearch: ggml_linesearch, } -#[test] -fn bindgen_test_layout_ggml_opt_params__bindgen_ty_2() { - const UNINIT: ::std::mem::MaybeUninit = - ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::(), - 36usize, - concat!("Size of: ", stringify!(ggml_opt_params__bindgen_ty_2)) - ); - assert_eq!( - ::std::mem::align_of::(), - 4usize, - concat!("Alignment of ", stringify!(ggml_opt_params__bindgen_ty_2)) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).m) as usize - ptr as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(ggml_opt_params__bindgen_ty_2), - "::", - stringify!(m) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).n_iter) as usize - ptr as usize }, - 4usize, - concat!( - "Offset of field: ", - stringify!(ggml_opt_params__bindgen_ty_2), - "::", - stringify!(n_iter) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).max_linesearch) as usize - ptr as usize }, - 8usize, - concat!( - "Offset of field: ", - stringify!(ggml_opt_params__bindgen_ty_2), - "::", - stringify!(max_linesearch) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).eps) as usize - ptr as usize }, - 12usize, - concat!( - "Offset of field: ", - stringify!(ggml_opt_params__bindgen_ty_2), - "::", - stringify!(eps) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).ftol) as usize - ptr as usize }, - 16usize, - concat!( - "Offset of field: ", - stringify!(ggml_opt_params__bindgen_ty_2), - "::", - stringify!(ftol) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).wolfe) as usize - ptr as usize }, - 20usize, - concat!( - "Offset of field: ", - stringify!(ggml_opt_params__bindgen_ty_2), - "::", - stringify!(wolfe) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).min_step) as usize - ptr as usize }, - 24usize, - concat!( - "Offset of field: ", - stringify!(ggml_opt_params__bindgen_ty_2), - "::", - stringify!(min_step) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).max_step) as usize - ptr as usize }, - 28usize, - concat!( - "Offset of field: ", - stringify!(ggml_opt_params__bindgen_ty_2), - "::", - stringify!(max_step) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).linesearch) as usize - ptr as usize }, - 32usize, - concat!( - "Offset of field: ", - stringify!(ggml_opt_params__bindgen_ty_2), - "::", - stringify!(linesearch) - ) - ); -} -#[test] -fn bindgen_test_layout_ggml_opt_params() { - const UNINIT: ::std::mem::MaybeUninit = ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::(), - 120usize, - concat!("Size of: ", stringify!(ggml_opt_params)) - ); - assert_eq!( - ::std::mem::align_of::(), - 8usize, - concat!("Alignment of ", stringify!(ggml_opt_params)) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).type_) as usize - ptr as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(ggml_opt_params), - "::", - stringify!(type_) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).graph_size) as usize - ptr as usize }, - 8usize, - concat!( - "Offset of field: ", - stringify!(ggml_opt_params), - "::", - stringify!(graph_size) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).n_threads) as usize - ptr as usize }, - 16usize, - concat!( - "Offset of field: ", - stringify!(ggml_opt_params), - "::", - stringify!(n_threads) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).past) as usize - ptr as usize }, - 20usize, - concat!( - "Offset of field: ", - stringify!(ggml_opt_params), - "::", - stringify!(past) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).delta) as usize - ptr as usize }, - 24usize, - concat!( - "Offset of field: ", - stringify!(ggml_opt_params), - "::", - stringify!(delta) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).max_no_improvement) as usize - ptr as usize }, - 28usize, - concat!( - "Offset of field: ", - stringify!(ggml_opt_params), - "::", - stringify!(max_no_improvement) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).print_forward_graph) as usize - ptr as usize }, - 32usize, - concat!( - "Offset of field: ", - stringify!(ggml_opt_params), - "::", - stringify!(print_forward_graph) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).print_backward_graph) as usize - ptr as usize }, - 33usize, - concat!( - "Offset of field: ", - stringify!(ggml_opt_params), - "::", - stringify!(print_backward_graph) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).n_gradient_accumulation) as usize - ptr as usize }, - 36usize, - concat!( - "Offset of field: ", - stringify!(ggml_opt_params), - "::", - stringify!(n_gradient_accumulation) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).adam) as usize - ptr as usize }, - 40usize, - concat!( - "Offset of field: ", - stringify!(ggml_opt_params), - "::", - stringify!(adam) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).lbfgs) as usize - ptr as usize }, - 84usize, - concat!( - "Offset of field: ", - stringify!(ggml_opt_params), - "::", - stringify!(lbfgs) - ) - ); -} +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of ggml_opt_params__bindgen_ty_2"] + [::std::mem::size_of::() - 36usize]; + ["Alignment of ggml_opt_params__bindgen_ty_2"] + [::std::mem::align_of::() - 4usize]; + ["Offset of field: ggml_opt_params__bindgen_ty_2::m"] + [::std::mem::offset_of!(ggml_opt_params__bindgen_ty_2, m) - 0usize]; + ["Offset of field: ggml_opt_params__bindgen_ty_2::n_iter"] + [::std::mem::offset_of!(ggml_opt_params__bindgen_ty_2, n_iter) - 4usize]; + ["Offset of field: ggml_opt_params__bindgen_ty_2::max_linesearch"] + [::std::mem::offset_of!(ggml_opt_params__bindgen_ty_2, max_linesearch) - 8usize]; + ["Offset of field: ggml_opt_params__bindgen_ty_2::eps"] + [::std::mem::offset_of!(ggml_opt_params__bindgen_ty_2, eps) - 12usize]; + ["Offset of field: ggml_opt_params__bindgen_ty_2::ftol"] + [::std::mem::offset_of!(ggml_opt_params__bindgen_ty_2, ftol) - 16usize]; + ["Offset of field: ggml_opt_params__bindgen_ty_2::wolfe"] + [::std::mem::offset_of!(ggml_opt_params__bindgen_ty_2, wolfe) - 20usize]; + ["Offset of field: ggml_opt_params__bindgen_ty_2::min_step"] + [::std::mem::offset_of!(ggml_opt_params__bindgen_ty_2, min_step) - 24usize]; + ["Offset of field: ggml_opt_params__bindgen_ty_2::max_step"] + [::std::mem::offset_of!(ggml_opt_params__bindgen_ty_2, max_step) - 28usize]; + ["Offset of field: ggml_opt_params__bindgen_ty_2::linesearch"] + [::std::mem::offset_of!(ggml_opt_params__bindgen_ty_2, linesearch) - 32usize]; +}; +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of ggml_opt_params"][::std::mem::size_of::() - 120usize]; + ["Alignment of ggml_opt_params"][::std::mem::align_of::() - 8usize]; + ["Offset of field: ggml_opt_params::type_"] + [::std::mem::offset_of!(ggml_opt_params, type_) - 0usize]; + ["Offset of field: ggml_opt_params::graph_size"] + [::std::mem::offset_of!(ggml_opt_params, graph_size) - 8usize]; + ["Offset of field: ggml_opt_params::n_threads"] + [::std::mem::offset_of!(ggml_opt_params, n_threads) - 16usize]; + ["Offset of field: ggml_opt_params::past"] + [::std::mem::offset_of!(ggml_opt_params, past) - 20usize]; + ["Offset of field: ggml_opt_params::delta"] + [::std::mem::offset_of!(ggml_opt_params, delta) - 24usize]; + ["Offset of field: ggml_opt_params::max_no_improvement"] + [::std::mem::offset_of!(ggml_opt_params, max_no_improvement) - 28usize]; + ["Offset of field: ggml_opt_params::print_forward_graph"] + [::std::mem::offset_of!(ggml_opt_params, print_forward_graph) - 32usize]; + ["Offset of field: ggml_opt_params::print_backward_graph"] + [::std::mem::offset_of!(ggml_opt_params, print_backward_graph) - 33usize]; + ["Offset of field: ggml_opt_params::n_gradient_accumulation"] + [::std::mem::offset_of!(ggml_opt_params, n_gradient_accumulation) - 36usize]; + ["Offset of field: ggml_opt_params::adam"] + [::std::mem::offset_of!(ggml_opt_params, adam) - 40usize]; + ["Offset of field: ggml_opt_params::lbfgs"] + [::std::mem::offset_of!(ggml_opt_params, lbfgs) - 84usize]; +}; #[repr(C)] #[derive(Debug, Copy, Clone)] pub struct ggml_opt_context { @@ -4402,92 +3338,27 @@ pub struct ggml_opt_context__bindgen_ty_1 { pub fx_prev: f32, pub n_no_improvement: ::std::os::raw::c_int, } -#[test] -fn bindgen_test_layout_ggml_opt_context__bindgen_ty_1() { - const UNINIT: ::std::mem::MaybeUninit = - ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::(), - 48usize, - concat!("Size of: ", stringify!(ggml_opt_context__bindgen_ty_1)) - ); - assert_eq!( - ::std::mem::align_of::(), - 8usize, - concat!("Alignment of ", stringify!(ggml_opt_context__bindgen_ty_1)) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).g) as usize - ptr as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(ggml_opt_context__bindgen_ty_1), - "::", - stringify!(g) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).m) as usize - ptr as usize }, - 8usize, - concat!( - "Offset of field: ", - stringify!(ggml_opt_context__bindgen_ty_1), - "::", - stringify!(m) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).v) as usize - ptr as usize }, - 16usize, - concat!( - "Offset of field: ", - stringify!(ggml_opt_context__bindgen_ty_1), - "::", - stringify!(v) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).pf) as usize - ptr as usize }, - 24usize, - concat!( - "Offset of field: ", - stringify!(ggml_opt_context__bindgen_ty_1), - "::", - stringify!(pf) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).fx_best) as usize - ptr as usize }, - 32usize, - concat!( - "Offset of field: ", - stringify!(ggml_opt_context__bindgen_ty_1), - "::", - stringify!(fx_best) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).fx_prev) as usize - ptr as usize }, - 36usize, - concat!( - "Offset of field: ", - stringify!(ggml_opt_context__bindgen_ty_1), - "::", - stringify!(fx_prev) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).n_no_improvement) as usize - ptr as usize }, - 40usize, - concat!( - "Offset of field: ", - stringify!(ggml_opt_context__bindgen_ty_1), - "::", - stringify!(n_no_improvement) - ) - ); -} +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of ggml_opt_context__bindgen_ty_1"] + [::std::mem::size_of::() - 48usize]; + ["Alignment of ggml_opt_context__bindgen_ty_1"] + [::std::mem::align_of::() - 8usize]; + ["Offset of field: ggml_opt_context__bindgen_ty_1::g"] + [::std::mem::offset_of!(ggml_opt_context__bindgen_ty_1, g) - 0usize]; + ["Offset of field: ggml_opt_context__bindgen_ty_1::m"] + [::std::mem::offset_of!(ggml_opt_context__bindgen_ty_1, m) - 8usize]; + ["Offset of field: ggml_opt_context__bindgen_ty_1::v"] + [::std::mem::offset_of!(ggml_opt_context__bindgen_ty_1, v) - 16usize]; + ["Offset of field: ggml_opt_context__bindgen_ty_1::pf"] + [::std::mem::offset_of!(ggml_opt_context__bindgen_ty_1, pf) - 24usize]; + ["Offset of field: ggml_opt_context__bindgen_ty_1::fx_best"] + [::std::mem::offset_of!(ggml_opt_context__bindgen_ty_1, fx_best) - 32usize]; + ["Offset of field: ggml_opt_context__bindgen_ty_1::fx_prev"] + [::std::mem::offset_of!(ggml_opt_context__bindgen_ty_1, fx_prev) - 36usize]; + ["Offset of field: ggml_opt_context__bindgen_ty_1::n_no_improvement"] + [::std::mem::offset_of!(ggml_opt_context__bindgen_ty_1, n_no_improvement) - 40usize]; +}; #[repr(C)] #[derive(Debug, Copy, Clone)] pub struct ggml_opt_context__bindgen_ty_2 { @@ -4508,287 +3379,68 @@ pub struct ggml_opt_context__bindgen_ty_2 { pub end: ::std::os::raw::c_int, pub n_no_improvement: ::std::os::raw::c_int, } -#[test] -fn bindgen_test_layout_ggml_opt_context__bindgen_ty_2() { - const UNINIT: ::std::mem::MaybeUninit = - ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::(), - 104usize, - concat!("Size of: ", stringify!(ggml_opt_context__bindgen_ty_2)) - ); - assert_eq!( - ::std::mem::align_of::(), - 8usize, - concat!("Alignment of ", stringify!(ggml_opt_context__bindgen_ty_2)) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).x) as usize - ptr as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(ggml_opt_context__bindgen_ty_2), - "::", - stringify!(x) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).xp) as usize - ptr as usize }, - 8usize, - concat!( - "Offset of field: ", - stringify!(ggml_opt_context__bindgen_ty_2), - "::", - stringify!(xp) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).g) as usize - ptr as usize }, - 16usize, - concat!( - "Offset of field: ", - stringify!(ggml_opt_context__bindgen_ty_2), - "::", - stringify!(g) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).gp) as usize - ptr as usize }, - 24usize, - concat!( - "Offset of field: ", - stringify!(ggml_opt_context__bindgen_ty_2), - "::", - stringify!(gp) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).d) as usize - ptr as usize }, - 32usize, - concat!( - "Offset of field: ", - stringify!(ggml_opt_context__bindgen_ty_2), - "::", - stringify!(d) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).pf) as usize - ptr as usize }, - 40usize, - concat!( - "Offset of field: ", - stringify!(ggml_opt_context__bindgen_ty_2), - "::", - stringify!(pf) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).lmal) as usize - ptr as usize }, - 48usize, - concat!( - "Offset of field: ", - stringify!(ggml_opt_context__bindgen_ty_2), - "::", - stringify!(lmal) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).lmys) as usize - ptr as usize }, - 56usize, - concat!( - "Offset of field: ", - stringify!(ggml_opt_context__bindgen_ty_2), - "::", - stringify!(lmys) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).lms) as usize - ptr as usize }, - 64usize, - concat!( - "Offset of field: ", - stringify!(ggml_opt_context__bindgen_ty_2), - "::", - stringify!(lms) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).lmy) as usize - ptr as usize }, - 72usize, - concat!( - "Offset of field: ", - stringify!(ggml_opt_context__bindgen_ty_2), - "::", - stringify!(lmy) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).fx_best) as usize - ptr as usize }, - 80usize, - concat!( - "Offset of field: ", - stringify!(ggml_opt_context__bindgen_ty_2), - "::", - stringify!(fx_best) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).step) as usize - ptr as usize }, - 84usize, - concat!( - "Offset of field: ", - stringify!(ggml_opt_context__bindgen_ty_2), - "::", - stringify!(step) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).j) as usize - ptr as usize }, - 88usize, - concat!( - "Offset of field: ", - stringify!(ggml_opt_context__bindgen_ty_2), - "::", - stringify!(j) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).k) as usize - ptr as usize }, - 92usize, - concat!( - "Offset of field: ", - stringify!(ggml_opt_context__bindgen_ty_2), - "::", - stringify!(k) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).end) as usize - ptr as usize }, - 96usize, - concat!( - "Offset of field: ", - stringify!(ggml_opt_context__bindgen_ty_2), - "::", - stringify!(end) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).n_no_improvement) as usize - ptr as usize }, - 100usize, - concat!( - "Offset of field: ", - stringify!(ggml_opt_context__bindgen_ty_2), - "::", - stringify!(n_no_improvement) - ) - ); -} -#[test] -fn bindgen_test_layout_ggml_opt_context() { - const UNINIT: ::std::mem::MaybeUninit = ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::(), - 312usize, - concat!("Size of: ", stringify!(ggml_opt_context)) - ); - assert_eq!( - ::std::mem::align_of::(), - 8usize, - concat!("Alignment of ", stringify!(ggml_opt_context)) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).ctx) as usize - ptr as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(ggml_opt_context), - "::", - stringify!(ctx) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).params) as usize - ptr as usize }, - 8usize, - concat!( - "Offset of field: ", - stringify!(ggml_opt_context), - "::", - stringify!(params) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).iter) as usize - ptr as usize }, - 128usize, - concat!( - "Offset of field: ", - stringify!(ggml_opt_context), - "::", - stringify!(iter) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).nx) as usize - ptr as usize }, - 136usize, - concat!( - "Offset of field: ", - stringify!(ggml_opt_context), - "::", - stringify!(nx) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).just_initialized) as usize - ptr as usize }, - 144usize, - concat!( - "Offset of field: ", - stringify!(ggml_opt_context), - "::", - stringify!(just_initialized) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).loss_before) as usize - ptr as usize }, - 148usize, - concat!( - "Offset of field: ", - stringify!(ggml_opt_context), - "::", - stringify!(loss_before) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).loss_after) as usize - ptr as usize }, - 152usize, - concat!( - "Offset of field: ", - stringify!(ggml_opt_context), - "::", - stringify!(loss_after) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).adam) as usize - ptr as usize }, - 160usize, - concat!( - "Offset of field: ", - stringify!(ggml_opt_context), - "::", - stringify!(adam) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).lbfgs) as usize - ptr as usize }, - 208usize, - concat!( - "Offset of field: ", - stringify!(ggml_opt_context), - "::", - stringify!(lbfgs) - ) - ); -} +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of ggml_opt_context__bindgen_ty_2"] + [::std::mem::size_of::() - 104usize]; + ["Alignment of ggml_opt_context__bindgen_ty_2"] + [::std::mem::align_of::() - 8usize]; + ["Offset of field: ggml_opt_context__bindgen_ty_2::x"] + [::std::mem::offset_of!(ggml_opt_context__bindgen_ty_2, x) - 0usize]; + ["Offset of field: ggml_opt_context__bindgen_ty_2::xp"] + [::std::mem::offset_of!(ggml_opt_context__bindgen_ty_2, xp) - 8usize]; + ["Offset of field: ggml_opt_context__bindgen_ty_2::g"] + [::std::mem::offset_of!(ggml_opt_context__bindgen_ty_2, g) - 16usize]; + ["Offset of field: ggml_opt_context__bindgen_ty_2::gp"] + [::std::mem::offset_of!(ggml_opt_context__bindgen_ty_2, gp) - 24usize]; + ["Offset of field: ggml_opt_context__bindgen_ty_2::d"] + [::std::mem::offset_of!(ggml_opt_context__bindgen_ty_2, d) - 32usize]; + ["Offset of field: ggml_opt_context__bindgen_ty_2::pf"] + [::std::mem::offset_of!(ggml_opt_context__bindgen_ty_2, pf) - 40usize]; + ["Offset of field: ggml_opt_context__bindgen_ty_2::lmal"] + [::std::mem::offset_of!(ggml_opt_context__bindgen_ty_2, lmal) - 48usize]; + ["Offset of field: ggml_opt_context__bindgen_ty_2::lmys"] + [::std::mem::offset_of!(ggml_opt_context__bindgen_ty_2, lmys) - 56usize]; + ["Offset of field: ggml_opt_context__bindgen_ty_2::lms"] + [::std::mem::offset_of!(ggml_opt_context__bindgen_ty_2, lms) - 64usize]; + ["Offset of field: ggml_opt_context__bindgen_ty_2::lmy"] + [::std::mem::offset_of!(ggml_opt_context__bindgen_ty_2, lmy) - 72usize]; + ["Offset of field: ggml_opt_context__bindgen_ty_2::fx_best"] + [::std::mem::offset_of!(ggml_opt_context__bindgen_ty_2, fx_best) - 80usize]; + ["Offset of field: ggml_opt_context__bindgen_ty_2::step"] + [::std::mem::offset_of!(ggml_opt_context__bindgen_ty_2, step) - 84usize]; + ["Offset of field: ggml_opt_context__bindgen_ty_2::j"] + [::std::mem::offset_of!(ggml_opt_context__bindgen_ty_2, j) - 88usize]; + ["Offset of field: ggml_opt_context__bindgen_ty_2::k"] + [::std::mem::offset_of!(ggml_opt_context__bindgen_ty_2, k) - 92usize]; + ["Offset of field: ggml_opt_context__bindgen_ty_2::end"] + [::std::mem::offset_of!(ggml_opt_context__bindgen_ty_2, end) - 96usize]; + ["Offset of field: ggml_opt_context__bindgen_ty_2::n_no_improvement"] + [::std::mem::offset_of!(ggml_opt_context__bindgen_ty_2, n_no_improvement) - 100usize]; +}; +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of ggml_opt_context"][::std::mem::size_of::() - 312usize]; + ["Alignment of ggml_opt_context"][::std::mem::align_of::() - 8usize]; + ["Offset of field: ggml_opt_context::ctx"] + [::std::mem::offset_of!(ggml_opt_context, ctx) - 0usize]; + ["Offset of field: ggml_opt_context::params"] + [::std::mem::offset_of!(ggml_opt_context, params) - 8usize]; + ["Offset of field: ggml_opt_context::iter"] + [::std::mem::offset_of!(ggml_opt_context, iter) - 128usize]; + ["Offset of field: ggml_opt_context::nx"] + [::std::mem::offset_of!(ggml_opt_context, nx) - 136usize]; + ["Offset of field: ggml_opt_context::just_initialized"] + [::std::mem::offset_of!(ggml_opt_context, just_initialized) - 144usize]; + ["Offset of field: ggml_opt_context::loss_before"] + [::std::mem::offset_of!(ggml_opt_context, loss_before) - 148usize]; + ["Offset of field: ggml_opt_context::loss_after"] + [::std::mem::offset_of!(ggml_opt_context, loss_after) - 152usize]; + ["Offset of field: ggml_opt_context::adam"] + [::std::mem::offset_of!(ggml_opt_context, adam) - 160usize]; + ["Offset of field: ggml_opt_context::lbfgs"] + [::std::mem::offset_of!(ggml_opt_context, lbfgs) - 208usize]; +}; extern "C" { pub fn ggml_opt_default_params(type_: ggml_opt_type) -> ggml_opt_params; } @@ -4877,41 +3529,15 @@ pub struct gguf_init_params { pub no_alloc: bool, pub ctx: *mut *mut ggml_context, } -#[test] -fn bindgen_test_layout_gguf_init_params() { - const UNINIT: ::std::mem::MaybeUninit = ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::(), - 16usize, - concat!("Size of: ", stringify!(gguf_init_params)) - ); - assert_eq!( - ::std::mem::align_of::(), - 8usize, - concat!("Alignment of ", stringify!(gguf_init_params)) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).no_alloc) as usize - ptr as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(gguf_init_params), - "::", - stringify!(no_alloc) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).ctx) as usize - ptr as usize }, - 8usize, - concat!( - "Offset of field: ", - stringify!(gguf_init_params), - "::", - stringify!(ctx) - ) - ); -} +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of gguf_init_params"][::std::mem::size_of::() - 16usize]; + ["Alignment of gguf_init_params"][::std::mem::align_of::() - 8usize]; + ["Offset of field: gguf_init_params::no_alloc"] + [::std::mem::offset_of!(gguf_init_params, no_alloc) - 0usize]; + ["Offset of field: gguf_init_params::ctx"] + [::std::mem::offset_of!(gguf_init_params, ctx) - 8usize]; +}; extern "C" { pub fn gguf_init_empty() -> *mut gguf_context; } @@ -5160,6 +3786,9 @@ extern "C" { extern "C" { pub fn ggml_cpu_has_avx512_bf16() -> ::std::os::raw::c_int; } +extern "C" { + pub fn ggml_cpu_has_amx_int8() -> ::std::os::raw::c_int; +} extern "C" { pub fn ggml_cpu_has_fma() -> ::std::os::raw::c_int; } @@ -5274,7 +3903,7 @@ pub type ggml_gemm_t = ::std::option::Option< >; #[repr(C)] #[derive(Debug, Copy, Clone)] -pub struct ggml_type_traits_t { +pub struct ggml_type_traits { pub type_name: *const ::std::os::raw::c_char, pub blck_size: i64, pub blck_size_interleave: i64, @@ -5291,173 +3920,43 @@ pub struct ggml_type_traits_t { pub gemv: ggml_gemv_t, pub gemm: ggml_gemm_t, } -#[test] -fn bindgen_test_layout_ggml_type_traits_t() { - const UNINIT: ::std::mem::MaybeUninit = ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::(), - 120usize, - concat!("Size of: ", stringify!(ggml_type_traits_t)) - ); - assert_eq!( - ::std::mem::align_of::(), - 8usize, - concat!("Alignment of ", stringify!(ggml_type_traits_t)) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).type_name) as usize - ptr as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(ggml_type_traits_t), - "::", - stringify!(type_name) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).blck_size) as usize - ptr as usize }, - 8usize, - concat!( - "Offset of field: ", - stringify!(ggml_type_traits_t), - "::", - stringify!(blck_size) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).blck_size_interleave) as usize - ptr as usize }, - 16usize, - concat!( - "Offset of field: ", - stringify!(ggml_type_traits_t), - "::", - stringify!(blck_size_interleave) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).type_size) as usize - ptr as usize }, - 24usize, - concat!( - "Offset of field: ", - stringify!(ggml_type_traits_t), - "::", - stringify!(type_size) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).is_quantized) as usize - ptr as usize }, - 32usize, - concat!( - "Offset of field: ", - stringify!(ggml_type_traits_t), - "::", - stringify!(is_quantized) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).to_float) as usize - ptr as usize }, - 40usize, - concat!( - "Offset of field: ", - stringify!(ggml_type_traits_t), - "::", - stringify!(to_float) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).from_float) as usize - ptr as usize }, - 48usize, - concat!( - "Offset of field: ", - stringify!(ggml_type_traits_t), - "::", - stringify!(from_float) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).from_float_ref) as usize - ptr as usize }, - 56usize, - concat!( - "Offset of field: ", - stringify!(ggml_type_traits_t), - "::", - stringify!(from_float_ref) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).from_float_to_mat) as usize - ptr as usize }, - 64usize, - concat!( - "Offset of field: ", - stringify!(ggml_type_traits_t), - "::", - stringify!(from_float_to_mat) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).vec_dot) as usize - ptr as usize }, - 72usize, - concat!( - "Offset of field: ", - stringify!(ggml_type_traits_t), - "::", - stringify!(vec_dot) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).vec_dot_type) as usize - ptr as usize }, - 80usize, - concat!( - "Offset of field: ", - stringify!(ggml_type_traits_t), - "::", - stringify!(vec_dot_type) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).nrows) as usize - ptr as usize }, - 88usize, - concat!( - "Offset of field: ", - stringify!(ggml_type_traits_t), - "::", - stringify!(nrows) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).ncols) as usize - ptr as usize }, - 96usize, - concat!( - "Offset of field: ", - stringify!(ggml_type_traits_t), - "::", - stringify!(ncols) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).gemv) as usize - ptr as usize }, - 104usize, - concat!( - "Offset of field: ", - stringify!(ggml_type_traits_t), - "::", - stringify!(gemv) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).gemm) as usize - ptr as usize }, - 112usize, - concat!( - "Offset of field: ", - stringify!(ggml_type_traits_t), - "::", - stringify!(gemm) - ) - ); -} -extern "C" { - pub fn ggml_internal_get_type_traits(type_: ggml_type) -> ggml_type_traits_t; +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of ggml_type_traits"][::std::mem::size_of::() - 120usize]; + ["Alignment of ggml_type_traits"][::std::mem::align_of::() - 8usize]; + ["Offset of field: ggml_type_traits::type_name"] + [::std::mem::offset_of!(ggml_type_traits, type_name) - 0usize]; + ["Offset of field: ggml_type_traits::blck_size"] + [::std::mem::offset_of!(ggml_type_traits, blck_size) - 8usize]; + ["Offset of field: ggml_type_traits::blck_size_interleave"] + [::std::mem::offset_of!(ggml_type_traits, blck_size_interleave) - 16usize]; + ["Offset of field: ggml_type_traits::type_size"] + [::std::mem::offset_of!(ggml_type_traits, type_size) - 24usize]; + ["Offset of field: ggml_type_traits::is_quantized"] + [::std::mem::offset_of!(ggml_type_traits, is_quantized) - 32usize]; + ["Offset of field: ggml_type_traits::to_float"] + [::std::mem::offset_of!(ggml_type_traits, to_float) - 40usize]; + ["Offset of field: ggml_type_traits::from_float"] + [::std::mem::offset_of!(ggml_type_traits, from_float) - 48usize]; + ["Offset of field: ggml_type_traits::from_float_ref"] + [::std::mem::offset_of!(ggml_type_traits, from_float_ref) - 56usize]; + ["Offset of field: ggml_type_traits::from_float_to_mat"] + [::std::mem::offset_of!(ggml_type_traits, from_float_to_mat) - 64usize]; + ["Offset of field: ggml_type_traits::vec_dot"] + [::std::mem::offset_of!(ggml_type_traits, vec_dot) - 72usize]; + ["Offset of field: ggml_type_traits::vec_dot_type"] + [::std::mem::offset_of!(ggml_type_traits, vec_dot_type) - 80usize]; + ["Offset of field: ggml_type_traits::nrows"] + [::std::mem::offset_of!(ggml_type_traits, nrows) - 88usize]; + ["Offset of field: ggml_type_traits::ncols"] + [::std::mem::offset_of!(ggml_type_traits, ncols) - 96usize]; + ["Offset of field: ggml_type_traits::gemv"] + [::std::mem::offset_of!(ggml_type_traits, gemv) - 104usize]; + ["Offset of field: ggml_type_traits::gemm"] + [::std::mem::offset_of!(ggml_type_traits, gemm) - 112usize]; +}; +extern "C" { + pub fn ggml_get_type_traits(type_: ggml_type) -> *const ggml_type_traits; } #[repr(C)] #[derive(Debug, Copy, Clone)] @@ -5492,6 +3991,8 @@ pub const whisper_alignment_heads_preset_WHISPER_AHEADS_LARGE_V2: whisper_alignm 12; pub const whisper_alignment_heads_preset_WHISPER_AHEADS_LARGE_V3: whisper_alignment_heads_preset = 13; +pub const whisper_alignment_heads_preset_WHISPER_AHEADS_LARGE_V3_TURBO: + whisper_alignment_heads_preset = 14; pub type whisper_alignment_heads_preset = ::std::os::raw::c_uint; #[repr(C)] #[derive(Debug, Copy, Clone)] @@ -5499,82 +4000,30 @@ pub struct whisper_ahead { pub n_text_layer: ::std::os::raw::c_int, pub n_head: ::std::os::raw::c_int, } -#[test] -fn bindgen_test_layout_whisper_ahead() { - const UNINIT: ::std::mem::MaybeUninit = ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::(), - 8usize, - concat!("Size of: ", stringify!(whisper_ahead)) - ); - assert_eq!( - ::std::mem::align_of::(), - 4usize, - concat!("Alignment of ", stringify!(whisper_ahead)) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).n_text_layer) as usize - ptr as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(whisper_ahead), - "::", - stringify!(n_text_layer) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).n_head) as usize - ptr as usize }, - 4usize, - concat!( - "Offset of field: ", - stringify!(whisper_ahead), - "::", - stringify!(n_head) - ) - ); -} +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of whisper_ahead"][::std::mem::size_of::() - 8usize]; + ["Alignment of whisper_ahead"][::std::mem::align_of::() - 4usize]; + ["Offset of field: whisper_ahead::n_text_layer"] + [::std::mem::offset_of!(whisper_ahead, n_text_layer) - 0usize]; + ["Offset of field: whisper_ahead::n_head"] + [::std::mem::offset_of!(whisper_ahead, n_head) - 4usize]; +}; #[repr(C)] #[derive(Debug, Copy, Clone)] pub struct whisper_aheads { pub n_heads: usize, pub heads: *const whisper_ahead, } -#[test] -fn bindgen_test_layout_whisper_aheads() { - const UNINIT: ::std::mem::MaybeUninit = ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::(), - 16usize, - concat!("Size of: ", stringify!(whisper_aheads)) - ); - assert_eq!( - ::std::mem::align_of::(), - 8usize, - concat!("Alignment of ", stringify!(whisper_aheads)) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).n_heads) as usize - ptr as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(whisper_aheads), - "::", - stringify!(n_heads) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).heads) as usize - ptr as usize }, - 8usize, - concat!( - "Offset of field: ", - stringify!(whisper_aheads), - "::", - stringify!(heads) - ) - ); -} +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of whisper_aheads"][::std::mem::size_of::() - 16usize]; + ["Alignment of whisper_aheads"][::std::mem::align_of::() - 8usize]; + ["Offset of field: whisper_aheads::n_heads"] + [::std::mem::offset_of!(whisper_aheads, n_heads) - 0usize]; + ["Offset of field: whisper_aheads::heads"] + [::std::mem::offset_of!(whisper_aheads, heads) - 8usize]; +}; #[repr(C)] #[derive(Debug, Copy, Clone)] pub struct whisper_context_params { @@ -5587,102 +4036,28 @@ pub struct whisper_context_params { pub dtw_aheads: whisper_aheads, pub dtw_mem_size: usize, } -#[test] -fn bindgen_test_layout_whisper_context_params() { - const UNINIT: ::std::mem::MaybeUninit = - ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::(), - 48usize, - concat!("Size of: ", stringify!(whisper_context_params)) - ); - assert_eq!( - ::std::mem::align_of::(), - 8usize, - concat!("Alignment of ", stringify!(whisper_context_params)) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).use_gpu) as usize - ptr as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(whisper_context_params), - "::", - stringify!(use_gpu) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).flash_attn) as usize - ptr as usize }, - 1usize, - concat!( - "Offset of field: ", - stringify!(whisper_context_params), - "::", - stringify!(flash_attn) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).gpu_device) as usize - ptr as usize }, - 4usize, - concat!( - "Offset of field: ", - stringify!(whisper_context_params), - "::", - stringify!(gpu_device) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).dtw_token_timestamps) as usize - ptr as usize }, - 8usize, - concat!( - "Offset of field: ", - stringify!(whisper_context_params), - "::", - stringify!(dtw_token_timestamps) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).dtw_aheads_preset) as usize - ptr as usize }, - 12usize, - concat!( - "Offset of field: ", - stringify!(whisper_context_params), - "::", - stringify!(dtw_aheads_preset) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).dtw_n_top) as usize - ptr as usize }, - 16usize, - concat!( - "Offset of field: ", - stringify!(whisper_context_params), - "::", - stringify!(dtw_n_top) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).dtw_aheads) as usize - ptr as usize }, - 24usize, - concat!( - "Offset of field: ", - stringify!(whisper_context_params), - "::", - stringify!(dtw_aheads) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).dtw_mem_size) as usize - ptr as usize }, - 40usize, - concat!( - "Offset of field: ", - stringify!(whisper_context_params), - "::", - stringify!(dtw_mem_size) - ) - ); -} +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of whisper_context_params"][::std::mem::size_of::() - 48usize]; + ["Alignment of whisper_context_params"] + [::std::mem::align_of::() - 8usize]; + ["Offset of field: whisper_context_params::use_gpu"] + [::std::mem::offset_of!(whisper_context_params, use_gpu) - 0usize]; + ["Offset of field: whisper_context_params::flash_attn"] + [::std::mem::offset_of!(whisper_context_params, flash_attn) - 1usize]; + ["Offset of field: whisper_context_params::gpu_device"] + [::std::mem::offset_of!(whisper_context_params, gpu_device) - 4usize]; + ["Offset of field: whisper_context_params::dtw_token_timestamps"] + [::std::mem::offset_of!(whisper_context_params, dtw_token_timestamps) - 8usize]; + ["Offset of field: whisper_context_params::dtw_aheads_preset"] + [::std::mem::offset_of!(whisper_context_params, dtw_aheads_preset) - 12usize]; + ["Offset of field: whisper_context_params::dtw_n_top"] + [::std::mem::offset_of!(whisper_context_params, dtw_n_top) - 16usize]; + ["Offset of field: whisper_context_params::dtw_aheads"] + [::std::mem::offset_of!(whisper_context_params, dtw_aheads) - 24usize]; + ["Offset of field: whisper_context_params::dtw_mem_size"] + [::std::mem::offset_of!(whisper_context_params, dtw_mem_size) - 40usize]; +}; #[repr(C)] #[derive(Debug, Copy, Clone)] pub struct whisper_token_data { @@ -5697,121 +4072,31 @@ pub struct whisper_token_data { pub t_dtw: i64, pub vlen: f32, } -#[test] -fn bindgen_test_layout_whisper_token_data() { - const UNINIT: ::std::mem::MaybeUninit = ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::(), - 56usize, - concat!("Size of: ", stringify!(whisper_token_data)) - ); - assert_eq!( - ::std::mem::align_of::(), - 8usize, - concat!("Alignment of ", stringify!(whisper_token_data)) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).id) as usize - ptr as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(whisper_token_data), - "::", - stringify!(id) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).tid) as usize - ptr as usize }, - 4usize, - concat!( - "Offset of field: ", - stringify!(whisper_token_data), - "::", - stringify!(tid) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).p) as usize - ptr as usize }, - 8usize, - concat!( - "Offset of field: ", - stringify!(whisper_token_data), - "::", - stringify!(p) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).plog) as usize - ptr as usize }, - 12usize, - concat!( - "Offset of field: ", - stringify!(whisper_token_data), - "::", - stringify!(plog) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).pt) as usize - ptr as usize }, - 16usize, - concat!( - "Offset of field: ", - stringify!(whisper_token_data), - "::", - stringify!(pt) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).ptsum) as usize - ptr as usize }, - 20usize, - concat!( - "Offset of field: ", - stringify!(whisper_token_data), - "::", - stringify!(ptsum) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).t0) as usize - ptr as usize }, - 24usize, - concat!( - "Offset of field: ", - stringify!(whisper_token_data), - "::", - stringify!(t0) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).t1) as usize - ptr as usize }, - 32usize, - concat!( - "Offset of field: ", - stringify!(whisper_token_data), - "::", - stringify!(t1) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).t_dtw) as usize - ptr as usize }, - 40usize, - concat!( - "Offset of field: ", - stringify!(whisper_token_data), - "::", - stringify!(t_dtw) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).vlen) as usize - ptr as usize }, - 48usize, - concat!( - "Offset of field: ", - stringify!(whisper_token_data), - "::", - stringify!(vlen) - ) - ); -} +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of whisper_token_data"][::std::mem::size_of::() - 56usize]; + ["Alignment of whisper_token_data"][::std::mem::align_of::() - 8usize]; + ["Offset of field: whisper_token_data::id"] + [::std::mem::offset_of!(whisper_token_data, id) - 0usize]; + ["Offset of field: whisper_token_data::tid"] + [::std::mem::offset_of!(whisper_token_data, tid) - 4usize]; + ["Offset of field: whisper_token_data::p"] + [::std::mem::offset_of!(whisper_token_data, p) - 8usize]; + ["Offset of field: whisper_token_data::plog"] + [::std::mem::offset_of!(whisper_token_data, plog) - 12usize]; + ["Offset of field: whisper_token_data::pt"] + [::std::mem::offset_of!(whisper_token_data, pt) - 16usize]; + ["Offset of field: whisper_token_data::ptsum"] + [::std::mem::offset_of!(whisper_token_data, ptsum) - 20usize]; + ["Offset of field: whisper_token_data::t0"] + [::std::mem::offset_of!(whisper_token_data, t0) - 24usize]; + ["Offset of field: whisper_token_data::t1"] + [::std::mem::offset_of!(whisper_token_data, t1) - 32usize]; + ["Offset of field: whisper_token_data::t_dtw"] + [::std::mem::offset_of!(whisper_token_data, t_dtw) - 40usize]; + ["Offset of field: whisper_token_data::vlen"] + [::std::mem::offset_of!(whisper_token_data, vlen) - 48usize]; +}; #[repr(C)] #[derive(Debug, Copy, Clone)] pub struct whisper_model_loader { @@ -5826,61 +4111,19 @@ pub struct whisper_model_loader { pub eof: ::std::option::Option bool>, pub close: ::std::option::Option, } -#[test] -fn bindgen_test_layout_whisper_model_loader() { - const UNINIT: ::std::mem::MaybeUninit = ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::(), - 32usize, - concat!("Size of: ", stringify!(whisper_model_loader)) - ); - assert_eq!( - ::std::mem::align_of::(), - 8usize, - concat!("Alignment of ", stringify!(whisper_model_loader)) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).context) as usize - ptr as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(whisper_model_loader), - "::", - stringify!(context) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).read) as usize - ptr as usize }, - 8usize, - concat!( - "Offset of field: ", - stringify!(whisper_model_loader), - "::", - stringify!(read) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).eof) as usize - ptr as usize }, - 16usize, - concat!( - "Offset of field: ", - stringify!(whisper_model_loader), - "::", - stringify!(eof) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).close) as usize - ptr as usize }, - 24usize, - concat!( - "Offset of field: ", - stringify!(whisper_model_loader), - "::", - stringify!(close) - ) - ); -} +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of whisper_model_loader"][::std::mem::size_of::() - 32usize]; + ["Alignment of whisper_model_loader"][::std::mem::align_of::() - 8usize]; + ["Offset of field: whisper_model_loader::context"] + [::std::mem::offset_of!(whisper_model_loader, context) - 0usize]; + ["Offset of field: whisper_model_loader::read"] + [::std::mem::offset_of!(whisper_model_loader, read) - 8usize]; + ["Offset of field: whisper_model_loader::eof"] + [::std::mem::offset_of!(whisper_model_loader, eof) - 16usize]; + ["Offset of field: whisper_model_loader::close"] + [::std::mem::offset_of!(whisper_model_loader, close) - 24usize]; +}; pub const whisper_gretype_WHISPER_GRETYPE_END: whisper_gretype = 0; pub const whisper_gretype_WHISPER_GRETYPE_ALT: whisper_gretype = 1; pub const whisper_gretype_WHISPER_GRETYPE_RULE_REF: whisper_gretype = 2; @@ -5895,42 +4138,16 @@ pub struct whisper_grammar_element { pub type_: whisper_gretype, pub value: u32, } -#[test] -fn bindgen_test_layout_whisper_grammar_element() { - const UNINIT: ::std::mem::MaybeUninit = - ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::(), - 8usize, - concat!("Size of: ", stringify!(whisper_grammar_element)) - ); - assert_eq!( - ::std::mem::align_of::(), - 4usize, - concat!("Alignment of ", stringify!(whisper_grammar_element)) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).type_) as usize - ptr as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(whisper_grammar_element), - "::", - stringify!(type_) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).value) as usize - ptr as usize }, - 4usize, - concat!( - "Offset of field: ", - stringify!(whisper_grammar_element), - "::", - stringify!(value) - ) - ); -} +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of whisper_grammar_element"][::std::mem::size_of::() - 8usize]; + ["Alignment of whisper_grammar_element"] + [::std::mem::align_of::() - 4usize]; + ["Offset of field: whisper_grammar_element::type_"] + [::std::mem::offset_of!(whisper_grammar_element, type_) - 0usize]; + ["Offset of field: whisper_grammar_element::value"] + [::std::mem::offset_of!(whisper_grammar_element, value) - 4usize]; +}; extern "C" { pub fn whisper_init_from_file_with_params( path_model: *const ::std::os::raw::c_char, @@ -6000,6 +4217,15 @@ extern "C" { extern "C" { pub fn whisper_init_state(ctx: *mut whisper_context) -> *mut whisper_state; } +extern "C" { + pub fn whisper_ctx_init_openvino_encoder_with_state( + ctx: *mut whisper_context, + state: *mut whisper_state, + model_path: *const ::std::os::raw::c_char, + device: *const ::std::os::raw::c_char, + cache_dir: *const ::std::os::raw::c_char, + ) -> ::std::os::raw::c_int; +} extern "C" { pub fn whisper_ctx_init_openvino_encoder( ctx: *mut whisper_context, @@ -6340,631 +4566,143 @@ pub struct whisper_full_params { pub struct whisper_full_params__bindgen_ty_1 { pub best_of: ::std::os::raw::c_int, } -#[test] -fn bindgen_test_layout_whisper_full_params__bindgen_ty_1() { - const UNINIT: ::std::mem::MaybeUninit = - ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::(), - 4usize, - concat!("Size of: ", stringify!(whisper_full_params__bindgen_ty_1)) - ); - assert_eq!( - ::std::mem::align_of::(), - 4usize, - concat!( - "Alignment of ", - stringify!(whisper_full_params__bindgen_ty_1) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).best_of) as usize - ptr as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(whisper_full_params__bindgen_ty_1), - "::", - stringify!(best_of) - ) - ); -} +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of whisper_full_params__bindgen_ty_1"] + [::std::mem::size_of::() - 4usize]; + ["Alignment of whisper_full_params__bindgen_ty_1"] + [::std::mem::align_of::() - 4usize]; + ["Offset of field: whisper_full_params__bindgen_ty_1::best_of"] + [::std::mem::offset_of!(whisper_full_params__bindgen_ty_1, best_of) - 0usize]; +}; #[repr(C)] #[derive(Debug, Copy, Clone)] pub struct whisper_full_params__bindgen_ty_2 { pub beam_size: ::std::os::raw::c_int, pub patience: f32, } -#[test] -fn bindgen_test_layout_whisper_full_params__bindgen_ty_2() { - const UNINIT: ::std::mem::MaybeUninit = - ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::(), - 8usize, - concat!("Size of: ", stringify!(whisper_full_params__bindgen_ty_2)) - ); - assert_eq!( - ::std::mem::align_of::(), - 4usize, - concat!( - "Alignment of ", - stringify!(whisper_full_params__bindgen_ty_2) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).beam_size) as usize - ptr as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(whisper_full_params__bindgen_ty_2), - "::", - stringify!(beam_size) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).patience) as usize - ptr as usize }, - 4usize, - concat!( - "Offset of field: ", - stringify!(whisper_full_params__bindgen_ty_2), - "::", - stringify!(patience) - ) - ); -} -#[test] -fn bindgen_test_layout_whisper_full_params() { - const UNINIT: ::std::mem::MaybeUninit = ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::(), - 264usize, - concat!("Size of: ", stringify!(whisper_full_params)) - ); - assert_eq!( - ::std::mem::align_of::(), - 8usize, - concat!("Alignment of ", stringify!(whisper_full_params)) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).strategy) as usize - ptr as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(whisper_full_params), - "::", - stringify!(strategy) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).n_threads) as usize - ptr as usize }, - 4usize, - concat!( - "Offset of field: ", - stringify!(whisper_full_params), - "::", - stringify!(n_threads) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).n_max_text_ctx) as usize - ptr as usize }, - 8usize, - concat!( - "Offset of field: ", - stringify!(whisper_full_params), - "::", - stringify!(n_max_text_ctx) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).offset_ms) as usize - ptr as usize }, - 12usize, - concat!( - "Offset of field: ", - stringify!(whisper_full_params), - "::", - stringify!(offset_ms) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).duration_ms) as usize - ptr as usize }, - 16usize, - concat!( - "Offset of field: ", - stringify!(whisper_full_params), - "::", - stringify!(duration_ms) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).translate) as usize - ptr as usize }, - 20usize, - concat!( - "Offset of field: ", - stringify!(whisper_full_params), - "::", - stringify!(translate) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).no_context) as usize - ptr as usize }, - 21usize, - concat!( - "Offset of field: ", - stringify!(whisper_full_params), - "::", - stringify!(no_context) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).no_timestamps) as usize - ptr as usize }, - 22usize, - concat!( - "Offset of field: ", - stringify!(whisper_full_params), - "::", - stringify!(no_timestamps) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).single_segment) as usize - ptr as usize }, - 23usize, - concat!( - "Offset of field: ", - stringify!(whisper_full_params), - "::", - stringify!(single_segment) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).print_special) as usize - ptr as usize }, - 24usize, - concat!( - "Offset of field: ", - stringify!(whisper_full_params), - "::", - stringify!(print_special) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).print_progress) as usize - ptr as usize }, - 25usize, - concat!( - "Offset of field: ", - stringify!(whisper_full_params), - "::", - stringify!(print_progress) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).print_realtime) as usize - ptr as usize }, - 26usize, - concat!( - "Offset of field: ", - stringify!(whisper_full_params), - "::", - stringify!(print_realtime) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).print_timestamps) as usize - ptr as usize }, - 27usize, - concat!( - "Offset of field: ", - stringify!(whisper_full_params), - "::", - stringify!(print_timestamps) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).token_timestamps) as usize - ptr as usize }, - 28usize, - concat!( - "Offset of field: ", - stringify!(whisper_full_params), - "::", - stringify!(token_timestamps) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).thold_pt) as usize - ptr as usize }, - 32usize, - concat!( - "Offset of field: ", - stringify!(whisper_full_params), - "::", - stringify!(thold_pt) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).thold_ptsum) as usize - ptr as usize }, - 36usize, - concat!( - "Offset of field: ", - stringify!(whisper_full_params), - "::", - stringify!(thold_ptsum) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).max_len) as usize - ptr as usize }, - 40usize, - concat!( - "Offset of field: ", - stringify!(whisper_full_params), - "::", - stringify!(max_len) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).split_on_word) as usize - ptr as usize }, - 44usize, - concat!( - "Offset of field: ", - stringify!(whisper_full_params), - "::", - stringify!(split_on_word) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).max_tokens) as usize - ptr as usize }, - 48usize, - concat!( - "Offset of field: ", - stringify!(whisper_full_params), - "::", - stringify!(max_tokens) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).debug_mode) as usize - ptr as usize }, - 52usize, - concat!( - "Offset of field: ", - stringify!(whisper_full_params), - "::", - stringify!(debug_mode) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).audio_ctx) as usize - ptr as usize }, - 56usize, - concat!( - "Offset of field: ", - stringify!(whisper_full_params), - "::", - stringify!(audio_ctx) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).tdrz_enable) as usize - ptr as usize }, - 60usize, - concat!( - "Offset of field: ", - stringify!(whisper_full_params), - "::", - stringify!(tdrz_enable) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).suppress_regex) as usize - ptr as usize }, - 64usize, - concat!( - "Offset of field: ", - stringify!(whisper_full_params), - "::", - stringify!(suppress_regex) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).initial_prompt) as usize - ptr as usize }, - 72usize, - concat!( - "Offset of field: ", - stringify!(whisper_full_params), - "::", - stringify!(initial_prompt) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).prompt_tokens) as usize - ptr as usize }, - 80usize, - concat!( - "Offset of field: ", - stringify!(whisper_full_params), - "::", - stringify!(prompt_tokens) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).prompt_n_tokens) as usize - ptr as usize }, - 88usize, - concat!( - "Offset of field: ", - stringify!(whisper_full_params), - "::", - stringify!(prompt_n_tokens) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).language) as usize - ptr as usize }, - 96usize, - concat!( - "Offset of field: ", - stringify!(whisper_full_params), - "::", - stringify!(language) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).detect_language) as usize - ptr as usize }, - 104usize, - concat!( - "Offset of field: ", - stringify!(whisper_full_params), - "::", - stringify!(detect_language) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).suppress_blank) as usize - ptr as usize }, - 105usize, - concat!( - "Offset of field: ", - stringify!(whisper_full_params), - "::", - stringify!(suppress_blank) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).suppress_non_speech_tokens) as usize - ptr as usize }, - 106usize, - concat!( - "Offset of field: ", - stringify!(whisper_full_params), - "::", - stringify!(suppress_non_speech_tokens) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).temperature) as usize - ptr as usize }, - 108usize, - concat!( - "Offset of field: ", - stringify!(whisper_full_params), - "::", - stringify!(temperature) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).max_initial_ts) as usize - ptr as usize }, - 112usize, - concat!( - "Offset of field: ", - stringify!(whisper_full_params), - "::", - stringify!(max_initial_ts) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).length_penalty) as usize - ptr as usize }, - 116usize, - concat!( - "Offset of field: ", - stringify!(whisper_full_params), - "::", - stringify!(length_penalty) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).temperature_inc) as usize - ptr as usize }, - 120usize, - concat!( - "Offset of field: ", - stringify!(whisper_full_params), - "::", - stringify!(temperature_inc) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).entropy_thold) as usize - ptr as usize }, - 124usize, - concat!( - "Offset of field: ", - stringify!(whisper_full_params), - "::", - stringify!(entropy_thold) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).logprob_thold) as usize - ptr as usize }, - 128usize, - concat!( - "Offset of field: ", - stringify!(whisper_full_params), - "::", - stringify!(logprob_thold) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).no_speech_thold) as usize - ptr as usize }, - 132usize, - concat!( - "Offset of field: ", - stringify!(whisper_full_params), - "::", - stringify!(no_speech_thold) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).greedy) as usize - ptr as usize }, - 136usize, - concat!( - "Offset of field: ", - stringify!(whisper_full_params), - "::", - stringify!(greedy) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).beam_search) as usize - ptr as usize }, - 140usize, - concat!( - "Offset of field: ", - stringify!(whisper_full_params), - "::", - stringify!(beam_search) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).new_segment_callback) as usize - ptr as usize }, - 152usize, - concat!( - "Offset of field: ", - stringify!(whisper_full_params), - "::", - stringify!(new_segment_callback) - ) - ); - assert_eq!( - unsafe { - ::std::ptr::addr_of!((*ptr).new_segment_callback_user_data) as usize - ptr as usize - }, - 160usize, - concat!( - "Offset of field: ", - stringify!(whisper_full_params), - "::", - stringify!(new_segment_callback_user_data) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).progress_callback) as usize - ptr as usize }, - 168usize, - concat!( - "Offset of field: ", - stringify!(whisper_full_params), - "::", - stringify!(progress_callback) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).progress_callback_user_data) as usize - ptr as usize }, - 176usize, - concat!( - "Offset of field: ", - stringify!(whisper_full_params), - "::", - stringify!(progress_callback_user_data) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).encoder_begin_callback) as usize - ptr as usize }, - 184usize, - concat!( - "Offset of field: ", - stringify!(whisper_full_params), - "::", - stringify!(encoder_begin_callback) - ) - ); - assert_eq!( - unsafe { - ::std::ptr::addr_of!((*ptr).encoder_begin_callback_user_data) as usize - ptr as usize - }, - 192usize, - concat!( - "Offset of field: ", - stringify!(whisper_full_params), - "::", - stringify!(encoder_begin_callback_user_data) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).abort_callback) as usize - ptr as usize }, - 200usize, - concat!( - "Offset of field: ", - stringify!(whisper_full_params), - "::", - stringify!(abort_callback) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).abort_callback_user_data) as usize - ptr as usize }, - 208usize, - concat!( - "Offset of field: ", - stringify!(whisper_full_params), - "::", - stringify!(abort_callback_user_data) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).logits_filter_callback) as usize - ptr as usize }, - 216usize, - concat!( - "Offset of field: ", - stringify!(whisper_full_params), - "::", - stringify!(logits_filter_callback) - ) - ); - assert_eq!( - unsafe { - ::std::ptr::addr_of!((*ptr).logits_filter_callback_user_data) as usize - ptr as usize - }, - 224usize, - concat!( - "Offset of field: ", - stringify!(whisper_full_params), - "::", - stringify!(logits_filter_callback_user_data) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).grammar_rules) as usize - ptr as usize }, - 232usize, - concat!( - "Offset of field: ", - stringify!(whisper_full_params), - "::", - stringify!(grammar_rules) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).n_grammar_rules) as usize - ptr as usize }, - 240usize, - concat!( - "Offset of field: ", - stringify!(whisper_full_params), - "::", - stringify!(n_grammar_rules) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).i_start_rule) as usize - ptr as usize }, - 248usize, - concat!( - "Offset of field: ", - stringify!(whisper_full_params), - "::", - stringify!(i_start_rule) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).grammar_penalty) as usize - ptr as usize }, - 256usize, - concat!( - "Offset of field: ", - stringify!(whisper_full_params), - "::", - stringify!(grammar_penalty) - ) - ); -} +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of whisper_full_params__bindgen_ty_2"] + [::std::mem::size_of::() - 8usize]; + ["Alignment of whisper_full_params__bindgen_ty_2"] + [::std::mem::align_of::() - 4usize]; + ["Offset of field: whisper_full_params__bindgen_ty_2::beam_size"] + [::std::mem::offset_of!(whisper_full_params__bindgen_ty_2, beam_size) - 0usize]; + ["Offset of field: whisper_full_params__bindgen_ty_2::patience"] + [::std::mem::offset_of!(whisper_full_params__bindgen_ty_2, patience) - 4usize]; +}; +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of whisper_full_params"][::std::mem::size_of::() - 264usize]; + ["Alignment of whisper_full_params"][::std::mem::align_of::() - 8usize]; + ["Offset of field: whisper_full_params::strategy"] + [::std::mem::offset_of!(whisper_full_params, strategy) - 0usize]; + ["Offset of field: whisper_full_params::n_threads"] + [::std::mem::offset_of!(whisper_full_params, n_threads) - 4usize]; + ["Offset of field: whisper_full_params::n_max_text_ctx"] + [::std::mem::offset_of!(whisper_full_params, n_max_text_ctx) - 8usize]; + ["Offset of field: whisper_full_params::offset_ms"] + [::std::mem::offset_of!(whisper_full_params, offset_ms) - 12usize]; + ["Offset of field: whisper_full_params::duration_ms"] + [::std::mem::offset_of!(whisper_full_params, duration_ms) - 16usize]; + ["Offset of field: whisper_full_params::translate"] + [::std::mem::offset_of!(whisper_full_params, translate) - 20usize]; + ["Offset of field: whisper_full_params::no_context"] + [::std::mem::offset_of!(whisper_full_params, no_context) - 21usize]; + ["Offset of field: whisper_full_params::no_timestamps"] + [::std::mem::offset_of!(whisper_full_params, no_timestamps) - 22usize]; + ["Offset of field: whisper_full_params::single_segment"] + [::std::mem::offset_of!(whisper_full_params, single_segment) - 23usize]; + ["Offset of field: whisper_full_params::print_special"] + [::std::mem::offset_of!(whisper_full_params, print_special) - 24usize]; + ["Offset of field: whisper_full_params::print_progress"] + [::std::mem::offset_of!(whisper_full_params, print_progress) - 25usize]; + ["Offset of field: whisper_full_params::print_realtime"] + [::std::mem::offset_of!(whisper_full_params, print_realtime) - 26usize]; + ["Offset of field: whisper_full_params::print_timestamps"] + [::std::mem::offset_of!(whisper_full_params, print_timestamps) - 27usize]; + ["Offset of field: whisper_full_params::token_timestamps"] + [::std::mem::offset_of!(whisper_full_params, token_timestamps) - 28usize]; + ["Offset of field: whisper_full_params::thold_pt"] + [::std::mem::offset_of!(whisper_full_params, thold_pt) - 32usize]; + ["Offset of field: whisper_full_params::thold_ptsum"] + [::std::mem::offset_of!(whisper_full_params, thold_ptsum) - 36usize]; + ["Offset of field: whisper_full_params::max_len"] + [::std::mem::offset_of!(whisper_full_params, max_len) - 40usize]; + ["Offset of field: whisper_full_params::split_on_word"] + [::std::mem::offset_of!(whisper_full_params, split_on_word) - 44usize]; + ["Offset of field: whisper_full_params::max_tokens"] + [::std::mem::offset_of!(whisper_full_params, max_tokens) - 48usize]; + ["Offset of field: whisper_full_params::debug_mode"] + [::std::mem::offset_of!(whisper_full_params, debug_mode) - 52usize]; + ["Offset of field: whisper_full_params::audio_ctx"] + [::std::mem::offset_of!(whisper_full_params, audio_ctx) - 56usize]; + ["Offset of field: whisper_full_params::tdrz_enable"] + [::std::mem::offset_of!(whisper_full_params, tdrz_enable) - 60usize]; + ["Offset of field: whisper_full_params::suppress_regex"] + [::std::mem::offset_of!(whisper_full_params, suppress_regex) - 64usize]; + ["Offset of field: whisper_full_params::initial_prompt"] + [::std::mem::offset_of!(whisper_full_params, initial_prompt) - 72usize]; + ["Offset of field: whisper_full_params::prompt_tokens"] + [::std::mem::offset_of!(whisper_full_params, prompt_tokens) - 80usize]; + ["Offset of field: whisper_full_params::prompt_n_tokens"] + [::std::mem::offset_of!(whisper_full_params, prompt_n_tokens) - 88usize]; + ["Offset of field: whisper_full_params::language"] + [::std::mem::offset_of!(whisper_full_params, language) - 96usize]; + ["Offset of field: whisper_full_params::detect_language"] + [::std::mem::offset_of!(whisper_full_params, detect_language) - 104usize]; + ["Offset of field: whisper_full_params::suppress_blank"] + [::std::mem::offset_of!(whisper_full_params, suppress_blank) - 105usize]; + ["Offset of field: whisper_full_params::suppress_non_speech_tokens"] + [::std::mem::offset_of!(whisper_full_params, suppress_non_speech_tokens) - 106usize]; + ["Offset of field: whisper_full_params::temperature"] + [::std::mem::offset_of!(whisper_full_params, temperature) - 108usize]; + ["Offset of field: whisper_full_params::max_initial_ts"] + [::std::mem::offset_of!(whisper_full_params, max_initial_ts) - 112usize]; + ["Offset of field: whisper_full_params::length_penalty"] + [::std::mem::offset_of!(whisper_full_params, length_penalty) - 116usize]; + ["Offset of field: whisper_full_params::temperature_inc"] + [::std::mem::offset_of!(whisper_full_params, temperature_inc) - 120usize]; + ["Offset of field: whisper_full_params::entropy_thold"] + [::std::mem::offset_of!(whisper_full_params, entropy_thold) - 124usize]; + ["Offset of field: whisper_full_params::logprob_thold"] + [::std::mem::offset_of!(whisper_full_params, logprob_thold) - 128usize]; + ["Offset of field: whisper_full_params::no_speech_thold"] + [::std::mem::offset_of!(whisper_full_params, no_speech_thold) - 132usize]; + ["Offset of field: whisper_full_params::greedy"] + [::std::mem::offset_of!(whisper_full_params, greedy) - 136usize]; + ["Offset of field: whisper_full_params::beam_search"] + [::std::mem::offset_of!(whisper_full_params, beam_search) - 140usize]; + ["Offset of field: whisper_full_params::new_segment_callback"] + [::std::mem::offset_of!(whisper_full_params, new_segment_callback) - 152usize]; + ["Offset of field: whisper_full_params::new_segment_callback_user_data"] + [::std::mem::offset_of!(whisper_full_params, new_segment_callback_user_data) - 160usize]; + ["Offset of field: whisper_full_params::progress_callback"] + [::std::mem::offset_of!(whisper_full_params, progress_callback) - 168usize]; + ["Offset of field: whisper_full_params::progress_callback_user_data"] + [::std::mem::offset_of!(whisper_full_params, progress_callback_user_data) - 176usize]; + ["Offset of field: whisper_full_params::encoder_begin_callback"] + [::std::mem::offset_of!(whisper_full_params, encoder_begin_callback) - 184usize]; + ["Offset of field: whisper_full_params::encoder_begin_callback_user_data"] + [::std::mem::offset_of!(whisper_full_params, encoder_begin_callback_user_data) - 192usize]; + ["Offset of field: whisper_full_params::abort_callback"] + [::std::mem::offset_of!(whisper_full_params, abort_callback) - 200usize]; + ["Offset of field: whisper_full_params::abort_callback_user_data"] + [::std::mem::offset_of!(whisper_full_params, abort_callback_user_data) - 208usize]; + ["Offset of field: whisper_full_params::logits_filter_callback"] + [::std::mem::offset_of!(whisper_full_params, logits_filter_callback) - 216usize]; + ["Offset of field: whisper_full_params::logits_filter_callback_user_data"] + [::std::mem::offset_of!(whisper_full_params, logits_filter_callback_user_data) - 224usize]; + ["Offset of field: whisper_full_params::grammar_rules"] + [::std::mem::offset_of!(whisper_full_params, grammar_rules) - 232usize]; + ["Offset of field: whisper_full_params::n_grammar_rules"] + [::std::mem::offset_of!(whisper_full_params, n_grammar_rules) - 240usize]; + ["Offset of field: whisper_full_params::i_start_rule"] + [::std::mem::offset_of!(whisper_full_params, i_start_rule) - 248usize]; + ["Offset of field: whisper_full_params::grammar_penalty"] + [::std::mem::offset_of!(whisper_full_params, grammar_penalty) - 256usize]; +}; extern "C" { pub fn whisper_context_default_params_by_ref() -> *mut whisper_context_params; } @@ -7162,61 +4900,19 @@ pub struct __va_list_tag { pub overflow_arg_area: *mut ::std::os::raw::c_void, pub reg_save_area: *mut ::std::os::raw::c_void, } -#[test] -fn bindgen_test_layout___va_list_tag() { - const UNINIT: ::std::mem::MaybeUninit<__va_list_tag> = ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::<__va_list_tag>(), - 24usize, - concat!("Size of: ", stringify!(__va_list_tag)) - ); - assert_eq!( - ::std::mem::align_of::<__va_list_tag>(), - 8usize, - concat!("Alignment of ", stringify!(__va_list_tag)) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).gp_offset) as usize - ptr as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(__va_list_tag), - "::", - stringify!(gp_offset) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).fp_offset) as usize - ptr as usize }, - 4usize, - concat!( - "Offset of field: ", - stringify!(__va_list_tag), - "::", - stringify!(fp_offset) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).overflow_arg_area) as usize - ptr as usize }, - 8usize, - concat!( - "Offset of field: ", - stringify!(__va_list_tag), - "::", - stringify!(overflow_arg_area) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).reg_save_area) as usize - ptr as usize }, - 16usize, - concat!( - "Offset of field: ", - stringify!(__va_list_tag), - "::", - stringify!(reg_save_area) - ) - ); -} +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of __va_list_tag"][::std::mem::size_of::<__va_list_tag>() - 24usize]; + ["Alignment of __va_list_tag"][::std::mem::align_of::<__va_list_tag>() - 8usize]; + ["Offset of field: __va_list_tag::gp_offset"] + [::std::mem::offset_of!(__va_list_tag, gp_offset) - 0usize]; + ["Offset of field: __va_list_tag::fp_offset"] + [::std::mem::offset_of!(__va_list_tag, fp_offset) - 4usize]; + ["Offset of field: __va_list_tag::overflow_arg_area"] + [::std::mem::offset_of!(__va_list_tag, overflow_arg_area) - 8usize]; + ["Offset of field: __va_list_tag::reg_save_area"] + [::std::mem::offset_of!(__va_list_tag, reg_save_area) - 16usize]; +}; #[repr(C)] #[derive(Debug, Copy, Clone)] pub struct ggml_backend_buffer { diff --git a/sys/whisper.cpp b/sys/whisper.cpp index ebca09a..0377596 160000 --- a/sys/whisper.cpp +++ b/sys/whisper.cpp @@ -1 +1 @@ -Subproject commit ebca09a3d1033417b0c630bbbe607b0f185b1488 +Subproject commit 0377596b77a3602e36430320cbe45f8c305ef04a diff --git a/sys/wrapper.h b/sys/wrapper.h index 5fb4710..0b0bbb9 100644 --- a/sys/wrapper.h +++ b/sys/wrapper.h @@ -1,2 +1,2 @@ -#include -#include +#include +#include