diff --git a/Cargo.toml b/Cargo.toml index 9c6db08..5f870e3 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -4,7 +4,7 @@ exclude = ["examples/full_usage"] [package] name = "whisper-rs" -version = "0.9.0-rc.2" +version = "0.10.0" edition = "2021" description = "Rust bindings for whisper.cpp" license = "Unlicense" @@ -14,7 +14,7 @@ repository = "https://github.com/tazz4843/whisper-rs" # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html [dependencies] -whisper-rs-sys = { path = "sys", version = "0.7" } +whisper-rs-sys = { path = "sys", version = "0.8" } [dev-dependencies] hound = "3.5.0" @@ -24,10 +24,11 @@ default = [] simd = [] coreml = ["whisper-rs-sys/coreml"] -cuda = ["whisper-rs-sys/cuda"] +cuda = ["whisper-rs-sys/cuda", "_gpu"] opencl = ["whisper-rs-sys/opencl"] openblas = ["whisper-rs-sys/openblas"] -metal = ["whisper-rs-sys/metal"] +metal = ["whisper-rs-sys/metal", "_gpu"] +_gpu = [] test-with-tiny-model = [] [package.metadata.docs.rs] diff --git a/src/lib.rs b/src/lib.rs index 8c3ac3c..6b7754c 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -5,6 +5,7 @@ mod error; mod standalone; mod utilities; mod whisper_ctx; +mod whisper_grammar; mod whisper_params; mod whisper_state; @@ -25,4 +26,4 @@ pub type WhisperStartEncoderCallback = whisper_rs_sys::whisper_encoder_begin_cal pub type WhisperProgressCallback = whisper_rs_sys::whisper_progress_callback; pub type WhisperLogitsFilterCallback = whisper_rs_sys::whisper_logits_filter_callback; pub type WhisperAbortCallback = whisper_rs_sys::whisper_abort_callback; -pub type WhisperLogCallback = whisper_rs_sys::whisper_log_callback; +pub type WhisperLogCallback = whisper_rs_sys::ggml_log_callback; diff --git a/src/standalone.rs b/src/standalone.rs index 35758fe..e945dfb 100644 --- a/src/standalone.rs +++ b/src/standalone.rs @@ -55,10 +55,16 @@ pub fn get_lang_str(id: i32) -> Option<&'static str> { /// Callback to control logging output: default behaviour is to print to stderr. /// +/// # Safety +/// The callback must be safe to call from C (i.e. no panicking, no unwinding, etc). +/// /// # C++ equivalent /// `void whisper_set_log_callback(whisper_log_callback callback);` -pub unsafe fn set_log_callback(callback: whisper_rs_sys::whisper_log_callback) { - unsafe { whisper_rs_sys::whisper_set_log_callback(callback) } +pub unsafe fn set_log_callback( + log_callback: crate::WhisperLogCallback, + user_data: *mut std::ffi::c_void, +) { + unsafe { whisper_rs_sys::whisper_log_set(log_callback, user_data) } } /// Print system information. diff --git a/src/whisper_ctx.rs b/src/whisper_ctx.rs index 350e534..eaa8302 100644 --- a/src/whisper_ctx.rs +++ b/src/whisper_ctx.rs @@ -5,7 +5,7 @@ use std::ffi::{c_int, CStr, CString}; /// Safe Rust wrapper around a Whisper context. /// -/// You likely want to create this with [WhisperContext::new], +/// You likely want to create this with [WhisperContext::new_with_params], /// then run a full transcription with [WhisperContext::full]. #[derive(Debug)] pub struct WhisperContext { @@ -13,6 +13,63 @@ pub struct WhisperContext { } impl WhisperContext { + /// Create a new WhisperContext from a file, with parameters. + /// + /// # Arguments + /// * path: The path to the model file. + /// * parameters: A parameter struct containing the parameters to use. + /// + /// # Returns + /// Ok(Self) on success, Err(WhisperError) on failure. + /// + /// # C++ equivalent + /// `struct whisper_context * whisper_init_from_file_with_params_no_state(const char * path_model, struct whisper_context_params params);` + pub fn new_with_params( + path: &str, + parameters: WhisperContextParameters, + ) -> Result { + let path_cstr = CString::new(path)?; + let ctx = unsafe { + whisper_rs_sys::whisper_init_from_file_with_params_no_state( + path_cstr.as_ptr(), + parameters.to_c_struct(), + ) + }; + if ctx.is_null() { + Err(WhisperError::InitError) + } else { + Ok(Self { ctx }) + } + } + + /// Create a new WhisperContext from a buffer. + /// + /// # Arguments + /// * buffer: The buffer containing the model. + /// + /// # Returns + /// Ok(Self) on success, Err(WhisperError) on failure. + /// + /// # C++ equivalent + /// `struct whisper_context * whisper_init_from_buffer_with_params_no_state(void * buffer, size_t buffer_size, struct whisper_context_params params);` + pub fn new_from_buffer_with_params( + buffer: &[u8], + parameters: WhisperContextParameters, + ) -> Result { + let ctx = unsafe { + whisper_rs_sys::whisper_init_from_buffer_with_params_no_state( + buffer.as_ptr() as _, + buffer.len(), + parameters.to_c_struct(), + ) + }; + if ctx.is_null() { + Err(WhisperError::InitError) + } else { + Ok(Self { ctx }) + } + } + /// Create a new WhisperContext from a file. /// /// # Arguments @@ -22,7 +79,8 @@ impl WhisperContext { /// Ok(Self) on success, Err(WhisperError) on failure. /// /// # C++ equivalent - /// `struct whisper_context * whisper_init_from_file(const char * path_model);` + /// `struct whisper_context * whisper_init_from_file_no_state(const char * path_model)` + #[deprecated = "Use `new_with_params` instead"] pub fn new(path: &str) -> Result { let path_cstr = CString::new(path)?; let ctx = unsafe { whisper_rs_sys::whisper_init_from_file_no_state(path_cstr.as_ptr()) }; @@ -42,7 +100,8 @@ impl WhisperContext { /// Ok(Self) on success, Err(WhisperError) on failure. /// /// # C++ equivalent - /// `struct whisper_context * whisper_init_from_buffer(const char * buffer, int n_bytes);` + /// `struct whisper_context * whisper_init_from_buffer_no_state(void * buffer, size_t buffer_size)` + #[deprecated = "Use `new_from_buffer_with_params` instead"] pub fn new_from_buffer(buffer: &[u8]) -> Result { let ctx = unsafe { whisper_rs_sys::whisper_init_from_buffer_no_state(buffer.as_ptr() as _, buffer.len()) @@ -472,6 +531,37 @@ impl Drop for WhisperContext { unsafe impl Send for WhisperContext {} unsafe impl Sync for WhisperContext {} +pub struct WhisperContextParameters { + /// Use GPU if available. + /// + /// **Warning**: Does not have an effect if OpenCL is selected as GPU backend + /// (in that case, GPU is always enabled). + pub use_gpu: bool, +} + +#[allow(clippy::derivable_impls)] // this impl cannot be derived +impl Default for WhisperContextParameters { + fn default() -> Self { + Self { + use_gpu: cfg!(feature = "_gpu"), + } + } +} +impl WhisperContextParameters { + pub fn new() -> Self { + Self::default() + } + pub fn use_gpu(mut self, use_gpu: bool) -> Self { + self.use_gpu = use_gpu; + self + } + fn to_c_struct(&self) -> whisper_rs_sys::whisper_context_params { + whisper_rs_sys::whisper_context_params { + use_gpu: self.use_gpu, + } + } +} + #[cfg(test)] #[cfg(feature = "test-with-tiny-model")] mod test_with_tiny_model { diff --git a/src/whisper_grammar.rs b/src/whisper_grammar.rs new file mode 100644 index 0000000..337f135 --- /dev/null +++ b/src/whisper_grammar.rs @@ -0,0 +1,79 @@ +use whisper_rs_sys::{ + whisper_gretype_WHISPER_GRETYPE_ALT, whisper_gretype_WHISPER_GRETYPE_CHAR, + whisper_gretype_WHISPER_GRETYPE_CHAR_ALT, whisper_gretype_WHISPER_GRETYPE_CHAR_NOT, + whisper_gretype_WHISPER_GRETYPE_CHAR_RNG_UPPER, whisper_gretype_WHISPER_GRETYPE_END, + whisper_gretype_WHISPER_GRETYPE_RULE_REF, +}; + +#[repr(u32)] +#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)] +pub enum WhisperGrammarElementType { + /// End of rule definition + End = whisper_gretype_WHISPER_GRETYPE_END, + /// Start of alternate definition for a rule + Alternate = whisper_gretype_WHISPER_GRETYPE_ALT, + /// Non-terminal element: reference to another rule + RuleReference = whisper_gretype_WHISPER_GRETYPE_RULE_REF, + /// Terminal element: character (code point) + Character = whisper_gretype_WHISPER_GRETYPE_CHAR, + /// Inverse of a character(s) + NotCharacter = whisper_gretype_WHISPER_GRETYPE_CHAR_NOT, + /// Modifies a preceding [Self::Character] to be an inclusive range + CharacterRangeUpper = whisper_gretype_WHISPER_GRETYPE_CHAR_RNG_UPPER, + /// Modifies a preceding [Self::Character] to add an alternate character to match + CharacterAlternate = whisper_gretype_WHISPER_GRETYPE_CHAR_ALT, +} + +impl From for WhisperGrammarElementType { + fn from(value: whisper_rs_sys::whisper_gretype) -> Self { + assert!( + (0..=6).contains(&value), + "Invalid WhisperGrammarElementType value: {}", + value + ); + + #[allow(non_upper_case_globals)] // weird place to trigger this + match value { + whisper_gretype_WHISPER_GRETYPE_END => WhisperGrammarElementType::End, + whisper_gretype_WHISPER_GRETYPE_ALT => WhisperGrammarElementType::Alternate, + whisper_gretype_WHISPER_GRETYPE_RULE_REF => WhisperGrammarElementType::RuleReference, + whisper_gretype_WHISPER_GRETYPE_CHAR => WhisperGrammarElementType::Character, + whisper_gretype_WHISPER_GRETYPE_CHAR_NOT => WhisperGrammarElementType::NotCharacter, + whisper_gretype_WHISPER_GRETYPE_CHAR_RNG_UPPER => { + WhisperGrammarElementType::CharacterRangeUpper + } + whisper_gretype_WHISPER_GRETYPE_CHAR_ALT => { + WhisperGrammarElementType::CharacterAlternate + } + _ => unreachable!(), + } + } +} + +impl From for whisper_rs_sys::whisper_gretype { + fn from(value: WhisperGrammarElementType) -> Self { + value as Self + } +} + +#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)] +pub struct WhisperGrammarElement { + pub element_type: WhisperGrammarElementType, + pub value: u32, +} + +impl WhisperGrammarElement { + pub fn new(element_type: WhisperGrammarElementType, value: u32) -> Self { + Self { + element_type, + value, + } + } + + pub fn to_c_type(self) -> whisper_rs_sys::whisper_grammar_element { + whisper_rs_sys::whisper_grammar_element { + type_: self.element_type.into(), + value: self.value, + } + } +} diff --git a/src/whisper_params.rs b/src/whisper_params.rs index 73e57be..692a040 100644 --- a/src/whisper_params.rs +++ b/src/whisper_params.rs @@ -1,3 +1,4 @@ +use crate::whisper_grammar::WhisperGrammarElement; use std::ffi::{c_float, c_int, CString}; use std::marker::PhantomData; use whisper_rs_sys::whisper_token; @@ -24,6 +25,7 @@ pub struct FullParams<'a, 'b> { pub(crate) fp: whisper_rs_sys::whisper_full_params, phantom_lang: PhantomData<&'a str>, phantom_tokens: PhantomData<&'b [c_int]>, + grammar: Option>, progess_callback_safe: Option>, } @@ -58,6 +60,7 @@ impl<'a, 'b> FullParams<'a, 'b> { fp, phantom_lang: PhantomData, phantom_tokens: PhantomData, + grammar: None, progess_callback_safe: None, } } @@ -104,6 +107,13 @@ impl<'a, 'b> FullParams<'a, 'b> { self.fp.no_context = no_context; } + /// Do not generate timestamps. + /// + /// Defaults to false. + pub fn set_no_timestamps(&mut self, no_timestamps: bool) { + self.fp.no_timestamps = no_timestamps; + } + /// Force single segment output. This may be useful for streaming. /// /// Defaults to false. @@ -529,6 +539,46 @@ impl<'a, 'b> FullParams<'a, 'b> { pub unsafe fn set_abort_callback_user_data(&mut self, user_data: *mut std::ffi::c_void) { self.fp.abort_callback_user_data = user_data; } + + /// Enable an array of grammar elements to be passed to the whisper model. + /// + /// Defaults to an empty vector. + pub fn set_grammar(&mut self, grammar: Option<&[WhisperGrammarElement]>) { + if let Some(grammar) = grammar { + // convert to c types + let inner = grammar.iter().map(|e| e.to_c_type()).collect::>(); + // turn into ptr and len + let grammar_ptr = inner.as_ptr() as *mut _; + let grammar_len = inner.len(); + + self.grammar = Some(inner); + + // set the grammar + self.fp.grammar_rules = grammar_ptr; + self.fp.n_grammar_rules = grammar_len; + } else { + self.grammar = None; + self.fp.grammar_rules = std::ptr::null_mut(); + self.fp.n_grammar_rules = 0; + self.fp.i_start_rule = 0; + } + } + + /// Set the start grammar rule. Does nothing if no grammar is set. + /// + /// Defaults to 0. + pub fn set_start_rule(&mut self, start_rule: usize) { + if self.grammar.is_some() { + self.fp.i_start_rule = start_rule; + } + } + + /// Set grammar penalty. + /// + /// Defaults to 100.0. + pub fn set_grammar_penalty(&mut self, grammar_penalty: f32) { + self.fp.grammar_penalty = grammar_penalty; + } } // following implementations are safe diff --git a/sys/Cargo.toml b/sys/Cargo.toml index 91dc858..baae8d1 100644 --- a/sys/Cargo.toml +++ b/sys/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "whisper-rs-sys" -version = "0.7.3" +version = "0.8.0" edition = "2021" description = "Rust bindings for whisper.cpp (FFI bindings)" license = "Unlicense" @@ -43,6 +43,6 @@ metal = [] [build-dependencies] cmake = "0.1" -bindgen = "0.68" +bindgen = "0.69" cfg-if = "1" fs_extra = "1.3" diff --git a/sys/build.rs b/sys/build.rs index e74ae3e..9545b61 100644 --- a/sys/build.rs +++ b/sys/build.rs @@ -78,7 +78,7 @@ fn main() { let bindings = bindgen::Builder::default() .header("wrapper.h") .clang_arg("-I./whisper.cpp") - .parse_callbacks(Box::new(bindgen::CargoCallbacks)) + .parse_callbacks(Box::new(bindgen::CargoCallbacks::new())) .generate(); match bindings { diff --git a/sys/src/bindings.rs b/sys/src/bindings.rs index 1e25f09..0c91318 100644 --- a/sys/src/bindings.rs +++ b/sys/src/bindings.rs @@ -1,4 +1,4 @@ -/* automatically generated by rust-bindgen 0.65.1 */ +/* automatically generated by rust-bindgen 0.69.1 */ pub const _STDINT_H: u32 = 1; pub const _FEATURES_H: u32 = 1; @@ -26,6 +26,7 @@ pub const __USE_ATFILE: u32 = 1; pub const __USE_FORTIFY_LEVEL: u32 = 0; pub const __GLIBC_USE_DEPRECATED_GETS: u32 = 0; pub const __GLIBC_USE_DEPRECATED_SCANF: u32 = 0; +pub const __GLIBC_USE_C2X_STRTOL: u32 = 0; pub const _STDC_PREDEF_H: u32 = 1; pub const __STDC_IEC_559__: u32 = 1; pub const __STDC_IEC_60559_BFP__: u32 = 201404; @@ -34,7 +35,7 @@ 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 = 37; +pub const __GLIBC_MINOR__: u32 = 38; pub const _SYS_CDEFS_H: u32 = 1; pub const __glibc_c99_flexarr_available: u32 = 1; pub const __LDOUBLE_REDIRECTS_TO_FLOAT128_ABI: u32 = 0; @@ -98,55 +99,29 @@ pub const WINT_MAX: u32 = 4294967295; pub const __bool_true_false_are_defined: u32 = 1; pub const true_: u32 = 1; pub const false_: 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 = 1024; +pub const GGML_MAX_CONTEXTS: u32 = 64; +pub const GGML_MAX_SRC: u32 = 6; +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_N_TASKS_MAX: i32 = -1; pub const WHISPER_SAMPLE_RATE: u32 = 16000; pub const WHISPER_N_FFT: u32 = 400; -pub const WHISPER_N_MEL: u32 = 80; pub const WHISPER_HOP_LENGTH: u32 = 160; pub const WHISPER_CHUNK_SIZE: u32 = 30; -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 = ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::(), - 32usize, - concat!("Size of: ", stringify!(max_align_t)) - ); - assert_eq!( - ::std::mem::align_of::(), - 16usize, - concat!("Alignment of ", stringify!(max_align_t)) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).__clang_max_align_nonce1) as usize - ptr as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(max_align_t), - "::", - stringify!(__clang_max_align_nonce1) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).__clang_max_align_nonce2) as usize - ptr as usize }, - 16usize, - concat!( - "Offset of field: ", - stringify!(max_align_t), - "::", - stringify!(__clang_max_align_nonce2) - ) - ); -} 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; @@ -257,6 +232,3868 @@ 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 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 = ::std::mem::MaybeUninit::uninit(); + let ptr = UNINIT.as_ptr(); + assert_eq!( + ::std::mem::size_of::(), + 32usize, + concat!("Size of: ", stringify!(max_align_t)) + ); + assert_eq!( + ::std::mem::align_of::(), + 16usize, + concat!("Alignment of ", stringify!(max_align_t)) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).__clang_max_align_nonce1) as usize - ptr as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(max_align_t), + "::", + stringify!(__clang_max_align_nonce1) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).__clang_max_align_nonce2) as usize - ptr as usize }, + 16usize, + concat!( + "Offset of field: ", + stringify!(max_align_t), + "::", + stringify!(__clang_max_align_nonce2) + ) + ); +} +pub type ggml_fp16_t = u16; +extern "C" { + pub fn ggml_fp16_to_fp32(x: ggml_fp16_t) -> f32; +} +extern "C" { + pub fn ggml_fp32_to_fp16(x: f32) -> ggml_fp16_t; +} +extern "C" { + pub fn ggml_fp16_to_fp32_row(x: *const ggml_fp16_t, y: *mut f32, n: ::std::os::raw::c_int); +} +extern "C" { + pub fn ggml_fp32_to_fp16_row(x: *const f32, y: *mut ggml_fp16_t, n: ::std::os::raw::c_int); +} +#[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_I8: ggml_type = 16; +pub const ggml_type_GGML_TYPE_I16: ggml_type = 17; +pub const ggml_type_GGML_TYPE_I32: ggml_type = 18; +pub const ggml_type_GGML_TYPE_COUNT: ggml_type = 19; +pub type ggml_type = ::std::os::raw::c_uint; +pub const ggml_backend_type_GGML_BACKEND_CPU: ggml_backend_type = 0; +pub const ggml_backend_type_GGML_BACKEND_GPU: ggml_backend_type = 10; +pub const ggml_backend_type_GGML_BACKEND_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 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_OUT_PROD: ggml_op = 24; +pub const ggml_op_GGML_OP_SCALE: ggml_op = 25; +pub const ggml_op_GGML_OP_SET: ggml_op = 26; +pub const ggml_op_GGML_OP_CPY: ggml_op = 27; +pub const ggml_op_GGML_OP_CONT: ggml_op = 28; +pub const ggml_op_GGML_OP_RESHAPE: ggml_op = 29; +pub const ggml_op_GGML_OP_VIEW: ggml_op = 30; +pub const ggml_op_GGML_OP_PERMUTE: ggml_op = 31; +pub const ggml_op_GGML_OP_TRANSPOSE: ggml_op = 32; +pub const ggml_op_GGML_OP_GET_ROWS: ggml_op = 33; +pub const ggml_op_GGML_OP_GET_ROWS_BACK: ggml_op = 34; +pub const ggml_op_GGML_OP_DIAG: ggml_op = 35; +pub const ggml_op_GGML_OP_DIAG_MASK_INF: ggml_op = 36; +pub const ggml_op_GGML_OP_DIAG_MASK_ZERO: ggml_op = 37; +pub const ggml_op_GGML_OP_SOFT_MAX: ggml_op = 38; +pub const ggml_op_GGML_OP_SOFT_MAX_BACK: ggml_op = 39; +pub const ggml_op_GGML_OP_ROPE: ggml_op = 40; +pub const ggml_op_GGML_OP_ROPE_BACK: ggml_op = 41; +pub const ggml_op_GGML_OP_ALIBI: 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_FLASH_ATTN: ggml_op = 50; +pub const ggml_op_GGML_OP_FLASH_FF: ggml_op = 51; +pub const ggml_op_GGML_OP_FLASH_ATTN_BACK: ggml_op = 52; +pub const ggml_op_GGML_OP_WIN_PART: ggml_op = 53; +pub const ggml_op_GGML_OP_WIN_UNPART: ggml_op = 54; +pub const ggml_op_GGML_OP_GET_REL_POS: ggml_op = 55; +pub const ggml_op_GGML_OP_ADD_REL_POS: ggml_op = 56; +pub const ggml_op_GGML_OP_UNARY: ggml_op = 57; +pub const ggml_op_GGML_OP_MAP_UNARY: ggml_op = 58; +pub const ggml_op_GGML_OP_MAP_BINARY: ggml_op = 59; +pub const ggml_op_GGML_OP_MAP_CUSTOM1_F32: ggml_op = 60; +pub const ggml_op_GGML_OP_MAP_CUSTOM2_F32: ggml_op = 61; +pub const ggml_op_GGML_OP_MAP_CUSTOM3_F32: ggml_op = 62; +pub const ggml_op_GGML_OP_MAP_CUSTOM1: ggml_op = 63; +pub const ggml_op_GGML_OP_MAP_CUSTOM2: ggml_op = 64; +pub const ggml_op_GGML_OP_MAP_CUSTOM3: ggml_op = 65; +pub const ggml_op_GGML_OP_CROSS_ENTROPY_LOSS: ggml_op = 66; +pub const ggml_op_GGML_OP_CROSS_ENTROPY_LOSS_BACK: ggml_op = 67; +pub const ggml_op_GGML_OP_COUNT: ggml_op = 68; +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_GELU: ggml_unary_op = 7; +pub const ggml_unary_op_GGML_UNARY_OP_GELU_QUICK: ggml_unary_op = 8; +pub const ggml_unary_op_GGML_UNARY_OP_SILU: ggml_unary_op = 9; +pub const ggml_unary_op_GGML_UNARY_OP_LEAKY: ggml_unary_op = 10; +pub type ggml_unary_op = ::std::os::raw::c_uint; +pub const ggml_object_type_GGML_OBJECT_TENSOR: ggml_object_type = 0; +pub const ggml_object_type_GGML_OBJECT_GRAPH: ggml_object_type = 1; +pub const ggml_object_type_GGML_OBJECT_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 type ggml_log_level = ::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 = ::std::mem::MaybeUninit::uninit(); + let ptr = UNINIT.as_ptr(); + assert_eq!( + ::std::mem::size_of::(), + 32usize, + concat!("Size of: ", stringify!(ggml_object)) + ); + assert_eq!( + ::std::mem::align_of::(), + 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 n_dims: ::std::os::raw::c_int, + pub ne: [i64; 4usize], + pub nb: [usize; 4usize], + pub op: ggml_op, + pub op_params: [i32; 16usize], + pub is_param: bool, + pub grad: *mut ggml_tensor, + pub src: [*mut ggml_tensor; 6usize], + pub perf_runs: ::std::os::raw::c_int, + pub perf_cycles: i64, + pub perf_time_us: i64, + 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, + pub padding: [::std::os::raw::c_char; 12usize], +} +#[test] +fn bindgen_test_layout_ggml_tensor() { + const UNINIT: ::std::mem::MaybeUninit = ::std::mem::MaybeUninit::uninit(); + let ptr = UNINIT.as_ptr(); + assert_eq!( + ::std::mem::size_of::(), + 352usize, + concat!("Size of: ", stringify!(ggml_tensor)) + ); + assert_eq!( + ::std::mem::align_of::(), + 8usize, + concat!("Alignment of ", stringify!(ggml_tensor)) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).type_) as usize - ptr as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(ggml_tensor), + "::", + stringify!(type_) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).backend) as usize - ptr as usize }, + 4usize, + concat!( + "Offset of field: ", + stringify!(ggml_tensor), + "::", + stringify!(backend) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).buffer) as usize - ptr as usize }, + 8usize, + concat!( + "Offset of field: ", + stringify!(ggml_tensor), + "::", + stringify!(buffer) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).n_dims) as usize - ptr as usize }, + 16usize, + concat!( + "Offset of field: ", + stringify!(ggml_tensor), + "::", + stringify!(n_dims) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).ne) as usize - ptr as usize }, + 24usize, + concat!( + "Offset of field: ", + stringify!(ggml_tensor), + "::", + stringify!(ne) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).nb) as usize - ptr as usize }, + 56usize, + concat!( + "Offset of field: ", + stringify!(ggml_tensor), + "::", + stringify!(nb) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).op) as usize - ptr as usize }, + 88usize, + concat!( + "Offset of field: ", + stringify!(ggml_tensor), + "::", + stringify!(op) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).op_params) as usize - ptr as usize }, + 92usize, + concat!( + "Offset of field: ", + stringify!(ggml_tensor), + "::", + stringify!(op_params) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).is_param) as usize - ptr as usize }, + 156usize, + concat!( + "Offset of field: ", + stringify!(ggml_tensor), + "::", + stringify!(is_param) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).grad) as usize - ptr as usize }, + 160usize, + concat!( + "Offset of field: ", + stringify!(ggml_tensor), + "::", + stringify!(grad) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).src) as usize - ptr as usize }, + 168usize, + concat!( + "Offset of field: ", + stringify!(ggml_tensor), + "::", + stringify!(src) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).perf_runs) as usize - ptr as usize }, + 216usize, + concat!( + "Offset of field: ", + stringify!(ggml_tensor), + "::", + stringify!(perf_runs) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).perf_cycles) as usize - ptr as usize }, + 224usize, + concat!( + "Offset of field: ", + stringify!(ggml_tensor), + "::", + stringify!(perf_cycles) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).perf_time_us) as usize - ptr as usize }, + 232usize, + concat!( + "Offset of field: ", + stringify!(ggml_tensor), + "::", + stringify!(perf_time_us) + ) + ); + 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) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).padding) as usize - ptr as usize }, + 336usize, + concat!( + "Offset of field: ", + stringify!(ggml_tensor), + "::", + stringify!(padding) + ) + ); +} +pub const GGML_TENSOR_SIZE: usize = 352; +#[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: + ::std::option::Option bool>, + pub abort_callback_data: *mut ::std::os::raw::c_void, +} +#[test] +fn bindgen_test_layout_ggml_cplan() { + const UNINIT: ::std::mem::MaybeUninit = ::std::mem::MaybeUninit::uninit(); + let ptr = UNINIT.as_ptr(); + assert_eq!( + ::std::mem::size_of::(), + 40usize, + concat!("Size of: ", stringify!(ggml_cplan)) + ); + assert_eq!( + ::std::mem::align_of::(), + 8usize, + concat!("Alignment of ", stringify!(ggml_cplan)) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).work_size) as usize - ptr as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(ggml_cplan), + "::", + stringify!(work_size) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).work_data) as usize - ptr as usize }, + 8usize, + concat!( + "Offset of field: ", + stringify!(ggml_cplan), + "::", + stringify!(work_data) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).n_threads) as usize - ptr as usize }, + 16usize, + concat!( + "Offset of field: ", + stringify!(ggml_cplan), + "::", + stringify!(n_threads) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).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; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct ggml_hash_set { + pub size: usize, + pub keys: *mut *mut ggml_tensor, +} +#[test] +fn bindgen_test_layout_ggml_hash_set() { + const UNINIT: ::std::mem::MaybeUninit = ::std::mem::MaybeUninit::uninit(); + let ptr = UNINIT.as_ptr(); + assert_eq!( + ::std::mem::size_of::(), + 16usize, + concat!("Size of: ", stringify!(ggml_hash_set)) + ); + assert_eq!( + ::std::mem::align_of::(), + 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).keys) as usize - ptr as usize }, + 8usize, + 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_table: ggml_hash_set, + pub order: ggml_cgraph_eval_order, + pub perf_runs: ::std::os::raw::c_int, + pub perf_cycles: i64, + pub perf_time_us: i64, +} +#[test] +fn bindgen_test_layout_ggml_cgraph() { + const UNINIT: ::std::mem::MaybeUninit = ::std::mem::MaybeUninit::uninit(); + let ptr = UNINIT.as_ptr(); + assert_eq!( + ::std::mem::size_of::(), + 80usize, + concat!("Size of: ", stringify!(ggml_cgraph)) + ); + assert_eq!( + ::std::mem::align_of::(), + 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_table) as usize - ptr as usize }, + 40usize, + concat!( + "Offset of field: ", + stringify!(ggml_cgraph), + "::", + stringify!(visited_hash_table) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).order) as usize - ptr as usize }, + 56usize, + concat!( + "Offset of field: ", + stringify!(ggml_cgraph), + "::", + stringify!(order) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).perf_runs) as usize - ptr as usize }, + 60usize, + concat!( + "Offset of field: ", + stringify!(ggml_cgraph), + "::", + stringify!(perf_runs) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).perf_cycles) as usize - ptr as usize }, + 64usize, + concat!( + "Offset of field: ", + stringify!(ggml_cgraph), + "::", + stringify!(perf_cycles) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).perf_time_us) as usize - ptr as usize }, + 72usize, + concat!( + "Offset of field: ", + stringify!(ggml_cgraph), + "::", + stringify!(perf_time_us) + ) + ); +} +#[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 = ::std::mem::MaybeUninit::uninit(); + let ptr = UNINIT.as_ptr(); + assert_eq!( + ::std::mem::size_of::(), + 24usize, + concat!("Size of: ", stringify!(ggml_scratch)) + ); + assert_eq!( + ::std::mem::align_of::(), + 8usize, + concat!("Alignment of ", stringify!(ggml_scratch)) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).offs) as usize - ptr as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(ggml_scratch), + "::", + stringify!(offs) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).size) as usize - ptr as usize }, + 8usize, + concat!( + "Offset of field: ", + stringify!(ggml_scratch), + "::", + stringify!(size) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).data) as usize - ptr as usize }, + 16usize, + concat!( + "Offset of field: ", + stringify!(ggml_scratch), + "::", + stringify!(data) + ) + ); +} +#[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 = ::std::mem::MaybeUninit::uninit(); + let ptr = UNINIT.as_ptr(); + assert_eq!( + ::std::mem::size_of::(), + 24usize, + concat!("Size of: ", stringify!(ggml_init_params)) + ); + assert_eq!( + ::std::mem::align_of::(), + 8usize, + concat!("Alignment of ", stringify!(ggml_init_params)) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).mem_size) as usize - ptr as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(ggml_init_params), + "::", + stringify!(mem_size) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).mem_buffer) as usize - ptr as usize }, + 8usize, + concat!( + "Offset of field: ", + stringify!(ggml_init_params), + "::", + stringify!(mem_buffer) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).no_alloc) as usize - ptr as usize }, + 16usize, + concat!( + "Offset of field: ", + stringify!(ggml_init_params), + "::", + stringify!(no_alloc) + ) + ); +} +pub const ggml_task_type_GGML_TASK_INIT: ggml_task_type = 0; +pub const ggml_task_type_GGML_TASK_COMPUTE: ggml_task_type = 1; +pub const ggml_task_type_GGML_TASK_FINALIZE: ggml_task_type = 2; +pub type ggml_task_type = ::std::os::raw::c_uint; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct ggml_compute_params { + pub type_: ggml_task_type, + pub ith: ::std::os::raw::c_int, + pub nth: ::std::os::raw::c_int, + pub wsize: usize, + pub wdata: *mut ::std::os::raw::c_void, +} +#[test] +fn bindgen_test_layout_ggml_compute_params() { + const UNINIT: ::std::mem::MaybeUninit = ::std::mem::MaybeUninit::uninit(); + let ptr = UNINIT.as_ptr(); + assert_eq!( + ::std::mem::size_of::(), + 32usize, + concat!("Size of: ", stringify!(ggml_compute_params)) + ); + assert_eq!( + ::std::mem::align_of::(), + 8usize, + concat!("Alignment of ", stringify!(ggml_compute_params)) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).type_) as usize - ptr as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(ggml_compute_params), + "::", + stringify!(type_) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).ith) as usize - ptr as usize }, + 4usize, + concat!( + "Offset of field: ", + stringify!(ggml_compute_params), + "::", + stringify!(ith) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).nth) as usize - ptr as usize }, + 8usize, + concat!( + "Offset of field: ", + stringify!(ggml_compute_params), + "::", + stringify!(nth) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).wsize) as usize - ptr as usize }, + 16usize, + concat!( + "Offset of field: ", + stringify!(ggml_compute_params), + "::", + stringify!(wsize) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).wdata) as usize - ptr as usize }, + 24usize, + concat!( + "Offset of field: ", + stringify!(ggml_compute_params), + "::", + stringify!(wdata) + ) + ); +} +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_print_backtrace(); +} +extern "C" { + pub fn ggml_numa_init(); +} +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_nbytes_split( + tensor: *const ggml_tensor, + nrows_split: ::std::os::raw::c_int, + ) -> usize; +} +extern "C" { + pub fn ggml_blck_size(type_: ggml_type) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn ggml_type_size(type_: ggml_type) -> usize; +} +extern "C" { + pub fn ggml_type_sizef(type_: ggml_type) -> f32; +} +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_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_contiguous(tensor: *const ggml_tensor) -> bool; +} +extern "C" { + pub fn ggml_is_permuted(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_tensor_overhead() -> usize; +} +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: *mut ggml_context) -> *mut ggml_tensor; +} +extern "C" { + pub fn ggml_get_next_tensor( + ctx: *mut 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, + ) -> *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(ctx: *mut ggml_context, a: *mut ggml_tensor) -> *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_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_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, + ) -> *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, + ) -> *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_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, + b: *mut ggml_tensor, + ) -> *mut ggml_tensor; +} +extern "C" { + pub fn ggml_scale_inplace( + ctx: *mut ggml_context, + a: *mut ggml_tensor, + b: *mut ggml_tensor, + ) -> *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_cpy_inplace( + ctx: *mut ggml_context, + a: *mut ggml_tensor, + b: *mut ggml_tensor, + ) -> *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_inplace(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_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, + n_ctx: ::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, + n_ctx: ::std::os::raw::c_int, + ) -> *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: ::std::os::raw::c_int, + n_orig_ctx: ::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: ::std::os::raw::c_int, + n_orig_ctx: ::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_orig_ctx: ::std::os::raw::c_int, + freq_base: f32, + beta_fast: f32, + beta_slow: f32, + dims: *mut f32, + ); +} +extern "C" { + pub fn ggml_rope_xpos_inplace( + ctx: *mut ggml_context, + a: *mut ggml_tensor, + b: *mut ggml_tensor, + n_dims: ::std::os::raw::c_int, + base: f32, + down: bool, + ) -> *mut ggml_tensor; +} +extern "C" { + pub fn ggml_rope_back( + 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: ::std::os::raw::c_int, + freq_base: f32, + freq_scale: f32, + xpos_base: f32, + xpos_down: bool, + ) -> *mut ggml_tensor; +} +extern "C" { + pub fn ggml_alibi( + ctx: *mut ggml_context, + a: *mut ggml_tensor, + n_past: ::std::os::raw::c_int, + n_head: ::std::os::raw::c_int, + bias_max: 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, + ) -> *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_flash_attn( + ctx: *mut ggml_context, + q: *mut ggml_tensor, + k: *mut ggml_tensor, + v: *mut ggml_tensor, + masked: bool, + ) -> *mut ggml_tensor; +} +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_flash_ff( + ctx: *mut ggml_context, + a: *mut ggml_tensor, + b0: *mut ggml_tensor, + b1: *mut ggml_tensor, + c0: *mut ggml_tensor, + c1: *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; +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( + ctx: *mut ggml_context, + cgraph: *mut ggml_cgraph, + i0: ::std::os::raw::c_int, + i1: ::std::os::raw::c_int, + ) -> *mut 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: *mut 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, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn ggml_graph_compute_with_ctx( + ctx: *mut ggml_context, + cgraph: *mut ggml_cgraph, + n_threads: ::std::os::raw::c_int, + ); +} +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_ADAM: ggml_opt_type = 0; +pub const ggml_opt_type_GGML_OPT_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_OK: ggml_opt_result = 0; +pub const ggml_opt_result_GGML_OPT_DID_NOT_CONVERGE: ggml_opt_result = 1; +pub const ggml_opt_result_GGML_OPT_NO_CONTEXT: ggml_opt_result = 2; +pub const ggml_opt_result_GGML_OPT_INVALID_WOLFE: ggml_opt_result = 3; +pub const ggml_opt_result_GGML_OPT_FAIL: ggml_opt_result = 4; +pub const ggml_opt_result_GGML_OPT_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 = + ::std::mem::MaybeUninit::uninit(); + let ptr = UNINIT.as_ptr(); + assert_eq!( + ::std::mem::size_of::(), + 44usize, + concat!("Size of: ", stringify!(ggml_opt_params__bindgen_ty_1)) + ); + assert_eq!( + ::std::mem::align_of::(), + 4usize, + concat!("Alignment of ", stringify!(ggml_opt_params__bindgen_ty_1)) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).n_iter) as usize - ptr as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(ggml_opt_params__bindgen_ty_1), + "::", + stringify!(n_iter) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).sched) as usize - ptr as usize }, + 4usize, + concat!( + "Offset of field: ", + stringify!(ggml_opt_params__bindgen_ty_1), + "::", + stringify!(sched) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).decay) as usize - ptr as usize }, + 8usize, + concat!( + "Offset of field: ", + stringify!(ggml_opt_params__bindgen_ty_1), + "::", + stringify!(decay) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).decay_min_ndim) as usize - ptr as usize }, + 12usize, + concat!( + "Offset of field: ", + stringify!(ggml_opt_params__bindgen_ty_1), + "::", + stringify!(decay_min_ndim) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).alpha) as usize - ptr as usize }, + 16usize, + concat!( + "Offset of field: ", + stringify!(ggml_opt_params__bindgen_ty_1), + "::", + stringify!(alpha) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).beta1) as usize - ptr as usize }, + 20usize, + concat!( + "Offset of field: ", + stringify!(ggml_opt_params__bindgen_ty_1), + "::", + stringify!(beta1) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).beta2) as usize - ptr as usize }, + 24usize, + concat!( + "Offset of field: ", + stringify!(ggml_opt_params__bindgen_ty_1), + "::", + stringify!(beta2) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).eps) as usize - ptr as usize }, + 28usize, + concat!( + "Offset of field: ", + stringify!(ggml_opt_params__bindgen_ty_1), + "::", + stringify!(eps) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).eps_f) as usize - ptr as usize }, + 32usize, + concat!( + "Offset of field: ", + stringify!(ggml_opt_params__bindgen_ty_1), + "::", + stringify!(eps_f) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).eps_g) as usize - ptr as usize }, + 36usize, + concat!( + "Offset of field: ", + stringify!(ggml_opt_params__bindgen_ty_1), + "::", + stringify!(eps_g) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).gclip) as usize - ptr as usize }, + 40usize, + concat!( + "Offset of field: ", + stringify!(ggml_opt_params__bindgen_ty_1), + "::", + stringify!(gclip) + ) + ); +} +#[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 = + ::std::mem::MaybeUninit::uninit(); + let ptr = UNINIT.as_ptr(); + assert_eq!( + ::std::mem::size_of::(), + 36usize, + concat!("Size of: ", stringify!(ggml_opt_params__bindgen_ty_2)) + ); + assert_eq!( + ::std::mem::align_of::(), + 4usize, + concat!("Alignment of ", stringify!(ggml_opt_params__bindgen_ty_2)) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).m) as usize - ptr as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(ggml_opt_params__bindgen_ty_2), + "::", + stringify!(m) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).n_iter) as usize - ptr as usize }, + 4usize, + concat!( + "Offset of field: ", + stringify!(ggml_opt_params__bindgen_ty_2), + "::", + stringify!(n_iter) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).max_linesearch) as usize - ptr as usize }, + 8usize, + concat!( + "Offset of field: ", + stringify!(ggml_opt_params__bindgen_ty_2), + "::", + stringify!(max_linesearch) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).eps) as usize - ptr as usize }, + 12usize, + concat!( + "Offset of field: ", + stringify!(ggml_opt_params__bindgen_ty_2), + "::", + stringify!(eps) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).ftol) as usize - ptr as usize }, + 16usize, + concat!( + "Offset of field: ", + stringify!(ggml_opt_params__bindgen_ty_2), + "::", + stringify!(ftol) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).wolfe) as usize - ptr as usize }, + 20usize, + concat!( + "Offset of field: ", + stringify!(ggml_opt_params__bindgen_ty_2), + "::", + stringify!(wolfe) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).min_step) as usize - ptr as usize }, + 24usize, + concat!( + "Offset of field: ", + stringify!(ggml_opt_params__bindgen_ty_2), + "::", + stringify!(min_step) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).max_step) as usize - ptr as usize }, + 28usize, + concat!( + "Offset of field: ", + stringify!(ggml_opt_params__bindgen_ty_2), + "::", + stringify!(max_step) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).linesearch) as usize - ptr as usize }, + 32usize, + concat!( + "Offset of field: ", + stringify!(ggml_opt_params__bindgen_ty_2), + "::", + stringify!(linesearch) + ) + ); +} +#[test] +fn bindgen_test_layout_ggml_opt_params() { + const UNINIT: ::std::mem::MaybeUninit = ::std::mem::MaybeUninit::uninit(); + let ptr = UNINIT.as_ptr(); + assert_eq!( + ::std::mem::size_of::(), + 120usize, + concat!("Size of: ", stringify!(ggml_opt_params)) + ); + assert_eq!( + ::std::mem::align_of::(), + 8usize, + concat!("Alignment of ", stringify!(ggml_opt_params)) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).type_) as usize - ptr as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(ggml_opt_params), + "::", + stringify!(type_) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).graph_size) as usize - ptr as usize }, + 8usize, + concat!( + "Offset of field: ", + stringify!(ggml_opt_params), + "::", + stringify!(graph_size) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).n_threads) as usize - ptr as usize }, + 16usize, + concat!( + "Offset of field: ", + stringify!(ggml_opt_params), + "::", + stringify!(n_threads) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).past) as usize - ptr as usize }, + 20usize, + concat!( + "Offset of field: ", + stringify!(ggml_opt_params), + "::", + stringify!(past) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).delta) as usize - ptr as usize }, + 24usize, + concat!( + "Offset of field: ", + stringify!(ggml_opt_params), + "::", + stringify!(delta) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).max_no_improvement) as usize - ptr as usize }, + 28usize, + concat!( + "Offset of field: ", + stringify!(ggml_opt_params), + "::", + stringify!(max_no_improvement) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).print_forward_graph) as usize - ptr as usize }, + 32usize, + concat!( + "Offset of field: ", + stringify!(ggml_opt_params), + "::", + stringify!(print_forward_graph) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).print_backward_graph) as usize - ptr as usize }, + 33usize, + concat!( + "Offset of field: ", + stringify!(ggml_opt_params), + "::", + stringify!(print_backward_graph) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).n_gradient_accumulation) as usize - ptr as usize }, + 36usize, + concat!( + "Offset of field: ", + stringify!(ggml_opt_params), + "::", + stringify!(n_gradient_accumulation) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).adam) as usize - ptr as usize }, + 40usize, + concat!( + "Offset of field: ", + stringify!(ggml_opt_params), + "::", + stringify!(adam) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).lbfgs) as usize - ptr as usize }, + 84usize, + concat!( + "Offset of field: ", + stringify!(ggml_opt_params), + "::", + stringify!(lbfgs) + ) + ); +} +#[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 = + ::std::mem::MaybeUninit::uninit(); + let ptr = UNINIT.as_ptr(); + assert_eq!( + ::std::mem::size_of::(), + 48usize, + concat!("Size of: ", stringify!(ggml_opt_context__bindgen_ty_1)) + ); + assert_eq!( + ::std::mem::align_of::(), + 8usize, + concat!("Alignment of ", stringify!(ggml_opt_context__bindgen_ty_1)) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).g) as usize - ptr as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(ggml_opt_context__bindgen_ty_1), + "::", + stringify!(g) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).m) as usize - ptr as usize }, + 8usize, + concat!( + "Offset of field: ", + stringify!(ggml_opt_context__bindgen_ty_1), + "::", + stringify!(m) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).v) as usize - ptr as usize }, + 16usize, + concat!( + "Offset of field: ", + stringify!(ggml_opt_context__bindgen_ty_1), + "::", + stringify!(v) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).pf) as usize - ptr as usize }, + 24usize, + concat!( + "Offset of field: ", + stringify!(ggml_opt_context__bindgen_ty_1), + "::", + stringify!(pf) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).fx_best) as usize - ptr as usize }, + 32usize, + concat!( + "Offset of field: ", + stringify!(ggml_opt_context__bindgen_ty_1), + "::", + stringify!(fx_best) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).fx_prev) as usize - ptr as usize }, + 36usize, + concat!( + "Offset of field: ", + stringify!(ggml_opt_context__bindgen_ty_1), + "::", + stringify!(fx_prev) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).n_no_improvement) as usize - ptr as usize }, + 40usize, + concat!( + "Offset of field: ", + stringify!(ggml_opt_context__bindgen_ty_1), + "::", + stringify!(n_no_improvement) + ) + ); +} +#[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 = + ::std::mem::MaybeUninit::uninit(); + let ptr = UNINIT.as_ptr(); + assert_eq!( + ::std::mem::size_of::(), + 104usize, + concat!("Size of: ", stringify!(ggml_opt_context__bindgen_ty_2)) + ); + assert_eq!( + ::std::mem::align_of::(), + 8usize, + concat!("Alignment of ", stringify!(ggml_opt_context__bindgen_ty_2)) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).x) as usize - ptr as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(ggml_opt_context__bindgen_ty_2), + "::", + stringify!(x) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).xp) as usize - ptr as usize }, + 8usize, + concat!( + "Offset of field: ", + stringify!(ggml_opt_context__bindgen_ty_2), + "::", + stringify!(xp) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).g) as usize - ptr as usize }, + 16usize, + concat!( + "Offset of field: ", + stringify!(ggml_opt_context__bindgen_ty_2), + "::", + stringify!(g) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).gp) as usize - ptr as usize }, + 24usize, + concat!( + "Offset of field: ", + stringify!(ggml_opt_context__bindgen_ty_2), + "::", + stringify!(gp) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).d) as usize - ptr as usize }, + 32usize, + concat!( + "Offset of field: ", + stringify!(ggml_opt_context__bindgen_ty_2), + "::", + stringify!(d) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).pf) as usize - ptr as usize }, + 40usize, + concat!( + "Offset of field: ", + stringify!(ggml_opt_context__bindgen_ty_2), + "::", + stringify!(pf) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).lmal) as usize - ptr as usize }, + 48usize, + concat!( + "Offset of field: ", + stringify!(ggml_opt_context__bindgen_ty_2), + "::", + stringify!(lmal) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).lmys) as usize - ptr as usize }, + 56usize, + concat!( + "Offset of field: ", + stringify!(ggml_opt_context__bindgen_ty_2), + "::", + stringify!(lmys) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).lms) as usize - ptr as usize }, + 64usize, + concat!( + "Offset of field: ", + stringify!(ggml_opt_context__bindgen_ty_2), + "::", + stringify!(lms) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).lmy) as usize - ptr as usize }, + 72usize, + concat!( + "Offset of field: ", + stringify!(ggml_opt_context__bindgen_ty_2), + "::", + stringify!(lmy) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).fx_best) as usize - ptr as usize }, + 80usize, + concat!( + "Offset of field: ", + stringify!(ggml_opt_context__bindgen_ty_2), + "::", + stringify!(fx_best) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).step) as usize - ptr as usize }, + 84usize, + concat!( + "Offset of field: ", + stringify!(ggml_opt_context__bindgen_ty_2), + "::", + stringify!(step) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).j) as usize - ptr as usize }, + 88usize, + concat!( + "Offset of field: ", + stringify!(ggml_opt_context__bindgen_ty_2), + "::", + stringify!(j) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).k) as usize - ptr as usize }, + 92usize, + concat!( + "Offset of field: ", + stringify!(ggml_opt_context__bindgen_ty_2), + "::", + stringify!(k) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).end) as usize - ptr as usize }, + 96usize, + concat!( + "Offset of field: ", + stringify!(ggml_opt_context__bindgen_ty_2), + "::", + stringify!(end) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).n_no_improvement) as usize - ptr as usize }, + 100usize, + concat!( + "Offset of field: ", + stringify!(ggml_opt_context__bindgen_ty_2), + "::", + stringify!(n_no_improvement) + ) + ); +} +#[test] +fn bindgen_test_layout_ggml_opt_context() { + const UNINIT: ::std::mem::MaybeUninit = ::std::mem::MaybeUninit::uninit(); + let ptr = UNINIT.as_ptr(); + assert_eq!( + ::std::mem::size_of::(), + 312usize, + concat!("Size of: ", stringify!(ggml_opt_context)) + ); + assert_eq!( + ::std::mem::align_of::(), + 8usize, + concat!("Alignment of ", stringify!(ggml_opt_context)) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).ctx) as usize - ptr as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(ggml_opt_context), + "::", + stringify!(ctx) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).params) as usize - ptr as usize }, + 8usize, + concat!( + "Offset of field: ", + stringify!(ggml_opt_context), + "::", + stringify!(params) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).iter) as usize - ptr as usize }, + 128usize, + concat!( + "Offset of field: ", + stringify!(ggml_opt_context), + "::", + stringify!(iter) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).nx) as usize - ptr as usize }, + 136usize, + concat!( + "Offset of field: ", + stringify!(ggml_opt_context), + "::", + stringify!(nx) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).just_initialized) as usize - ptr as usize }, + 144usize, + concat!( + "Offset of field: ", + stringify!(ggml_opt_context), + "::", + stringify!(just_initialized) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).loss_before) as usize - ptr as usize }, + 148usize, + concat!( + "Offset of field: ", + stringify!(ggml_opt_context), + "::", + stringify!(loss_before) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).loss_after) as usize - ptr as usize }, + 152usize, + concat!( + "Offset of field: ", + stringify!(ggml_opt_context), + "::", + stringify!(loss_after) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).adam) as usize - ptr as usize }, + 160usize, + concat!( + "Offset of field: ", + stringify!(ggml_opt_context), + "::", + stringify!(adam) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).lbfgs) as usize - ptr as usize }, + 208usize, + concat!( + "Offset of field: ", + stringify!(ggml_opt_context), + "::", + stringify!(lbfgs) + ) + ); +} +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_quantize_q4_0( + src: *const f32, + dst: *mut ::std::os::raw::c_void, + n: ::std::os::raw::c_int, + k: ::std::os::raw::c_int, + hist: *mut i64, + ) -> usize; +} +extern "C" { + pub fn ggml_quantize_q4_1( + src: *const f32, + dst: *mut ::std::os::raw::c_void, + n: ::std::os::raw::c_int, + k: ::std::os::raw::c_int, + hist: *mut i64, + ) -> usize; +} +extern "C" { + pub fn ggml_quantize_q5_0( + src: *const f32, + dst: *mut ::std::os::raw::c_void, + n: ::std::os::raw::c_int, + k: ::std::os::raw::c_int, + hist: *mut i64, + ) -> usize; +} +extern "C" { + pub fn ggml_quantize_q5_1( + src: *const f32, + dst: *mut ::std::os::raw::c_void, + n: ::std::os::raw::c_int, + k: ::std::os::raw::c_int, + hist: *mut i64, + ) -> usize; +} +extern "C" { + pub fn ggml_quantize_q8_0( + src: *const f32, + dst: *mut ::std::os::raw::c_void, + n: ::std::os::raw::c_int, + k: ::std::os::raw::c_int, + hist: *mut i64, + ) -> usize; +} +extern "C" { + pub fn ggml_quantize_q2_K( + src: *const f32, + dst: *mut ::std::os::raw::c_void, + n: ::std::os::raw::c_int, + k: ::std::os::raw::c_int, + hist: *mut i64, + ) -> usize; +} +extern "C" { + pub fn ggml_quantize_q3_K( + src: *const f32, + dst: *mut ::std::os::raw::c_void, + n: ::std::os::raw::c_int, + k: ::std::os::raw::c_int, + hist: *mut i64, + ) -> usize; +} +extern "C" { + pub fn ggml_quantize_q4_K( + src: *const f32, + dst: *mut ::std::os::raw::c_void, + n: ::std::os::raw::c_int, + k: ::std::os::raw::c_int, + hist: *mut i64, + ) -> usize; +} +extern "C" { + pub fn ggml_quantize_q5_K( + src: *const f32, + dst: *mut ::std::os::raw::c_void, + n: ::std::os::raw::c_int, + k: ::std::os::raw::c_int, + hist: *mut i64, + ) -> usize; +} +extern "C" { + pub fn ggml_quantize_q6_K( + src: *const f32, + dst: *mut ::std::os::raw::c_void, + n: ::std::os::raw::c_int, + k: ::std::os::raw::c_int, + hist: *mut i64, + ) -> usize; +} +extern "C" { + pub fn ggml_quantize_chunk( + type_: ggml_type, + src: *const f32, + dst: *mut ::std::os::raw::c_void, + start: ::std::os::raw::c_int, + n: ::std::os::raw::c_int, + hist: *mut i64, + ) -> 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 = ::std::mem::MaybeUninit::uninit(); + let ptr = UNINIT.as_ptr(); + assert_eq!( + ::std::mem::size_of::(), + 16usize, + concat!("Size of: ", stringify!(gguf_init_params)) + ); + assert_eq!( + ::std::mem::align_of::(), + 8usize, + concat!("Alignment of ", stringify!(gguf_init_params)) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).no_alloc) as usize - ptr as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(gguf_init_params), + "::", + stringify!(no_alloc) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).ctx) as usize - ptr as usize }, + 8usize, + concat!( + "Offset of field: ", + stringify!(gguf_init_params), + "::", + stringify!(ctx) + ) + ); +} +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_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_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_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_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_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_cublas() -> ::std::os::raw::c_int; +} +extern "C" { + pub fn ggml_cpu_has_clblast() -> ::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_vsx() -> ::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: ::std::os::raw::c_int), +>; +pub type ggml_from_float_t = ::std::option::Option< + unsafe extern "C" fn(x: *const f32, y: *mut ::std::os::raw::c_void, k: ::std::os::raw::c_int), +>; +pub type ggml_vec_dot_t = ::std::option::Option< + unsafe extern "C" fn( + n: ::std::os::raw::c_int, + s: *mut f32, + x: *const ::std::os::raw::c_void, + y: *const ::std::os::raw::c_void, + ), +>; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct ggml_type_traits_t { + pub type_name: *const ::std::os::raw::c_char, + pub blck_size: ::std::os::raw::c_int, + 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_reference: ggml_from_float_t, + pub vec_dot: ggml_vec_dot_t, + pub vec_dot_type: ggml_type, +} +#[test] +fn bindgen_test_layout_ggml_type_traits_t() { + const UNINIT: ::std::mem::MaybeUninit = ::std::mem::MaybeUninit::uninit(); + let ptr = UNINIT.as_ptr(); + assert_eq!( + ::std::mem::size_of::(), + 72usize, + concat!("Size of: ", stringify!(ggml_type_traits_t)) + ); + assert_eq!( + ::std::mem::align_of::(), + 8usize, + concat!("Alignment of ", stringify!(ggml_type_traits_t)) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).type_name) as usize - ptr as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(ggml_type_traits_t), + "::", + stringify!(type_name) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).blck_size) as usize - ptr as usize }, + 8usize, + concat!( + "Offset of field: ", + stringify!(ggml_type_traits_t), + "::", + stringify!(blck_size) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).type_size) as usize - ptr as usize }, + 16usize, + 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 }, + 24usize, + 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 }, + 32usize, + 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 }, + 40usize, + concat!( + "Offset of field: ", + stringify!(ggml_type_traits_t), + "::", + stringify!(from_float) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).from_float_reference) as usize - ptr as usize }, + 48usize, + concat!( + "Offset of field: ", + stringify!(ggml_type_traits_t), + "::", + stringify!(from_float_reference) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).vec_dot) as usize - ptr as usize }, + 56usize, + 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 }, + 64usize, + concat!( + "Offset of field: ", + stringify!(ggml_type_traits_t), + "::", + stringify!(vec_dot_type) + ) + ); +} +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 { @@ -267,7 +4104,40 @@ pub struct whisper_context { pub struct whisper_state { _unused: [u8; 0], } -pub type whisper_token = ::std::os::raw::c_int; +pub type whisper_pos = i32; +pub type whisper_token = i32; +pub type whisper_seq_id = i32; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct whisper_context_params { + pub use_gpu: bool, +} +#[test] +fn bindgen_test_layout_whisper_context_params() { + const UNINIT: ::std::mem::MaybeUninit = + ::std::mem::MaybeUninit::uninit(); + let ptr = UNINIT.as_ptr(); + assert_eq!( + ::std::mem::size_of::(), + 1usize, + concat!("Size of: ", stringify!(whisper_context_params)) + ); + assert_eq!( + ::std::mem::align_of::(), + 1usize, + 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) + ) + ); +} #[repr(C)] #[derive(Debug, Copy, Clone)] pub struct whisper_token_data { @@ -455,6 +4325,94 @@ fn bindgen_test_layout_whisper_model_loader() { ) ); } +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 = + ::std::mem::MaybeUninit::uninit(); + let ptr = UNINIT.as_ptr(); + assert_eq!( + ::std::mem::size_of::(), + 8usize, + concat!("Size of: ", stringify!(whisper_grammar_element)) + ); + assert_eq!( + ::std::mem::align_of::(), + 4usize, + concat!("Alignment of ", stringify!(whisper_grammar_element)) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).type_) as usize - ptr as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(whisper_grammar_element), + "::", + stringify!(type_) + ) + ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).value) as usize - ptr as usize }, + 4usize, + concat!( + "Offset of field: ", + stringify!(whisper_grammar_element), + "::", + stringify!(value) + ) + ); +} +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, @@ -486,12 +4444,26 @@ extern "C" { extern "C" { pub fn whisper_init_state(ctx: *mut whisper_context) -> *mut whisper_state; } +extern "C" { + pub fn whisper_ctx_init_openvino_encoder( + 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, @@ -686,11 +4658,14 @@ extern "C" { 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_solm(ctx: *mut whisper_context) -> whisper_token; + pub fn whisper_token_nosp(ctx: *mut whisper_context) -> whisper_token; } extern "C" { pub fn whisper_token_not(ctx: *mut whisper_context) -> whisper_token; @@ -705,10 +4680,10 @@ extern "C" { ) -> whisper_token; } extern "C" { - pub fn whisper_token_translate() -> whisper_token; + pub fn whisper_token_translate(ctx: *mut whisper_context) -> whisper_token; } extern "C" { - pub fn whisper_token_transcribe() -> whisper_token; + pub fn whisper_token_transcribe(ctx: *mut whisper_context) -> whisper_token; } extern "C" { pub fn whisper_print_timings(ctx: *mut whisper_context); @@ -745,6 +4720,8 @@ pub type whisper_encoder_begin_callback = ::std::option::Option< user_data: *mut ::std::os::raw::c_void, ) -> bool, >; +pub type whisper_abort_callback = + ::std::option::Option bool>; pub type whisper_logits_filter_callback = ::std::option::Option< unsafe extern "C" fn( ctx: *mut whisper_context, @@ -765,6 +4742,7 @@ pub struct whisper_full_params { 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, @@ -777,7 +4755,9 @@ pub struct whisper_full_params { pub split_on_word: bool, pub max_tokens: ::std::os::raw::c_int, pub speed_up: bool, + pub debug_mode: bool, pub audio_ctx: ::std::os::raw::c_int, + pub tdrz_enable: bool, pub initial_prompt: *const ::std::os::raw::c_char, pub prompt_tokens: *const whisper_token, pub prompt_n_tokens: ::std::os::raw::c_int, @@ -800,8 +4780,14 @@ pub struct whisper_full_params { 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: whisper_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)] @@ -888,7 +4874,7 @@ fn bindgen_test_layout_whisper_full_params() { let ptr = UNINIT.as_ptr(); assert_eq!( ::std::mem::size_of::(), - 200usize, + 256usize, concat!("Size of: ", stringify!(whisper_full_params)) ); assert_eq!( @@ -967,8 +4953,18 @@ fn bindgen_test_layout_whisper_full_params() { ) ); assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).single_segment) as usize - ptr as usize }, + 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), @@ -978,7 +4974,7 @@ fn bindgen_test_layout_whisper_full_params() { ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).print_special) as usize - ptr as usize }, - 23usize, + 24usize, concat!( "Offset of field: ", stringify!(whisper_full_params), @@ -988,7 +4984,7 @@ fn bindgen_test_layout_whisper_full_params() { ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).print_progress) as usize - ptr as usize }, - 24usize, + 25usize, concat!( "Offset of field: ", stringify!(whisper_full_params), @@ -998,7 +4994,7 @@ fn bindgen_test_layout_whisper_full_params() { ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).print_realtime) as usize - ptr as usize }, - 25usize, + 26usize, concat!( "Offset of field: ", stringify!(whisper_full_params), @@ -1008,7 +5004,7 @@ fn bindgen_test_layout_whisper_full_params() { ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).print_timestamps) as usize - ptr as usize }, - 26usize, + 27usize, concat!( "Offset of field: ", stringify!(whisper_full_params), @@ -1018,7 +5014,7 @@ fn bindgen_test_layout_whisper_full_params() { ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).token_timestamps) as usize - ptr as usize }, - 27usize, + 28usize, concat!( "Offset of field: ", stringify!(whisper_full_params), @@ -1028,7 +5024,7 @@ fn bindgen_test_layout_whisper_full_params() { ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).thold_pt) as usize - ptr as usize }, - 28usize, + 32usize, concat!( "Offset of field: ", stringify!(whisper_full_params), @@ -1038,7 +5034,7 @@ fn bindgen_test_layout_whisper_full_params() { ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).thold_ptsum) as usize - ptr as usize }, - 32usize, + 36usize, concat!( "Offset of field: ", stringify!(whisper_full_params), @@ -1048,7 +5044,7 @@ fn bindgen_test_layout_whisper_full_params() { ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).max_len) as usize - ptr as usize }, - 36usize, + 40usize, concat!( "Offset of field: ", stringify!(whisper_full_params), @@ -1058,7 +5054,7 @@ fn bindgen_test_layout_whisper_full_params() { ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).split_on_word) as usize - ptr as usize }, - 40usize, + 44usize, concat!( "Offset of field: ", stringify!(whisper_full_params), @@ -1068,7 +5064,7 @@ fn bindgen_test_layout_whisper_full_params() { ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).max_tokens) as usize - ptr as usize }, - 44usize, + 48usize, concat!( "Offset of field: ", stringify!(whisper_full_params), @@ -1078,7 +5074,7 @@ fn bindgen_test_layout_whisper_full_params() { ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).speed_up) as usize - ptr as usize }, - 48usize, + 52usize, concat!( "Offset of field: ", stringify!(whisper_full_params), @@ -1086,9 +5082,19 @@ fn bindgen_test_layout_whisper_full_params() { stringify!(speed_up) ) ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).debug_mode) as usize - ptr as usize }, + 53usize, + 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 }, - 52usize, + 56usize, concat!( "Offset of field: ", stringify!(whisper_full_params), @@ -1096,9 +5102,19 @@ fn bindgen_test_layout_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).initial_prompt) as usize - ptr as usize }, - 56usize, + 64usize, concat!( "Offset of field: ", stringify!(whisper_full_params), @@ -1108,7 +5124,7 @@ fn bindgen_test_layout_whisper_full_params() { ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).prompt_tokens) as usize - ptr as usize }, - 64usize, + 72usize, concat!( "Offset of field: ", stringify!(whisper_full_params), @@ -1118,7 +5134,7 @@ fn bindgen_test_layout_whisper_full_params() { ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).prompt_n_tokens) as usize - ptr as usize }, - 72usize, + 80usize, concat!( "Offset of field: ", stringify!(whisper_full_params), @@ -1128,7 +5144,7 @@ fn bindgen_test_layout_whisper_full_params() { ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).language) as usize - ptr as usize }, - 80usize, + 88usize, concat!( "Offset of field: ", stringify!(whisper_full_params), @@ -1138,7 +5154,7 @@ fn bindgen_test_layout_whisper_full_params() { ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).detect_language) as usize - ptr as usize }, - 88usize, + 96usize, concat!( "Offset of field: ", stringify!(whisper_full_params), @@ -1148,7 +5164,7 @@ fn bindgen_test_layout_whisper_full_params() { ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).suppress_blank) as usize - ptr as usize }, - 89usize, + 97usize, concat!( "Offset of field: ", stringify!(whisper_full_params), @@ -1158,7 +5174,7 @@ fn bindgen_test_layout_whisper_full_params() { ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).suppress_non_speech_tokens) as usize - ptr as usize }, - 90usize, + 98usize, concat!( "Offset of field: ", stringify!(whisper_full_params), @@ -1168,7 +5184,7 @@ fn bindgen_test_layout_whisper_full_params() { ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).temperature) as usize - ptr as usize }, - 92usize, + 100usize, concat!( "Offset of field: ", stringify!(whisper_full_params), @@ -1178,7 +5194,7 @@ fn bindgen_test_layout_whisper_full_params() { ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).max_initial_ts) as usize - ptr as usize }, - 96usize, + 104usize, concat!( "Offset of field: ", stringify!(whisper_full_params), @@ -1188,7 +5204,7 @@ fn bindgen_test_layout_whisper_full_params() { ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).length_penalty) as usize - ptr as usize }, - 100usize, + 108usize, concat!( "Offset of field: ", stringify!(whisper_full_params), @@ -1198,7 +5214,7 @@ fn bindgen_test_layout_whisper_full_params() { ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).temperature_inc) as usize - ptr as usize }, - 104usize, + 112usize, concat!( "Offset of field: ", stringify!(whisper_full_params), @@ -1208,7 +5224,7 @@ fn bindgen_test_layout_whisper_full_params() { ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).entropy_thold) as usize - ptr as usize }, - 108usize, + 116usize, concat!( "Offset of field: ", stringify!(whisper_full_params), @@ -1218,7 +5234,7 @@ fn bindgen_test_layout_whisper_full_params() { ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).logprob_thold) as usize - ptr as usize }, - 112usize, + 120usize, concat!( "Offset of field: ", stringify!(whisper_full_params), @@ -1228,7 +5244,7 @@ fn bindgen_test_layout_whisper_full_params() { ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).no_speech_thold) as usize - ptr as usize }, - 116usize, + 124usize, concat!( "Offset of field: ", stringify!(whisper_full_params), @@ -1238,7 +5254,7 @@ fn bindgen_test_layout_whisper_full_params() { ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).greedy) as usize - ptr as usize }, - 120usize, + 128usize, concat!( "Offset of field: ", stringify!(whisper_full_params), @@ -1248,7 +5264,7 @@ fn bindgen_test_layout_whisper_full_params() { ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).beam_search) as usize - ptr as usize }, - 124usize, + 132usize, concat!( "Offset of field: ", stringify!(whisper_full_params), @@ -1258,7 +5274,7 @@ fn bindgen_test_layout_whisper_full_params() { ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).new_segment_callback) as usize - ptr as usize }, - 136usize, + 144usize, concat!( "Offset of field: ", stringify!(whisper_full_params), @@ -1270,7 +5286,7 @@ fn bindgen_test_layout_whisper_full_params() { unsafe { ::std::ptr::addr_of!((*ptr).new_segment_callback_user_data) as usize - ptr as usize }, - 144usize, + 152usize, concat!( "Offset of field: ", stringify!(whisper_full_params), @@ -1280,7 +5296,7 @@ fn bindgen_test_layout_whisper_full_params() { ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).progress_callback) as usize - ptr as usize }, - 152usize, + 160usize, concat!( "Offset of field: ", stringify!(whisper_full_params), @@ -1290,7 +5306,7 @@ fn bindgen_test_layout_whisper_full_params() { ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).progress_callback_user_data) as usize - ptr as usize }, - 160usize, + 168usize, concat!( "Offset of field: ", stringify!(whisper_full_params), @@ -1300,7 +5316,7 @@ fn bindgen_test_layout_whisper_full_params() { ); assert_eq!( unsafe { ::std::ptr::addr_of!((*ptr).encoder_begin_callback) as usize - ptr as usize }, - 168usize, + 176usize, concat!( "Offset of field: ", stringify!(whisper_full_params), @@ -1312,7 +5328,7 @@ fn bindgen_test_layout_whisper_full_params() { unsafe { ::std::ptr::addr_of!((*ptr).encoder_begin_callback_user_data) as usize - ptr as usize }, - 176usize, + 184usize, concat!( "Offset of field: ", stringify!(whisper_full_params), @@ -1320,9 +5336,29 @@ fn bindgen_test_layout_whisper_full_params() { stringify!(encoder_begin_callback_user_data) ) ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).abort_callback) as usize - ptr as usize }, + 192usize, + 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 }, + 200usize, + 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 }, - 184usize, + 208usize, concat!( "Offset of field: ", stringify!(whisper_full_params), @@ -1334,7 +5370,7 @@ fn bindgen_test_layout_whisper_full_params() { unsafe { ::std::ptr::addr_of!((*ptr).logits_filter_callback_user_data) as usize - ptr as usize }, - 192usize, + 216usize, concat!( "Offset of field: ", stringify!(whisper_full_params), @@ -1342,6 +5378,57 @@ fn bindgen_test_layout_whisper_full_params() { stringify!(logits_filter_callback_user_data) ) ); + assert_eq!( + unsafe { ::std::ptr::addr_of!((*ptr).grammar_rules) as usize - ptr as usize }, + 224usize, + 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 }, + 232usize, + 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 }, + 240usize, + 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 }, + 248usize, + 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; @@ -1408,6 +5495,18 @@ extern "C" { 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, @@ -1505,3 +5604,11 @@ extern "C" { 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); +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct ggml_backend_buffer { + pub _address: u8, +} diff --git a/sys/whisper.cpp b/sys/whisper.cpp index 1b775cd..e8d5638 160000 --- a/sys/whisper.cpp +++ b/sys/whisper.cpp @@ -1 +1 @@ -Subproject commit 1b775cdd68843fcfe331fc32ceb0d915c73a3cbd +Subproject commit e8d5638b7c19e60cdf03d6928a0c8933cb31d2ad