7071 lines
204 KiB
Rust
7071 lines
204 KiB
Rust
/* automatically generated by rust-bindgen 0.69.4 */
|
|
|
|
pub const __bool_true_false_are_defined: u32 = 1;
|
|
pub const true_: u32 = 1;
|
|
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 __USE_ISOC11: u32 = 1;
|
|
pub const __USE_ISOC99: u32 = 1;
|
|
pub const __USE_ISOC95: u32 = 1;
|
|
pub const __USE_POSIX_IMPLICITLY: u32 = 1;
|
|
pub const _POSIX_SOURCE: u32 = 1;
|
|
pub const _POSIX_C_SOURCE: u32 = 200809;
|
|
pub const __USE_POSIX: u32 = 1;
|
|
pub const __USE_POSIX2: u32 = 1;
|
|
pub const __USE_POSIX199309: u32 = 1;
|
|
pub const __USE_POSIX199506: u32 = 1;
|
|
pub const __USE_XOPEN2K: u32 = 1;
|
|
pub const __USE_XOPEN2K8: u32 = 1;
|
|
pub const _ATFILE_SOURCE: u32 = 1;
|
|
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_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 _STDC_PREDEF_H: u32 = 1;
|
|
pub const __STDC_IEC_559__: u32 = 1;
|
|
pub const __STDC_IEC_60559_BFP__: u32 = 201404;
|
|
pub const __STDC_IEC_559_COMPLEX__: u32 = 1;
|
|
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 = 35;
|
|
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_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_TYPES_EXT: u32 = 0;
|
|
pub const _BITS_TYPES_H: u32 = 1;
|
|
pub const _BITS_TYPESIZES_H: u32 = 1;
|
|
pub const __OFF_T_MATCHES_OFF64_T: u32 = 1;
|
|
pub const __INO_T_MATCHES_INO64_T: u32 = 1;
|
|
pub const __RLIM_T_MATCHES_RLIM64_T: u32 = 1;
|
|
pub const __STATFS_MATCHES_STATFS64: u32 = 1;
|
|
pub const __KERNEL_OLD_TIMEVAL_MATCHES_TIMEVAL64: u32 = 1;
|
|
pub const __FD_SETSIZE: u32 = 1024;
|
|
pub const _BITS_TIME64_H: u32 = 1;
|
|
pub const _BITS_WCHAR_H: u32 = 1;
|
|
pub const _BITS_STDINT_INTN_H: u32 = 1;
|
|
pub const _BITS_STDINT_UINTN_H: u32 = 1;
|
|
pub const INT8_MIN: i32 = -128;
|
|
pub const INT16_MIN: i32 = -32768;
|
|
pub const INT32_MIN: i32 = -2147483648;
|
|
pub const INT8_MAX: u32 = 127;
|
|
pub const INT16_MAX: u32 = 32767;
|
|
pub const INT32_MAX: u32 = 2147483647;
|
|
pub const UINT8_MAX: u32 = 255;
|
|
pub const UINT16_MAX: u32 = 65535;
|
|
pub const UINT32_MAX: u32 = 4294967295;
|
|
pub const INT_LEAST8_MIN: i32 = -128;
|
|
pub const INT_LEAST16_MIN: i32 = -32768;
|
|
pub const INT_LEAST32_MIN: i32 = -2147483648;
|
|
pub const INT_LEAST8_MAX: u32 = 127;
|
|
pub const INT_LEAST16_MAX: u32 = 32767;
|
|
pub const INT_LEAST32_MAX: u32 = 2147483647;
|
|
pub const UINT_LEAST8_MAX: u32 = 255;
|
|
pub const UINT_LEAST16_MAX: u32 = 65535;
|
|
pub const UINT_LEAST32_MAX: u32 = 4294967295;
|
|
pub const INT_FAST8_MIN: i32 = -128;
|
|
pub const INT_FAST16_MIN: i64 = -9223372036854775808;
|
|
pub const INT_FAST32_MIN: i64 = -9223372036854775808;
|
|
pub const INT_FAST8_MAX: u32 = 127;
|
|
pub const INT_FAST16_MAX: u64 = 9223372036854775807;
|
|
pub const INT_FAST32_MAX: u64 = 9223372036854775807;
|
|
pub const UINT_FAST8_MAX: u32 = 255;
|
|
pub const UINT_FAST16_MAX: i32 = -1;
|
|
pub const UINT_FAST32_MAX: i32 = -1;
|
|
pub const INTPTR_MIN: i64 = -9223372036854775808;
|
|
pub const INTPTR_MAX: u64 = 9223372036854775807;
|
|
pub const UINTPTR_MAX: i32 = -1;
|
|
pub const PTRDIFF_MIN: i64 = -9223372036854775808;
|
|
pub const PTRDIFF_MAX: u64 = 9223372036854775807;
|
|
pub const SIG_ATOMIC_MIN: i32 = -2147483648;
|
|
pub const SIG_ATOMIC_MAX: u32 = 2147483647;
|
|
pub const SIZE_MAX: i32 = -1;
|
|
pub const WINT_MIN: u32 = 0;
|
|
pub const WINT_MAX: u32 = 4294967295;
|
|
pub const _STDIO_H: u32 = 1;
|
|
pub const _____fpos_t_defined: u32 = 1;
|
|
pub const ____mbstate_t_defined: u32 = 1;
|
|
pub const _____fpos64_t_defined: u32 = 1;
|
|
pub const ____FILE_defined: u32 = 1;
|
|
pub const __FILE_defined: u32 = 1;
|
|
pub const __struct_FILE_defined: u32 = 1;
|
|
pub const _IO_EOF_SEEN: u32 = 16;
|
|
pub const _IO_ERR_SEEN: u32 = 32;
|
|
pub const _IO_USER_LOCK: u32 = 32768;
|
|
pub const _IOFBF: u32 = 0;
|
|
pub const _IOLBF: u32 = 1;
|
|
pub const _IONBF: u32 = 2;
|
|
pub const BUFSIZ: u32 = 8192;
|
|
pub const EOF: i32 = -1;
|
|
pub const SEEK_SET: u32 = 0;
|
|
pub const SEEK_CUR: u32 = 1;
|
|
pub const SEEK_END: u32 = 2;
|
|
pub const P_tmpdir: &[u8; 5] = b"/tmp\0";
|
|
pub const _BITS_STDIO_LIM_H: u32 = 1;
|
|
pub const L_tmpnam: u32 = 20;
|
|
pub const TMP_MAX: u32 = 238328;
|
|
pub const FILENAME_MAX: u32 = 4096;
|
|
pub const L_ctermid: u32 = 9;
|
|
pub const FOPEN_MAX: u32 = 16;
|
|
pub const __HAVE_FLOAT128: u32 = 0;
|
|
pub const __HAVE_DISTINCT_FLOAT128: u32 = 0;
|
|
pub const __HAVE_FLOAT64X: u32 = 1;
|
|
pub const __HAVE_FLOAT64X_LONG_DOUBLE: u32 = 1;
|
|
pub const __HAVE_FLOAT16: u32 = 0;
|
|
pub const __HAVE_FLOAT32: u32 = 1;
|
|
pub const __HAVE_FLOAT64: u32 = 1;
|
|
pub const __HAVE_FLOAT32X: u32 = 1;
|
|
pub const __HAVE_FLOAT128X: u32 = 0;
|
|
pub const __HAVE_DISTINCT_FLOAT16: u32 = 0;
|
|
pub const __HAVE_DISTINCT_FLOAT32: u32 = 0;
|
|
pub const __HAVE_DISTINCT_FLOAT64: u32 = 0;
|
|
pub const __HAVE_DISTINCT_FLOAT32X: u32 = 0;
|
|
pub const __HAVE_DISTINCT_FLOAT64X: u32 = 0;
|
|
pub const __HAVE_DISTINCT_FLOAT128X: u32 = 0;
|
|
pub const __HAVE_FLOATN_NOT_TYPEDEF: u32 = 0;
|
|
pub const GGML_FILE_MAGIC: u32 = 1734831468;
|
|
pub const GGML_FILE_VERSION: u32 = 1;
|
|
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_NAME: u32 = 64;
|
|
pub const GGML_MAX_OP_PARAMS: u32 = 64;
|
|
pub const GGML_DEFAULT_N_THREADS: u32 = 4;
|
|
pub const GGML_DEFAULT_GRAPH_SIZE: u32 = 2048;
|
|
pub const GGML_MEM_ALIGN: u32 = 16;
|
|
pub const GGML_EXIT_SUCCESS: u32 = 0;
|
|
pub const GGML_EXIT_ABORTED: u32 = 1;
|
|
pub const GGUF_MAGIC: &[u8; 5] = b"GGUF\0";
|
|
pub const GGUF_VERSION: u32 = 3;
|
|
pub const GGUF_DEFAULT_ALIGNMENT: u32 = 32;
|
|
pub const GGML_KQ_MASK_PAD: u32 = 32;
|
|
pub const GGML_N_TASKS_MAX: i32 = -1;
|
|
pub const WHISPER_SAMPLE_RATE: u32 = 16000;
|
|
pub const WHISPER_N_FFT: u32 = 400;
|
|
pub const WHISPER_N_FFT_HALF: u32 = 201;
|
|
pub const WHISPER_HOP_LENGTH: u32 = 160;
|
|
pub const WHISPER_CHUNK_SIZE: u32 = 30;
|
|
pub const WHISPER_N_SAMPLES: u32 = 480000;
|
|
pub type wchar_t = ::std::os::raw::c_int;
|
|
#[repr(C)]
|
|
#[repr(align(16))]
|
|
#[derive(Debug, Copy, Clone)]
|
|
pub struct max_align_t {
|
|
pub __clang_max_align_nonce1: ::std::os::raw::c_longlong,
|
|
pub __bindgen_padding_0: u64,
|
|
pub __clang_max_align_nonce2: u128,
|
|
}
|
|
#[test]
|
|
fn bindgen_test_layout_max_align_t() {
|
|
const UNINIT: ::std::mem::MaybeUninit<max_align_t> = ::std::mem::MaybeUninit::uninit();
|
|
let ptr = UNINIT.as_ptr();
|
|
assert_eq!(
|
|
::std::mem::size_of::<max_align_t>(),
|
|
32usize,
|
|
concat!("Size of: ", stringify!(max_align_t))
|
|
);
|
|
assert_eq!(
|
|
::std::mem::align_of::<max_align_t>(),
|
|
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)
|
|
)
|
|
);
|
|
}
|
|
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;
|
|
pub type __u_long = ::std::os::raw::c_ulong;
|
|
pub type __int8_t = ::std::os::raw::c_schar;
|
|
pub type __uint8_t = ::std::os::raw::c_uchar;
|
|
pub type __int16_t = ::std::os::raw::c_short;
|
|
pub type __uint16_t = ::std::os::raw::c_ushort;
|
|
pub type __int32_t = ::std::os::raw::c_int;
|
|
pub type __uint32_t = ::std::os::raw::c_uint;
|
|
pub type __int64_t = ::std::os::raw::c_long;
|
|
pub type __uint64_t = ::std::os::raw::c_ulong;
|
|
pub type __int_least8_t = __int8_t;
|
|
pub type __uint_least8_t = __uint8_t;
|
|
pub type __int_least16_t = __int16_t;
|
|
pub type __uint_least16_t = __uint16_t;
|
|
pub type __int_least32_t = __int32_t;
|
|
pub type __uint_least32_t = __uint32_t;
|
|
pub type __int_least64_t = __int64_t;
|
|
pub type __uint_least64_t = __uint64_t;
|
|
pub type __quad_t = ::std::os::raw::c_long;
|
|
pub type __u_quad_t = ::std::os::raw::c_ulong;
|
|
pub type __intmax_t = ::std::os::raw::c_long;
|
|
pub type __uintmax_t = ::std::os::raw::c_ulong;
|
|
pub type __dev_t = ::std::os::raw::c_ulong;
|
|
pub type __uid_t = ::std::os::raw::c_uint;
|
|
pub type __gid_t = ::std::os::raw::c_uint;
|
|
pub type __ino_t = ::std::os::raw::c_ulong;
|
|
pub type __ino64_t = ::std::os::raw::c_ulong;
|
|
pub type __mode_t = ::std::os::raw::c_uint;
|
|
pub type __nlink_t = ::std::os::raw::c_ulong;
|
|
pub type __off_t = ::std::os::raw::c_long;
|
|
pub type __off64_t = ::std::os::raw::c_long;
|
|
pub type __pid_t = ::std::os::raw::c_int;
|
|
#[repr(C)]
|
|
#[derive(Debug, Copy, Clone)]
|
|
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)
|
|
)
|
|
);
|
|
}
|
|
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;
|
|
pub type __id_t = ::std::os::raw::c_uint;
|
|
pub type __time_t = ::std::os::raw::c_long;
|
|
pub type __useconds_t = ::std::os::raw::c_uint;
|
|
pub type __suseconds_t = ::std::os::raw::c_long;
|
|
pub type __suseconds64_t = ::std::os::raw::c_long;
|
|
pub type __daddr_t = ::std::os::raw::c_int;
|
|
pub type __key_t = ::std::os::raw::c_int;
|
|
pub type __clockid_t = ::std::os::raw::c_int;
|
|
pub type __timer_t = *mut ::std::os::raw::c_void;
|
|
pub type __blksize_t = ::std::os::raw::c_long;
|
|
pub type __blkcnt_t = ::std::os::raw::c_long;
|
|
pub type __blkcnt64_t = ::std::os::raw::c_long;
|
|
pub type __fsblkcnt_t = ::std::os::raw::c_ulong;
|
|
pub type __fsblkcnt64_t = ::std::os::raw::c_ulong;
|
|
pub type __fsfilcnt_t = ::std::os::raw::c_ulong;
|
|
pub type __fsfilcnt64_t = ::std::os::raw::c_ulong;
|
|
pub type __fsword_t = ::std::os::raw::c_long;
|
|
pub type __ssize_t = ::std::os::raw::c_long;
|
|
pub type __syscall_slong_t = ::std::os::raw::c_long;
|
|
pub type __syscall_ulong_t = ::std::os::raw::c_ulong;
|
|
pub type __loff_t = __off64_t;
|
|
pub type __caddr_t = *mut ::std::os::raw::c_char;
|
|
pub type __intptr_t = ::std::os::raw::c_long;
|
|
pub type __socklen_t = ::std::os::raw::c_uint;
|
|
pub type __sig_atomic_t = ::std::os::raw::c_int;
|
|
pub type int_least8_t = __int_least8_t;
|
|
pub type int_least16_t = __int_least16_t;
|
|
pub type int_least32_t = __int_least32_t;
|
|
pub type int_least64_t = __int_least64_t;
|
|
pub type uint_least8_t = __uint_least8_t;
|
|
pub type uint_least16_t = __uint_least16_t;
|
|
pub type uint_least32_t = __uint_least32_t;
|
|
pub type uint_least64_t = __uint_least64_t;
|
|
pub type int_fast8_t = ::std::os::raw::c_schar;
|
|
pub type int_fast16_t = ::std::os::raw::c_long;
|
|
pub type int_fast32_t = ::std::os::raw::c_long;
|
|
pub type int_fast64_t = ::std::os::raw::c_long;
|
|
pub type uint_fast8_t = ::std::os::raw::c_uchar;
|
|
pub type uint_fast16_t = ::std::os::raw::c_ulong;
|
|
pub type uint_fast32_t = ::std::os::raw::c_ulong;
|
|
pub type uint_fast64_t = ::std::os::raw::c_ulong;
|
|
pub type intmax_t = __intmax_t;
|
|
pub type uintmax_t = __uintmax_t;
|
|
pub type __gnuc_va_list = __builtin_va_list;
|
|
#[repr(C)]
|
|
#[derive(Copy, Clone)]
|
|
pub struct __mbstate_t {
|
|
pub __count: ::std::os::raw::c_int,
|
|
pub __value: __mbstate_t__bindgen_ty_1,
|
|
}
|
|
#[repr(C)]
|
|
#[derive(Copy, Clone)]
|
|
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)
|
|
)
|
|
);
|
|
}
|
|
#[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)
|
|
)
|
|
);
|
|
}
|
|
pub type __fpos_t = _G_fpos_t;
|
|
#[repr(C)]
|
|
#[derive(Copy, Clone)]
|
|
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)
|
|
)
|
|
);
|
|
}
|
|
pub type __fpos64_t = _G_fpos64_t;
|
|
pub type __FILE = _IO_FILE;
|
|
pub type FILE = _IO_FILE;
|
|
#[repr(C)]
|
|
#[derive(Debug, Copy, Clone)]
|
|
pub struct _IO_marker {
|
|
_unused: [u8; 0],
|
|
}
|
|
#[repr(C)]
|
|
#[derive(Debug, Copy, Clone)]
|
|
pub struct _IO_codecvt {
|
|
_unused: [u8; 0],
|
|
}
|
|
#[repr(C)]
|
|
#[derive(Debug, Copy, Clone)]
|
|
pub struct _IO_wide_data {
|
|
_unused: [u8; 0],
|
|
}
|
|
pub type _IO_lock_t = ::std::os::raw::c_void;
|
|
#[repr(C)]
|
|
#[derive(Debug, Copy, Clone)]
|
|
pub struct _IO_FILE {
|
|
pub _flags: ::std::os::raw::c_int,
|
|
pub _IO_read_ptr: *mut ::std::os::raw::c_char,
|
|
pub _IO_read_end: *mut ::std::os::raw::c_char,
|
|
pub _IO_read_base: *mut ::std::os::raw::c_char,
|
|
pub _IO_write_base: *mut ::std::os::raw::c_char,
|
|
pub _IO_write_ptr: *mut ::std::os::raw::c_char,
|
|
pub _IO_write_end: *mut ::std::os::raw::c_char,
|
|
pub _IO_buf_base: *mut ::std::os::raw::c_char,
|
|
pub _IO_buf_end: *mut ::std::os::raw::c_char,
|
|
pub _IO_save_base: *mut ::std::os::raw::c_char,
|
|
pub _IO_backup_base: *mut ::std::os::raw::c_char,
|
|
pub _IO_save_end: *mut ::std::os::raw::c_char,
|
|
pub _markers: *mut _IO_marker,
|
|
pub _chain: *mut _IO_FILE,
|
|
pub _fileno: ::std::os::raw::c_int,
|
|
pub _flags2: ::std::os::raw::c_int,
|
|
pub _old_offset: __off_t,
|
|
pub _cur_column: ::std::os::raw::c_ushort,
|
|
pub _vtable_offset: ::std::os::raw::c_schar,
|
|
pub _shortbuf: [::std::os::raw::c_char; 1usize],
|
|
pub _lock: *mut _IO_lock_t,
|
|
pub _offset: __off64_t,
|
|
pub _codecvt: *mut _IO_codecvt,
|
|
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 _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)
|
|
)
|
|
);
|
|
}
|
|
pub type va_list = __gnuc_va_list;
|
|
pub type off_t = __off_t;
|
|
pub type fpos_t = __fpos_t;
|
|
extern "C" {
|
|
pub static mut stdin: *mut FILE;
|
|
}
|
|
extern "C" {
|
|
pub static mut stdout: *mut FILE;
|
|
}
|
|
extern "C" {
|
|
pub static mut stderr: *mut FILE;
|
|
}
|
|
extern "C" {
|
|
pub fn remove(__filename: *const ::std::os::raw::c_char) -> ::std::os::raw::c_int;
|
|
}
|
|
extern "C" {
|
|
pub fn rename(
|
|
__old: *const ::std::os::raw::c_char,
|
|
__new: *const ::std::os::raw::c_char,
|
|
) -> ::std::os::raw::c_int;
|
|
}
|
|
extern "C" {
|
|
pub fn renameat(
|
|
__oldfd: ::std::os::raw::c_int,
|
|
__old: *const ::std::os::raw::c_char,
|
|
__newfd: ::std::os::raw::c_int,
|
|
__new: *const ::std::os::raw::c_char,
|
|
) -> ::std::os::raw::c_int;
|
|
}
|
|
extern "C" {
|
|
pub fn fclose(__stream: *mut FILE) -> ::std::os::raw::c_int;
|
|
}
|
|
extern "C" {
|
|
pub fn tmpfile() -> *mut FILE;
|
|
}
|
|
extern "C" {
|
|
pub fn tmpnam(arg1: *mut ::std::os::raw::c_char) -> *mut ::std::os::raw::c_char;
|
|
}
|
|
extern "C" {
|
|
pub fn tmpnam_r(__s: *mut ::std::os::raw::c_char) -> *mut ::std::os::raw::c_char;
|
|
}
|
|
extern "C" {
|
|
pub fn tempnam(
|
|
__dir: *const ::std::os::raw::c_char,
|
|
__pfx: *const ::std::os::raw::c_char,
|
|
) -> *mut ::std::os::raw::c_char;
|
|
}
|
|
extern "C" {
|
|
pub fn fflush(__stream: *mut FILE) -> ::std::os::raw::c_int;
|
|
}
|
|
extern "C" {
|
|
pub fn fflush_unlocked(__stream: *mut FILE) -> ::std::os::raw::c_int;
|
|
}
|
|
extern "C" {
|
|
pub fn fopen(
|
|
__filename: *const ::std::os::raw::c_char,
|
|
__modes: *const ::std::os::raw::c_char,
|
|
) -> *mut FILE;
|
|
}
|
|
extern "C" {
|
|
pub fn freopen(
|
|
__filename: *const ::std::os::raw::c_char,
|
|
__modes: *const ::std::os::raw::c_char,
|
|
__stream: *mut FILE,
|
|
) -> *mut FILE;
|
|
}
|
|
extern "C" {
|
|
pub fn fdopen(__fd: ::std::os::raw::c_int, __modes: *const ::std::os::raw::c_char)
|
|
-> *mut FILE;
|
|
}
|
|
extern "C" {
|
|
pub fn fmemopen(
|
|
__s: *mut ::std::os::raw::c_void,
|
|
__len: usize,
|
|
__modes: *const ::std::os::raw::c_char,
|
|
) -> *mut FILE;
|
|
}
|
|
extern "C" {
|
|
pub fn open_memstream(
|
|
__bufloc: *mut *mut ::std::os::raw::c_char,
|
|
__sizeloc: *mut usize,
|
|
) -> *mut FILE;
|
|
}
|
|
extern "C" {
|
|
pub fn setbuf(__stream: *mut FILE, __buf: *mut ::std::os::raw::c_char);
|
|
}
|
|
extern "C" {
|
|
pub fn setvbuf(
|
|
__stream: *mut FILE,
|
|
__buf: *mut ::std::os::raw::c_char,
|
|
__modes: ::std::os::raw::c_int,
|
|
__n: usize,
|
|
) -> ::std::os::raw::c_int;
|
|
}
|
|
extern "C" {
|
|
pub fn setbuffer(__stream: *mut FILE, __buf: *mut ::std::os::raw::c_char, __size: usize);
|
|
}
|
|
extern "C" {
|
|
pub fn setlinebuf(__stream: *mut FILE);
|
|
}
|
|
extern "C" {
|
|
pub fn fprintf(
|
|
__stream: *mut FILE,
|
|
__format: *const ::std::os::raw::c_char,
|
|
...
|
|
) -> ::std::os::raw::c_int;
|
|
}
|
|
extern "C" {
|
|
pub fn printf(__format: *const ::std::os::raw::c_char, ...) -> ::std::os::raw::c_int;
|
|
}
|
|
extern "C" {
|
|
pub fn sprintf(
|
|
__s: *mut ::std::os::raw::c_char,
|
|
__format: *const ::std::os::raw::c_char,
|
|
...
|
|
) -> ::std::os::raw::c_int;
|
|
}
|
|
extern "C" {
|
|
pub fn vfprintf(
|
|
__s: *mut FILE,
|
|
__format: *const ::std::os::raw::c_char,
|
|
__arg: *mut __va_list_tag,
|
|
) -> ::std::os::raw::c_int;
|
|
}
|
|
extern "C" {
|
|
pub fn vprintf(
|
|
__format: *const ::std::os::raw::c_char,
|
|
__arg: *mut __va_list_tag,
|
|
) -> ::std::os::raw::c_int;
|
|
}
|
|
extern "C" {
|
|
pub fn vsprintf(
|
|
__s: *mut ::std::os::raw::c_char,
|
|
__format: *const ::std::os::raw::c_char,
|
|
__arg: *mut __va_list_tag,
|
|
) -> ::std::os::raw::c_int;
|
|
}
|
|
extern "C" {
|
|
pub fn snprintf(
|
|
__s: *mut ::std::os::raw::c_char,
|
|
__maxlen: ::std::os::raw::c_ulong,
|
|
__format: *const ::std::os::raw::c_char,
|
|
...
|
|
) -> ::std::os::raw::c_int;
|
|
}
|
|
extern "C" {
|
|
pub fn vsnprintf(
|
|
__s: *mut ::std::os::raw::c_char,
|
|
__maxlen: ::std::os::raw::c_ulong,
|
|
__format: *const ::std::os::raw::c_char,
|
|
__arg: *mut __va_list_tag,
|
|
) -> ::std::os::raw::c_int;
|
|
}
|
|
extern "C" {
|
|
pub fn vdprintf(
|
|
__fd: ::std::os::raw::c_int,
|
|
__fmt: *const ::std::os::raw::c_char,
|
|
__arg: *mut __va_list_tag,
|
|
) -> ::std::os::raw::c_int;
|
|
}
|
|
extern "C" {
|
|
pub fn dprintf(
|
|
__fd: ::std::os::raw::c_int,
|
|
__fmt: *const ::std::os::raw::c_char,
|
|
...
|
|
) -> ::std::os::raw::c_int;
|
|
}
|
|
extern "C" {
|
|
pub fn fscanf(
|
|
__stream: *mut FILE,
|
|
__format: *const ::std::os::raw::c_char,
|
|
...
|
|
) -> ::std::os::raw::c_int;
|
|
}
|
|
extern "C" {
|
|
pub fn scanf(__format: *const ::std::os::raw::c_char, ...) -> ::std::os::raw::c_int;
|
|
}
|
|
extern "C" {
|
|
pub fn sscanf(
|
|
__s: *const ::std::os::raw::c_char,
|
|
__format: *const ::std::os::raw::c_char,
|
|
...
|
|
) -> ::std::os::raw::c_int;
|
|
}
|
|
pub type _Float32 = f32;
|
|
pub type _Float64 = f64;
|
|
pub type _Float32x = f64;
|
|
pub type _Float64x = u128;
|
|
extern "C" {
|
|
#[link_name = "\u{1}__isoc99_fscanf"]
|
|
pub fn fscanf1(
|
|
__stream: *mut FILE,
|
|
__format: *const ::std::os::raw::c_char,
|
|
...
|
|
) -> ::std::os::raw::c_int;
|
|
}
|
|
extern "C" {
|
|
#[link_name = "\u{1}__isoc99_scanf"]
|
|
pub fn scanf1(__format: *const ::std::os::raw::c_char, ...) -> ::std::os::raw::c_int;
|
|
}
|
|
extern "C" {
|
|
#[link_name = "\u{1}__isoc99_sscanf"]
|
|
pub fn sscanf1(
|
|
__s: *const ::std::os::raw::c_char,
|
|
__format: *const ::std::os::raw::c_char,
|
|
...
|
|
) -> ::std::os::raw::c_int;
|
|
}
|
|
extern "C" {
|
|
pub fn vfscanf(
|
|
__s: *mut FILE,
|
|
__format: *const ::std::os::raw::c_char,
|
|
__arg: *mut __va_list_tag,
|
|
) -> ::std::os::raw::c_int;
|
|
}
|
|
extern "C" {
|
|
pub fn vscanf(
|
|
__format: *const ::std::os::raw::c_char,
|
|
__arg: *mut __va_list_tag,
|
|
) -> ::std::os::raw::c_int;
|
|
}
|
|
extern "C" {
|
|
pub fn vsscanf(
|
|
__s: *const ::std::os::raw::c_char,
|
|
__format: *const ::std::os::raw::c_char,
|
|
__arg: *mut __va_list_tag,
|
|
) -> ::std::os::raw::c_int;
|
|
}
|
|
extern "C" {
|
|
#[link_name = "\u{1}__isoc99_vfscanf"]
|
|
pub fn vfscanf1(
|
|
__s: *mut FILE,
|
|
__format: *const ::std::os::raw::c_char,
|
|
__arg: *mut __va_list_tag,
|
|
) -> ::std::os::raw::c_int;
|
|
}
|
|
extern "C" {
|
|
#[link_name = "\u{1}__isoc99_vscanf"]
|
|
pub fn vscanf1(
|
|
__format: *const ::std::os::raw::c_char,
|
|
__arg: *mut __va_list_tag,
|
|
) -> ::std::os::raw::c_int;
|
|
}
|
|
extern "C" {
|
|
#[link_name = "\u{1}__isoc99_vsscanf"]
|
|
pub fn vsscanf1(
|
|
__s: *const ::std::os::raw::c_char,
|
|
__format: *const ::std::os::raw::c_char,
|
|
__arg: *mut __va_list_tag,
|
|
) -> ::std::os::raw::c_int;
|
|
}
|
|
extern "C" {
|
|
pub fn fgetc(__stream: *mut FILE) -> ::std::os::raw::c_int;
|
|
}
|
|
extern "C" {
|
|
pub fn getc(__stream: *mut FILE) -> ::std::os::raw::c_int;
|
|
}
|
|
extern "C" {
|
|
pub fn getchar() -> ::std::os::raw::c_int;
|
|
}
|
|
extern "C" {
|
|
pub fn getc_unlocked(__stream: *mut FILE) -> ::std::os::raw::c_int;
|
|
}
|
|
extern "C" {
|
|
pub fn getchar_unlocked() -> ::std::os::raw::c_int;
|
|
}
|
|
extern "C" {
|
|
pub fn fgetc_unlocked(__stream: *mut FILE) -> ::std::os::raw::c_int;
|
|
}
|
|
extern "C" {
|
|
pub fn fputc(__c: ::std::os::raw::c_int, __stream: *mut FILE) -> ::std::os::raw::c_int;
|
|
}
|
|
extern "C" {
|
|
pub fn putc(__c: ::std::os::raw::c_int, __stream: *mut FILE) -> ::std::os::raw::c_int;
|
|
}
|
|
extern "C" {
|
|
pub fn putchar(__c: ::std::os::raw::c_int) -> ::std::os::raw::c_int;
|
|
}
|
|
extern "C" {
|
|
pub fn fputc_unlocked(__c: ::std::os::raw::c_int, __stream: *mut FILE)
|
|
-> ::std::os::raw::c_int;
|
|
}
|
|
extern "C" {
|
|
pub fn putc_unlocked(__c: ::std::os::raw::c_int, __stream: *mut FILE) -> ::std::os::raw::c_int;
|
|
}
|
|
extern "C" {
|
|
pub fn putchar_unlocked(__c: ::std::os::raw::c_int) -> ::std::os::raw::c_int;
|
|
}
|
|
extern "C" {
|
|
pub fn getw(__stream: *mut FILE) -> ::std::os::raw::c_int;
|
|
}
|
|
extern "C" {
|
|
pub fn putw(__w: ::std::os::raw::c_int, __stream: *mut FILE) -> ::std::os::raw::c_int;
|
|
}
|
|
extern "C" {
|
|
pub fn fgets(
|
|
__s: *mut ::std::os::raw::c_char,
|
|
__n: ::std::os::raw::c_int,
|
|
__stream: *mut FILE,
|
|
) -> *mut ::std::os::raw::c_char;
|
|
}
|
|
extern "C" {
|
|
pub fn __getdelim(
|
|
__lineptr: *mut *mut ::std::os::raw::c_char,
|
|
__n: *mut usize,
|
|
__delimiter: ::std::os::raw::c_int,
|
|
__stream: *mut FILE,
|
|
) -> __ssize_t;
|
|
}
|
|
extern "C" {
|
|
pub fn getdelim(
|
|
__lineptr: *mut *mut ::std::os::raw::c_char,
|
|
__n: *mut usize,
|
|
__delimiter: ::std::os::raw::c_int,
|
|
__stream: *mut FILE,
|
|
) -> __ssize_t;
|
|
}
|
|
extern "C" {
|
|
pub fn getline(
|
|
__lineptr: *mut *mut ::std::os::raw::c_char,
|
|
__n: *mut usize,
|
|
__stream: *mut FILE,
|
|
) -> __ssize_t;
|
|
}
|
|
extern "C" {
|
|
pub fn fputs(__s: *const ::std::os::raw::c_char, __stream: *mut FILE) -> ::std::os::raw::c_int;
|
|
}
|
|
extern "C" {
|
|
pub fn puts(__s: *const ::std::os::raw::c_char) -> ::std::os::raw::c_int;
|
|
}
|
|
extern "C" {
|
|
pub fn ungetc(__c: ::std::os::raw::c_int, __stream: *mut FILE) -> ::std::os::raw::c_int;
|
|
}
|
|
extern "C" {
|
|
pub fn fread(
|
|
__ptr: *mut ::std::os::raw::c_void,
|
|
__size: ::std::os::raw::c_ulong,
|
|
__n: ::std::os::raw::c_ulong,
|
|
__stream: *mut FILE,
|
|
) -> ::std::os::raw::c_ulong;
|
|
}
|
|
extern "C" {
|
|
pub fn fwrite(
|
|
__ptr: *const ::std::os::raw::c_void,
|
|
__size: ::std::os::raw::c_ulong,
|
|
__n: ::std::os::raw::c_ulong,
|
|
__s: *mut FILE,
|
|
) -> ::std::os::raw::c_ulong;
|
|
}
|
|
extern "C" {
|
|
pub fn fread_unlocked(
|
|
__ptr: *mut ::std::os::raw::c_void,
|
|
__size: usize,
|
|
__n: usize,
|
|
__stream: *mut FILE,
|
|
) -> usize;
|
|
}
|
|
extern "C" {
|
|
pub fn fwrite_unlocked(
|
|
__ptr: *const ::std::os::raw::c_void,
|
|
__size: usize,
|
|
__n: usize,
|
|
__stream: *mut FILE,
|
|
) -> usize;
|
|
}
|
|
extern "C" {
|
|
pub fn fseek(
|
|
__stream: *mut FILE,
|
|
__off: ::std::os::raw::c_long,
|
|
__whence: ::std::os::raw::c_int,
|
|
) -> ::std::os::raw::c_int;
|
|
}
|
|
extern "C" {
|
|
pub fn ftell(__stream: *mut FILE) -> ::std::os::raw::c_long;
|
|
}
|
|
extern "C" {
|
|
pub fn rewind(__stream: *mut FILE);
|
|
}
|
|
extern "C" {
|
|
pub fn fseeko(
|
|
__stream: *mut FILE,
|
|
__off: __off_t,
|
|
__whence: ::std::os::raw::c_int,
|
|
) -> ::std::os::raw::c_int;
|
|
}
|
|
extern "C" {
|
|
pub fn ftello(__stream: *mut FILE) -> __off_t;
|
|
}
|
|
extern "C" {
|
|
pub fn fgetpos(__stream: *mut FILE, __pos: *mut fpos_t) -> ::std::os::raw::c_int;
|
|
}
|
|
extern "C" {
|
|
pub fn fsetpos(__stream: *mut FILE, __pos: *const fpos_t) -> ::std::os::raw::c_int;
|
|
}
|
|
extern "C" {
|
|
pub fn clearerr(__stream: *mut FILE);
|
|
}
|
|
extern "C" {
|
|
pub fn feof(__stream: *mut FILE) -> ::std::os::raw::c_int;
|
|
}
|
|
extern "C" {
|
|
pub fn ferror(__stream: *mut FILE) -> ::std::os::raw::c_int;
|
|
}
|
|
extern "C" {
|
|
pub fn clearerr_unlocked(__stream: *mut FILE);
|
|
}
|
|
extern "C" {
|
|
pub fn feof_unlocked(__stream: *mut FILE) -> ::std::os::raw::c_int;
|
|
}
|
|
extern "C" {
|
|
pub fn ferror_unlocked(__stream: *mut FILE) -> ::std::os::raw::c_int;
|
|
}
|
|
extern "C" {
|
|
pub fn perror(__s: *const ::std::os::raw::c_char);
|
|
}
|
|
extern "C" {
|
|
pub fn fileno(__stream: *mut FILE) -> ::std::os::raw::c_int;
|
|
}
|
|
extern "C" {
|
|
pub fn fileno_unlocked(__stream: *mut FILE) -> ::std::os::raw::c_int;
|
|
}
|
|
extern "C" {
|
|
pub fn pclose(__stream: *mut FILE) -> ::std::os::raw::c_int;
|
|
}
|
|
extern "C" {
|
|
pub fn popen(
|
|
__command: *const ::std::os::raw::c_char,
|
|
__modes: *const ::std::os::raw::c_char,
|
|
) -> *mut FILE;
|
|
}
|
|
extern "C" {
|
|
pub fn ctermid(__s: *mut ::std::os::raw::c_char) -> *mut ::std::os::raw::c_char;
|
|
}
|
|
extern "C" {
|
|
pub fn flockfile(__stream: *mut FILE);
|
|
}
|
|
extern "C" {
|
|
pub fn ftrylockfile(__stream: *mut FILE) -> ::std::os::raw::c_int;
|
|
}
|
|
extern "C" {
|
|
pub fn funlockfile(__stream: *mut FILE);
|
|
}
|
|
extern "C" {
|
|
pub fn __uflow(arg1: *mut FILE) -> ::std::os::raw::c_int;
|
|
}
|
|
extern "C" {
|
|
pub fn __overflow(arg1: *mut FILE, arg2: ::std::os::raw::c_int) -> ::std::os::raw::c_int;
|
|
}
|
|
extern "C" {
|
|
pub fn ggml_abort(
|
|
file: *const ::std::os::raw::c_char,
|
|
line: ::std::os::raw::c_int,
|
|
fmt: *const ::std::os::raw::c_char,
|
|
...
|
|
);
|
|
}
|
|
pub const ggml_status_GGML_STATUS_ALLOC_FAILED: ggml_status = -2;
|
|
pub const ggml_status_GGML_STATUS_FAILED: ggml_status = -1;
|
|
pub const ggml_status_GGML_STATUS_SUCCESS: ggml_status = 0;
|
|
pub const ggml_status_GGML_STATUS_ABORTED: ggml_status = 1;
|
|
pub type ggml_status = ::std::os::raw::c_int;
|
|
extern "C" {
|
|
pub fn ggml_status_to_string(status: ggml_status) -> *const ::std::os::raw::c_char;
|
|
}
|
|
pub type ggml_fp16_t = u16;
|
|
extern "C" {
|
|
pub fn ggml_fp16_to_fp32(arg1: ggml_fp16_t) -> f32;
|
|
}
|
|
extern "C" {
|
|
pub fn ggml_fp32_to_fp16(arg1: f32) -> ggml_fp16_t;
|
|
}
|
|
extern "C" {
|
|
pub fn ggml_fp16_to_fp32_row(arg1: *const ggml_fp16_t, arg2: *mut f32, arg3: i64);
|
|
}
|
|
extern "C" {
|
|
pub fn ggml_fp32_to_fp16_row(arg1: *const f32, arg2: *mut ggml_fp16_t, arg3: i64);
|
|
}
|
|
#[repr(C)]
|
|
#[derive(Debug, Copy, Clone)]
|
|
pub struct ggml_bf16_t {
|
|
pub bits: u16,
|
|
}
|
|
#[test]
|
|
fn bindgen_test_layout_ggml_bf16_t() {
|
|
const UNINIT: ::std::mem::MaybeUninit<ggml_bf16_t> = ::std::mem::MaybeUninit::uninit();
|
|
let ptr = UNINIT.as_ptr();
|
|
assert_eq!(
|
|
::std::mem::size_of::<ggml_bf16_t>(),
|
|
2usize,
|
|
concat!("Size of: ", stringify!(ggml_bf16_t))
|
|
);
|
|
assert_eq!(
|
|
::std::mem::align_of::<ggml_bf16_t>(),
|
|
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)
|
|
)
|
|
);
|
|
}
|
|
extern "C" {
|
|
pub fn ggml_fp32_to_bf16(arg1: f32) -> ggml_bf16_t;
|
|
}
|
|
extern "C" {
|
|
pub fn ggml_bf16_to_fp32(arg1: ggml_bf16_t) -> f32;
|
|
}
|
|
extern "C" {
|
|
pub fn ggml_bf16_to_fp32_row(arg1: *const ggml_bf16_t, arg2: *mut f32, arg3: i64);
|
|
}
|
|
extern "C" {
|
|
pub fn ggml_fp32_to_bf16_row_ref(arg1: *const f32, arg2: *mut ggml_bf16_t, arg3: i64);
|
|
}
|
|
extern "C" {
|
|
pub fn ggml_fp32_to_bf16_row(arg1: *const f32, arg2: *mut ggml_bf16_t, arg3: i64);
|
|
}
|
|
#[repr(C)]
|
|
#[derive(Debug, Copy, Clone)]
|
|
pub struct ggml_context {
|
|
_unused: [u8; 0],
|
|
}
|
|
pub const ggml_type_GGML_TYPE_F32: ggml_type = 0;
|
|
pub const ggml_type_GGML_TYPE_F16: ggml_type = 1;
|
|
pub const ggml_type_GGML_TYPE_Q4_0: ggml_type = 2;
|
|
pub const ggml_type_GGML_TYPE_Q4_1: ggml_type = 3;
|
|
pub const ggml_type_GGML_TYPE_Q5_0: ggml_type = 6;
|
|
pub const ggml_type_GGML_TYPE_Q5_1: ggml_type = 7;
|
|
pub const ggml_type_GGML_TYPE_Q8_0: ggml_type = 8;
|
|
pub const ggml_type_GGML_TYPE_Q8_1: ggml_type = 9;
|
|
pub const ggml_type_GGML_TYPE_Q2_K: ggml_type = 10;
|
|
pub const ggml_type_GGML_TYPE_Q3_K: ggml_type = 11;
|
|
pub const ggml_type_GGML_TYPE_Q4_K: ggml_type = 12;
|
|
pub const ggml_type_GGML_TYPE_Q5_K: ggml_type = 13;
|
|
pub const ggml_type_GGML_TYPE_Q6_K: ggml_type = 14;
|
|
pub const ggml_type_GGML_TYPE_Q8_K: ggml_type = 15;
|
|
pub const ggml_type_GGML_TYPE_IQ2_XXS: ggml_type = 16;
|
|
pub const ggml_type_GGML_TYPE_IQ2_XS: ggml_type = 17;
|
|
pub const ggml_type_GGML_TYPE_IQ3_XXS: ggml_type = 18;
|
|
pub const ggml_type_GGML_TYPE_IQ1_S: ggml_type = 19;
|
|
pub const ggml_type_GGML_TYPE_IQ4_NL: ggml_type = 20;
|
|
pub const ggml_type_GGML_TYPE_IQ3_S: ggml_type = 21;
|
|
pub const ggml_type_GGML_TYPE_IQ2_S: ggml_type = 22;
|
|
pub const ggml_type_GGML_TYPE_IQ4_XS: ggml_type = 23;
|
|
pub const ggml_type_GGML_TYPE_I8: ggml_type = 24;
|
|
pub const ggml_type_GGML_TYPE_I16: ggml_type = 25;
|
|
pub const ggml_type_GGML_TYPE_I32: ggml_type = 26;
|
|
pub const ggml_type_GGML_TYPE_I64: ggml_type = 27;
|
|
pub const ggml_type_GGML_TYPE_F64: ggml_type = 28;
|
|
pub const ggml_type_GGML_TYPE_IQ1_M: ggml_type = 29;
|
|
pub const ggml_type_GGML_TYPE_BF16: ggml_type = 30;
|
|
pub const ggml_type_GGML_TYPE_Q4_0_4_4: ggml_type = 31;
|
|
pub const ggml_type_GGML_TYPE_Q4_0_4_8: ggml_type = 32;
|
|
pub const ggml_type_GGML_TYPE_Q4_0_8_8: ggml_type = 33;
|
|
pub const ggml_type_GGML_TYPE_COUNT: ggml_type = 34;
|
|
pub type ggml_type = ::std::os::raw::c_uint;
|
|
pub const ggml_prec_GGML_PREC_DEFAULT: ggml_prec = 0;
|
|
pub const ggml_prec_GGML_PREC_F32: ggml_prec = 1;
|
|
pub type ggml_prec = ::std::os::raw::c_uint;
|
|
pub const ggml_backend_type_GGML_BACKEND_TYPE_CPU: ggml_backend_type = 0;
|
|
pub const ggml_backend_type_GGML_BACKEND_TYPE_GPU: ggml_backend_type = 10;
|
|
pub const ggml_backend_type_GGML_BACKEND_TYPE_GPU_SPLIT: ggml_backend_type = 20;
|
|
pub type ggml_backend_type = ::std::os::raw::c_uint;
|
|
pub const ggml_ftype_GGML_FTYPE_UNKNOWN: ggml_ftype = -1;
|
|
pub const ggml_ftype_GGML_FTYPE_ALL_F32: ggml_ftype = 0;
|
|
pub const ggml_ftype_GGML_FTYPE_MOSTLY_F16: ggml_ftype = 1;
|
|
pub const ggml_ftype_GGML_FTYPE_MOSTLY_Q4_0: ggml_ftype = 2;
|
|
pub const ggml_ftype_GGML_FTYPE_MOSTLY_Q4_1: ggml_ftype = 3;
|
|
pub const ggml_ftype_GGML_FTYPE_MOSTLY_Q4_1_SOME_F16: ggml_ftype = 4;
|
|
pub const ggml_ftype_GGML_FTYPE_MOSTLY_Q8_0: ggml_ftype = 7;
|
|
pub const ggml_ftype_GGML_FTYPE_MOSTLY_Q5_0: ggml_ftype = 8;
|
|
pub const ggml_ftype_GGML_FTYPE_MOSTLY_Q5_1: ggml_ftype = 9;
|
|
pub const ggml_ftype_GGML_FTYPE_MOSTLY_Q2_K: ggml_ftype = 10;
|
|
pub const ggml_ftype_GGML_FTYPE_MOSTLY_Q3_K: ggml_ftype = 11;
|
|
pub const ggml_ftype_GGML_FTYPE_MOSTLY_Q4_K: ggml_ftype = 12;
|
|
pub const ggml_ftype_GGML_FTYPE_MOSTLY_Q5_K: ggml_ftype = 13;
|
|
pub const ggml_ftype_GGML_FTYPE_MOSTLY_Q6_K: ggml_ftype = 14;
|
|
pub const ggml_ftype_GGML_FTYPE_MOSTLY_IQ2_XXS: ggml_ftype = 15;
|
|
pub const ggml_ftype_GGML_FTYPE_MOSTLY_IQ2_XS: ggml_ftype = 16;
|
|
pub const ggml_ftype_GGML_FTYPE_MOSTLY_IQ3_XXS: ggml_ftype = 17;
|
|
pub const ggml_ftype_GGML_FTYPE_MOSTLY_IQ1_S: ggml_ftype = 18;
|
|
pub const ggml_ftype_GGML_FTYPE_MOSTLY_IQ4_NL: ggml_ftype = 19;
|
|
pub const ggml_ftype_GGML_FTYPE_MOSTLY_IQ3_S: ggml_ftype = 20;
|
|
pub const ggml_ftype_GGML_FTYPE_MOSTLY_IQ2_S: ggml_ftype = 21;
|
|
pub const ggml_ftype_GGML_FTYPE_MOSTLY_IQ4_XS: ggml_ftype = 22;
|
|
pub const ggml_ftype_GGML_FTYPE_MOSTLY_IQ1_M: ggml_ftype = 23;
|
|
pub const ggml_ftype_GGML_FTYPE_MOSTLY_BF16: ggml_ftype = 24;
|
|
pub const ggml_ftype_GGML_FTYPE_MOSTLY_Q4_0_4_4: ggml_ftype = 25;
|
|
pub const ggml_ftype_GGML_FTYPE_MOSTLY_Q4_0_4_8: ggml_ftype = 26;
|
|
pub const ggml_ftype_GGML_FTYPE_MOSTLY_Q4_0_8_8: ggml_ftype = 27;
|
|
pub type ggml_ftype = ::std::os::raw::c_int;
|
|
pub const ggml_op_GGML_OP_NONE: ggml_op = 0;
|
|
pub const ggml_op_GGML_OP_DUP: ggml_op = 1;
|
|
pub const ggml_op_GGML_OP_ADD: ggml_op = 2;
|
|
pub const ggml_op_GGML_OP_ADD1: ggml_op = 3;
|
|
pub const ggml_op_GGML_OP_ACC: ggml_op = 4;
|
|
pub const ggml_op_GGML_OP_SUB: ggml_op = 5;
|
|
pub const ggml_op_GGML_OP_MUL: ggml_op = 6;
|
|
pub const ggml_op_GGML_OP_DIV: ggml_op = 7;
|
|
pub const ggml_op_GGML_OP_SQR: ggml_op = 8;
|
|
pub const ggml_op_GGML_OP_SQRT: ggml_op = 9;
|
|
pub const ggml_op_GGML_OP_LOG: ggml_op = 10;
|
|
pub const ggml_op_GGML_OP_SUM: ggml_op = 11;
|
|
pub const ggml_op_GGML_OP_SUM_ROWS: ggml_op = 12;
|
|
pub const ggml_op_GGML_OP_MEAN: ggml_op = 13;
|
|
pub const ggml_op_GGML_OP_ARGMAX: ggml_op = 14;
|
|
pub const ggml_op_GGML_OP_REPEAT: ggml_op = 15;
|
|
pub const ggml_op_GGML_OP_REPEAT_BACK: ggml_op = 16;
|
|
pub const ggml_op_GGML_OP_CONCAT: ggml_op = 17;
|
|
pub const ggml_op_GGML_OP_SILU_BACK: ggml_op = 18;
|
|
pub const ggml_op_GGML_OP_NORM: ggml_op = 19;
|
|
pub const ggml_op_GGML_OP_RMS_NORM: ggml_op = 20;
|
|
pub const ggml_op_GGML_OP_RMS_NORM_BACK: ggml_op = 21;
|
|
pub const ggml_op_GGML_OP_GROUP_NORM: ggml_op = 22;
|
|
pub const ggml_op_GGML_OP_MUL_MAT: ggml_op = 23;
|
|
pub const ggml_op_GGML_OP_MUL_MAT_ID: ggml_op = 24;
|
|
pub const ggml_op_GGML_OP_OUT_PROD: ggml_op = 25;
|
|
pub const ggml_op_GGML_OP_SCALE: ggml_op = 26;
|
|
pub const ggml_op_GGML_OP_SET: ggml_op = 27;
|
|
pub const ggml_op_GGML_OP_CPY: ggml_op = 28;
|
|
pub const ggml_op_GGML_OP_CONT: ggml_op = 29;
|
|
pub const ggml_op_GGML_OP_RESHAPE: ggml_op = 30;
|
|
pub const ggml_op_GGML_OP_VIEW: ggml_op = 31;
|
|
pub const ggml_op_GGML_OP_PERMUTE: ggml_op = 32;
|
|
pub const ggml_op_GGML_OP_TRANSPOSE: ggml_op = 33;
|
|
pub const ggml_op_GGML_OP_GET_ROWS: ggml_op = 34;
|
|
pub const ggml_op_GGML_OP_GET_ROWS_BACK: ggml_op = 35;
|
|
pub const ggml_op_GGML_OP_DIAG: ggml_op = 36;
|
|
pub const ggml_op_GGML_OP_DIAG_MASK_INF: ggml_op = 37;
|
|
pub const ggml_op_GGML_OP_DIAG_MASK_ZERO: ggml_op = 38;
|
|
pub const ggml_op_GGML_OP_SOFT_MAX: ggml_op = 39;
|
|
pub const ggml_op_GGML_OP_SOFT_MAX_BACK: ggml_op = 40;
|
|
pub const ggml_op_GGML_OP_ROPE: ggml_op = 41;
|
|
pub const ggml_op_GGML_OP_ROPE_BACK: ggml_op = 42;
|
|
pub const ggml_op_GGML_OP_CLAMP: ggml_op = 43;
|
|
pub const ggml_op_GGML_OP_CONV_TRANSPOSE_1D: ggml_op = 44;
|
|
pub const ggml_op_GGML_OP_IM2COL: ggml_op = 45;
|
|
pub const ggml_op_GGML_OP_CONV_TRANSPOSE_2D: ggml_op = 46;
|
|
pub const ggml_op_GGML_OP_POOL_1D: ggml_op = 47;
|
|
pub const ggml_op_GGML_OP_POOL_2D: ggml_op = 48;
|
|
pub const ggml_op_GGML_OP_UPSCALE: ggml_op = 49;
|
|
pub const ggml_op_GGML_OP_PAD: ggml_op = 50;
|
|
pub const ggml_op_GGML_OP_ARANGE: ggml_op = 51;
|
|
pub const ggml_op_GGML_OP_TIMESTEP_EMBEDDING: ggml_op = 52;
|
|
pub const ggml_op_GGML_OP_ARGSORT: ggml_op = 53;
|
|
pub const ggml_op_GGML_OP_LEAKY_RELU: ggml_op = 54;
|
|
pub const ggml_op_GGML_OP_FLASH_ATTN_EXT: ggml_op = 55;
|
|
pub const ggml_op_GGML_OP_FLASH_ATTN_BACK: ggml_op = 56;
|
|
pub const ggml_op_GGML_OP_SSM_CONV: ggml_op = 57;
|
|
pub const ggml_op_GGML_OP_SSM_SCAN: ggml_op = 58;
|
|
pub const ggml_op_GGML_OP_WIN_PART: ggml_op = 59;
|
|
pub const ggml_op_GGML_OP_WIN_UNPART: ggml_op = 60;
|
|
pub const ggml_op_GGML_OP_GET_REL_POS: ggml_op = 61;
|
|
pub const ggml_op_GGML_OP_ADD_REL_POS: ggml_op = 62;
|
|
pub const ggml_op_GGML_OP_UNARY: ggml_op = 63;
|
|
pub const ggml_op_GGML_OP_MAP_UNARY: ggml_op = 64;
|
|
pub const ggml_op_GGML_OP_MAP_BINARY: ggml_op = 65;
|
|
pub const ggml_op_GGML_OP_MAP_CUSTOM1_F32: ggml_op = 66;
|
|
pub const ggml_op_GGML_OP_MAP_CUSTOM2_F32: ggml_op = 67;
|
|
pub const ggml_op_GGML_OP_MAP_CUSTOM3_F32: ggml_op = 68;
|
|
pub const ggml_op_GGML_OP_MAP_CUSTOM1: ggml_op = 69;
|
|
pub const ggml_op_GGML_OP_MAP_CUSTOM2: ggml_op = 70;
|
|
pub const ggml_op_GGML_OP_MAP_CUSTOM3: ggml_op = 71;
|
|
pub const ggml_op_GGML_OP_CROSS_ENTROPY_LOSS: ggml_op = 72;
|
|
pub const ggml_op_GGML_OP_CROSS_ENTROPY_LOSS_BACK: ggml_op = 73;
|
|
pub const ggml_op_GGML_OP_COUNT: ggml_op = 74;
|
|
pub type ggml_op = ::std::os::raw::c_uint;
|
|
pub const ggml_unary_op_GGML_UNARY_OP_ABS: ggml_unary_op = 0;
|
|
pub const ggml_unary_op_GGML_UNARY_OP_SGN: ggml_unary_op = 1;
|
|
pub const ggml_unary_op_GGML_UNARY_OP_NEG: ggml_unary_op = 2;
|
|
pub const ggml_unary_op_GGML_UNARY_OP_STEP: ggml_unary_op = 3;
|
|
pub const ggml_unary_op_GGML_UNARY_OP_TANH: ggml_unary_op = 4;
|
|
pub const ggml_unary_op_GGML_UNARY_OP_ELU: ggml_unary_op = 5;
|
|
pub const ggml_unary_op_GGML_UNARY_OP_RELU: ggml_unary_op = 6;
|
|
pub const ggml_unary_op_GGML_UNARY_OP_SIGMOID: ggml_unary_op = 7;
|
|
pub const ggml_unary_op_GGML_UNARY_OP_GELU: ggml_unary_op = 8;
|
|
pub const ggml_unary_op_GGML_UNARY_OP_GELU_QUICK: ggml_unary_op = 9;
|
|
pub const ggml_unary_op_GGML_UNARY_OP_SILU: ggml_unary_op = 10;
|
|
pub const ggml_unary_op_GGML_UNARY_OP_HARDSWISH: ggml_unary_op = 11;
|
|
pub const ggml_unary_op_GGML_UNARY_OP_HARDSIGMOID: ggml_unary_op = 12;
|
|
pub const ggml_unary_op_GGML_UNARY_OP_COUNT: ggml_unary_op = 13;
|
|
pub type ggml_unary_op = ::std::os::raw::c_uint;
|
|
pub const ggml_object_type_GGML_OBJECT_TYPE_TENSOR: ggml_object_type = 0;
|
|
pub const ggml_object_type_GGML_OBJECT_TYPE_GRAPH: ggml_object_type = 1;
|
|
pub const ggml_object_type_GGML_OBJECT_TYPE_WORK_BUFFER: ggml_object_type = 2;
|
|
pub type ggml_object_type = ::std::os::raw::c_uint;
|
|
pub const ggml_log_level_GGML_LOG_LEVEL_ERROR: ggml_log_level = 2;
|
|
pub const ggml_log_level_GGML_LOG_LEVEL_WARN: ggml_log_level = 3;
|
|
pub const ggml_log_level_GGML_LOG_LEVEL_INFO: ggml_log_level = 4;
|
|
pub const ggml_log_level_GGML_LOG_LEVEL_DEBUG: ggml_log_level = 5;
|
|
pub type ggml_log_level = ::std::os::raw::c_uint;
|
|
pub const ggml_tensor_flag_GGML_TENSOR_FLAG_INPUT: ggml_tensor_flag = 1;
|
|
pub const ggml_tensor_flag_GGML_TENSOR_FLAG_OUTPUT: ggml_tensor_flag = 2;
|
|
pub const ggml_tensor_flag_GGML_TENSOR_FLAG_PARAM: ggml_tensor_flag = 4;
|
|
pub type ggml_tensor_flag = ::std::os::raw::c_uint;
|
|
#[repr(C)]
|
|
#[derive(Debug, Copy, Clone)]
|
|
pub struct ggml_object {
|
|
pub offs: usize,
|
|
pub size: usize,
|
|
pub next: *mut ggml_object,
|
|
pub type_: ggml_object_type,
|
|
pub padding: [::std::os::raw::c_char; 4usize],
|
|
}
|
|
#[test]
|
|
fn bindgen_test_layout_ggml_object() {
|
|
const UNINIT: ::std::mem::MaybeUninit<ggml_object> = ::std::mem::MaybeUninit::uninit();
|
|
let ptr = UNINIT.as_ptr();
|
|
assert_eq!(
|
|
::std::mem::size_of::<ggml_object>(),
|
|
32usize,
|
|
concat!("Size of: ", stringify!(ggml_object))
|
|
);
|
|
assert_eq!(
|
|
::std::mem::align_of::<ggml_object>(),
|
|
8usize,
|
|
concat!("Alignment of ", stringify!(ggml_object))
|
|
);
|
|
assert_eq!(
|
|
unsafe { ::std::ptr::addr_of!((*ptr).offs) as usize - ptr as usize },
|
|
0usize,
|
|
concat!(
|
|
"Offset of field: ",
|
|
stringify!(ggml_object),
|
|
"::",
|
|
stringify!(offs)
|
|
)
|
|
);
|
|
assert_eq!(
|
|
unsafe { ::std::ptr::addr_of!((*ptr).size) as usize - ptr as usize },
|
|
8usize,
|
|
concat!(
|
|
"Offset of field: ",
|
|
stringify!(ggml_object),
|
|
"::",
|
|
stringify!(size)
|
|
)
|
|
);
|
|
assert_eq!(
|
|
unsafe { ::std::ptr::addr_of!((*ptr).next) as usize - ptr as usize },
|
|
16usize,
|
|
concat!(
|
|
"Offset of field: ",
|
|
stringify!(ggml_object),
|
|
"::",
|
|
stringify!(next)
|
|
)
|
|
);
|
|
assert_eq!(
|
|
unsafe { ::std::ptr::addr_of!((*ptr).type_) as usize - ptr as usize },
|
|
24usize,
|
|
concat!(
|
|
"Offset of field: ",
|
|
stringify!(ggml_object),
|
|
"::",
|
|
stringify!(type_)
|
|
)
|
|
);
|
|
assert_eq!(
|
|
unsafe { ::std::ptr::addr_of!((*ptr).padding) as usize - ptr as usize },
|
|
28usize,
|
|
concat!(
|
|
"Offset of field: ",
|
|
stringify!(ggml_object),
|
|
"::",
|
|
stringify!(padding)
|
|
)
|
|
);
|
|
}
|
|
pub const GGML_OBJECT_SIZE: usize = 32;
|
|
#[repr(C)]
|
|
#[derive(Debug, Copy, Clone)]
|
|
pub struct ggml_tensor {
|
|
pub type_: ggml_type,
|
|
pub backend: ggml_backend_type,
|
|
pub buffer: *mut ggml_backend_buffer,
|
|
pub ne: [i64; 4usize],
|
|
pub nb: [usize; 4usize],
|
|
pub op: ggml_op,
|
|
pub op_params: [i32; 16usize],
|
|
pub flags: i32,
|
|
pub grad: *mut ggml_tensor,
|
|
pub src: [*mut ggml_tensor; 10usize],
|
|
pub view_src: *mut ggml_tensor,
|
|
pub view_offs: usize,
|
|
pub data: *mut ::std::os::raw::c_void,
|
|
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<ggml_tensor> = ::std::mem::MaybeUninit::uninit();
|
|
let ptr = UNINIT.as_ptr();
|
|
assert_eq!(
|
|
::std::mem::size_of::<ggml_tensor>(),
|
|
336usize,
|
|
concat!("Size of: ", stringify!(ggml_tensor))
|
|
);
|
|
assert_eq!(
|
|
::std::mem::align_of::<ggml_tensor>(),
|
|
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)
|
|
)
|
|
);
|
|
}
|
|
pub const GGML_TENSOR_SIZE: usize = 336;
|
|
pub type ggml_abort_callback =
|
|
::std::option::Option<unsafe extern "C" fn(data: *mut ::std::os::raw::c_void) -> bool>;
|
|
#[repr(C)]
|
|
#[derive(Debug, Copy, Clone)]
|
|
pub struct ggml_cplan {
|
|
pub work_size: usize,
|
|
pub work_data: *mut u8,
|
|
pub n_threads: ::std::os::raw::c_int,
|
|
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<ggml_cplan> = ::std::mem::MaybeUninit::uninit();
|
|
let ptr = UNINIT.as_ptr();
|
|
assert_eq!(
|
|
::std::mem::size_of::<ggml_cplan>(),
|
|
40usize,
|
|
concat!("Size of: ", stringify!(ggml_cplan))
|
|
);
|
|
assert_eq!(
|
|
::std::mem::align_of::<ggml_cplan>(),
|
|
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).abort_callback) as usize - ptr as usize },
|
|
24usize,
|
|
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 },
|
|
32usize,
|
|
concat!(
|
|
"Offset of field: ",
|
|
stringify!(ggml_cplan),
|
|
"::",
|
|
stringify!(abort_callback_data)
|
|
)
|
|
);
|
|
}
|
|
pub const ggml_cgraph_eval_order_GGML_CGRAPH_EVAL_ORDER_LEFT_TO_RIGHT: ggml_cgraph_eval_order = 0;
|
|
pub const ggml_cgraph_eval_order_GGML_CGRAPH_EVAL_ORDER_RIGHT_TO_LEFT: ggml_cgraph_eval_order = 1;
|
|
pub const ggml_cgraph_eval_order_GGML_CGRAPH_EVAL_ORDER_COUNT: ggml_cgraph_eval_order = 2;
|
|
pub type ggml_cgraph_eval_order = ::std::os::raw::c_uint;
|
|
pub type ggml_bitset_t = u32;
|
|
#[repr(C)]
|
|
#[derive(Debug, Copy, Clone)]
|
|
pub struct ggml_hash_set {
|
|
pub size: usize,
|
|
pub used: *mut ggml_bitset_t,
|
|
pub keys: *mut *mut ggml_tensor,
|
|
}
|
|
#[test]
|
|
fn bindgen_test_layout_ggml_hash_set() {
|
|
const UNINIT: ::std::mem::MaybeUninit<ggml_hash_set> = ::std::mem::MaybeUninit::uninit();
|
|
let ptr = UNINIT.as_ptr();
|
|
assert_eq!(
|
|
::std::mem::size_of::<ggml_hash_set>(),
|
|
24usize,
|
|
concat!("Size of: ", stringify!(ggml_hash_set))
|
|
);
|
|
assert_eq!(
|
|
::std::mem::align_of::<ggml_hash_set>(),
|
|
8usize,
|
|
concat!("Alignment of ", stringify!(ggml_hash_set))
|
|
);
|
|
assert_eq!(
|
|
unsafe { ::std::ptr::addr_of!((*ptr).size) as usize - ptr as usize },
|
|
0usize,
|
|
concat!(
|
|
"Offset of field: ",
|
|
stringify!(ggml_hash_set),
|
|
"::",
|
|
stringify!(size)
|
|
)
|
|
);
|
|
assert_eq!(
|
|
unsafe { ::std::ptr::addr_of!((*ptr).used) as usize - ptr as usize },
|
|
8usize,
|
|
concat!(
|
|
"Offset of field: ",
|
|
stringify!(ggml_hash_set),
|
|
"::",
|
|
stringify!(used)
|
|
)
|
|
);
|
|
assert_eq!(
|
|
unsafe { ::std::ptr::addr_of!((*ptr).keys) as usize - ptr as usize },
|
|
16usize,
|
|
concat!(
|
|
"Offset of field: ",
|
|
stringify!(ggml_hash_set),
|
|
"::",
|
|
stringify!(keys)
|
|
)
|
|
);
|
|
}
|
|
#[repr(C)]
|
|
#[derive(Debug, Copy, Clone)]
|
|
pub struct ggml_cgraph {
|
|
pub size: ::std::os::raw::c_int,
|
|
pub n_nodes: ::std::os::raw::c_int,
|
|
pub n_leafs: ::std::os::raw::c_int,
|
|
pub nodes: *mut *mut ggml_tensor,
|
|
pub grads: *mut *mut ggml_tensor,
|
|
pub leafs: *mut *mut ggml_tensor,
|
|
pub visited_hash_set: ggml_hash_set,
|
|
pub order: ggml_cgraph_eval_order,
|
|
}
|
|
#[test]
|
|
fn bindgen_test_layout_ggml_cgraph() {
|
|
const UNINIT: ::std::mem::MaybeUninit<ggml_cgraph> = ::std::mem::MaybeUninit::uninit();
|
|
let ptr = UNINIT.as_ptr();
|
|
assert_eq!(
|
|
::std::mem::size_of::<ggml_cgraph>(),
|
|
72usize,
|
|
concat!("Size of: ", stringify!(ggml_cgraph))
|
|
);
|
|
assert_eq!(
|
|
::std::mem::align_of::<ggml_cgraph>(),
|
|
8usize,
|
|
concat!("Alignment of ", stringify!(ggml_cgraph))
|
|
);
|
|
assert_eq!(
|
|
unsafe { ::std::ptr::addr_of!((*ptr).size) as usize - ptr as usize },
|
|
0usize,
|
|
concat!(
|
|
"Offset of field: ",
|
|
stringify!(ggml_cgraph),
|
|
"::",
|
|
stringify!(size)
|
|
)
|
|
);
|
|
assert_eq!(
|
|
unsafe { ::std::ptr::addr_of!((*ptr).n_nodes) as usize - ptr as usize },
|
|
4usize,
|
|
concat!(
|
|
"Offset of field: ",
|
|
stringify!(ggml_cgraph),
|
|
"::",
|
|
stringify!(n_nodes)
|
|
)
|
|
);
|
|
assert_eq!(
|
|
unsafe { ::std::ptr::addr_of!((*ptr).n_leafs) as usize - ptr as usize },
|
|
8usize,
|
|
concat!(
|
|
"Offset of field: ",
|
|
stringify!(ggml_cgraph),
|
|
"::",
|
|
stringify!(n_leafs)
|
|
)
|
|
);
|
|
assert_eq!(
|
|
unsafe { ::std::ptr::addr_of!((*ptr).nodes) as usize - ptr as usize },
|
|
16usize,
|
|
concat!(
|
|
"Offset of field: ",
|
|
stringify!(ggml_cgraph),
|
|
"::",
|
|
stringify!(nodes)
|
|
)
|
|
);
|
|
assert_eq!(
|
|
unsafe { ::std::ptr::addr_of!((*ptr).grads) as usize - ptr as usize },
|
|
24usize,
|
|
concat!(
|
|
"Offset of field: ",
|
|
stringify!(ggml_cgraph),
|
|
"::",
|
|
stringify!(grads)
|
|
)
|
|
);
|
|
assert_eq!(
|
|
unsafe { ::std::ptr::addr_of!((*ptr).leafs) as usize - ptr as usize },
|
|
32usize,
|
|
concat!(
|
|
"Offset of field: ",
|
|
stringify!(ggml_cgraph),
|
|
"::",
|
|
stringify!(leafs)
|
|
)
|
|
);
|
|
assert_eq!(
|
|
unsafe { ::std::ptr::addr_of!((*ptr).visited_hash_set) as usize - ptr as usize },
|
|
40usize,
|
|
concat!(
|
|
"Offset of field: ",
|
|
stringify!(ggml_cgraph),
|
|
"::",
|
|
stringify!(visited_hash_set)
|
|
)
|
|
);
|
|
assert_eq!(
|
|
unsafe { ::std::ptr::addr_of!((*ptr).order) as usize - ptr as usize },
|
|
64usize,
|
|
concat!(
|
|
"Offset of field: ",
|
|
stringify!(ggml_cgraph),
|
|
"::",
|
|
stringify!(order)
|
|
)
|
|
);
|
|
}
|
|
#[repr(C)]
|
|
#[derive(Debug, Copy, Clone)]
|
|
pub struct ggml_scratch {
|
|
pub offs: usize,
|
|
pub size: usize,
|
|
pub data: *mut ::std::os::raw::c_void,
|
|
}
|
|
#[test]
|
|
fn bindgen_test_layout_ggml_scratch() {
|
|
const UNINIT: ::std::mem::MaybeUninit<ggml_scratch> = ::std::mem::MaybeUninit::uninit();
|
|
let ptr = UNINIT.as_ptr();
|
|
assert_eq!(
|
|
::std::mem::size_of::<ggml_scratch>(),
|
|
24usize,
|
|
concat!("Size of: ", stringify!(ggml_scratch))
|
|
);
|
|
assert_eq!(
|
|
::std::mem::align_of::<ggml_scratch>(),
|
|
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)
|
|
)
|
|
);
|
|
}
|
|
#[repr(C)]
|
|
#[derive(Debug, Copy, Clone)]
|
|
pub struct ggml_init_params {
|
|
pub mem_size: usize,
|
|
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<ggml_init_params> = ::std::mem::MaybeUninit::uninit();
|
|
let ptr = UNINIT.as_ptr();
|
|
assert_eq!(
|
|
::std::mem::size_of::<ggml_init_params>(),
|
|
24usize,
|
|
concat!("Size of: ", stringify!(ggml_init_params))
|
|
);
|
|
assert_eq!(
|
|
::std::mem::align_of::<ggml_init_params>(),
|
|
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)
|
|
)
|
|
);
|
|
}
|
|
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;
|
|
pub const ggml_numa_strategy_GGML_NUMA_STRATEGY_NUMACTL: ggml_numa_strategy = 3;
|
|
pub const ggml_numa_strategy_GGML_NUMA_STRATEGY_MIRROR: ggml_numa_strategy = 4;
|
|
pub const ggml_numa_strategy_GGML_NUMA_STRATEGY_COUNT: ggml_numa_strategy = 5;
|
|
pub type ggml_numa_strategy = ::std::os::raw::c_uint;
|
|
pub type ggml_guid = [u8; 16usize];
|
|
pub type ggml_guid_t = *mut ggml_guid;
|
|
extern "C" {
|
|
pub fn ggml_guid_matches(guid_a: ggml_guid_t, guid_b: ggml_guid_t) -> bool;
|
|
}
|
|
extern "C" {
|
|
pub fn ggml_time_init();
|
|
}
|
|
extern "C" {
|
|
pub fn ggml_time_ms() -> i64;
|
|
}
|
|
extern "C" {
|
|
pub fn ggml_time_us() -> i64;
|
|
}
|
|
extern "C" {
|
|
pub fn ggml_cycles() -> i64;
|
|
}
|
|
extern "C" {
|
|
pub fn ggml_cycles_per_ms() -> i64;
|
|
}
|
|
extern "C" {
|
|
pub fn ggml_fopen(
|
|
fname: *const ::std::os::raw::c_char,
|
|
mode: *const ::std::os::raw::c_char,
|
|
) -> *mut FILE;
|
|
}
|
|
extern "C" {
|
|
pub fn ggml_numa_init(numa: ggml_numa_strategy);
|
|
}
|
|
extern "C" {
|
|
pub fn ggml_is_numa() -> bool;
|
|
}
|
|
extern "C" {
|
|
pub fn ggml_print_object(obj: *const ggml_object);
|
|
}
|
|
extern "C" {
|
|
pub fn ggml_print_objects(ctx: *const ggml_context);
|
|
}
|
|
extern "C" {
|
|
pub fn ggml_nelements(tensor: *const ggml_tensor) -> i64;
|
|
}
|
|
extern "C" {
|
|
pub fn ggml_nrows(tensor: *const ggml_tensor) -> i64;
|
|
}
|
|
extern "C" {
|
|
pub fn ggml_nbytes(tensor: *const ggml_tensor) -> usize;
|
|
}
|
|
extern "C" {
|
|
pub fn ggml_nbytes_pad(tensor: *const ggml_tensor) -> usize;
|
|
}
|
|
extern "C" {
|
|
pub fn ggml_blck_size(type_: ggml_type) -> i64;
|
|
}
|
|
extern "C" {
|
|
pub fn ggml_type_size(type_: ggml_type) -> usize;
|
|
}
|
|
extern "C" {
|
|
pub fn ggml_row_size(type_: ggml_type, ne: i64) -> usize;
|
|
}
|
|
extern "C" {
|
|
pub fn ggml_type_sizef(type_: ggml_type) -> f64;
|
|
}
|
|
extern "C" {
|
|
pub fn ggml_type_name(type_: ggml_type) -> *const ::std::os::raw::c_char;
|
|
}
|
|
extern "C" {
|
|
pub fn ggml_op_name(op: ggml_op) -> *const ::std::os::raw::c_char;
|
|
}
|
|
extern "C" {
|
|
pub fn ggml_op_symbol(op: ggml_op) -> *const ::std::os::raw::c_char;
|
|
}
|
|
extern "C" {
|
|
pub fn ggml_unary_op_name(op: ggml_unary_op) -> *const ::std::os::raw::c_char;
|
|
}
|
|
extern "C" {
|
|
pub fn ggml_op_desc(t: *const ggml_tensor) -> *const ::std::os::raw::c_char;
|
|
}
|
|
extern "C" {
|
|
pub fn ggml_element_size(tensor: *const ggml_tensor) -> usize;
|
|
}
|
|
extern "C" {
|
|
pub fn ggml_is_quantized(type_: ggml_type) -> bool;
|
|
}
|
|
extern "C" {
|
|
pub fn ggml_ftype_to_ggml_type(ftype: ggml_ftype) -> ggml_type;
|
|
}
|
|
extern "C" {
|
|
pub fn ggml_is_transposed(tensor: *const ggml_tensor) -> bool;
|
|
}
|
|
extern "C" {
|
|
pub fn ggml_is_permuted(tensor: *const ggml_tensor) -> bool;
|
|
}
|
|
extern "C" {
|
|
pub fn ggml_is_empty(tensor: *const ggml_tensor) -> bool;
|
|
}
|
|
extern "C" {
|
|
pub fn ggml_is_scalar(tensor: *const ggml_tensor) -> bool;
|
|
}
|
|
extern "C" {
|
|
pub fn ggml_is_vector(tensor: *const ggml_tensor) -> bool;
|
|
}
|
|
extern "C" {
|
|
pub fn ggml_is_matrix(tensor: *const ggml_tensor) -> bool;
|
|
}
|
|
extern "C" {
|
|
pub fn ggml_is_3d(tensor: *const ggml_tensor) -> bool;
|
|
}
|
|
extern "C" {
|
|
pub fn ggml_n_dims(tensor: *const ggml_tensor) -> ::std::os::raw::c_int;
|
|
}
|
|
extern "C" {
|
|
pub fn ggml_is_contiguous(tensor: *const ggml_tensor) -> bool;
|
|
}
|
|
extern "C" {
|
|
pub fn ggml_is_contiguous_0(tensor: *const ggml_tensor) -> bool;
|
|
}
|
|
extern "C" {
|
|
pub fn ggml_is_contiguous_1(tensor: *const ggml_tensor) -> bool;
|
|
}
|
|
extern "C" {
|
|
pub fn ggml_is_contiguous_2(tensor: *const ggml_tensor) -> bool;
|
|
}
|
|
extern "C" {
|
|
pub fn ggml_are_same_shape(t0: *const ggml_tensor, t1: *const ggml_tensor) -> bool;
|
|
}
|
|
extern "C" {
|
|
pub fn ggml_are_same_stride(t0: *const ggml_tensor, t1: *const ggml_tensor) -> bool;
|
|
}
|
|
extern "C" {
|
|
pub fn ggml_can_repeat(t0: *const ggml_tensor, t1: *const ggml_tensor) -> bool;
|
|
}
|
|
extern "C" {
|
|
pub fn ggml_tensor_overhead() -> usize;
|
|
}
|
|
extern "C" {
|
|
pub fn ggml_validate_row_data(
|
|
type_: ggml_type,
|
|
data: *const ::std::os::raw::c_void,
|
|
nbytes: usize,
|
|
) -> bool;
|
|
}
|
|
extern "C" {
|
|
pub fn ggml_init(params: ggml_init_params) -> *mut ggml_context;
|
|
}
|
|
extern "C" {
|
|
pub fn ggml_free(ctx: *mut ggml_context);
|
|
}
|
|
extern "C" {
|
|
pub fn ggml_used_mem(ctx: *const ggml_context) -> usize;
|
|
}
|
|
extern "C" {
|
|
pub fn ggml_set_scratch(ctx: *mut ggml_context, scratch: ggml_scratch) -> usize;
|
|
}
|
|
extern "C" {
|
|
pub fn ggml_get_no_alloc(ctx: *mut ggml_context) -> bool;
|
|
}
|
|
extern "C" {
|
|
pub fn ggml_set_no_alloc(ctx: *mut ggml_context, no_alloc: bool);
|
|
}
|
|
extern "C" {
|
|
pub fn ggml_get_mem_buffer(ctx: *const ggml_context) -> *mut ::std::os::raw::c_void;
|
|
}
|
|
extern "C" {
|
|
pub fn ggml_get_mem_size(ctx: *const ggml_context) -> usize;
|
|
}
|
|
extern "C" {
|
|
pub fn ggml_get_max_tensor_size(ctx: *const ggml_context) -> usize;
|
|
}
|
|
extern "C" {
|
|
pub fn ggml_new_tensor(
|
|
ctx: *mut ggml_context,
|
|
type_: ggml_type,
|
|
n_dims: ::std::os::raw::c_int,
|
|
ne: *const i64,
|
|
) -> *mut ggml_tensor;
|
|
}
|
|
extern "C" {
|
|
pub fn ggml_new_tensor_1d(
|
|
ctx: *mut ggml_context,
|
|
type_: ggml_type,
|
|
ne0: i64,
|
|
) -> *mut ggml_tensor;
|
|
}
|
|
extern "C" {
|
|
pub fn ggml_new_tensor_2d(
|
|
ctx: *mut ggml_context,
|
|
type_: ggml_type,
|
|
ne0: i64,
|
|
ne1: i64,
|
|
) -> *mut ggml_tensor;
|
|
}
|
|
extern "C" {
|
|
pub fn ggml_new_tensor_3d(
|
|
ctx: *mut ggml_context,
|
|
type_: ggml_type,
|
|
ne0: i64,
|
|
ne1: i64,
|
|
ne2: i64,
|
|
) -> *mut ggml_tensor;
|
|
}
|
|
extern "C" {
|
|
pub fn ggml_new_tensor_4d(
|
|
ctx: *mut ggml_context,
|
|
type_: ggml_type,
|
|
ne0: i64,
|
|
ne1: i64,
|
|
ne2: i64,
|
|
ne3: i64,
|
|
) -> *mut ggml_tensor;
|
|
}
|
|
extern "C" {
|
|
pub fn ggml_new_i32(ctx: *mut ggml_context, value: i32) -> *mut ggml_tensor;
|
|
}
|
|
extern "C" {
|
|
pub fn ggml_new_f32(ctx: *mut ggml_context, value: f32) -> *mut ggml_tensor;
|
|
}
|
|
extern "C" {
|
|
pub fn ggml_dup_tensor(ctx: *mut ggml_context, src: *const ggml_tensor) -> *mut ggml_tensor;
|
|
}
|
|
extern "C" {
|
|
pub fn ggml_view_tensor(ctx: *mut ggml_context, src: *mut ggml_tensor) -> *mut ggml_tensor;
|
|
}
|
|
extern "C" {
|
|
pub fn ggml_get_first_tensor(ctx: *const ggml_context) -> *mut ggml_tensor;
|
|
}
|
|
extern "C" {
|
|
pub fn ggml_get_next_tensor(
|
|
ctx: *const ggml_context,
|
|
tensor: *mut ggml_tensor,
|
|
) -> *mut ggml_tensor;
|
|
}
|
|
extern "C" {
|
|
pub fn ggml_get_tensor(
|
|
ctx: *mut ggml_context,
|
|
name: *const ::std::os::raw::c_char,
|
|
) -> *mut ggml_tensor;
|
|
}
|
|
extern "C" {
|
|
pub fn ggml_set_zero(tensor: *mut ggml_tensor) -> *mut ggml_tensor;
|
|
}
|
|
extern "C" {
|
|
pub fn ggml_set_i32(tensor: *mut ggml_tensor, value: i32) -> *mut ggml_tensor;
|
|
}
|
|
extern "C" {
|
|
pub fn ggml_set_f32(tensor: *mut ggml_tensor, value: f32) -> *mut ggml_tensor;
|
|
}
|
|
extern "C" {
|
|
pub fn ggml_unravel_index(
|
|
tensor: *const ggml_tensor,
|
|
i: i64,
|
|
i0: *mut i64,
|
|
i1: *mut i64,
|
|
i2: *mut i64,
|
|
i3: *mut i64,
|
|
);
|
|
}
|
|
extern "C" {
|
|
pub fn ggml_get_i32_1d(tensor: *const ggml_tensor, i: ::std::os::raw::c_int) -> i32;
|
|
}
|
|
extern "C" {
|
|
pub fn ggml_set_i32_1d(tensor: *const ggml_tensor, i: ::std::os::raw::c_int, value: i32);
|
|
}
|
|
extern "C" {
|
|
pub fn ggml_get_i32_nd(
|
|
tensor: *const ggml_tensor,
|
|
i0: ::std::os::raw::c_int,
|
|
i1: ::std::os::raw::c_int,
|
|
i2: ::std::os::raw::c_int,
|
|
i3: ::std::os::raw::c_int,
|
|
) -> i32;
|
|
}
|
|
extern "C" {
|
|
pub fn ggml_set_i32_nd(
|
|
tensor: *const ggml_tensor,
|
|
i0: ::std::os::raw::c_int,
|
|
i1: ::std::os::raw::c_int,
|
|
i2: ::std::os::raw::c_int,
|
|
i3: ::std::os::raw::c_int,
|
|
value: i32,
|
|
);
|
|
}
|
|
extern "C" {
|
|
pub fn ggml_get_f32_1d(tensor: *const ggml_tensor, i: ::std::os::raw::c_int) -> f32;
|
|
}
|
|
extern "C" {
|
|
pub fn ggml_set_f32_1d(tensor: *const ggml_tensor, i: ::std::os::raw::c_int, value: f32);
|
|
}
|
|
extern "C" {
|
|
pub fn ggml_get_f32_nd(
|
|
tensor: *const ggml_tensor,
|
|
i0: ::std::os::raw::c_int,
|
|
i1: ::std::os::raw::c_int,
|
|
i2: ::std::os::raw::c_int,
|
|
i3: ::std::os::raw::c_int,
|
|
) -> f32;
|
|
}
|
|
extern "C" {
|
|
pub fn ggml_set_f32_nd(
|
|
tensor: *const ggml_tensor,
|
|
i0: ::std::os::raw::c_int,
|
|
i1: ::std::os::raw::c_int,
|
|
i2: ::std::os::raw::c_int,
|
|
i3: ::std::os::raw::c_int,
|
|
value: f32,
|
|
);
|
|
}
|
|
extern "C" {
|
|
pub fn ggml_get_data(tensor: *const ggml_tensor) -> *mut ::std::os::raw::c_void;
|
|
}
|
|
extern "C" {
|
|
pub fn ggml_get_data_f32(tensor: *const ggml_tensor) -> *mut f32;
|
|
}
|
|
extern "C" {
|
|
pub fn ggml_get_unary_op(tensor: *const ggml_tensor) -> ggml_unary_op;
|
|
}
|
|
extern "C" {
|
|
pub fn ggml_get_name(tensor: *const ggml_tensor) -> *const ::std::os::raw::c_char;
|
|
}
|
|
extern "C" {
|
|
pub fn ggml_set_name(
|
|
tensor: *mut ggml_tensor,
|
|
name: *const ::std::os::raw::c_char,
|
|
) -> *mut ggml_tensor;
|
|
}
|
|
extern "C" {
|
|
pub fn ggml_format_name(
|
|
tensor: *mut ggml_tensor,
|
|
fmt: *const ::std::os::raw::c_char,
|
|
...
|
|
) -> *mut ggml_tensor;
|
|
}
|
|
extern "C" {
|
|
pub fn ggml_dup(ctx: *mut ggml_context, a: *mut ggml_tensor) -> *mut ggml_tensor;
|
|
}
|
|
extern "C" {
|
|
pub fn ggml_dup_inplace(ctx: *mut ggml_context, a: *mut ggml_tensor) -> *mut ggml_tensor;
|
|
}
|
|
extern "C" {
|
|
pub fn ggml_add(
|
|
ctx: *mut ggml_context,
|
|
a: *mut ggml_tensor,
|
|
b: *mut ggml_tensor,
|
|
) -> *mut ggml_tensor;
|
|
}
|
|
extern "C" {
|
|
pub fn ggml_add_inplace(
|
|
ctx: *mut ggml_context,
|
|
a: *mut ggml_tensor,
|
|
b: *mut ggml_tensor,
|
|
) -> *mut ggml_tensor;
|
|
}
|
|
extern "C" {
|
|
pub fn ggml_add_cast(
|
|
ctx: *mut ggml_context,
|
|
a: *mut ggml_tensor,
|
|
b: *mut ggml_tensor,
|
|
type_: ggml_type,
|
|
) -> *mut ggml_tensor;
|
|
}
|
|
extern "C" {
|
|
pub fn ggml_add1(
|
|
ctx: *mut ggml_context,
|
|
a: *mut ggml_tensor,
|
|
b: *mut ggml_tensor,
|
|
) -> *mut ggml_tensor;
|
|
}
|
|
extern "C" {
|
|
pub fn ggml_add1_inplace(
|
|
ctx: *mut ggml_context,
|
|
a: *mut ggml_tensor,
|
|
b: *mut ggml_tensor,
|
|
) -> *mut ggml_tensor;
|
|
}
|
|
extern "C" {
|
|
pub fn ggml_acc(
|
|
ctx: *mut ggml_context,
|
|
a: *mut ggml_tensor,
|
|
b: *mut ggml_tensor,
|
|
nb1: usize,
|
|
nb2: usize,
|
|
nb3: usize,
|
|
offset: usize,
|
|
) -> *mut ggml_tensor;
|
|
}
|
|
extern "C" {
|
|
pub fn ggml_acc_inplace(
|
|
ctx: *mut ggml_context,
|
|
a: *mut ggml_tensor,
|
|
b: *mut ggml_tensor,
|
|
nb1: usize,
|
|
nb2: usize,
|
|
nb3: usize,
|
|
offset: usize,
|
|
) -> *mut ggml_tensor;
|
|
}
|
|
extern "C" {
|
|
pub fn ggml_sub(
|
|
ctx: *mut ggml_context,
|
|
a: *mut ggml_tensor,
|
|
b: *mut ggml_tensor,
|
|
) -> *mut ggml_tensor;
|
|
}
|
|
extern "C" {
|
|
pub fn ggml_sub_inplace(
|
|
ctx: *mut ggml_context,
|
|
a: *mut ggml_tensor,
|
|
b: *mut ggml_tensor,
|
|
) -> *mut ggml_tensor;
|
|
}
|
|
extern "C" {
|
|
pub fn ggml_mul(
|
|
ctx: *mut ggml_context,
|
|
a: *mut ggml_tensor,
|
|
b: *mut ggml_tensor,
|
|
) -> *mut ggml_tensor;
|
|
}
|
|
extern "C" {
|
|
pub fn ggml_mul_inplace(
|
|
ctx: *mut ggml_context,
|
|
a: *mut ggml_tensor,
|
|
b: *mut ggml_tensor,
|
|
) -> *mut ggml_tensor;
|
|
}
|
|
extern "C" {
|
|
pub fn ggml_div(
|
|
ctx: *mut ggml_context,
|
|
a: *mut ggml_tensor,
|
|
b: *mut ggml_tensor,
|
|
) -> *mut ggml_tensor;
|
|
}
|
|
extern "C" {
|
|
pub fn ggml_div_inplace(
|
|
ctx: *mut ggml_context,
|
|
a: *mut ggml_tensor,
|
|
b: *mut ggml_tensor,
|
|
) -> *mut ggml_tensor;
|
|
}
|
|
extern "C" {
|
|
pub fn ggml_sqr(ctx: *mut ggml_context, a: *mut ggml_tensor) -> *mut ggml_tensor;
|
|
}
|
|
extern "C" {
|
|
pub fn ggml_sqr_inplace(ctx: *mut ggml_context, a: *mut ggml_tensor) -> *mut ggml_tensor;
|
|
}
|
|
extern "C" {
|
|
pub fn ggml_sqrt(ctx: *mut ggml_context, a: *mut ggml_tensor) -> *mut ggml_tensor;
|
|
}
|
|
extern "C" {
|
|
pub fn ggml_sqrt_inplace(ctx: *mut ggml_context, a: *mut ggml_tensor) -> *mut ggml_tensor;
|
|
}
|
|
extern "C" {
|
|
pub fn ggml_log(ctx: *mut ggml_context, a: *mut ggml_tensor) -> *mut ggml_tensor;
|
|
}
|
|
extern "C" {
|
|
pub fn ggml_log_inplace(ctx: *mut ggml_context, a: *mut ggml_tensor) -> *mut ggml_tensor;
|
|
}
|
|
extern "C" {
|
|
pub fn ggml_sum(ctx: *mut ggml_context, a: *mut ggml_tensor) -> *mut ggml_tensor;
|
|
}
|
|
extern "C" {
|
|
pub fn ggml_sum_rows(ctx: *mut ggml_context, a: *mut ggml_tensor) -> *mut ggml_tensor;
|
|
}
|
|
extern "C" {
|
|
pub fn ggml_mean(ctx: *mut ggml_context, a: *mut ggml_tensor) -> *mut ggml_tensor;
|
|
}
|
|
extern "C" {
|
|
pub fn ggml_argmax(ctx: *mut ggml_context, a: *mut ggml_tensor) -> *mut ggml_tensor;
|
|
}
|
|
extern "C" {
|
|
pub fn ggml_repeat(
|
|
ctx: *mut ggml_context,
|
|
a: *mut ggml_tensor,
|
|
b: *mut ggml_tensor,
|
|
) -> *mut ggml_tensor;
|
|
}
|
|
extern "C" {
|
|
pub fn ggml_repeat_back(
|
|
ctx: *mut ggml_context,
|
|
a: *mut ggml_tensor,
|
|
b: *mut ggml_tensor,
|
|
) -> *mut ggml_tensor;
|
|
}
|
|
extern "C" {
|
|
pub fn ggml_concat(
|
|
ctx: *mut ggml_context,
|
|
a: *mut ggml_tensor,
|
|
b: *mut ggml_tensor,
|
|
dim: ::std::os::raw::c_int,
|
|
) -> *mut ggml_tensor;
|
|
}
|
|
extern "C" {
|
|
pub fn ggml_abs(ctx: *mut ggml_context, a: *mut ggml_tensor) -> *mut ggml_tensor;
|
|
}
|
|
extern "C" {
|
|
pub fn ggml_abs_inplace(ctx: *mut ggml_context, a: *mut ggml_tensor) -> *mut ggml_tensor;
|
|
}
|
|
extern "C" {
|
|
pub fn ggml_sgn(ctx: *mut ggml_context, a: *mut ggml_tensor) -> *mut ggml_tensor;
|
|
}
|
|
extern "C" {
|
|
pub fn ggml_sgn_inplace(ctx: *mut ggml_context, a: *mut ggml_tensor) -> *mut ggml_tensor;
|
|
}
|
|
extern "C" {
|
|
pub fn ggml_neg(ctx: *mut ggml_context, a: *mut ggml_tensor) -> *mut ggml_tensor;
|
|
}
|
|
extern "C" {
|
|
pub fn ggml_neg_inplace(ctx: *mut ggml_context, a: *mut ggml_tensor) -> *mut ggml_tensor;
|
|
}
|
|
extern "C" {
|
|
pub fn ggml_step(ctx: *mut ggml_context, a: *mut ggml_tensor) -> *mut ggml_tensor;
|
|
}
|
|
extern "C" {
|
|
pub fn ggml_step_inplace(ctx: *mut ggml_context, a: *mut ggml_tensor) -> *mut ggml_tensor;
|
|
}
|
|
extern "C" {
|
|
pub fn ggml_tanh(ctx: *mut ggml_context, a: *mut ggml_tensor) -> *mut ggml_tensor;
|
|
}
|
|
extern "C" {
|
|
pub fn ggml_tanh_inplace(ctx: *mut ggml_context, a: *mut ggml_tensor) -> *mut ggml_tensor;
|
|
}
|
|
extern "C" {
|
|
pub fn ggml_elu(ctx: *mut ggml_context, a: *mut ggml_tensor) -> *mut ggml_tensor;
|
|
}
|
|
extern "C" {
|
|
pub fn ggml_elu_inplace(ctx: *mut ggml_context, a: *mut ggml_tensor) -> *mut ggml_tensor;
|
|
}
|
|
extern "C" {
|
|
pub fn ggml_relu(ctx: *mut ggml_context, a: *mut ggml_tensor) -> *mut ggml_tensor;
|
|
}
|
|
extern "C" {
|
|
pub fn ggml_leaky_relu(
|
|
ctx: *mut ggml_context,
|
|
a: *mut ggml_tensor,
|
|
negative_slope: f32,
|
|
inplace: bool,
|
|
) -> *mut ggml_tensor;
|
|
}
|
|
extern "C" {
|
|
pub fn ggml_relu_inplace(ctx: *mut ggml_context, a: *mut ggml_tensor) -> *mut ggml_tensor;
|
|
}
|
|
extern "C" {
|
|
pub fn ggml_sigmoid(ctx: *mut ggml_context, a: *mut ggml_tensor) -> *mut ggml_tensor;
|
|
}
|
|
extern "C" {
|
|
pub fn ggml_sigmoid_inplace(ctx: *mut ggml_context, a: *mut ggml_tensor) -> *mut ggml_tensor;
|
|
}
|
|
extern "C" {
|
|
pub fn ggml_gelu(ctx: *mut ggml_context, a: *mut ggml_tensor) -> *mut ggml_tensor;
|
|
}
|
|
extern "C" {
|
|
pub fn ggml_gelu_inplace(ctx: *mut ggml_context, a: *mut ggml_tensor) -> *mut ggml_tensor;
|
|
}
|
|
extern "C" {
|
|
pub fn ggml_gelu_quick(ctx: *mut ggml_context, a: *mut ggml_tensor) -> *mut ggml_tensor;
|
|
}
|
|
extern "C" {
|
|
pub fn ggml_gelu_quick_inplace(ctx: *mut ggml_context, a: *mut ggml_tensor)
|
|
-> *mut ggml_tensor;
|
|
}
|
|
extern "C" {
|
|
pub fn ggml_silu(ctx: *mut ggml_context, a: *mut ggml_tensor) -> *mut ggml_tensor;
|
|
}
|
|
extern "C" {
|
|
pub fn ggml_silu_inplace(ctx: *mut ggml_context, a: *mut ggml_tensor) -> *mut ggml_tensor;
|
|
}
|
|
extern "C" {
|
|
pub fn ggml_silu_back(
|
|
ctx: *mut ggml_context,
|
|
a: *mut ggml_tensor,
|
|
b: *mut ggml_tensor,
|
|
) -> *mut ggml_tensor;
|
|
}
|
|
extern "C" {
|
|
pub fn ggml_hardswish(ctx: *mut ggml_context, a: *mut ggml_tensor) -> *mut ggml_tensor;
|
|
}
|
|
extern "C" {
|
|
pub fn ggml_hardsigmoid(ctx: *mut ggml_context, a: *mut ggml_tensor) -> *mut ggml_tensor;
|
|
}
|
|
extern "C" {
|
|
pub fn ggml_norm(ctx: *mut ggml_context, a: *mut ggml_tensor, eps: f32) -> *mut ggml_tensor;
|
|
}
|
|
extern "C" {
|
|
pub fn ggml_norm_inplace(
|
|
ctx: *mut ggml_context,
|
|
a: *mut ggml_tensor,
|
|
eps: f32,
|
|
) -> *mut ggml_tensor;
|
|
}
|
|
extern "C" {
|
|
pub fn ggml_rms_norm(ctx: *mut ggml_context, a: *mut ggml_tensor, eps: f32)
|
|
-> *mut ggml_tensor;
|
|
}
|
|
extern "C" {
|
|
pub fn ggml_rms_norm_inplace(
|
|
ctx: *mut ggml_context,
|
|
a: *mut ggml_tensor,
|
|
eps: f32,
|
|
) -> *mut ggml_tensor;
|
|
}
|
|
extern "C" {
|
|
pub fn ggml_group_norm(
|
|
ctx: *mut ggml_context,
|
|
a: *mut ggml_tensor,
|
|
n_groups: ::std::os::raw::c_int,
|
|
eps: f32,
|
|
) -> *mut ggml_tensor;
|
|
}
|
|
extern "C" {
|
|
pub fn ggml_group_norm_inplace(
|
|
ctx: *mut ggml_context,
|
|
a: *mut ggml_tensor,
|
|
n_groups: ::std::os::raw::c_int,
|
|
eps: f32,
|
|
) -> *mut ggml_tensor;
|
|
}
|
|
extern "C" {
|
|
pub fn ggml_rms_norm_back(
|
|
ctx: *mut ggml_context,
|
|
a: *mut ggml_tensor,
|
|
b: *mut ggml_tensor,
|
|
eps: f32,
|
|
) -> *mut ggml_tensor;
|
|
}
|
|
extern "C" {
|
|
pub fn ggml_mul_mat(
|
|
ctx: *mut ggml_context,
|
|
a: *mut ggml_tensor,
|
|
b: *mut ggml_tensor,
|
|
) -> *mut ggml_tensor;
|
|
}
|
|
extern "C" {
|
|
pub fn ggml_mul_mat_set_prec(a: *mut ggml_tensor, prec: ggml_prec);
|
|
}
|
|
extern "C" {
|
|
pub fn ggml_mul_mat_id(
|
|
ctx: *mut ggml_context,
|
|
as_: *mut ggml_tensor,
|
|
b: *mut ggml_tensor,
|
|
ids: *mut ggml_tensor,
|
|
) -> *mut ggml_tensor;
|
|
}
|
|
extern "C" {
|
|
pub fn ggml_out_prod(
|
|
ctx: *mut ggml_context,
|
|
a: *mut ggml_tensor,
|
|
b: *mut ggml_tensor,
|
|
) -> *mut ggml_tensor;
|
|
}
|
|
extern "C" {
|
|
pub fn ggml_scale(ctx: *mut ggml_context, a: *mut ggml_tensor, s: f32) -> *mut ggml_tensor;
|
|
}
|
|
extern "C" {
|
|
pub fn ggml_scale_inplace(
|
|
ctx: *mut ggml_context,
|
|
a: *mut ggml_tensor,
|
|
s: f32,
|
|
) -> *mut ggml_tensor;
|
|
}
|
|
extern "C" {
|
|
pub fn ggml_set(
|
|
ctx: *mut ggml_context,
|
|
a: *mut ggml_tensor,
|
|
b: *mut ggml_tensor,
|
|
nb1: usize,
|
|
nb2: usize,
|
|
nb3: usize,
|
|
offset: usize,
|
|
) -> *mut ggml_tensor;
|
|
}
|
|
extern "C" {
|
|
pub fn ggml_set_inplace(
|
|
ctx: *mut ggml_context,
|
|
a: *mut ggml_tensor,
|
|
b: *mut ggml_tensor,
|
|
nb1: usize,
|
|
nb2: usize,
|
|
nb3: usize,
|
|
offset: usize,
|
|
) -> *mut ggml_tensor;
|
|
}
|
|
extern "C" {
|
|
pub fn ggml_set_1d(
|
|
ctx: *mut ggml_context,
|
|
a: *mut ggml_tensor,
|
|
b: *mut ggml_tensor,
|
|
offset: usize,
|
|
) -> *mut ggml_tensor;
|
|
}
|
|
extern "C" {
|
|
pub fn ggml_set_1d_inplace(
|
|
ctx: *mut ggml_context,
|
|
a: *mut ggml_tensor,
|
|
b: *mut ggml_tensor,
|
|
offset: usize,
|
|
) -> *mut ggml_tensor;
|
|
}
|
|
extern "C" {
|
|
pub fn ggml_set_2d(
|
|
ctx: *mut ggml_context,
|
|
a: *mut ggml_tensor,
|
|
b: *mut ggml_tensor,
|
|
nb1: usize,
|
|
offset: usize,
|
|
) -> *mut ggml_tensor;
|
|
}
|
|
extern "C" {
|
|
pub fn ggml_set_2d_inplace(
|
|
ctx: *mut ggml_context,
|
|
a: *mut ggml_tensor,
|
|
b: *mut ggml_tensor,
|
|
nb1: usize,
|
|
offset: usize,
|
|
) -> *mut ggml_tensor;
|
|
}
|
|
extern "C" {
|
|
pub fn ggml_cpy(
|
|
ctx: *mut ggml_context,
|
|
a: *mut ggml_tensor,
|
|
b: *mut ggml_tensor,
|
|
) -> *mut ggml_tensor;
|
|
}
|
|
extern "C" {
|
|
pub fn ggml_cast(
|
|
ctx: *mut ggml_context,
|
|
a: *mut ggml_tensor,
|
|
type_: ggml_type,
|
|
) -> *mut ggml_tensor;
|
|
}
|
|
extern "C" {
|
|
pub fn ggml_cont(ctx: *mut ggml_context, a: *mut ggml_tensor) -> *mut ggml_tensor;
|
|
}
|
|
extern "C" {
|
|
pub fn ggml_cont_1d(ctx: *mut ggml_context, a: *mut ggml_tensor, ne0: i64) -> *mut ggml_tensor;
|
|
}
|
|
extern "C" {
|
|
pub fn ggml_cont_2d(
|
|
ctx: *mut ggml_context,
|
|
a: *mut ggml_tensor,
|
|
ne0: i64,
|
|
ne1: i64,
|
|
) -> *mut ggml_tensor;
|
|
}
|
|
extern "C" {
|
|
pub fn ggml_cont_3d(
|
|
ctx: *mut ggml_context,
|
|
a: *mut ggml_tensor,
|
|
ne0: i64,
|
|
ne1: i64,
|
|
ne2: i64,
|
|
) -> *mut ggml_tensor;
|
|
}
|
|
extern "C" {
|
|
pub fn ggml_cont_4d(
|
|
ctx: *mut ggml_context,
|
|
a: *mut ggml_tensor,
|
|
ne0: i64,
|
|
ne1: i64,
|
|
ne2: i64,
|
|
ne3: i64,
|
|
) -> *mut ggml_tensor;
|
|
}
|
|
extern "C" {
|
|
pub fn ggml_reshape(
|
|
ctx: *mut ggml_context,
|
|
a: *mut ggml_tensor,
|
|
b: *mut ggml_tensor,
|
|
) -> *mut ggml_tensor;
|
|
}
|
|
extern "C" {
|
|
pub fn ggml_reshape_1d(
|
|
ctx: *mut ggml_context,
|
|
a: *mut ggml_tensor,
|
|
ne0: i64,
|
|
) -> *mut ggml_tensor;
|
|
}
|
|
extern "C" {
|
|
pub fn ggml_reshape_2d(
|
|
ctx: *mut ggml_context,
|
|
a: *mut ggml_tensor,
|
|
ne0: i64,
|
|
ne1: i64,
|
|
) -> *mut ggml_tensor;
|
|
}
|
|
extern "C" {
|
|
pub fn ggml_reshape_3d(
|
|
ctx: *mut ggml_context,
|
|
a: *mut ggml_tensor,
|
|
ne0: i64,
|
|
ne1: i64,
|
|
ne2: i64,
|
|
) -> *mut ggml_tensor;
|
|
}
|
|
extern "C" {
|
|
pub fn ggml_reshape_4d(
|
|
ctx: *mut ggml_context,
|
|
a: *mut ggml_tensor,
|
|
ne0: i64,
|
|
ne1: i64,
|
|
ne2: i64,
|
|
ne3: i64,
|
|
) -> *mut ggml_tensor;
|
|
}
|
|
extern "C" {
|
|
pub fn ggml_view_1d(
|
|
ctx: *mut ggml_context,
|
|
a: *mut ggml_tensor,
|
|
ne0: i64,
|
|
offset: usize,
|
|
) -> *mut ggml_tensor;
|
|
}
|
|
extern "C" {
|
|
pub fn ggml_view_2d(
|
|
ctx: *mut ggml_context,
|
|
a: *mut ggml_tensor,
|
|
ne0: i64,
|
|
ne1: i64,
|
|
nb1: usize,
|
|
offset: usize,
|
|
) -> *mut ggml_tensor;
|
|
}
|
|
extern "C" {
|
|
pub fn ggml_view_3d(
|
|
ctx: *mut ggml_context,
|
|
a: *mut ggml_tensor,
|
|
ne0: i64,
|
|
ne1: i64,
|
|
ne2: i64,
|
|
nb1: usize,
|
|
nb2: usize,
|
|
offset: usize,
|
|
) -> *mut ggml_tensor;
|
|
}
|
|
extern "C" {
|
|
pub fn ggml_view_4d(
|
|
ctx: *mut ggml_context,
|
|
a: *mut ggml_tensor,
|
|
ne0: i64,
|
|
ne1: i64,
|
|
ne2: i64,
|
|
ne3: i64,
|
|
nb1: usize,
|
|
nb2: usize,
|
|
nb3: usize,
|
|
offset: usize,
|
|
) -> *mut ggml_tensor;
|
|
}
|
|
extern "C" {
|
|
pub fn ggml_permute(
|
|
ctx: *mut ggml_context,
|
|
a: *mut ggml_tensor,
|
|
axis0: ::std::os::raw::c_int,
|
|
axis1: ::std::os::raw::c_int,
|
|
axis2: ::std::os::raw::c_int,
|
|
axis3: ::std::os::raw::c_int,
|
|
) -> *mut ggml_tensor;
|
|
}
|
|
extern "C" {
|
|
pub fn ggml_transpose(ctx: *mut ggml_context, a: *mut ggml_tensor) -> *mut ggml_tensor;
|
|
}
|
|
extern "C" {
|
|
pub fn ggml_get_rows(
|
|
ctx: *mut ggml_context,
|
|
a: *mut ggml_tensor,
|
|
b: *mut ggml_tensor,
|
|
) -> *mut ggml_tensor;
|
|
}
|
|
extern "C" {
|
|
pub fn ggml_get_rows_back(
|
|
ctx: *mut ggml_context,
|
|
a: *mut ggml_tensor,
|
|
b: *mut ggml_tensor,
|
|
c: *mut ggml_tensor,
|
|
) -> *mut ggml_tensor;
|
|
}
|
|
extern "C" {
|
|
pub fn ggml_diag(ctx: *mut ggml_context, a: *mut ggml_tensor) -> *mut ggml_tensor;
|
|
}
|
|
extern "C" {
|
|
pub fn ggml_diag_mask_inf(
|
|
ctx: *mut ggml_context,
|
|
a: *mut ggml_tensor,
|
|
n_past: ::std::os::raw::c_int,
|
|
) -> *mut ggml_tensor;
|
|
}
|
|
extern "C" {
|
|
pub fn ggml_diag_mask_inf_inplace(
|
|
ctx: *mut ggml_context,
|
|
a: *mut ggml_tensor,
|
|
n_past: ::std::os::raw::c_int,
|
|
) -> *mut ggml_tensor;
|
|
}
|
|
extern "C" {
|
|
pub fn ggml_diag_mask_zero(
|
|
ctx: *mut ggml_context,
|
|
a: *mut ggml_tensor,
|
|
n_past: ::std::os::raw::c_int,
|
|
) -> *mut ggml_tensor;
|
|
}
|
|
extern "C" {
|
|
pub fn ggml_diag_mask_zero_inplace(
|
|
ctx: *mut ggml_context,
|
|
a: *mut ggml_tensor,
|
|
n_past: ::std::os::raw::c_int,
|
|
) -> *mut ggml_tensor;
|
|
}
|
|
extern "C" {
|
|
pub fn ggml_soft_max(ctx: *mut ggml_context, a: *mut ggml_tensor) -> *mut ggml_tensor;
|
|
}
|
|
extern "C" {
|
|
pub fn ggml_soft_max_inplace(ctx: *mut ggml_context, a: *mut ggml_tensor) -> *mut ggml_tensor;
|
|
}
|
|
extern "C" {
|
|
pub fn ggml_soft_max_ext(
|
|
ctx: *mut ggml_context,
|
|
a: *mut ggml_tensor,
|
|
mask: *mut ggml_tensor,
|
|
scale: f32,
|
|
max_bias: f32,
|
|
) -> *mut ggml_tensor;
|
|
}
|
|
extern "C" {
|
|
pub fn ggml_soft_max_back(
|
|
ctx: *mut ggml_context,
|
|
a: *mut ggml_tensor,
|
|
b: *mut ggml_tensor,
|
|
) -> *mut ggml_tensor;
|
|
}
|
|
extern "C" {
|
|
pub fn ggml_soft_max_back_inplace(
|
|
ctx: *mut ggml_context,
|
|
a: *mut ggml_tensor,
|
|
b: *mut ggml_tensor,
|
|
) -> *mut ggml_tensor;
|
|
}
|
|
extern "C" {
|
|
pub fn ggml_rope(
|
|
ctx: *mut ggml_context,
|
|
a: *mut ggml_tensor,
|
|
b: *mut ggml_tensor,
|
|
n_dims: ::std::os::raw::c_int,
|
|
mode: ::std::os::raw::c_int,
|
|
) -> *mut ggml_tensor;
|
|
}
|
|
extern "C" {
|
|
pub fn ggml_rope_inplace(
|
|
ctx: *mut ggml_context,
|
|
a: *mut ggml_tensor,
|
|
b: *mut ggml_tensor,
|
|
n_dims: ::std::os::raw::c_int,
|
|
mode: ::std::os::raw::c_int,
|
|
) -> *mut ggml_tensor;
|
|
}
|
|
extern "C" {
|
|
pub fn ggml_rope_ext(
|
|
ctx: *mut ggml_context,
|
|
a: *mut ggml_tensor,
|
|
b: *mut ggml_tensor,
|
|
c: *mut ggml_tensor,
|
|
n_dims: ::std::os::raw::c_int,
|
|
mode: ::std::os::raw::c_int,
|
|
n_ctx_orig: ::std::os::raw::c_int,
|
|
freq_base: f32,
|
|
freq_scale: f32,
|
|
ext_factor: f32,
|
|
attn_factor: f32,
|
|
beta_fast: f32,
|
|
beta_slow: f32,
|
|
) -> *mut ggml_tensor;
|
|
}
|
|
extern "C" {
|
|
pub fn ggml_rope_ext_inplace(
|
|
ctx: *mut ggml_context,
|
|
a: *mut ggml_tensor,
|
|
b: *mut ggml_tensor,
|
|
c: *mut ggml_tensor,
|
|
n_dims: ::std::os::raw::c_int,
|
|
mode: ::std::os::raw::c_int,
|
|
n_ctx_orig: ::std::os::raw::c_int,
|
|
freq_base: f32,
|
|
freq_scale: f32,
|
|
ext_factor: f32,
|
|
attn_factor: f32,
|
|
beta_fast: f32,
|
|
beta_slow: f32,
|
|
) -> *mut ggml_tensor;
|
|
}
|
|
extern "C" {
|
|
pub fn ggml_rope_custom(
|
|
ctx: *mut ggml_context,
|
|
a: *mut ggml_tensor,
|
|
b: *mut ggml_tensor,
|
|
n_dims: ::std::os::raw::c_int,
|
|
mode: ::std::os::raw::c_int,
|
|
n_ctx_orig: ::std::os::raw::c_int,
|
|
freq_base: f32,
|
|
freq_scale: f32,
|
|
ext_factor: f32,
|
|
attn_factor: f32,
|
|
beta_fast: f32,
|
|
beta_slow: f32,
|
|
) -> *mut ggml_tensor;
|
|
}
|
|
extern "C" {
|
|
pub fn ggml_rope_custom_inplace(
|
|
ctx: *mut ggml_context,
|
|
a: *mut ggml_tensor,
|
|
b: *mut ggml_tensor,
|
|
n_dims: ::std::os::raw::c_int,
|
|
mode: ::std::os::raw::c_int,
|
|
n_ctx_orig: ::std::os::raw::c_int,
|
|
freq_base: f32,
|
|
freq_scale: f32,
|
|
ext_factor: f32,
|
|
attn_factor: f32,
|
|
beta_fast: f32,
|
|
beta_slow: f32,
|
|
) -> *mut ggml_tensor;
|
|
}
|
|
extern "C" {
|
|
pub fn ggml_rope_yarn_corr_dims(
|
|
n_dims: ::std::os::raw::c_int,
|
|
n_ctx_orig: ::std::os::raw::c_int,
|
|
freq_base: f32,
|
|
beta_fast: f32,
|
|
beta_slow: f32,
|
|
dims: *mut f32,
|
|
);
|
|
}
|
|
extern "C" {
|
|
pub fn ggml_rope_back(
|
|
ctx: *mut ggml_context,
|
|
a: *mut ggml_tensor,
|
|
b: *mut ggml_tensor,
|
|
c: *mut ggml_tensor,
|
|
n_dims: ::std::os::raw::c_int,
|
|
mode: ::std::os::raw::c_int,
|
|
n_ctx_orig: ::std::os::raw::c_int,
|
|
freq_base: f32,
|
|
freq_scale: f32,
|
|
ext_factor: f32,
|
|
attn_factor: f32,
|
|
beta_fast: f32,
|
|
beta_slow: f32,
|
|
) -> *mut ggml_tensor;
|
|
}
|
|
extern "C" {
|
|
pub fn ggml_clamp(
|
|
ctx: *mut ggml_context,
|
|
a: *mut ggml_tensor,
|
|
min: f32,
|
|
max: f32,
|
|
) -> *mut ggml_tensor;
|
|
}
|
|
extern "C" {
|
|
pub fn ggml_im2col(
|
|
ctx: *mut ggml_context,
|
|
a: *mut ggml_tensor,
|
|
b: *mut ggml_tensor,
|
|
s0: ::std::os::raw::c_int,
|
|
s1: ::std::os::raw::c_int,
|
|
p0: ::std::os::raw::c_int,
|
|
p1: ::std::os::raw::c_int,
|
|
d0: ::std::os::raw::c_int,
|
|
d1: ::std::os::raw::c_int,
|
|
is_2D: bool,
|
|
dst_type: ggml_type,
|
|
) -> *mut ggml_tensor;
|
|
}
|
|
extern "C" {
|
|
pub fn ggml_conv_depthwise_2d(
|
|
ctx: *mut ggml_context,
|
|
a: *mut ggml_tensor,
|
|
b: *mut ggml_tensor,
|
|
s0: ::std::os::raw::c_int,
|
|
s1: ::std::os::raw::c_int,
|
|
p0: ::std::os::raw::c_int,
|
|
p1: ::std::os::raw::c_int,
|
|
d0: ::std::os::raw::c_int,
|
|
d1: ::std::os::raw::c_int,
|
|
) -> *mut ggml_tensor;
|
|
}
|
|
extern "C" {
|
|
pub fn ggml_conv_1d(
|
|
ctx: *mut ggml_context,
|
|
a: *mut ggml_tensor,
|
|
b: *mut ggml_tensor,
|
|
s0: ::std::os::raw::c_int,
|
|
p0: ::std::os::raw::c_int,
|
|
d0: ::std::os::raw::c_int,
|
|
) -> *mut ggml_tensor;
|
|
}
|
|
extern "C" {
|
|
pub fn ggml_conv_1d_ph(
|
|
ctx: *mut ggml_context,
|
|
a: *mut ggml_tensor,
|
|
b: *mut ggml_tensor,
|
|
s: ::std::os::raw::c_int,
|
|
d: ::std::os::raw::c_int,
|
|
) -> *mut ggml_tensor;
|
|
}
|
|
extern "C" {
|
|
pub fn ggml_conv_transpose_1d(
|
|
ctx: *mut ggml_context,
|
|
a: *mut ggml_tensor,
|
|
b: *mut ggml_tensor,
|
|
s0: ::std::os::raw::c_int,
|
|
p0: ::std::os::raw::c_int,
|
|
d0: ::std::os::raw::c_int,
|
|
) -> *mut ggml_tensor;
|
|
}
|
|
extern "C" {
|
|
pub fn ggml_conv_2d(
|
|
ctx: *mut ggml_context,
|
|
a: *mut ggml_tensor,
|
|
b: *mut ggml_tensor,
|
|
s0: ::std::os::raw::c_int,
|
|
s1: ::std::os::raw::c_int,
|
|
p0: ::std::os::raw::c_int,
|
|
p1: ::std::os::raw::c_int,
|
|
d0: ::std::os::raw::c_int,
|
|
d1: ::std::os::raw::c_int,
|
|
) -> *mut ggml_tensor;
|
|
}
|
|
extern "C" {
|
|
pub fn ggml_conv_2d_sk_p0(
|
|
ctx: *mut ggml_context,
|
|
a: *mut ggml_tensor,
|
|
b: *mut ggml_tensor,
|
|
) -> *mut ggml_tensor;
|
|
}
|
|
extern "C" {
|
|
pub fn ggml_conv_2d_s1_ph(
|
|
ctx: *mut ggml_context,
|
|
a: *mut ggml_tensor,
|
|
b: *mut ggml_tensor,
|
|
) -> *mut ggml_tensor;
|
|
}
|
|
extern "C" {
|
|
pub fn ggml_conv_transpose_2d_p0(
|
|
ctx: *mut ggml_context,
|
|
a: *mut ggml_tensor,
|
|
b: *mut ggml_tensor,
|
|
stride: ::std::os::raw::c_int,
|
|
) -> *mut ggml_tensor;
|
|
}
|
|
pub const ggml_op_pool_GGML_OP_POOL_MAX: ggml_op_pool = 0;
|
|
pub const ggml_op_pool_GGML_OP_POOL_AVG: ggml_op_pool = 1;
|
|
pub const ggml_op_pool_GGML_OP_POOL_COUNT: ggml_op_pool = 2;
|
|
pub type ggml_op_pool = ::std::os::raw::c_uint;
|
|
extern "C" {
|
|
pub fn ggml_pool_1d(
|
|
ctx: *mut ggml_context,
|
|
a: *mut ggml_tensor,
|
|
op: ggml_op_pool,
|
|
k0: ::std::os::raw::c_int,
|
|
s0: ::std::os::raw::c_int,
|
|
p0: ::std::os::raw::c_int,
|
|
) -> *mut ggml_tensor;
|
|
}
|
|
extern "C" {
|
|
pub fn ggml_pool_2d(
|
|
ctx: *mut ggml_context,
|
|
a: *mut ggml_tensor,
|
|
op: ggml_op_pool,
|
|
k0: ::std::os::raw::c_int,
|
|
k1: ::std::os::raw::c_int,
|
|
s0: ::std::os::raw::c_int,
|
|
s1: ::std::os::raw::c_int,
|
|
p0: f32,
|
|
p1: f32,
|
|
) -> *mut ggml_tensor;
|
|
}
|
|
extern "C" {
|
|
pub fn ggml_upscale(
|
|
ctx: *mut ggml_context,
|
|
a: *mut ggml_tensor,
|
|
scale_factor: ::std::os::raw::c_int,
|
|
) -> *mut ggml_tensor;
|
|
}
|
|
extern "C" {
|
|
pub fn ggml_upscale_ext(
|
|
ctx: *mut ggml_context,
|
|
a: *mut ggml_tensor,
|
|
ne0: ::std::os::raw::c_int,
|
|
ne1: ::std::os::raw::c_int,
|
|
ne2: ::std::os::raw::c_int,
|
|
ne3: ::std::os::raw::c_int,
|
|
) -> *mut ggml_tensor;
|
|
}
|
|
extern "C" {
|
|
pub fn ggml_pad(
|
|
ctx: *mut ggml_context,
|
|
a: *mut ggml_tensor,
|
|
p0: ::std::os::raw::c_int,
|
|
p1: ::std::os::raw::c_int,
|
|
p2: ::std::os::raw::c_int,
|
|
p3: ::std::os::raw::c_int,
|
|
) -> *mut ggml_tensor;
|
|
}
|
|
extern "C" {
|
|
pub fn ggml_timestep_embedding(
|
|
ctx: *mut ggml_context,
|
|
timesteps: *mut ggml_tensor,
|
|
dim: ::std::os::raw::c_int,
|
|
max_period: ::std::os::raw::c_int,
|
|
) -> *mut ggml_tensor;
|
|
}
|
|
pub const ggml_sort_order_GGML_SORT_ORDER_ASC: ggml_sort_order = 0;
|
|
pub const ggml_sort_order_GGML_SORT_ORDER_DESC: ggml_sort_order = 1;
|
|
pub type ggml_sort_order = ::std::os::raw::c_uint;
|
|
extern "C" {
|
|
pub fn ggml_argsort(
|
|
ctx: *mut ggml_context,
|
|
a: *mut ggml_tensor,
|
|
order: ggml_sort_order,
|
|
) -> *mut ggml_tensor;
|
|
}
|
|
extern "C" {
|
|
pub fn ggml_arange(
|
|
ctx: *mut ggml_context,
|
|
start: f32,
|
|
stop: f32,
|
|
step: f32,
|
|
) -> *mut ggml_tensor;
|
|
}
|
|
extern "C" {
|
|
pub fn ggml_top_k(
|
|
ctx: *mut ggml_context,
|
|
a: *mut ggml_tensor,
|
|
k: ::std::os::raw::c_int,
|
|
) -> *mut ggml_tensor;
|
|
}
|
|
extern "C" {
|
|
pub fn ggml_flash_attn_ext(
|
|
ctx: *mut ggml_context,
|
|
q: *mut ggml_tensor,
|
|
k: *mut ggml_tensor,
|
|
v: *mut ggml_tensor,
|
|
mask: *mut ggml_tensor,
|
|
scale: f32,
|
|
max_bias: f32,
|
|
) -> *mut ggml_tensor;
|
|
}
|
|
extern "C" {
|
|
pub fn ggml_flash_attn_ext_set_prec(a: *mut ggml_tensor, prec: ggml_prec);
|
|
}
|
|
extern "C" {
|
|
pub fn ggml_flash_attn_back(
|
|
ctx: *mut ggml_context,
|
|
q: *mut ggml_tensor,
|
|
k: *mut ggml_tensor,
|
|
v: *mut ggml_tensor,
|
|
d: *mut ggml_tensor,
|
|
masked: bool,
|
|
) -> *mut ggml_tensor;
|
|
}
|
|
extern "C" {
|
|
pub fn ggml_ssm_conv(
|
|
ctx: *mut ggml_context,
|
|
s: *mut ggml_tensor,
|
|
x: *mut ggml_tensor,
|
|
c: *mut ggml_tensor,
|
|
sq: *mut ggml_tensor,
|
|
) -> *mut ggml_tensor;
|
|
}
|
|
extern "C" {
|
|
pub fn ggml_ssm_scan(
|
|
ctx: *mut ggml_context,
|
|
s: *mut ggml_tensor,
|
|
x: *mut ggml_tensor,
|
|
dt: *mut ggml_tensor,
|
|
A: *mut ggml_tensor,
|
|
B: *mut ggml_tensor,
|
|
C: *mut ggml_tensor,
|
|
sq: *mut ggml_tensor,
|
|
) -> *mut ggml_tensor;
|
|
}
|
|
extern "C" {
|
|
pub fn ggml_win_part(
|
|
ctx: *mut ggml_context,
|
|
a: *mut ggml_tensor,
|
|
w: ::std::os::raw::c_int,
|
|
) -> *mut ggml_tensor;
|
|
}
|
|
extern "C" {
|
|
pub fn ggml_win_unpart(
|
|
ctx: *mut ggml_context,
|
|
a: *mut ggml_tensor,
|
|
w0: ::std::os::raw::c_int,
|
|
h0: ::std::os::raw::c_int,
|
|
w: ::std::os::raw::c_int,
|
|
) -> *mut ggml_tensor;
|
|
}
|
|
extern "C" {
|
|
pub fn ggml_unary(
|
|
ctx: *mut ggml_context,
|
|
a: *mut ggml_tensor,
|
|
op: ggml_unary_op,
|
|
) -> *mut ggml_tensor;
|
|
}
|
|
extern "C" {
|
|
pub fn ggml_unary_inplace(
|
|
ctx: *mut ggml_context,
|
|
a: *mut ggml_tensor,
|
|
op: ggml_unary_op,
|
|
) -> *mut ggml_tensor;
|
|
}
|
|
extern "C" {
|
|
pub fn ggml_get_rel_pos(
|
|
ctx: *mut ggml_context,
|
|
a: *mut ggml_tensor,
|
|
qh: ::std::os::raw::c_int,
|
|
kh: ::std::os::raw::c_int,
|
|
) -> *mut ggml_tensor;
|
|
}
|
|
extern "C" {
|
|
pub fn ggml_add_rel_pos(
|
|
ctx: *mut ggml_context,
|
|
a: *mut ggml_tensor,
|
|
pw: *mut ggml_tensor,
|
|
ph: *mut ggml_tensor,
|
|
) -> *mut ggml_tensor;
|
|
}
|
|
extern "C" {
|
|
pub fn ggml_add_rel_pos_inplace(
|
|
ctx: *mut ggml_context,
|
|
a: *mut ggml_tensor,
|
|
pw: *mut ggml_tensor,
|
|
ph: *mut ggml_tensor,
|
|
) -> *mut ggml_tensor;
|
|
}
|
|
pub type ggml_unary_op_f32_t = ::std::option::Option<
|
|
unsafe extern "C" fn(arg1: ::std::os::raw::c_int, arg2: *mut f32, arg3: *const f32),
|
|
>;
|
|
pub type ggml_binary_op_f32_t = ::std::option::Option<
|
|
unsafe extern "C" fn(
|
|
arg1: ::std::os::raw::c_int,
|
|
arg2: *mut f32,
|
|
arg3: *const f32,
|
|
arg4: *const f32,
|
|
),
|
|
>;
|
|
pub type ggml_custom1_op_f32_t =
|
|
::std::option::Option<unsafe extern "C" fn(arg1: *mut ggml_tensor, arg2: *const ggml_tensor)>;
|
|
pub type ggml_custom2_op_f32_t = ::std::option::Option<
|
|
unsafe extern "C" fn(
|
|
arg1: *mut ggml_tensor,
|
|
arg2: *const ggml_tensor,
|
|
arg3: *const ggml_tensor,
|
|
),
|
|
>;
|
|
pub type ggml_custom3_op_f32_t = ::std::option::Option<
|
|
unsafe extern "C" fn(
|
|
arg1: *mut ggml_tensor,
|
|
arg2: *const ggml_tensor,
|
|
arg3: *const ggml_tensor,
|
|
arg4: *const ggml_tensor,
|
|
),
|
|
>;
|
|
extern "C" {
|
|
pub fn ggml_map_unary_f32(
|
|
ctx: *mut ggml_context,
|
|
a: *mut ggml_tensor,
|
|
fun: ggml_unary_op_f32_t,
|
|
) -> *mut ggml_tensor;
|
|
}
|
|
extern "C" {
|
|
pub fn ggml_map_unary_inplace_f32(
|
|
ctx: *mut ggml_context,
|
|
a: *mut ggml_tensor,
|
|
fun: ggml_unary_op_f32_t,
|
|
) -> *mut ggml_tensor;
|
|
}
|
|
extern "C" {
|
|
pub fn ggml_map_binary_f32(
|
|
ctx: *mut ggml_context,
|
|
a: *mut ggml_tensor,
|
|
b: *mut ggml_tensor,
|
|
fun: ggml_binary_op_f32_t,
|
|
) -> *mut ggml_tensor;
|
|
}
|
|
extern "C" {
|
|
pub fn ggml_map_binary_inplace_f32(
|
|
ctx: *mut ggml_context,
|
|
a: *mut ggml_tensor,
|
|
b: *mut ggml_tensor,
|
|
fun: ggml_binary_op_f32_t,
|
|
) -> *mut ggml_tensor;
|
|
}
|
|
extern "C" {
|
|
pub fn ggml_map_custom1_f32(
|
|
ctx: *mut ggml_context,
|
|
a: *mut ggml_tensor,
|
|
fun: ggml_custom1_op_f32_t,
|
|
) -> *mut ggml_tensor;
|
|
}
|
|
extern "C" {
|
|
pub fn ggml_map_custom1_inplace_f32(
|
|
ctx: *mut ggml_context,
|
|
a: *mut ggml_tensor,
|
|
fun: ggml_custom1_op_f32_t,
|
|
) -> *mut ggml_tensor;
|
|
}
|
|
extern "C" {
|
|
pub fn ggml_map_custom2_f32(
|
|
ctx: *mut ggml_context,
|
|
a: *mut ggml_tensor,
|
|
b: *mut ggml_tensor,
|
|
fun: ggml_custom2_op_f32_t,
|
|
) -> *mut ggml_tensor;
|
|
}
|
|
extern "C" {
|
|
pub fn ggml_map_custom2_inplace_f32(
|
|
ctx: *mut ggml_context,
|
|
a: *mut ggml_tensor,
|
|
b: *mut ggml_tensor,
|
|
fun: ggml_custom2_op_f32_t,
|
|
) -> *mut ggml_tensor;
|
|
}
|
|
extern "C" {
|
|
pub fn ggml_map_custom3_f32(
|
|
ctx: *mut ggml_context,
|
|
a: *mut ggml_tensor,
|
|
b: *mut ggml_tensor,
|
|
c: *mut ggml_tensor,
|
|
fun: ggml_custom3_op_f32_t,
|
|
) -> *mut ggml_tensor;
|
|
}
|
|
extern "C" {
|
|
pub fn ggml_map_custom3_inplace_f32(
|
|
ctx: *mut ggml_context,
|
|
a: *mut ggml_tensor,
|
|
b: *mut ggml_tensor,
|
|
c: *mut ggml_tensor,
|
|
fun: ggml_custom3_op_f32_t,
|
|
) -> *mut ggml_tensor;
|
|
}
|
|
pub type ggml_custom1_op_t = ::std::option::Option<
|
|
unsafe extern "C" fn(
|
|
dst: *mut ggml_tensor,
|
|
a: *const ggml_tensor,
|
|
ith: ::std::os::raw::c_int,
|
|
nth: ::std::os::raw::c_int,
|
|
userdata: *mut ::std::os::raw::c_void,
|
|
),
|
|
>;
|
|
pub type ggml_custom2_op_t = ::std::option::Option<
|
|
unsafe extern "C" fn(
|
|
dst: *mut ggml_tensor,
|
|
a: *const ggml_tensor,
|
|
b: *const ggml_tensor,
|
|
ith: ::std::os::raw::c_int,
|
|
nth: ::std::os::raw::c_int,
|
|
userdata: *mut ::std::os::raw::c_void,
|
|
),
|
|
>;
|
|
pub type ggml_custom3_op_t = ::std::option::Option<
|
|
unsafe extern "C" fn(
|
|
dst: *mut ggml_tensor,
|
|
a: *const ggml_tensor,
|
|
b: *const ggml_tensor,
|
|
c: *const ggml_tensor,
|
|
ith: ::std::os::raw::c_int,
|
|
nth: ::std::os::raw::c_int,
|
|
userdata: *mut ::std::os::raw::c_void,
|
|
),
|
|
>;
|
|
extern "C" {
|
|
pub fn ggml_map_custom1(
|
|
ctx: *mut ggml_context,
|
|
a: *mut ggml_tensor,
|
|
fun: ggml_custom1_op_t,
|
|
n_tasks: ::std::os::raw::c_int,
|
|
userdata: *mut ::std::os::raw::c_void,
|
|
) -> *mut ggml_tensor;
|
|
}
|
|
extern "C" {
|
|
pub fn ggml_map_custom1_inplace(
|
|
ctx: *mut ggml_context,
|
|
a: *mut ggml_tensor,
|
|
fun: ggml_custom1_op_t,
|
|
n_tasks: ::std::os::raw::c_int,
|
|
userdata: *mut ::std::os::raw::c_void,
|
|
) -> *mut ggml_tensor;
|
|
}
|
|
extern "C" {
|
|
pub fn ggml_map_custom2(
|
|
ctx: *mut ggml_context,
|
|
a: *mut ggml_tensor,
|
|
b: *mut ggml_tensor,
|
|
fun: ggml_custom2_op_t,
|
|
n_tasks: ::std::os::raw::c_int,
|
|
userdata: *mut ::std::os::raw::c_void,
|
|
) -> *mut ggml_tensor;
|
|
}
|
|
extern "C" {
|
|
pub fn ggml_map_custom2_inplace(
|
|
ctx: *mut ggml_context,
|
|
a: *mut ggml_tensor,
|
|
b: *mut ggml_tensor,
|
|
fun: ggml_custom2_op_t,
|
|
n_tasks: ::std::os::raw::c_int,
|
|
userdata: *mut ::std::os::raw::c_void,
|
|
) -> *mut ggml_tensor;
|
|
}
|
|
extern "C" {
|
|
pub fn ggml_map_custom3(
|
|
ctx: *mut ggml_context,
|
|
a: *mut ggml_tensor,
|
|
b: *mut ggml_tensor,
|
|
c: *mut ggml_tensor,
|
|
fun: ggml_custom3_op_t,
|
|
n_tasks: ::std::os::raw::c_int,
|
|
userdata: *mut ::std::os::raw::c_void,
|
|
) -> *mut ggml_tensor;
|
|
}
|
|
extern "C" {
|
|
pub fn ggml_map_custom3_inplace(
|
|
ctx: *mut ggml_context,
|
|
a: *mut ggml_tensor,
|
|
b: *mut ggml_tensor,
|
|
c: *mut ggml_tensor,
|
|
fun: ggml_custom3_op_t,
|
|
n_tasks: ::std::os::raw::c_int,
|
|
userdata: *mut ::std::os::raw::c_void,
|
|
) -> *mut ggml_tensor;
|
|
}
|
|
extern "C" {
|
|
pub fn ggml_cross_entropy_loss(
|
|
ctx: *mut ggml_context,
|
|
a: *mut ggml_tensor,
|
|
b: *mut ggml_tensor,
|
|
) -> *mut ggml_tensor;
|
|
}
|
|
extern "C" {
|
|
pub fn ggml_cross_entropy_loss_back(
|
|
ctx: *mut ggml_context,
|
|
a: *mut ggml_tensor,
|
|
b: *mut ggml_tensor,
|
|
c: *mut ggml_tensor,
|
|
) -> *mut ggml_tensor;
|
|
}
|
|
extern "C" {
|
|
pub fn ggml_set_param(ctx: *mut ggml_context, tensor: *mut ggml_tensor);
|
|
}
|
|
extern "C" {
|
|
pub fn ggml_build_forward_expand(cgraph: *mut ggml_cgraph, tensor: *mut ggml_tensor);
|
|
}
|
|
extern "C" {
|
|
pub fn ggml_build_backward_expand(
|
|
ctx: *mut ggml_context,
|
|
gf: *mut ggml_cgraph,
|
|
gb: *mut ggml_cgraph,
|
|
keep: bool,
|
|
);
|
|
}
|
|
extern "C" {
|
|
pub fn ggml_new_graph(ctx: *mut ggml_context) -> *mut ggml_cgraph;
|
|
}
|
|
extern "C" {
|
|
pub fn ggml_new_graph_custom(
|
|
ctx: *mut ggml_context,
|
|
size: usize,
|
|
grads: bool,
|
|
) -> *mut ggml_cgraph;
|
|
}
|
|
extern "C" {
|
|
pub fn ggml_graph_dup(ctx: *mut ggml_context, cgraph: *mut ggml_cgraph) -> *mut ggml_cgraph;
|
|
}
|
|
extern "C" {
|
|
pub fn ggml_graph_view(
|
|
cgraph: *mut ggml_cgraph,
|
|
i0: ::std::os::raw::c_int,
|
|
i1: ::std::os::raw::c_int,
|
|
) -> ggml_cgraph;
|
|
}
|
|
extern "C" {
|
|
pub fn ggml_graph_cpy(src: *mut ggml_cgraph, dst: *mut ggml_cgraph);
|
|
}
|
|
extern "C" {
|
|
pub fn ggml_graph_reset(cgraph: *mut ggml_cgraph);
|
|
}
|
|
extern "C" {
|
|
pub fn ggml_graph_clear(cgraph: *mut ggml_cgraph);
|
|
}
|
|
extern "C" {
|
|
pub fn ggml_graph_overhead() -> usize;
|
|
}
|
|
extern "C" {
|
|
pub fn ggml_graph_overhead_custom(size: usize, grads: bool) -> usize;
|
|
}
|
|
extern "C" {
|
|
pub fn ggml_graph_plan(
|
|
cgraph: *const ggml_cgraph,
|
|
n_threads: ::std::os::raw::c_int,
|
|
) -> ggml_cplan;
|
|
}
|
|
extern "C" {
|
|
pub fn ggml_graph_compute(cgraph: *mut ggml_cgraph, cplan: *mut ggml_cplan) -> ggml_status;
|
|
}
|
|
extern "C" {
|
|
pub fn ggml_graph_compute_with_ctx(
|
|
ctx: *mut ggml_context,
|
|
cgraph: *mut ggml_cgraph,
|
|
n_threads: ::std::os::raw::c_int,
|
|
) -> ggml_status;
|
|
}
|
|
extern "C" {
|
|
pub fn ggml_graph_get_tensor(
|
|
cgraph: *mut ggml_cgraph,
|
|
name: *const ::std::os::raw::c_char,
|
|
) -> *mut ggml_tensor;
|
|
}
|
|
extern "C" {
|
|
pub fn ggml_graph_export(cgraph: *const ggml_cgraph, fname: *const ::std::os::raw::c_char);
|
|
}
|
|
extern "C" {
|
|
pub fn ggml_graph_import(
|
|
fname: *const ::std::os::raw::c_char,
|
|
ctx_data: *mut *mut ggml_context,
|
|
ctx_eval: *mut *mut ggml_context,
|
|
) -> *mut ggml_cgraph;
|
|
}
|
|
extern "C" {
|
|
pub fn ggml_graph_print(cgraph: *const ggml_cgraph);
|
|
}
|
|
extern "C" {
|
|
pub fn ggml_graph_dump_dot(
|
|
gb: *const ggml_cgraph,
|
|
gf: *const ggml_cgraph,
|
|
filename: *const ::std::os::raw::c_char,
|
|
);
|
|
}
|
|
extern "C" {
|
|
pub fn ggml_build_backward_gradient_checkpointing(
|
|
ctx: *mut ggml_context,
|
|
gf: *mut ggml_cgraph,
|
|
gb: *mut ggml_cgraph,
|
|
gb_tmp: *mut ggml_cgraph,
|
|
checkpoints: *mut *mut ggml_tensor,
|
|
n_checkpoints: ::std::os::raw::c_int,
|
|
);
|
|
}
|
|
pub const ggml_opt_type_GGML_OPT_TYPE_ADAM: ggml_opt_type = 0;
|
|
pub const ggml_opt_type_GGML_OPT_TYPE_LBFGS: ggml_opt_type = 1;
|
|
pub type ggml_opt_type = ::std::os::raw::c_uint;
|
|
pub const ggml_linesearch_GGML_LINESEARCH_DEFAULT: ggml_linesearch = 1;
|
|
pub const ggml_linesearch_GGML_LINESEARCH_BACKTRACKING_ARMIJO: ggml_linesearch = 0;
|
|
pub const ggml_linesearch_GGML_LINESEARCH_BACKTRACKING_WOLFE: ggml_linesearch = 1;
|
|
pub const ggml_linesearch_GGML_LINESEARCH_BACKTRACKING_STRONG_WOLFE: ggml_linesearch = 2;
|
|
pub type ggml_linesearch = ::std::os::raw::c_uint;
|
|
pub const ggml_opt_result_GGML_OPT_RESULT_OK: ggml_opt_result = 0;
|
|
pub const ggml_opt_result_GGML_OPT_RESULT_DID_NOT_CONVERGE: ggml_opt_result = 1;
|
|
pub const ggml_opt_result_GGML_OPT_RESULT_NO_CONTEXT: ggml_opt_result = 2;
|
|
pub const ggml_opt_result_GGML_OPT_RESULT_INVALID_WOLFE: ggml_opt_result = 3;
|
|
pub const ggml_opt_result_GGML_OPT_RESULT_FAIL: ggml_opt_result = 4;
|
|
pub const ggml_opt_result_GGML_OPT_RESULT_CANCEL: ggml_opt_result = 5;
|
|
pub const ggml_opt_result_GGML_LINESEARCH_FAIL: ggml_opt_result = -128;
|
|
pub const ggml_opt_result_GGML_LINESEARCH_MINIMUM_STEP: ggml_opt_result = -127;
|
|
pub const ggml_opt_result_GGML_LINESEARCH_MAXIMUM_STEP: ggml_opt_result = -126;
|
|
pub const ggml_opt_result_GGML_LINESEARCH_MAXIMUM_ITERATIONS: ggml_opt_result = -125;
|
|
pub const ggml_opt_result_GGML_LINESEARCH_INVALID_PARAMETERS: ggml_opt_result = -124;
|
|
pub type ggml_opt_result = ::std::os::raw::c_int;
|
|
pub type ggml_opt_callback = ::std::option::Option<
|
|
unsafe extern "C" fn(
|
|
data: *mut ::std::os::raw::c_void,
|
|
accum_step: ::std::os::raw::c_int,
|
|
sched: *mut f32,
|
|
cancel: *mut bool,
|
|
),
|
|
>;
|
|
pub type ggml_log_callback = ::std::option::Option<
|
|
unsafe extern "C" fn(
|
|
level: ggml_log_level,
|
|
text: *const ::std::os::raw::c_char,
|
|
user_data: *mut ::std::os::raw::c_void,
|
|
),
|
|
>;
|
|
#[repr(C)]
|
|
#[derive(Debug, Copy, Clone)]
|
|
pub struct ggml_opt_params {
|
|
pub type_: ggml_opt_type,
|
|
pub graph_size: usize,
|
|
pub n_threads: ::std::os::raw::c_int,
|
|
pub past: ::std::os::raw::c_int,
|
|
pub delta: f32,
|
|
pub max_no_improvement: ::std::os::raw::c_int,
|
|
pub print_forward_graph: bool,
|
|
pub print_backward_graph: bool,
|
|
pub n_gradient_accumulation: ::std::os::raw::c_int,
|
|
pub adam: ggml_opt_params__bindgen_ty_1,
|
|
pub lbfgs: ggml_opt_params__bindgen_ty_2,
|
|
}
|
|
#[repr(C)]
|
|
#[derive(Debug, Copy, Clone)]
|
|
pub struct ggml_opt_params__bindgen_ty_1 {
|
|
pub n_iter: ::std::os::raw::c_int,
|
|
pub sched: f32,
|
|
pub decay: f32,
|
|
pub decay_min_ndim: ::std::os::raw::c_int,
|
|
pub alpha: f32,
|
|
pub beta1: f32,
|
|
pub beta2: f32,
|
|
pub eps: f32,
|
|
pub eps_f: f32,
|
|
pub eps_g: f32,
|
|
pub gclip: f32,
|
|
}
|
|
#[test]
|
|
fn bindgen_test_layout_ggml_opt_params__bindgen_ty_1() {
|
|
const UNINIT: ::std::mem::MaybeUninit<ggml_opt_params__bindgen_ty_1> =
|
|
::std::mem::MaybeUninit::uninit();
|
|
let ptr = UNINIT.as_ptr();
|
|
assert_eq!(
|
|
::std::mem::size_of::<ggml_opt_params__bindgen_ty_1>(),
|
|
44usize,
|
|
concat!("Size of: ", stringify!(ggml_opt_params__bindgen_ty_1))
|
|
);
|
|
assert_eq!(
|
|
::std::mem::align_of::<ggml_opt_params__bindgen_ty_1>(),
|
|
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)
|
|
)
|
|
);
|
|
}
|
|
#[repr(C)]
|
|
#[derive(Debug, Copy, Clone)]
|
|
pub struct ggml_opt_params__bindgen_ty_2 {
|
|
pub m: ::std::os::raw::c_int,
|
|
pub n_iter: ::std::os::raw::c_int,
|
|
pub max_linesearch: ::std::os::raw::c_int,
|
|
pub eps: f32,
|
|
pub ftol: f32,
|
|
pub wolfe: f32,
|
|
pub min_step: f32,
|
|
pub max_step: f32,
|
|
pub linesearch: ggml_linesearch,
|
|
}
|
|
#[test]
|
|
fn bindgen_test_layout_ggml_opt_params__bindgen_ty_2() {
|
|
const UNINIT: ::std::mem::MaybeUninit<ggml_opt_params__bindgen_ty_2> =
|
|
::std::mem::MaybeUninit::uninit();
|
|
let ptr = UNINIT.as_ptr();
|
|
assert_eq!(
|
|
::std::mem::size_of::<ggml_opt_params__bindgen_ty_2>(),
|
|
36usize,
|
|
concat!("Size of: ", stringify!(ggml_opt_params__bindgen_ty_2))
|
|
);
|
|
assert_eq!(
|
|
::std::mem::align_of::<ggml_opt_params__bindgen_ty_2>(),
|
|
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<ggml_opt_params> = ::std::mem::MaybeUninit::uninit();
|
|
let ptr = UNINIT.as_ptr();
|
|
assert_eq!(
|
|
::std::mem::size_of::<ggml_opt_params>(),
|
|
120usize,
|
|
concat!("Size of: ", stringify!(ggml_opt_params))
|
|
);
|
|
assert_eq!(
|
|
::std::mem::align_of::<ggml_opt_params>(),
|
|
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)
|
|
)
|
|
);
|
|
}
|
|
#[repr(C)]
|
|
#[derive(Debug, Copy, Clone)]
|
|
pub struct ggml_opt_context {
|
|
pub ctx: *mut ggml_context,
|
|
pub params: ggml_opt_params,
|
|
pub iter: ::std::os::raw::c_int,
|
|
pub nx: i64,
|
|
pub just_initialized: bool,
|
|
pub loss_before: f32,
|
|
pub loss_after: f32,
|
|
pub adam: ggml_opt_context__bindgen_ty_1,
|
|
pub lbfgs: ggml_opt_context__bindgen_ty_2,
|
|
}
|
|
#[repr(C)]
|
|
#[derive(Debug, Copy, Clone)]
|
|
pub struct ggml_opt_context__bindgen_ty_1 {
|
|
pub g: *mut ggml_tensor,
|
|
pub m: *mut ggml_tensor,
|
|
pub v: *mut ggml_tensor,
|
|
pub pf: *mut ggml_tensor,
|
|
pub fx_best: f32,
|
|
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<ggml_opt_context__bindgen_ty_1> =
|
|
::std::mem::MaybeUninit::uninit();
|
|
let ptr = UNINIT.as_ptr();
|
|
assert_eq!(
|
|
::std::mem::size_of::<ggml_opt_context__bindgen_ty_1>(),
|
|
48usize,
|
|
concat!("Size of: ", stringify!(ggml_opt_context__bindgen_ty_1))
|
|
);
|
|
assert_eq!(
|
|
::std::mem::align_of::<ggml_opt_context__bindgen_ty_1>(),
|
|
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)
|
|
)
|
|
);
|
|
}
|
|
#[repr(C)]
|
|
#[derive(Debug, Copy, Clone)]
|
|
pub struct ggml_opt_context__bindgen_ty_2 {
|
|
pub x: *mut ggml_tensor,
|
|
pub xp: *mut ggml_tensor,
|
|
pub g: *mut ggml_tensor,
|
|
pub gp: *mut ggml_tensor,
|
|
pub d: *mut ggml_tensor,
|
|
pub pf: *mut ggml_tensor,
|
|
pub lmal: *mut ggml_tensor,
|
|
pub lmys: *mut ggml_tensor,
|
|
pub lms: *mut ggml_tensor,
|
|
pub lmy: *mut ggml_tensor,
|
|
pub fx_best: f32,
|
|
pub step: f32,
|
|
pub j: ::std::os::raw::c_int,
|
|
pub k: ::std::os::raw::c_int,
|
|
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<ggml_opt_context__bindgen_ty_2> =
|
|
::std::mem::MaybeUninit::uninit();
|
|
let ptr = UNINIT.as_ptr();
|
|
assert_eq!(
|
|
::std::mem::size_of::<ggml_opt_context__bindgen_ty_2>(),
|
|
104usize,
|
|
concat!("Size of: ", stringify!(ggml_opt_context__bindgen_ty_2))
|
|
);
|
|
assert_eq!(
|
|
::std::mem::align_of::<ggml_opt_context__bindgen_ty_2>(),
|
|
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<ggml_opt_context> = ::std::mem::MaybeUninit::uninit();
|
|
let ptr = UNINIT.as_ptr();
|
|
assert_eq!(
|
|
::std::mem::size_of::<ggml_opt_context>(),
|
|
312usize,
|
|
concat!("Size of: ", stringify!(ggml_opt_context))
|
|
);
|
|
assert_eq!(
|
|
::std::mem::align_of::<ggml_opt_context>(),
|
|
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)
|
|
)
|
|
);
|
|
}
|
|
extern "C" {
|
|
pub fn ggml_opt_default_params(type_: ggml_opt_type) -> ggml_opt_params;
|
|
}
|
|
extern "C" {
|
|
pub fn ggml_opt(
|
|
ctx: *mut ggml_context,
|
|
params: ggml_opt_params,
|
|
f: *mut ggml_tensor,
|
|
) -> ggml_opt_result;
|
|
}
|
|
extern "C" {
|
|
pub fn ggml_opt_init(
|
|
ctx: *mut ggml_context,
|
|
opt: *mut ggml_opt_context,
|
|
params: ggml_opt_params,
|
|
nx: i64,
|
|
);
|
|
}
|
|
extern "C" {
|
|
pub fn ggml_opt_resume(
|
|
ctx: *mut ggml_context,
|
|
opt: *mut ggml_opt_context,
|
|
f: *mut ggml_tensor,
|
|
) -> ggml_opt_result;
|
|
}
|
|
extern "C" {
|
|
pub fn ggml_opt_resume_g(
|
|
ctx: *mut ggml_context,
|
|
opt: *mut ggml_opt_context,
|
|
f: *mut ggml_tensor,
|
|
gf: *mut ggml_cgraph,
|
|
gb: *mut ggml_cgraph,
|
|
callback: ggml_opt_callback,
|
|
callback_data: *mut ::std::os::raw::c_void,
|
|
) -> ggml_opt_result;
|
|
}
|
|
extern "C" {
|
|
pub fn ggml_set_input(tensor: *mut ggml_tensor);
|
|
}
|
|
extern "C" {
|
|
pub fn ggml_set_output(tensor: *mut ggml_tensor);
|
|
}
|
|
extern "C" {
|
|
pub fn ggml_quantize_init(type_: ggml_type);
|
|
}
|
|
extern "C" {
|
|
pub fn ggml_quantize_free();
|
|
}
|
|
extern "C" {
|
|
pub fn ggml_quantize_requires_imatrix(type_: ggml_type) -> bool;
|
|
}
|
|
extern "C" {
|
|
pub fn ggml_quantize_chunk(
|
|
type_: ggml_type,
|
|
src: *const f32,
|
|
dst: *mut ::std::os::raw::c_void,
|
|
start: i64,
|
|
nrows: i64,
|
|
n_per_row: i64,
|
|
imatrix: *const f32,
|
|
) -> usize;
|
|
}
|
|
pub const gguf_type_GGUF_TYPE_UINT8: gguf_type = 0;
|
|
pub const gguf_type_GGUF_TYPE_INT8: gguf_type = 1;
|
|
pub const gguf_type_GGUF_TYPE_UINT16: gguf_type = 2;
|
|
pub const gguf_type_GGUF_TYPE_INT16: gguf_type = 3;
|
|
pub const gguf_type_GGUF_TYPE_UINT32: gguf_type = 4;
|
|
pub const gguf_type_GGUF_TYPE_INT32: gguf_type = 5;
|
|
pub const gguf_type_GGUF_TYPE_FLOAT32: gguf_type = 6;
|
|
pub const gguf_type_GGUF_TYPE_BOOL: gguf_type = 7;
|
|
pub const gguf_type_GGUF_TYPE_STRING: gguf_type = 8;
|
|
pub const gguf_type_GGUF_TYPE_ARRAY: gguf_type = 9;
|
|
pub const gguf_type_GGUF_TYPE_UINT64: gguf_type = 10;
|
|
pub const gguf_type_GGUF_TYPE_INT64: gguf_type = 11;
|
|
pub const gguf_type_GGUF_TYPE_FLOAT64: gguf_type = 12;
|
|
pub const gguf_type_GGUF_TYPE_COUNT: gguf_type = 13;
|
|
pub type gguf_type = ::std::os::raw::c_uint;
|
|
#[repr(C)]
|
|
#[derive(Debug, Copy, Clone)]
|
|
pub struct gguf_context {
|
|
_unused: [u8; 0],
|
|
}
|
|
#[repr(C)]
|
|
#[derive(Debug, Copy, Clone)]
|
|
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<gguf_init_params> = ::std::mem::MaybeUninit::uninit();
|
|
let ptr = UNINIT.as_ptr();
|
|
assert_eq!(
|
|
::std::mem::size_of::<gguf_init_params>(),
|
|
16usize,
|
|
concat!("Size of: ", stringify!(gguf_init_params))
|
|
);
|
|
assert_eq!(
|
|
::std::mem::align_of::<gguf_init_params>(),
|
|
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)
|
|
)
|
|
);
|
|
}
|
|
extern "C" {
|
|
pub fn gguf_init_empty() -> *mut gguf_context;
|
|
}
|
|
extern "C" {
|
|
pub fn gguf_init_from_file(
|
|
fname: *const ::std::os::raw::c_char,
|
|
params: gguf_init_params,
|
|
) -> *mut gguf_context;
|
|
}
|
|
extern "C" {
|
|
pub fn gguf_free(ctx: *mut gguf_context);
|
|
}
|
|
extern "C" {
|
|
pub fn gguf_type_name(type_: gguf_type) -> *const ::std::os::raw::c_char;
|
|
}
|
|
extern "C" {
|
|
pub fn gguf_get_version(ctx: *const gguf_context) -> ::std::os::raw::c_int;
|
|
}
|
|
extern "C" {
|
|
pub fn gguf_get_alignment(ctx: *const gguf_context) -> usize;
|
|
}
|
|
extern "C" {
|
|
pub fn gguf_get_data_offset(ctx: *const gguf_context) -> usize;
|
|
}
|
|
extern "C" {
|
|
pub fn gguf_get_data(ctx: *const gguf_context) -> *mut ::std::os::raw::c_void;
|
|
}
|
|
extern "C" {
|
|
pub fn gguf_get_n_kv(ctx: *const gguf_context) -> ::std::os::raw::c_int;
|
|
}
|
|
extern "C" {
|
|
pub fn gguf_find_key(
|
|
ctx: *const gguf_context,
|
|
key: *const ::std::os::raw::c_char,
|
|
) -> ::std::os::raw::c_int;
|
|
}
|
|
extern "C" {
|
|
pub fn gguf_get_key(
|
|
ctx: *const gguf_context,
|
|
key_id: ::std::os::raw::c_int,
|
|
) -> *const ::std::os::raw::c_char;
|
|
}
|
|
extern "C" {
|
|
pub fn gguf_get_kv_type(ctx: *const gguf_context, key_id: ::std::os::raw::c_int) -> gguf_type;
|
|
}
|
|
extern "C" {
|
|
pub fn gguf_get_arr_type(ctx: *const gguf_context, key_id: ::std::os::raw::c_int) -> gguf_type;
|
|
}
|
|
extern "C" {
|
|
pub fn gguf_get_val_u8(ctx: *const gguf_context, key_id: ::std::os::raw::c_int) -> u8;
|
|
}
|
|
extern "C" {
|
|
pub fn gguf_get_val_i8(ctx: *const gguf_context, key_id: ::std::os::raw::c_int) -> i8;
|
|
}
|
|
extern "C" {
|
|
pub fn gguf_get_val_u16(ctx: *const gguf_context, key_id: ::std::os::raw::c_int) -> u16;
|
|
}
|
|
extern "C" {
|
|
pub fn gguf_get_val_i16(ctx: *const gguf_context, key_id: ::std::os::raw::c_int) -> i16;
|
|
}
|
|
extern "C" {
|
|
pub fn gguf_get_val_u32(ctx: *const gguf_context, key_id: ::std::os::raw::c_int) -> u32;
|
|
}
|
|
extern "C" {
|
|
pub fn gguf_get_val_i32(ctx: *const gguf_context, key_id: ::std::os::raw::c_int) -> i32;
|
|
}
|
|
extern "C" {
|
|
pub fn gguf_get_val_f32(ctx: *const gguf_context, key_id: ::std::os::raw::c_int) -> f32;
|
|
}
|
|
extern "C" {
|
|
pub fn gguf_get_val_u64(ctx: *const gguf_context, key_id: ::std::os::raw::c_int) -> u64;
|
|
}
|
|
extern "C" {
|
|
pub fn gguf_get_val_i64(ctx: *const gguf_context, key_id: ::std::os::raw::c_int) -> i64;
|
|
}
|
|
extern "C" {
|
|
pub fn gguf_get_val_f64(ctx: *const gguf_context, key_id: ::std::os::raw::c_int) -> f64;
|
|
}
|
|
extern "C" {
|
|
pub fn gguf_get_val_bool(ctx: *const gguf_context, key_id: ::std::os::raw::c_int) -> bool;
|
|
}
|
|
extern "C" {
|
|
pub fn gguf_get_val_str(
|
|
ctx: *const gguf_context,
|
|
key_id: ::std::os::raw::c_int,
|
|
) -> *const ::std::os::raw::c_char;
|
|
}
|
|
extern "C" {
|
|
pub fn gguf_get_val_data(
|
|
ctx: *const gguf_context,
|
|
key_id: ::std::os::raw::c_int,
|
|
) -> *const ::std::os::raw::c_void;
|
|
}
|
|
extern "C" {
|
|
pub fn gguf_get_arr_n(
|
|
ctx: *const gguf_context,
|
|
key_id: ::std::os::raw::c_int,
|
|
) -> ::std::os::raw::c_int;
|
|
}
|
|
extern "C" {
|
|
pub fn gguf_get_arr_data(
|
|
ctx: *const gguf_context,
|
|
key_id: ::std::os::raw::c_int,
|
|
) -> *const ::std::os::raw::c_void;
|
|
}
|
|
extern "C" {
|
|
pub fn gguf_get_arr_str(
|
|
ctx: *const gguf_context,
|
|
key_id: ::std::os::raw::c_int,
|
|
i: ::std::os::raw::c_int,
|
|
) -> *const ::std::os::raw::c_char;
|
|
}
|
|
extern "C" {
|
|
pub fn gguf_get_n_tensors(ctx: *const gguf_context) -> ::std::os::raw::c_int;
|
|
}
|
|
extern "C" {
|
|
pub fn gguf_find_tensor(
|
|
ctx: *const gguf_context,
|
|
name: *const ::std::os::raw::c_char,
|
|
) -> ::std::os::raw::c_int;
|
|
}
|
|
extern "C" {
|
|
pub fn gguf_get_tensor_offset(ctx: *const gguf_context, i: ::std::os::raw::c_int) -> usize;
|
|
}
|
|
extern "C" {
|
|
pub fn gguf_get_tensor_name(
|
|
ctx: *const gguf_context,
|
|
i: ::std::os::raw::c_int,
|
|
) -> *mut ::std::os::raw::c_char;
|
|
}
|
|
extern "C" {
|
|
pub fn gguf_get_tensor_type(ctx: *const gguf_context, i: ::std::os::raw::c_int) -> ggml_type;
|
|
}
|
|
extern "C" {
|
|
pub fn gguf_remove_key(ctx: *mut gguf_context, key: *const ::std::os::raw::c_char);
|
|
}
|
|
extern "C" {
|
|
pub fn gguf_set_val_u8(ctx: *mut gguf_context, key: *const ::std::os::raw::c_char, val: u8);
|
|
}
|
|
extern "C" {
|
|
pub fn gguf_set_val_i8(ctx: *mut gguf_context, key: *const ::std::os::raw::c_char, val: i8);
|
|
}
|
|
extern "C" {
|
|
pub fn gguf_set_val_u16(ctx: *mut gguf_context, key: *const ::std::os::raw::c_char, val: u16);
|
|
}
|
|
extern "C" {
|
|
pub fn gguf_set_val_i16(ctx: *mut gguf_context, key: *const ::std::os::raw::c_char, val: i16);
|
|
}
|
|
extern "C" {
|
|
pub fn gguf_set_val_u32(ctx: *mut gguf_context, key: *const ::std::os::raw::c_char, val: u32);
|
|
}
|
|
extern "C" {
|
|
pub fn gguf_set_val_i32(ctx: *mut gguf_context, key: *const ::std::os::raw::c_char, val: i32);
|
|
}
|
|
extern "C" {
|
|
pub fn gguf_set_val_f32(ctx: *mut gguf_context, key: *const ::std::os::raw::c_char, val: f32);
|
|
}
|
|
extern "C" {
|
|
pub fn gguf_set_val_u64(ctx: *mut gguf_context, key: *const ::std::os::raw::c_char, val: u64);
|
|
}
|
|
extern "C" {
|
|
pub fn gguf_set_val_i64(ctx: *mut gguf_context, key: *const ::std::os::raw::c_char, val: i64);
|
|
}
|
|
extern "C" {
|
|
pub fn gguf_set_val_f64(ctx: *mut gguf_context, key: *const ::std::os::raw::c_char, val: f64);
|
|
}
|
|
extern "C" {
|
|
pub fn gguf_set_val_bool(ctx: *mut gguf_context, key: *const ::std::os::raw::c_char, val: bool);
|
|
}
|
|
extern "C" {
|
|
pub fn gguf_set_val_str(
|
|
ctx: *mut gguf_context,
|
|
key: *const ::std::os::raw::c_char,
|
|
val: *const ::std::os::raw::c_char,
|
|
);
|
|
}
|
|
extern "C" {
|
|
pub fn gguf_set_arr_data(
|
|
ctx: *mut gguf_context,
|
|
key: *const ::std::os::raw::c_char,
|
|
type_: gguf_type,
|
|
data: *const ::std::os::raw::c_void,
|
|
n: ::std::os::raw::c_int,
|
|
);
|
|
}
|
|
extern "C" {
|
|
pub fn gguf_set_arr_str(
|
|
ctx: *mut gguf_context,
|
|
key: *const ::std::os::raw::c_char,
|
|
data: *mut *const ::std::os::raw::c_char,
|
|
n: ::std::os::raw::c_int,
|
|
);
|
|
}
|
|
extern "C" {
|
|
pub fn gguf_set_kv(ctx: *mut gguf_context, src: *mut gguf_context);
|
|
}
|
|
extern "C" {
|
|
pub fn gguf_add_tensor(ctx: *mut gguf_context, tensor: *const ggml_tensor);
|
|
}
|
|
extern "C" {
|
|
pub fn gguf_set_tensor_type(
|
|
ctx: *mut gguf_context,
|
|
name: *const ::std::os::raw::c_char,
|
|
type_: ggml_type,
|
|
);
|
|
}
|
|
extern "C" {
|
|
pub fn gguf_set_tensor_data(
|
|
ctx: *mut gguf_context,
|
|
name: *const ::std::os::raw::c_char,
|
|
data: *const ::std::os::raw::c_void,
|
|
size: usize,
|
|
);
|
|
}
|
|
extern "C" {
|
|
pub fn gguf_write_to_file(
|
|
ctx: *const gguf_context,
|
|
fname: *const ::std::os::raw::c_char,
|
|
only_meta: bool,
|
|
);
|
|
}
|
|
extern "C" {
|
|
pub fn gguf_get_meta_size(ctx: *const gguf_context) -> usize;
|
|
}
|
|
extern "C" {
|
|
pub fn gguf_get_meta_data(ctx: *const gguf_context, data: *mut ::std::os::raw::c_void);
|
|
}
|
|
extern "C" {
|
|
pub fn ggml_cpu_has_avx() -> ::std::os::raw::c_int;
|
|
}
|
|
extern "C" {
|
|
pub fn ggml_cpu_has_avx_vnni() -> ::std::os::raw::c_int;
|
|
}
|
|
extern "C" {
|
|
pub fn ggml_cpu_has_avx2() -> ::std::os::raw::c_int;
|
|
}
|
|
extern "C" {
|
|
pub fn ggml_cpu_has_avx512() -> ::std::os::raw::c_int;
|
|
}
|
|
extern "C" {
|
|
pub fn ggml_cpu_has_avx512_vbmi() -> ::std::os::raw::c_int;
|
|
}
|
|
extern "C" {
|
|
pub fn ggml_cpu_has_avx512_vnni() -> ::std::os::raw::c_int;
|
|
}
|
|
extern "C" {
|
|
pub fn ggml_cpu_has_avx512_bf16() -> ::std::os::raw::c_int;
|
|
}
|
|
extern "C" {
|
|
pub fn ggml_cpu_has_fma() -> ::std::os::raw::c_int;
|
|
}
|
|
extern "C" {
|
|
pub fn ggml_cpu_has_neon() -> ::std::os::raw::c_int;
|
|
}
|
|
extern "C" {
|
|
pub fn ggml_cpu_has_sve() -> ::std::os::raw::c_int;
|
|
}
|
|
extern "C" {
|
|
pub fn ggml_cpu_has_arm_fma() -> ::std::os::raw::c_int;
|
|
}
|
|
extern "C" {
|
|
pub fn ggml_cpu_has_metal() -> ::std::os::raw::c_int;
|
|
}
|
|
extern "C" {
|
|
pub fn ggml_cpu_has_f16c() -> ::std::os::raw::c_int;
|
|
}
|
|
extern "C" {
|
|
pub fn ggml_cpu_has_fp16_va() -> ::std::os::raw::c_int;
|
|
}
|
|
extern "C" {
|
|
pub fn ggml_cpu_has_wasm_simd() -> ::std::os::raw::c_int;
|
|
}
|
|
extern "C" {
|
|
pub fn ggml_cpu_has_blas() -> ::std::os::raw::c_int;
|
|
}
|
|
extern "C" {
|
|
pub fn ggml_cpu_has_cuda() -> ::std::os::raw::c_int;
|
|
}
|
|
extern "C" {
|
|
pub fn ggml_cpu_has_vulkan() -> ::std::os::raw::c_int;
|
|
}
|
|
extern "C" {
|
|
pub fn ggml_cpu_has_kompute() -> ::std::os::raw::c_int;
|
|
}
|
|
extern "C" {
|
|
pub fn ggml_cpu_has_gpublas() -> ::std::os::raw::c_int;
|
|
}
|
|
extern "C" {
|
|
pub fn ggml_cpu_has_sse3() -> ::std::os::raw::c_int;
|
|
}
|
|
extern "C" {
|
|
pub fn ggml_cpu_has_ssse3() -> ::std::os::raw::c_int;
|
|
}
|
|
extern "C" {
|
|
pub fn ggml_cpu_has_sycl() -> ::std::os::raw::c_int;
|
|
}
|
|
extern "C" {
|
|
pub fn ggml_cpu_has_rpc() -> ::std::os::raw::c_int;
|
|
}
|
|
extern "C" {
|
|
pub fn ggml_cpu_has_vsx() -> ::std::os::raw::c_int;
|
|
}
|
|
extern "C" {
|
|
pub fn ggml_cpu_has_matmul_int8() -> ::std::os::raw::c_int;
|
|
}
|
|
extern "C" {
|
|
pub fn ggml_cpu_has_cann() -> ::std::os::raw::c_int;
|
|
}
|
|
extern "C" {
|
|
pub fn ggml_cpu_has_llamafile() -> ::std::os::raw::c_int;
|
|
}
|
|
pub type ggml_to_float_t = ::std::option::Option<
|
|
unsafe extern "C" fn(x: *const ::std::os::raw::c_void, y: *mut f32, k: i64),
|
|
>;
|
|
pub type ggml_from_float_t = ::std::option::Option<
|
|
unsafe extern "C" fn(x: *const f32, y: *mut ::std::os::raw::c_void, k: i64),
|
|
>;
|
|
pub type ggml_from_float_to_mat_t = ::std::option::Option<
|
|
unsafe extern "C" fn(x: *const f32, y: *mut ::std::os::raw::c_void, nr: i64, k: i64, bs: i64),
|
|
>;
|
|
pub type ggml_vec_dot_t = ::std::option::Option<
|
|
unsafe extern "C" fn(
|
|
n: ::std::os::raw::c_int,
|
|
s: *mut f32,
|
|
bs: usize,
|
|
x: *const ::std::os::raw::c_void,
|
|
bx: usize,
|
|
y: *const ::std::os::raw::c_void,
|
|
by: usize,
|
|
nrc: ::std::os::raw::c_int,
|
|
),
|
|
>;
|
|
pub type ggml_gemv_t = ::std::option::Option<
|
|
unsafe extern "C" fn(
|
|
n: ::std::os::raw::c_int,
|
|
s: *mut f32,
|
|
bs: usize,
|
|
x: *const ::std::os::raw::c_void,
|
|
y: *const ::std::os::raw::c_void,
|
|
nr: ::std::os::raw::c_int,
|
|
nc: ::std::os::raw::c_int,
|
|
),
|
|
>;
|
|
pub type ggml_gemm_t = ::std::option::Option<
|
|
unsafe extern "C" fn(
|
|
n: ::std::os::raw::c_int,
|
|
s: *mut f32,
|
|
bs: usize,
|
|
x: *const ::std::os::raw::c_void,
|
|
y: *const ::std::os::raw::c_void,
|
|
nr: ::std::os::raw::c_int,
|
|
nc: ::std::os::raw::c_int,
|
|
),
|
|
>;
|
|
#[repr(C)]
|
|
#[derive(Debug, Copy, Clone)]
|
|
pub struct ggml_type_traits_t {
|
|
pub type_name: *const ::std::os::raw::c_char,
|
|
pub blck_size: i64,
|
|
pub blck_size_interleave: i64,
|
|
pub type_size: usize,
|
|
pub is_quantized: bool,
|
|
pub to_float: ggml_to_float_t,
|
|
pub from_float: ggml_from_float_t,
|
|
pub from_float_ref: ggml_from_float_t,
|
|
pub from_float_to_mat: ggml_from_float_to_mat_t,
|
|
pub vec_dot: ggml_vec_dot_t,
|
|
pub vec_dot_type: ggml_type,
|
|
pub nrows: i64,
|
|
pub ncols: i64,
|
|
pub gemv: ggml_gemv_t,
|
|
pub gemm: ggml_gemm_t,
|
|
}
|
|
#[test]
|
|
fn bindgen_test_layout_ggml_type_traits_t() {
|
|
const UNINIT: ::std::mem::MaybeUninit<ggml_type_traits_t> = ::std::mem::MaybeUninit::uninit();
|
|
let ptr = UNINIT.as_ptr();
|
|
assert_eq!(
|
|
::std::mem::size_of::<ggml_type_traits_t>(),
|
|
120usize,
|
|
concat!("Size of: ", stringify!(ggml_type_traits_t))
|
|
);
|
|
assert_eq!(
|
|
::std::mem::align_of::<ggml_type_traits_t>(),
|
|
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;
|
|
}
|
|
#[repr(C)]
|
|
#[derive(Debug, Copy, Clone)]
|
|
pub struct whisper_context {
|
|
_unused: [u8; 0],
|
|
}
|
|
#[repr(C)]
|
|
#[derive(Debug, Copy, Clone)]
|
|
pub struct whisper_state {
|
|
_unused: [u8; 0],
|
|
}
|
|
pub type whisper_pos = i32;
|
|
pub type whisper_token = i32;
|
|
pub type whisper_seq_id = i32;
|
|
pub const whisper_alignment_heads_preset_WHISPER_AHEADS_NONE: whisper_alignment_heads_preset = 0;
|
|
pub const whisper_alignment_heads_preset_WHISPER_AHEADS_N_TOP_MOST: whisper_alignment_heads_preset =
|
|
1;
|
|
pub const whisper_alignment_heads_preset_WHISPER_AHEADS_CUSTOM: whisper_alignment_heads_preset = 2;
|
|
pub const whisper_alignment_heads_preset_WHISPER_AHEADS_TINY_EN: whisper_alignment_heads_preset = 3;
|
|
pub const whisper_alignment_heads_preset_WHISPER_AHEADS_TINY: whisper_alignment_heads_preset = 4;
|
|
pub const whisper_alignment_heads_preset_WHISPER_AHEADS_BASE_EN: whisper_alignment_heads_preset = 5;
|
|
pub const whisper_alignment_heads_preset_WHISPER_AHEADS_BASE: whisper_alignment_heads_preset = 6;
|
|
pub const whisper_alignment_heads_preset_WHISPER_AHEADS_SMALL_EN: whisper_alignment_heads_preset =
|
|
7;
|
|
pub const whisper_alignment_heads_preset_WHISPER_AHEADS_SMALL: whisper_alignment_heads_preset = 8;
|
|
pub const whisper_alignment_heads_preset_WHISPER_AHEADS_MEDIUM_EN: whisper_alignment_heads_preset =
|
|
9;
|
|
pub const whisper_alignment_heads_preset_WHISPER_AHEADS_MEDIUM: whisper_alignment_heads_preset = 10;
|
|
pub const whisper_alignment_heads_preset_WHISPER_AHEADS_LARGE_V1: whisper_alignment_heads_preset =
|
|
11;
|
|
pub const whisper_alignment_heads_preset_WHISPER_AHEADS_LARGE_V2: whisper_alignment_heads_preset =
|
|
12;
|
|
pub const whisper_alignment_heads_preset_WHISPER_AHEADS_LARGE_V3: whisper_alignment_heads_preset =
|
|
13;
|
|
pub type whisper_alignment_heads_preset = ::std::os::raw::c_uint;
|
|
#[repr(C)]
|
|
#[derive(Debug, Copy, Clone)]
|
|
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<whisper_ahead> = ::std::mem::MaybeUninit::uninit();
|
|
let ptr = UNINIT.as_ptr();
|
|
assert_eq!(
|
|
::std::mem::size_of::<whisper_ahead>(),
|
|
8usize,
|
|
concat!("Size of: ", stringify!(whisper_ahead))
|
|
);
|
|
assert_eq!(
|
|
::std::mem::align_of::<whisper_ahead>(),
|
|
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)
|
|
)
|
|
);
|
|
}
|
|
#[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<whisper_aheads> = ::std::mem::MaybeUninit::uninit();
|
|
let ptr = UNINIT.as_ptr();
|
|
assert_eq!(
|
|
::std::mem::size_of::<whisper_aheads>(),
|
|
16usize,
|
|
concat!("Size of: ", stringify!(whisper_aheads))
|
|
);
|
|
assert_eq!(
|
|
::std::mem::align_of::<whisper_aheads>(),
|
|
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)
|
|
)
|
|
);
|
|
}
|
|
#[repr(C)]
|
|
#[derive(Debug, Copy, Clone)]
|
|
pub struct whisper_context_params {
|
|
pub use_gpu: bool,
|
|
pub flash_attn: bool,
|
|
pub gpu_device: ::std::os::raw::c_int,
|
|
pub dtw_token_timestamps: bool,
|
|
pub dtw_aheads_preset: whisper_alignment_heads_preset,
|
|
pub dtw_n_top: ::std::os::raw::c_int,
|
|
pub dtw_aheads: whisper_aheads,
|
|
pub dtw_mem_size: usize,
|
|
}
|
|
#[test]
|
|
fn bindgen_test_layout_whisper_context_params() {
|
|
const UNINIT: ::std::mem::MaybeUninit<whisper_context_params> =
|
|
::std::mem::MaybeUninit::uninit();
|
|
let ptr = UNINIT.as_ptr();
|
|
assert_eq!(
|
|
::std::mem::size_of::<whisper_context_params>(),
|
|
48usize,
|
|
concat!("Size of: ", stringify!(whisper_context_params))
|
|
);
|
|
assert_eq!(
|
|
::std::mem::align_of::<whisper_context_params>(),
|
|
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)
|
|
)
|
|
);
|
|
}
|
|
#[repr(C)]
|
|
#[derive(Debug, Copy, Clone)]
|
|
pub struct whisper_token_data {
|
|
pub id: whisper_token,
|
|
pub tid: whisper_token,
|
|
pub p: f32,
|
|
pub plog: f32,
|
|
pub pt: f32,
|
|
pub ptsum: f32,
|
|
pub t0: i64,
|
|
pub t1: i64,
|
|
pub t_dtw: i64,
|
|
pub vlen: f32,
|
|
}
|
|
#[test]
|
|
fn bindgen_test_layout_whisper_token_data() {
|
|
const UNINIT: ::std::mem::MaybeUninit<whisper_token_data> = ::std::mem::MaybeUninit::uninit();
|
|
let ptr = UNINIT.as_ptr();
|
|
assert_eq!(
|
|
::std::mem::size_of::<whisper_token_data>(),
|
|
56usize,
|
|
concat!("Size of: ", stringify!(whisper_token_data))
|
|
);
|
|
assert_eq!(
|
|
::std::mem::align_of::<whisper_token_data>(),
|
|
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)
|
|
)
|
|
);
|
|
}
|
|
#[repr(C)]
|
|
#[derive(Debug, Copy, Clone)]
|
|
pub struct whisper_model_loader {
|
|
pub context: *mut ::std::os::raw::c_void,
|
|
pub read: ::std::option::Option<
|
|
unsafe extern "C" fn(
|
|
ctx: *mut ::std::os::raw::c_void,
|
|
output: *mut ::std::os::raw::c_void,
|
|
read_size: usize,
|
|
) -> usize,
|
|
>,
|
|
pub eof: ::std::option::Option<unsafe extern "C" fn(ctx: *mut ::std::os::raw::c_void) -> bool>,
|
|
pub close: ::std::option::Option<unsafe extern "C" fn(ctx: *mut ::std::os::raw::c_void)>,
|
|
}
|
|
#[test]
|
|
fn bindgen_test_layout_whisper_model_loader() {
|
|
const UNINIT: ::std::mem::MaybeUninit<whisper_model_loader> = ::std::mem::MaybeUninit::uninit();
|
|
let ptr = UNINIT.as_ptr();
|
|
assert_eq!(
|
|
::std::mem::size_of::<whisper_model_loader>(),
|
|
32usize,
|
|
concat!("Size of: ", stringify!(whisper_model_loader))
|
|
);
|
|
assert_eq!(
|
|
::std::mem::align_of::<whisper_model_loader>(),
|
|
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)
|
|
)
|
|
);
|
|
}
|
|
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;
|
|
pub const whisper_gretype_WHISPER_GRETYPE_CHAR: whisper_gretype = 3;
|
|
pub const whisper_gretype_WHISPER_GRETYPE_CHAR_NOT: whisper_gretype = 4;
|
|
pub const whisper_gretype_WHISPER_GRETYPE_CHAR_RNG_UPPER: whisper_gretype = 5;
|
|
pub const whisper_gretype_WHISPER_GRETYPE_CHAR_ALT: whisper_gretype = 6;
|
|
pub type whisper_gretype = ::std::os::raw::c_uint;
|
|
#[repr(C)]
|
|
#[derive(Debug, Copy, Clone)]
|
|
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<whisper_grammar_element> =
|
|
::std::mem::MaybeUninit::uninit();
|
|
let ptr = UNINIT.as_ptr();
|
|
assert_eq!(
|
|
::std::mem::size_of::<whisper_grammar_element>(),
|
|
8usize,
|
|
concat!("Size of: ", stringify!(whisper_grammar_element))
|
|
);
|
|
assert_eq!(
|
|
::std::mem::align_of::<whisper_grammar_element>(),
|
|
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)
|
|
)
|
|
);
|
|
}
|
|
extern "C" {
|
|
pub fn whisper_init_from_file_with_params(
|
|
path_model: *const ::std::os::raw::c_char,
|
|
params: whisper_context_params,
|
|
) -> *mut whisper_context;
|
|
}
|
|
extern "C" {
|
|
pub fn whisper_init_from_buffer_with_params(
|
|
buffer: *mut ::std::os::raw::c_void,
|
|
buffer_size: usize,
|
|
params: whisper_context_params,
|
|
) -> *mut whisper_context;
|
|
}
|
|
extern "C" {
|
|
pub fn whisper_init_with_params(
|
|
loader: *mut whisper_model_loader,
|
|
params: whisper_context_params,
|
|
) -> *mut whisper_context;
|
|
}
|
|
extern "C" {
|
|
pub fn whisper_init_from_file_with_params_no_state(
|
|
path_model: *const ::std::os::raw::c_char,
|
|
params: whisper_context_params,
|
|
) -> *mut whisper_context;
|
|
}
|
|
extern "C" {
|
|
pub fn whisper_init_from_buffer_with_params_no_state(
|
|
buffer: *mut ::std::os::raw::c_void,
|
|
buffer_size: usize,
|
|
params: whisper_context_params,
|
|
) -> *mut whisper_context;
|
|
}
|
|
extern "C" {
|
|
pub fn whisper_init_with_params_no_state(
|
|
loader: *mut whisper_model_loader,
|
|
params: whisper_context_params,
|
|
) -> *mut whisper_context;
|
|
}
|
|
extern "C" {
|
|
pub fn whisper_init_from_file(
|
|
path_model: *const ::std::os::raw::c_char,
|
|
) -> *mut whisper_context;
|
|
}
|
|
extern "C" {
|
|
pub fn whisper_init_from_buffer(
|
|
buffer: *mut ::std::os::raw::c_void,
|
|
buffer_size: usize,
|
|
) -> *mut whisper_context;
|
|
}
|
|
extern "C" {
|
|
pub fn whisper_init(loader: *mut whisper_model_loader) -> *mut whisper_context;
|
|
}
|
|
extern "C" {
|
|
pub fn whisper_init_from_file_no_state(
|
|
path_model: *const ::std::os::raw::c_char,
|
|
) -> *mut whisper_context;
|
|
}
|
|
extern "C" {
|
|
pub fn whisper_init_from_buffer_no_state(
|
|
buffer: *mut ::std::os::raw::c_void,
|
|
buffer_size: usize,
|
|
) -> *mut whisper_context;
|
|
}
|
|
extern "C" {
|
|
pub fn whisper_init_no_state(loader: *mut whisper_model_loader) -> *mut whisper_context;
|
|
}
|
|
extern "C" {
|
|
pub fn whisper_init_state(ctx: *mut whisper_context) -> *mut whisper_state;
|
|
}
|
|
extern "C" {
|
|
pub fn whisper_ctx_init_openvino_encoder(
|
|
ctx: *mut whisper_context,
|
|
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_free(ctx: *mut whisper_context);
|
|
}
|
|
extern "C" {
|
|
pub fn whisper_free_state(state: *mut whisper_state);
|
|
}
|
|
extern "C" {
|
|
pub fn whisper_free_params(params: *mut whisper_full_params);
|
|
}
|
|
extern "C" {
|
|
pub fn whisper_free_context_params(params: *mut whisper_context_params);
|
|
}
|
|
extern "C" {
|
|
pub fn whisper_pcm_to_mel(
|
|
ctx: *mut whisper_context,
|
|
samples: *const f32,
|
|
n_samples: ::std::os::raw::c_int,
|
|
n_threads: ::std::os::raw::c_int,
|
|
) -> ::std::os::raw::c_int;
|
|
}
|
|
extern "C" {
|
|
pub fn whisper_pcm_to_mel_with_state(
|
|
ctx: *mut whisper_context,
|
|
state: *mut whisper_state,
|
|
samples: *const f32,
|
|
n_samples: ::std::os::raw::c_int,
|
|
n_threads: ::std::os::raw::c_int,
|
|
) -> ::std::os::raw::c_int;
|
|
}
|
|
extern "C" {
|
|
pub fn whisper_set_mel(
|
|
ctx: *mut whisper_context,
|
|
data: *const f32,
|
|
n_len: ::std::os::raw::c_int,
|
|
n_mel: ::std::os::raw::c_int,
|
|
) -> ::std::os::raw::c_int;
|
|
}
|
|
extern "C" {
|
|
pub fn whisper_set_mel_with_state(
|
|
ctx: *mut whisper_context,
|
|
state: *mut whisper_state,
|
|
data: *const f32,
|
|
n_len: ::std::os::raw::c_int,
|
|
n_mel: ::std::os::raw::c_int,
|
|
) -> ::std::os::raw::c_int;
|
|
}
|
|
extern "C" {
|
|
pub fn whisper_encode(
|
|
ctx: *mut whisper_context,
|
|
offset: ::std::os::raw::c_int,
|
|
n_threads: ::std::os::raw::c_int,
|
|
) -> ::std::os::raw::c_int;
|
|
}
|
|
extern "C" {
|
|
pub fn whisper_encode_with_state(
|
|
ctx: *mut whisper_context,
|
|
state: *mut whisper_state,
|
|
offset: ::std::os::raw::c_int,
|
|
n_threads: ::std::os::raw::c_int,
|
|
) -> ::std::os::raw::c_int;
|
|
}
|
|
extern "C" {
|
|
pub fn whisper_decode(
|
|
ctx: *mut whisper_context,
|
|
tokens: *const whisper_token,
|
|
n_tokens: ::std::os::raw::c_int,
|
|
n_past: ::std::os::raw::c_int,
|
|
n_threads: ::std::os::raw::c_int,
|
|
) -> ::std::os::raw::c_int;
|
|
}
|
|
extern "C" {
|
|
pub fn whisper_decode_with_state(
|
|
ctx: *mut whisper_context,
|
|
state: *mut whisper_state,
|
|
tokens: *const whisper_token,
|
|
n_tokens: ::std::os::raw::c_int,
|
|
n_past: ::std::os::raw::c_int,
|
|
n_threads: ::std::os::raw::c_int,
|
|
) -> ::std::os::raw::c_int;
|
|
}
|
|
extern "C" {
|
|
pub fn whisper_tokenize(
|
|
ctx: *mut whisper_context,
|
|
text: *const ::std::os::raw::c_char,
|
|
tokens: *mut whisper_token,
|
|
n_max_tokens: ::std::os::raw::c_int,
|
|
) -> ::std::os::raw::c_int;
|
|
}
|
|
extern "C" {
|
|
pub fn whisper_token_count(
|
|
ctx: *mut whisper_context,
|
|
text: *const ::std::os::raw::c_char,
|
|
) -> ::std::os::raw::c_int;
|
|
}
|
|
extern "C" {
|
|
pub fn whisper_lang_max_id() -> ::std::os::raw::c_int;
|
|
}
|
|
extern "C" {
|
|
pub fn whisper_lang_id(lang: *const ::std::os::raw::c_char) -> ::std::os::raw::c_int;
|
|
}
|
|
extern "C" {
|
|
pub fn whisper_lang_str(id: ::std::os::raw::c_int) -> *const ::std::os::raw::c_char;
|
|
}
|
|
extern "C" {
|
|
pub fn whisper_lang_str_full(id: ::std::os::raw::c_int) -> *const ::std::os::raw::c_char;
|
|
}
|
|
extern "C" {
|
|
pub fn whisper_lang_auto_detect(
|
|
ctx: *mut whisper_context,
|
|
offset_ms: ::std::os::raw::c_int,
|
|
n_threads: ::std::os::raw::c_int,
|
|
lang_probs: *mut f32,
|
|
) -> ::std::os::raw::c_int;
|
|
}
|
|
extern "C" {
|
|
pub fn whisper_lang_auto_detect_with_state(
|
|
ctx: *mut whisper_context,
|
|
state: *mut whisper_state,
|
|
offset_ms: ::std::os::raw::c_int,
|
|
n_threads: ::std::os::raw::c_int,
|
|
lang_probs: *mut f32,
|
|
) -> ::std::os::raw::c_int;
|
|
}
|
|
extern "C" {
|
|
pub fn whisper_n_len(ctx: *mut whisper_context) -> ::std::os::raw::c_int;
|
|
}
|
|
extern "C" {
|
|
pub fn whisper_n_len_from_state(state: *mut whisper_state) -> ::std::os::raw::c_int;
|
|
}
|
|
extern "C" {
|
|
pub fn whisper_n_vocab(ctx: *mut whisper_context) -> ::std::os::raw::c_int;
|
|
}
|
|
extern "C" {
|
|
pub fn whisper_n_text_ctx(ctx: *mut whisper_context) -> ::std::os::raw::c_int;
|
|
}
|
|
extern "C" {
|
|
pub fn whisper_n_audio_ctx(ctx: *mut whisper_context) -> ::std::os::raw::c_int;
|
|
}
|
|
extern "C" {
|
|
pub fn whisper_is_multilingual(ctx: *mut whisper_context) -> ::std::os::raw::c_int;
|
|
}
|
|
extern "C" {
|
|
pub fn whisper_model_n_vocab(ctx: *mut whisper_context) -> ::std::os::raw::c_int;
|
|
}
|
|
extern "C" {
|
|
pub fn whisper_model_n_audio_ctx(ctx: *mut whisper_context) -> ::std::os::raw::c_int;
|
|
}
|
|
extern "C" {
|
|
pub fn whisper_model_n_audio_state(ctx: *mut whisper_context) -> ::std::os::raw::c_int;
|
|
}
|
|
extern "C" {
|
|
pub fn whisper_model_n_audio_head(ctx: *mut whisper_context) -> ::std::os::raw::c_int;
|
|
}
|
|
extern "C" {
|
|
pub fn whisper_model_n_audio_layer(ctx: *mut whisper_context) -> ::std::os::raw::c_int;
|
|
}
|
|
extern "C" {
|
|
pub fn whisper_model_n_text_ctx(ctx: *mut whisper_context) -> ::std::os::raw::c_int;
|
|
}
|
|
extern "C" {
|
|
pub fn whisper_model_n_text_state(ctx: *mut whisper_context) -> ::std::os::raw::c_int;
|
|
}
|
|
extern "C" {
|
|
pub fn whisper_model_n_text_head(ctx: *mut whisper_context) -> ::std::os::raw::c_int;
|
|
}
|
|
extern "C" {
|
|
pub fn whisper_model_n_text_layer(ctx: *mut whisper_context) -> ::std::os::raw::c_int;
|
|
}
|
|
extern "C" {
|
|
pub fn whisper_model_n_mels(ctx: *mut whisper_context) -> ::std::os::raw::c_int;
|
|
}
|
|
extern "C" {
|
|
pub fn whisper_model_ftype(ctx: *mut whisper_context) -> ::std::os::raw::c_int;
|
|
}
|
|
extern "C" {
|
|
pub fn whisper_model_type(ctx: *mut whisper_context) -> ::std::os::raw::c_int;
|
|
}
|
|
extern "C" {
|
|
pub fn whisper_get_logits(ctx: *mut whisper_context) -> *mut f32;
|
|
}
|
|
extern "C" {
|
|
pub fn whisper_get_logits_from_state(state: *mut whisper_state) -> *mut f32;
|
|
}
|
|
extern "C" {
|
|
pub fn whisper_token_to_str(
|
|
ctx: *mut whisper_context,
|
|
token: whisper_token,
|
|
) -> *const ::std::os::raw::c_char;
|
|
}
|
|
extern "C" {
|
|
pub fn whisper_model_type_readable(ctx: *mut whisper_context) -> *const ::std::os::raw::c_char;
|
|
}
|
|
extern "C" {
|
|
pub fn whisper_token_eot(ctx: *mut whisper_context) -> whisper_token;
|
|
}
|
|
extern "C" {
|
|
pub fn whisper_token_sot(ctx: *mut whisper_context) -> whisper_token;
|
|
}
|
|
extern "C" {
|
|
pub fn whisper_token_solm(ctx: *mut whisper_context) -> whisper_token;
|
|
}
|
|
extern "C" {
|
|
pub fn whisper_token_prev(ctx: *mut whisper_context) -> whisper_token;
|
|
}
|
|
extern "C" {
|
|
pub fn whisper_token_nosp(ctx: *mut whisper_context) -> whisper_token;
|
|
}
|
|
extern "C" {
|
|
pub fn whisper_token_not(ctx: *mut whisper_context) -> whisper_token;
|
|
}
|
|
extern "C" {
|
|
pub fn whisper_token_beg(ctx: *mut whisper_context) -> whisper_token;
|
|
}
|
|
extern "C" {
|
|
pub fn whisper_token_lang(
|
|
ctx: *mut whisper_context,
|
|
lang_id: ::std::os::raw::c_int,
|
|
) -> whisper_token;
|
|
}
|
|
extern "C" {
|
|
pub fn whisper_token_translate(ctx: *mut whisper_context) -> whisper_token;
|
|
}
|
|
extern "C" {
|
|
pub fn whisper_token_transcribe(ctx: *mut whisper_context) -> whisper_token;
|
|
}
|
|
extern "C" {
|
|
pub fn whisper_print_timings(ctx: *mut whisper_context);
|
|
}
|
|
extern "C" {
|
|
pub fn whisper_reset_timings(ctx: *mut whisper_context);
|
|
}
|
|
extern "C" {
|
|
pub fn whisper_print_system_info() -> *const ::std::os::raw::c_char;
|
|
}
|
|
pub const whisper_sampling_strategy_WHISPER_SAMPLING_GREEDY: whisper_sampling_strategy = 0;
|
|
pub const whisper_sampling_strategy_WHISPER_SAMPLING_BEAM_SEARCH: whisper_sampling_strategy = 1;
|
|
pub type whisper_sampling_strategy = ::std::os::raw::c_uint;
|
|
pub type whisper_new_segment_callback = ::std::option::Option<
|
|
unsafe extern "C" fn(
|
|
ctx: *mut whisper_context,
|
|
state: *mut whisper_state,
|
|
n_new: ::std::os::raw::c_int,
|
|
user_data: *mut ::std::os::raw::c_void,
|
|
),
|
|
>;
|
|
pub type whisper_progress_callback = ::std::option::Option<
|
|
unsafe extern "C" fn(
|
|
ctx: *mut whisper_context,
|
|
state: *mut whisper_state,
|
|
progress: ::std::os::raw::c_int,
|
|
user_data: *mut ::std::os::raw::c_void,
|
|
),
|
|
>;
|
|
pub type whisper_encoder_begin_callback = ::std::option::Option<
|
|
unsafe extern "C" fn(
|
|
ctx: *mut whisper_context,
|
|
state: *mut whisper_state,
|
|
user_data: *mut ::std::os::raw::c_void,
|
|
) -> bool,
|
|
>;
|
|
pub type whisper_logits_filter_callback = ::std::option::Option<
|
|
unsafe extern "C" fn(
|
|
ctx: *mut whisper_context,
|
|
state: *mut whisper_state,
|
|
tokens: *const whisper_token_data,
|
|
n_tokens: ::std::os::raw::c_int,
|
|
logits: *mut f32,
|
|
user_data: *mut ::std::os::raw::c_void,
|
|
),
|
|
>;
|
|
#[repr(C)]
|
|
#[derive(Debug, Copy, Clone)]
|
|
pub struct whisper_full_params {
|
|
pub strategy: whisper_sampling_strategy,
|
|
pub n_threads: ::std::os::raw::c_int,
|
|
pub n_max_text_ctx: ::std::os::raw::c_int,
|
|
pub offset_ms: ::std::os::raw::c_int,
|
|
pub duration_ms: ::std::os::raw::c_int,
|
|
pub translate: bool,
|
|
pub no_context: bool,
|
|
pub no_timestamps: bool,
|
|
pub single_segment: bool,
|
|
pub print_special: bool,
|
|
pub print_progress: bool,
|
|
pub print_realtime: bool,
|
|
pub print_timestamps: bool,
|
|
pub token_timestamps: bool,
|
|
pub thold_pt: f32,
|
|
pub thold_ptsum: f32,
|
|
pub max_len: ::std::os::raw::c_int,
|
|
pub split_on_word: bool,
|
|
pub max_tokens: ::std::os::raw::c_int,
|
|
pub debug_mode: bool,
|
|
pub audio_ctx: ::std::os::raw::c_int,
|
|
pub tdrz_enable: bool,
|
|
pub suppress_regex: *const ::std::os::raw::c_char,
|
|
pub initial_prompt: *const ::std::os::raw::c_char,
|
|
pub prompt_tokens: *const whisper_token,
|
|
pub prompt_n_tokens: ::std::os::raw::c_int,
|
|
pub language: *const ::std::os::raw::c_char,
|
|
pub detect_language: bool,
|
|
pub suppress_blank: bool,
|
|
pub suppress_non_speech_tokens: bool,
|
|
pub temperature: f32,
|
|
pub max_initial_ts: f32,
|
|
pub length_penalty: f32,
|
|
pub temperature_inc: f32,
|
|
pub entropy_thold: f32,
|
|
pub logprob_thold: f32,
|
|
pub no_speech_thold: f32,
|
|
pub greedy: whisper_full_params__bindgen_ty_1,
|
|
pub beam_search: whisper_full_params__bindgen_ty_2,
|
|
pub new_segment_callback: whisper_new_segment_callback,
|
|
pub new_segment_callback_user_data: *mut ::std::os::raw::c_void,
|
|
pub progress_callback: whisper_progress_callback,
|
|
pub progress_callback_user_data: *mut ::std::os::raw::c_void,
|
|
pub encoder_begin_callback: whisper_encoder_begin_callback,
|
|
pub encoder_begin_callback_user_data: *mut ::std::os::raw::c_void,
|
|
pub abort_callback: ggml_abort_callback,
|
|
pub abort_callback_user_data: *mut ::std::os::raw::c_void,
|
|
pub logits_filter_callback: whisper_logits_filter_callback,
|
|
pub logits_filter_callback_user_data: *mut ::std::os::raw::c_void,
|
|
pub grammar_rules: *mut *const whisper_grammar_element,
|
|
pub n_grammar_rules: usize,
|
|
pub i_start_rule: usize,
|
|
pub grammar_penalty: f32,
|
|
}
|
|
#[repr(C)]
|
|
#[derive(Debug, Copy, Clone)]
|
|
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<whisper_full_params__bindgen_ty_1> =
|
|
::std::mem::MaybeUninit::uninit();
|
|
let ptr = UNINIT.as_ptr();
|
|
assert_eq!(
|
|
::std::mem::size_of::<whisper_full_params__bindgen_ty_1>(),
|
|
4usize,
|
|
concat!("Size of: ", stringify!(whisper_full_params__bindgen_ty_1))
|
|
);
|
|
assert_eq!(
|
|
::std::mem::align_of::<whisper_full_params__bindgen_ty_1>(),
|
|
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)
|
|
)
|
|
);
|
|
}
|
|
#[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<whisper_full_params__bindgen_ty_2> =
|
|
::std::mem::MaybeUninit::uninit();
|
|
let ptr = UNINIT.as_ptr();
|
|
assert_eq!(
|
|
::std::mem::size_of::<whisper_full_params__bindgen_ty_2>(),
|
|
8usize,
|
|
concat!("Size of: ", stringify!(whisper_full_params__bindgen_ty_2))
|
|
);
|
|
assert_eq!(
|
|
::std::mem::align_of::<whisper_full_params__bindgen_ty_2>(),
|
|
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<whisper_full_params> = ::std::mem::MaybeUninit::uninit();
|
|
let ptr = UNINIT.as_ptr();
|
|
assert_eq!(
|
|
::std::mem::size_of::<whisper_full_params>(),
|
|
264usize,
|
|
concat!("Size of: ", stringify!(whisper_full_params))
|
|
);
|
|
assert_eq!(
|
|
::std::mem::align_of::<whisper_full_params>(),
|
|
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)
|
|
)
|
|
);
|
|
}
|
|
extern "C" {
|
|
pub fn whisper_context_default_params_by_ref() -> *mut whisper_context_params;
|
|
}
|
|
extern "C" {
|
|
pub fn whisper_context_default_params() -> whisper_context_params;
|
|
}
|
|
extern "C" {
|
|
pub fn whisper_full_default_params_by_ref(
|
|
strategy: whisper_sampling_strategy,
|
|
) -> *mut whisper_full_params;
|
|
}
|
|
extern "C" {
|
|
pub fn whisper_full_default_params(strategy: whisper_sampling_strategy) -> whisper_full_params;
|
|
}
|
|
extern "C" {
|
|
pub fn whisper_full(
|
|
ctx: *mut whisper_context,
|
|
params: whisper_full_params,
|
|
samples: *const f32,
|
|
n_samples: ::std::os::raw::c_int,
|
|
) -> ::std::os::raw::c_int;
|
|
}
|
|
extern "C" {
|
|
pub fn whisper_full_with_state(
|
|
ctx: *mut whisper_context,
|
|
state: *mut whisper_state,
|
|
params: whisper_full_params,
|
|
samples: *const f32,
|
|
n_samples: ::std::os::raw::c_int,
|
|
) -> ::std::os::raw::c_int;
|
|
}
|
|
extern "C" {
|
|
pub fn whisper_full_parallel(
|
|
ctx: *mut whisper_context,
|
|
params: whisper_full_params,
|
|
samples: *const f32,
|
|
n_samples: ::std::os::raw::c_int,
|
|
n_processors: ::std::os::raw::c_int,
|
|
) -> ::std::os::raw::c_int;
|
|
}
|
|
extern "C" {
|
|
pub fn whisper_full_n_segments(ctx: *mut whisper_context) -> ::std::os::raw::c_int;
|
|
}
|
|
extern "C" {
|
|
pub fn whisper_full_n_segments_from_state(state: *mut whisper_state) -> ::std::os::raw::c_int;
|
|
}
|
|
extern "C" {
|
|
pub fn whisper_full_lang_id(ctx: *mut whisper_context) -> ::std::os::raw::c_int;
|
|
}
|
|
extern "C" {
|
|
pub fn whisper_full_lang_id_from_state(state: *mut whisper_state) -> ::std::os::raw::c_int;
|
|
}
|
|
extern "C" {
|
|
pub fn whisper_full_get_segment_t0(
|
|
ctx: *mut whisper_context,
|
|
i_segment: ::std::os::raw::c_int,
|
|
) -> i64;
|
|
}
|
|
extern "C" {
|
|
pub fn whisper_full_get_segment_t0_from_state(
|
|
state: *mut whisper_state,
|
|
i_segment: ::std::os::raw::c_int,
|
|
) -> i64;
|
|
}
|
|
extern "C" {
|
|
pub fn whisper_full_get_segment_t1(
|
|
ctx: *mut whisper_context,
|
|
i_segment: ::std::os::raw::c_int,
|
|
) -> i64;
|
|
}
|
|
extern "C" {
|
|
pub fn whisper_full_get_segment_t1_from_state(
|
|
state: *mut whisper_state,
|
|
i_segment: ::std::os::raw::c_int,
|
|
) -> i64;
|
|
}
|
|
extern "C" {
|
|
pub fn whisper_full_get_segment_speaker_turn_next(
|
|
ctx: *mut whisper_context,
|
|
i_segment: ::std::os::raw::c_int,
|
|
) -> bool;
|
|
}
|
|
extern "C" {
|
|
pub fn whisper_full_get_segment_speaker_turn_next_from_state(
|
|
state: *mut whisper_state,
|
|
i_segment: ::std::os::raw::c_int,
|
|
) -> bool;
|
|
}
|
|
extern "C" {
|
|
pub fn whisper_full_get_segment_text(
|
|
ctx: *mut whisper_context,
|
|
i_segment: ::std::os::raw::c_int,
|
|
) -> *const ::std::os::raw::c_char;
|
|
}
|
|
extern "C" {
|
|
pub fn whisper_full_get_segment_text_from_state(
|
|
state: *mut whisper_state,
|
|
i_segment: ::std::os::raw::c_int,
|
|
) -> *const ::std::os::raw::c_char;
|
|
}
|
|
extern "C" {
|
|
pub fn whisper_full_n_tokens(
|
|
ctx: *mut whisper_context,
|
|
i_segment: ::std::os::raw::c_int,
|
|
) -> ::std::os::raw::c_int;
|
|
}
|
|
extern "C" {
|
|
pub fn whisper_full_n_tokens_from_state(
|
|
state: *mut whisper_state,
|
|
i_segment: ::std::os::raw::c_int,
|
|
) -> ::std::os::raw::c_int;
|
|
}
|
|
extern "C" {
|
|
pub fn whisper_full_get_token_text(
|
|
ctx: *mut whisper_context,
|
|
i_segment: ::std::os::raw::c_int,
|
|
i_token: ::std::os::raw::c_int,
|
|
) -> *const ::std::os::raw::c_char;
|
|
}
|
|
extern "C" {
|
|
pub fn whisper_full_get_token_text_from_state(
|
|
ctx: *mut whisper_context,
|
|
state: *mut whisper_state,
|
|
i_segment: ::std::os::raw::c_int,
|
|
i_token: ::std::os::raw::c_int,
|
|
) -> *const ::std::os::raw::c_char;
|
|
}
|
|
extern "C" {
|
|
pub fn whisper_full_get_token_id(
|
|
ctx: *mut whisper_context,
|
|
i_segment: ::std::os::raw::c_int,
|
|
i_token: ::std::os::raw::c_int,
|
|
) -> whisper_token;
|
|
}
|
|
extern "C" {
|
|
pub fn whisper_full_get_token_id_from_state(
|
|
state: *mut whisper_state,
|
|
i_segment: ::std::os::raw::c_int,
|
|
i_token: ::std::os::raw::c_int,
|
|
) -> whisper_token;
|
|
}
|
|
extern "C" {
|
|
pub fn whisper_full_get_token_data(
|
|
ctx: *mut whisper_context,
|
|
i_segment: ::std::os::raw::c_int,
|
|
i_token: ::std::os::raw::c_int,
|
|
) -> whisper_token_data;
|
|
}
|
|
extern "C" {
|
|
pub fn whisper_full_get_token_data_from_state(
|
|
state: *mut whisper_state,
|
|
i_segment: ::std::os::raw::c_int,
|
|
i_token: ::std::os::raw::c_int,
|
|
) -> whisper_token_data;
|
|
}
|
|
extern "C" {
|
|
pub fn whisper_full_get_token_p(
|
|
ctx: *mut whisper_context,
|
|
i_segment: ::std::os::raw::c_int,
|
|
i_token: ::std::os::raw::c_int,
|
|
) -> f32;
|
|
}
|
|
extern "C" {
|
|
pub fn whisper_full_get_token_p_from_state(
|
|
state: *mut whisper_state,
|
|
i_segment: ::std::os::raw::c_int,
|
|
i_token: ::std::os::raw::c_int,
|
|
) -> f32;
|
|
}
|
|
extern "C" {
|
|
pub fn whisper_bench_memcpy(n_threads: ::std::os::raw::c_int) -> ::std::os::raw::c_int;
|
|
}
|
|
extern "C" {
|
|
pub fn whisper_bench_memcpy_str(
|
|
n_threads: ::std::os::raw::c_int,
|
|
) -> *const ::std::os::raw::c_char;
|
|
}
|
|
extern "C" {
|
|
pub fn whisper_bench_ggml_mul_mat(n_threads: ::std::os::raw::c_int) -> ::std::os::raw::c_int;
|
|
}
|
|
extern "C" {
|
|
pub fn whisper_bench_ggml_mul_mat_str(
|
|
n_threads: ::std::os::raw::c_int,
|
|
) -> *const ::std::os::raw::c_char;
|
|
}
|
|
extern "C" {
|
|
pub fn whisper_log_set(log_callback: ggml_log_callback, user_data: *mut ::std::os::raw::c_void);
|
|
}
|
|
pub type __builtin_va_list = [__va_list_tag; 1usize];
|
|
#[repr(C)]
|
|
#[derive(Debug, Copy, Clone)]
|
|
pub struct __va_list_tag {
|
|
pub gp_offset: ::std::os::raw::c_uint,
|
|
pub fp_offset: ::std::os::raw::c_uint,
|
|
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)
|
|
)
|
|
);
|
|
}
|
|
#[repr(C)]
|
|
#[derive(Debug, Copy, Clone)]
|
|
pub struct ggml_backend_buffer {
|
|
pub _address: u8,
|
|
}
|