#![allow(non_upper_case_globals)]
#![allow(non_camel_case_types)]
#![allow(non_snake_case)]
#![allow(unused)]
pub const GGMLSYS_VERSION: Option<&str> = option_env!("CARGO_PKG_VERSION");
pub type __off_t = ::std::os::raw::c_long;
pub type __off64_t = ::std::os::raw::c_long;
pub type ggml_fp16_t = u16;
pub type ggml_type = ::std::os::raw::c_uint;
pub type ggml_prec = ::std::os::raw::c_uint;
pub type ggml_backend_type = ::std::os::raw::c_uint;
pub type ggml_ftype = ::std::os::raw::c_int;
pub type ggml_op = ::std::os::raw::c_uint;
pub type ggml_unary_op = ::std::os::raw::c_uint;
pub type ggml_object_type = ::std::os::raw::c_uint;
pub type ggml_log_level = ::std::os::raw::c_uint;
pub type ggml_cgraph_eval_order = ::std::os::raw::c_uint;
pub type ggml_task_type = ::std::os::raw::c_uint;
pub type ggml_op_pool = ::std::os::raw::c_uint;
pub type ggml_sort_order = ::std::os::raw::c_uint;
pub type ggml_unary_op_f32_t = ::std::option::Option<
unsafe extern "C" fn(arg1: ::std::os::raw::c_int, arg2: *mut f32, arg3: *const f32),
>;
pub type ggml_binary_op_f32_t = ::std::option::Option<
unsafe extern "C" fn(
arg1: ::std::os::raw::c_int,
arg2: *mut f32,
arg3: *const f32,
arg4: *const f32,
),
>;
pub type ggml_custom1_op_f32_t =
::std::option::Option<unsafe extern "C" fn(arg1: *mut ggml_tensor, arg2: *const ggml_tensor)>;
pub type ggml_custom2_op_f32_t = ::std::option::Option<
unsafe extern "C" fn(
arg1: *mut ggml_tensor,
arg2: *const ggml_tensor,
arg3: *const ggml_tensor,
),
>;
pub type ggml_custom3_op_f32_t = ::std::option::Option<
unsafe extern "C" fn(
arg1: *mut ggml_tensor,
arg2: *const ggml_tensor,
arg3: *const ggml_tensor,
arg4: *const ggml_tensor,
),
>;
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,
),
>;
pub type ggml_opt_type = ::std::os::raw::c_uint;
pub type ggml_linesearch = ::std::os::raw::c_uint;
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,
),
>;
pub type ggml_collect_imatrix_t =
::std::option::Option<unsafe extern "C" fn(src0: *const ggml_tensor, src1: *const ggml_tensor)>;
pub type gguf_type = ::std::os::raw::c_uint;
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,
),
>;
pub type FILE = _IO_FILE;
pub type _IO_lock_t = ::std::os::raw::c_void;
pub type llama_pos = i32;
pub type llama_token = i32;
pub type llama_seq_id = i32;
pub type llama_vocab_type = ::std::os::raw::c_uint;
pub type llama_token_type = ::std::os::raw::c_uint;
pub type llama_ftype = ::std::os::raw::c_uint;
pub type llama_rope_scaling_type = ::std::os::raw::c_int;
pub type llama_split_mode = ::std::os::raw::c_uint;
pub type llama_progress_callback = ::std::option::Option<
unsafe extern "C" fn(progress: f32, ctx: *mut ::std::os::raw::c_void) -> bool,
>;
pub type llama_model_kv_override_type = ::std::os::raw::c_uint;
pub type llama_gretype = ::std::os::raw::c_uint;
pub type llama_beam_search_callback_fn_t = ::std::option::Option<
unsafe extern "C" fn(callback_data: *mut ::std::os::raw::c_void, arg1: llama_beams_state),
>;
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct ggml_context {
_unused: [u8; 0],
}
#[repr(C)]
#[derive(Debug, Copy, Clone, Hash, PartialOrd, Ord, PartialEq, Eq)]
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],
}
#[repr(C)]
#[derive(Debug, Copy, Clone, Hash, PartialOrd, Ord, PartialEq, Eq)]
pub struct ggml_tensor {
pub type_: ggml_type,
pub backend: ggml_backend_type,
pub buffer: *mut ggml_backend_buffer,
pub ne: [i64; 4usize],
pub nb: [usize; 4usize],
pub op: ggml_op,
pub op_params: [i32; 16usize],
pub is_param: bool,
pub grad: *mut ggml_tensor,
pub src: [*mut ggml_tensor; 10usize],
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; 8usize],
}
#[repr(C)]
#[derive(Debug, Copy, Clone, Hash, PartialOrd, Ord, PartialEq, Eq)]
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<unsafe extern "C" fn(data: *mut ::std::os::raw::c_void) -> bool>,
pub abort_callback_data: *mut ::std::os::raw::c_void,
}
#[repr(C)]
#[derive(Debug, Copy, Clone, Hash, PartialOrd, Ord, PartialEq, Eq)]
pub struct ggml_hash_set {
pub size: usize,
pub keys: *mut *mut ggml_tensor,
}
#[repr(C)]
#[derive(Debug, Copy, Clone, Hash, PartialOrd, Ord, PartialEq, Eq)]
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,
}
#[repr(C)]
#[derive(Debug, Copy, Clone, Hash, PartialOrd, Ord, PartialEq, Eq)]
pub struct ggml_scratch {
pub offs: usize,
pub size: usize,
pub data: *mut ::std::os::raw::c_void,
}
#[repr(C)]
#[derive(Debug, Copy, Clone, Hash, PartialOrd, Ord, PartialEq, Eq)]
pub struct ggml_init_params {
pub mem_size: usize,
pub mem_buffer: *mut ::std::os::raw::c_void,
pub no_alloc: bool,
}
#[repr(C)]
#[derive(Debug, Copy, Clone, Hash, PartialOrd, Ord, PartialEq, Eq)]
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,
}
#[repr(C)]
#[derive(Debug, Copy, Clone, PartialOrd, PartialEq)]
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, PartialOrd, PartialEq)]
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,
}
#[repr(C)]
#[derive(Debug, Copy, Clone, PartialOrd, PartialEq)]
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,
}
#[repr(C)]
#[derive(Debug, Copy, Clone, PartialOrd, PartialEq)]
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, PartialOrd, PartialEq)]
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,
}
#[repr(C)]
#[derive(Debug, Copy, Clone, PartialOrd, PartialEq)]
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,
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct gguf_context {
_unused: [u8; 0],
}
#[repr(C)]
#[derive(Debug, Copy, Clone, Hash, PartialOrd, Ord, PartialEq, Eq)]
pub struct gguf_init_params {
pub no_alloc: bool,
pub ctx: *mut *mut ggml_context,
}
#[repr(C)]
#[derive(Debug, Copy, Clone, Hash, PartialOrd, Ord, PartialEq, Eq)]
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,
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct _IO_marker {
_unused: [u8; 0],
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct _IO_codecvt {
_unused: [u8; 0],
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct _IO_wide_data {
_unused: [u8; 0],
}
#[repr(C)]
#[derive(Debug, Copy, Clone, Hash, PartialOrd, Ord, PartialEq, Eq)]
pub struct _IO_FILE {
pub _flags: ::std::os::raw::c_int,
pub _IO_read_ptr: *mut ::std::os::raw::c_char,
pub _IO_read_end: *mut ::std::os::raw::c_char,
pub _IO_read_base: *mut ::std::os::raw::c_char,
pub _IO_write_base: *mut ::std::os::raw::c_char,
pub _IO_write_ptr: *mut ::std::os::raw::c_char,
pub _IO_write_end: *mut ::std::os::raw::c_char,
pub _IO_buf_base: *mut ::std::os::raw::c_char,
pub _IO_buf_end: *mut ::std::os::raw::c_char,
pub _IO_save_base: *mut ::std::os::raw::c_char,
pub _IO_backup_base: *mut ::std::os::raw::c_char,
pub _IO_save_end: *mut ::std::os::raw::c_char,
pub _markers: *mut _IO_marker,
pub _chain: *mut _IO_FILE,
pub _fileno: ::std::os::raw::c_int,
pub _flags2: ::std::os::raw::c_int,
pub _old_offset: __off_t,
pub _cur_column: ::std::os::raw::c_ushort,
pub _vtable_offset: ::std::os::raw::c_schar,
pub _shortbuf: [::std::os::raw::c_char; 1usize],
pub _lock: *mut _IO_lock_t,
pub _offset: __off64_t,
pub _codecvt: *mut _IO_codecvt,
pub _wide_data: *mut _IO_wide_data,
pub _freeres_list: *mut _IO_FILE,
pub _freeres_buf: *mut ::std::os::raw::c_void,
pub __pad5: usize,
pub _mode: ::std::os::raw::c_int,
pub _unused2: [::std::os::raw::c_char; 20usize],
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct llama_model {
_unused: [u8; 0],
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct llama_context {
_unused: [u8; 0],
}
#[repr(C)]
#[derive(Debug, Copy, Clone, PartialOrd, PartialEq)]
pub struct llama_token_data {
pub id: llama_token,
pub logit: f32,
pub p: f32,
}
#[repr(C)]
#[derive(Debug, Copy, Clone, Hash, PartialOrd, Ord, PartialEq, Eq)]
pub struct llama_token_data_array {
pub data: *mut llama_token_data,
pub size: usize,
pub sorted: bool,
}
#[repr(C)]
#[derive(Debug, Copy, Clone, Hash, PartialOrd, Ord, PartialEq, Eq)]
pub struct llama_batch {
pub n_tokens: i32,
pub token: *mut llama_token,
pub embd: *mut f32,
pub pos: *mut llama_pos,
pub n_seq_id: *mut i32,
pub seq_id: *mut *mut llama_seq_id,
pub logits: *mut i8,
pub all_pos_0: llama_pos,
pub all_pos_1: llama_pos,
pub all_seq_id: llama_seq_id,
}
#[repr(C)]
#[derive(Copy, Clone)]
pub struct llama_model_kv_override {
pub key: [::std::os::raw::c_char; 128usize],
pub tag: llama_model_kv_override_type,
pub __bindgen_anon_1: llama_model_kv_override__bindgen_ty_1,
}
#[repr(C)]
#[derive(Debug, Copy, Clone, Hash, PartialOrd, Ord, PartialEq, Eq)]
pub struct llama_model_params {
pub n_gpu_layers: i32,
pub split_mode: llama_split_mode,
pub main_gpu: i32,
pub tensor_split: *const f32,
pub progress_callback: llama_progress_callback,
pub progress_callback_user_data: *mut ::std::os::raw::c_void,
pub kv_overrides: *const llama_model_kv_override,
pub vocab_only: bool,
pub use_mmap: bool,
pub use_mlock: bool,
}
#[repr(C)]
#[derive(Debug, Copy, Clone, PartialOrd, PartialEq)]
pub struct llama_context_params {
pub seed: u32,
pub n_ctx: u32,
pub n_batch: u32,
pub n_threads: u32,
pub n_threads_batch: u32,
pub rope_scaling_type: i8,
pub rope_freq_base: f32,
pub rope_freq_scale: f32,
pub yarn_ext_factor: f32,
pub yarn_attn_factor: f32,
pub yarn_beta_fast: f32,
pub yarn_beta_slow: f32,
pub yarn_orig_ctx: u32,
pub type_k: ggml_type,
pub type_v: ggml_type,
pub mul_mat_q: bool,
pub logits_all: bool,
pub embedding: bool,
pub offload_kqv: bool,
}
#[repr(C)]
#[derive(Debug, Copy, Clone, Hash, PartialOrd, Ord, PartialEq, Eq)]
pub struct llama_model_quantize_params {
pub nthread: i32,
pub ftype: llama_ftype,
pub allow_requantize: bool,
pub quantize_output_tensor: bool,
pub only_copy: bool,
pub pure_: bool,
pub imatrix: *mut ::std::os::raw::c_void,
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct llama_grammar {
_unused: [u8; 0],
}
#[repr(C)]
#[derive(Debug, Copy, Clone, Hash, PartialOrd, Ord, PartialEq, Eq)]
pub struct llama_grammar_element {
pub type_: llama_gretype,
pub value: u32,
}
#[repr(C)]
#[derive(Debug, Copy, Clone, PartialOrd, PartialEq)]
pub struct llama_timings {
pub t_start_ms: f64,
pub t_end_ms: f64,
pub t_load_ms: f64,
pub t_sample_ms: f64,
pub t_p_eval_ms: f64,
pub t_eval_ms: f64,
pub n_sample: i32,
pub n_p_eval: i32,
pub n_eval: i32,
}
#[repr(C)]
#[derive(Debug, Copy, Clone, Hash, PartialOrd, Ord, PartialEq, Eq)]
pub struct llama_kv_cache_view_cell {
pub pos: llama_pos,
}
#[repr(C)]
#[derive(Debug, Copy, Clone, Hash, PartialOrd, Ord, PartialEq, Eq)]
pub struct llama_kv_cache_view {
pub n_cells: i32,
pub n_max_seq: i32,
pub token_count: i32,
pub used_cells: i32,
pub max_contiguous: i32,
pub max_contiguous_idx: i32,
pub cells: *mut llama_kv_cache_view_cell,
pub cells_sequences: *mut llama_seq_id,
}
#[repr(C)]
#[derive(Debug, Copy, Clone, PartialOrd, PartialEq)]
pub struct llama_beam_view {
pub tokens: *const llama_token,
pub n_tokens: usize,
pub p: f32,
pub eob: bool,
}
#[repr(C)]
#[derive(Debug, Copy, Clone, Hash, PartialOrd, Ord, PartialEq, Eq)]
pub struct llama_beams_state {
pub beam_views: *mut llama_beam_view,
pub n_beams: usize,
pub common_prefix_length: usize,
pub last_call: bool,
}
#[repr(C)]
#[derive(Debug, Copy, Clone, Hash, PartialOrd, Ord, PartialEq, Eq)]
pub struct ggml_backend_buffer {
pub _address: u8,
}
pub const GGML_FILE_MAGIC: u32 = 1734831468;
pub const GGML_FILE_VERSION: u32 = 1;
pub const GGML_QNT_VERSION: u32 = 2;
pub const GGML_QNT_VERSION_FACTOR: u32 = 1000;
pub const GGML_MAX_DIMS: u32 = 4;
pub const GGML_MAX_PARAMS: u32 = 2048;
pub const GGML_MAX_CONTEXTS: u32 = 64;
pub const GGML_MAX_SRC: u32 = 10;
pub const GGML_MAX_NAME: u32 = 64;
pub const GGML_MAX_OP_PARAMS: u32 = 64;
pub const GGML_DEFAULT_N_THREADS: u32 = 4;
pub const GGML_DEFAULT_GRAPH_SIZE: u32 = 2048;
pub const GGML_MEM_ALIGN: u32 = 16;
pub const GGML_EXIT_SUCCESS: u32 = 0;
pub const GGML_EXIT_ABORTED: u32 = 1;
pub const GGUF_MAGIC: &[u8; 5] = b"GGUF\0";
pub const GGUF_VERSION: u32 = 3;
pub const GGUF_DEFAULT_ALIGNMENT: u32 = 32;
pub const GGML_N_TASKS_MAX: i32 = -1;
pub const LLAMA_MAX_DEVICES: u32 = 1;
pub const LLAMA_DEFAULT_SEED: u32 = 4294967295;
pub const LLAMA_MAX_RNG_STATE: u32 = 65536;
pub const LLAMA_FILE_MAGIC_GGLA: u32 = 1734831201;
pub const LLAMA_FILE_MAGIC_GGSN: u32 = 1734833006;
pub const LLAMA_SESSION_MAGIC: u32 = 1734833006;
pub const LLAMA_SESSION_VERSION: u32 = 4;
pub const ggml_type_GGML_TYPE_F32: ggml_type = 0;
pub const ggml_type_GGML_TYPE_F16: ggml_type = 1;
pub const ggml_type_GGML_TYPE_Q4_0: ggml_type = 2;
pub const ggml_type_GGML_TYPE_Q4_1: ggml_type = 3;
pub const ggml_type_GGML_TYPE_Q5_0: ggml_type = 6;
pub const ggml_type_GGML_TYPE_Q5_1: ggml_type = 7;
pub const ggml_type_GGML_TYPE_Q8_0: ggml_type = 8;
pub const ggml_type_GGML_TYPE_Q8_1: ggml_type = 9;
pub const ggml_type_GGML_TYPE_Q2_K: ggml_type = 10;
pub const ggml_type_GGML_TYPE_Q3_K: ggml_type = 11;
pub const ggml_type_GGML_TYPE_Q4_K: ggml_type = 12;
pub const ggml_type_GGML_TYPE_Q5_K: ggml_type = 13;
pub const ggml_type_GGML_TYPE_Q6_K: ggml_type = 14;
pub const ggml_type_GGML_TYPE_Q8_K: ggml_type = 15;
pub const ggml_type_GGML_TYPE_IQ2_XXS: ggml_type = 16;
pub const ggml_type_GGML_TYPE_IQ2_XS: ggml_type = 17;
pub const ggml_type_GGML_TYPE_I8: ggml_type = 18;
pub const ggml_type_GGML_TYPE_I16: ggml_type = 19;
pub const ggml_type_GGML_TYPE_I32: ggml_type = 20;
pub const ggml_type_GGML_TYPE_COUNT: ggml_type = 21;
pub const ggml_prec_GGML_PREC_DEFAULT: ggml_prec = 0;
pub const ggml_prec_GGML_PREC_F32: ggml_prec = 1;
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 const ggml_ftype_GGML_FTYPE_UNKNOWN: ggml_ftype = -1;
pub const ggml_ftype_GGML_FTYPE_ALL_F32: ggml_ftype = 0;
pub const ggml_ftype_GGML_FTYPE_MOSTLY_F16: ggml_ftype = 1;
pub const ggml_ftype_GGML_FTYPE_MOSTLY_Q4_0: ggml_ftype = 2;
pub const ggml_ftype_GGML_FTYPE_MOSTLY_Q4_1: ggml_ftype = 3;
pub const ggml_ftype_GGML_FTYPE_MOSTLY_Q4_1_SOME_F16: ggml_ftype = 4;
pub const ggml_ftype_GGML_FTYPE_MOSTLY_Q8_0: ggml_ftype = 7;
pub const ggml_ftype_GGML_FTYPE_MOSTLY_Q5_0: ggml_ftype = 8;
pub const ggml_ftype_GGML_FTYPE_MOSTLY_Q5_1: ggml_ftype = 9;
pub const ggml_ftype_GGML_FTYPE_MOSTLY_Q2_K: ggml_ftype = 10;
pub const ggml_ftype_GGML_FTYPE_MOSTLY_Q3_K: ggml_ftype = 11;
pub const ggml_ftype_GGML_FTYPE_MOSTLY_Q4_K: ggml_ftype = 12;
pub const ggml_ftype_GGML_FTYPE_MOSTLY_Q5_K: ggml_ftype = 13;
pub const ggml_ftype_GGML_FTYPE_MOSTLY_Q6_K: ggml_ftype = 14;
pub const ggml_ftype_GGML_FTYPE_MOSTLY_IQ2_XXS: ggml_ftype = 15;
pub const ggml_ftype_GGML_FTYPE_MOSTLY_IQ2_XS: ggml_ftype = 16;
pub const ggml_op_GGML_OP_NONE: ggml_op = 0;
pub const ggml_op_GGML_OP_DUP: ggml_op = 1;
pub const ggml_op_GGML_OP_ADD: ggml_op = 2;
pub const ggml_op_GGML_OP_ADD1: ggml_op = 3;
pub const ggml_op_GGML_OP_ACC: ggml_op = 4;
pub const ggml_op_GGML_OP_SUB: ggml_op = 5;
pub const ggml_op_GGML_OP_MUL: ggml_op = 6;
pub const ggml_op_GGML_OP_DIV: ggml_op = 7;
pub const ggml_op_GGML_OP_SQR: ggml_op = 8;
pub const ggml_op_GGML_OP_SQRT: ggml_op = 9;
pub const ggml_op_GGML_OP_LOG: ggml_op = 10;
pub const ggml_op_GGML_OP_SUM: ggml_op = 11;
pub const ggml_op_GGML_OP_SUM_ROWS: ggml_op = 12;
pub const ggml_op_GGML_OP_MEAN: ggml_op = 13;
pub const ggml_op_GGML_OP_ARGMAX: ggml_op = 14;
pub const ggml_op_GGML_OP_REPEAT: ggml_op = 15;
pub const ggml_op_GGML_OP_REPEAT_BACK: ggml_op = 16;
pub const ggml_op_GGML_OP_CONCAT: ggml_op = 17;
pub const ggml_op_GGML_OP_SILU_BACK: ggml_op = 18;
pub const ggml_op_GGML_OP_NORM: ggml_op = 19;
pub const ggml_op_GGML_OP_RMS_NORM: ggml_op = 20;
pub const ggml_op_GGML_OP_RMS_NORM_BACK: ggml_op = 21;
pub const ggml_op_GGML_OP_GROUP_NORM: ggml_op = 22;
pub const ggml_op_GGML_OP_MUL_MAT: ggml_op = 23;
pub const ggml_op_GGML_OP_MUL_MAT_ID: ggml_op = 24;
pub const ggml_op_GGML_OP_OUT_PROD: ggml_op = 25;
pub const ggml_op_GGML_OP_SCALE: ggml_op = 26;
pub const ggml_op_GGML_OP_SET: ggml_op = 27;
pub const ggml_op_GGML_OP_CPY: ggml_op = 28;
pub const ggml_op_GGML_OP_CONT: ggml_op = 29;
pub const ggml_op_GGML_OP_RESHAPE: ggml_op = 30;
pub const ggml_op_GGML_OP_VIEW: ggml_op = 31;
pub const ggml_op_GGML_OP_PERMUTE: ggml_op = 32;
pub const ggml_op_GGML_OP_TRANSPOSE: ggml_op = 33;
pub const ggml_op_GGML_OP_GET_ROWS: ggml_op = 34;
pub const ggml_op_GGML_OP_GET_ROWS_BACK: ggml_op = 35;
pub const ggml_op_GGML_OP_DIAG: ggml_op = 36;
pub const ggml_op_GGML_OP_DIAG_MASK_INF: ggml_op = 37;
pub const ggml_op_GGML_OP_DIAG_MASK_ZERO: ggml_op = 38;
pub const ggml_op_GGML_OP_SOFT_MAX: ggml_op = 39;
pub const ggml_op_GGML_OP_SOFT_MAX_BACK: ggml_op = 40;
pub const ggml_op_GGML_OP_ROPE: ggml_op = 41;
pub const ggml_op_GGML_OP_ROPE_BACK: ggml_op = 42;
pub const ggml_op_GGML_OP_ALIBI: ggml_op = 43;
pub const ggml_op_GGML_OP_CLAMP: ggml_op = 44;
pub const ggml_op_GGML_OP_CONV_TRANSPOSE_1D: ggml_op = 45;
pub const ggml_op_GGML_OP_IM2COL: ggml_op = 46;
pub const ggml_op_GGML_OP_CONV_TRANSPOSE_2D: ggml_op = 47;
pub const ggml_op_GGML_OP_POOL_1D: ggml_op = 48;
pub const ggml_op_GGML_OP_POOL_2D: ggml_op = 49;
pub const ggml_op_GGML_OP_UPSCALE: ggml_op = 50;
pub const ggml_op_GGML_OP_PAD: ggml_op = 51;
pub const ggml_op_GGML_OP_ARGSORT: ggml_op = 52;
pub const ggml_op_GGML_OP_LEAKY_RELU: ggml_op = 53;
pub const ggml_op_GGML_OP_FLASH_ATTN: ggml_op = 54;
pub const ggml_op_GGML_OP_FLASH_FF: ggml_op = 55;
pub const ggml_op_GGML_OP_FLASH_ATTN_BACK: ggml_op = 56;
pub const ggml_op_GGML_OP_WIN_PART: ggml_op = 57;
pub const ggml_op_GGML_OP_WIN_UNPART: ggml_op = 58;
pub const ggml_op_GGML_OP_GET_REL_POS: ggml_op = 59;
pub const ggml_op_GGML_OP_ADD_REL_POS: ggml_op = 60;
pub const ggml_op_GGML_OP_UNARY: ggml_op = 61;
pub const ggml_op_GGML_OP_MAP_UNARY: ggml_op = 62;
pub const ggml_op_GGML_OP_MAP_BINARY: ggml_op = 63;
pub const ggml_op_GGML_OP_MAP_CUSTOM1_F32: ggml_op = 64;
pub const ggml_op_GGML_OP_MAP_CUSTOM2_F32: ggml_op = 65;
pub const ggml_op_GGML_OP_MAP_CUSTOM3_F32: ggml_op = 66;
pub const ggml_op_GGML_OP_MAP_CUSTOM1: ggml_op = 67;
pub const ggml_op_GGML_OP_MAP_CUSTOM2: ggml_op = 68;
pub const ggml_op_GGML_OP_MAP_CUSTOM3: ggml_op = 69;
pub const ggml_op_GGML_OP_CROSS_ENTROPY_LOSS: ggml_op = 70;
pub const ggml_op_GGML_OP_CROSS_ENTROPY_LOSS_BACK: ggml_op = 71;
pub const ggml_op_GGML_OP_COUNT: ggml_op = 72;
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_COUNT: ggml_unary_op = 10;
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 const ggml_log_level_GGML_LOG_LEVEL_ERROR: ggml_log_level = 2;
pub const ggml_log_level_GGML_LOG_LEVEL_WARN: ggml_log_level = 3;
pub const ggml_log_level_GGML_LOG_LEVEL_INFO: ggml_log_level = 4;
pub const ggml_log_level_GGML_LOG_LEVEL_DEBUG: ggml_log_level = 5;
pub const GGML_OBJECT_SIZE: usize = 32;
pub const GGML_TENSOR_SIZE: usize = 368;
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 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 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 const ggml_sort_order_GGML_SORT_ASC: ggml_sort_order = 0;
pub const ggml_sort_order_GGML_SORT_DESC: ggml_sort_order = 1;
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 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 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 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 const llama_vocab_type_LLAMA_VOCAB_TYPE_SPM: llama_vocab_type = 0;
pub const llama_vocab_type_LLAMA_VOCAB_TYPE_BPE: llama_vocab_type = 1;
pub const llama_token_type_LLAMA_TOKEN_TYPE_UNDEFINED: llama_token_type = 0;
pub const llama_token_type_LLAMA_TOKEN_TYPE_NORMAL: llama_token_type = 1;
pub const llama_token_type_LLAMA_TOKEN_TYPE_UNKNOWN: llama_token_type = 2;
pub const llama_token_type_LLAMA_TOKEN_TYPE_CONTROL: llama_token_type = 3;
pub const llama_token_type_LLAMA_TOKEN_TYPE_USER_DEFINED: llama_token_type = 4;
pub const llama_token_type_LLAMA_TOKEN_TYPE_UNUSED: llama_token_type = 5;
pub const llama_token_type_LLAMA_TOKEN_TYPE_BYTE: llama_token_type = 6;
pub const llama_ftype_LLAMA_FTYPE_ALL_F32: llama_ftype = 0;
pub const llama_ftype_LLAMA_FTYPE_MOSTLY_F16: llama_ftype = 1;
pub const llama_ftype_LLAMA_FTYPE_MOSTLY_Q4_0: llama_ftype = 2;
pub const llama_ftype_LLAMA_FTYPE_MOSTLY_Q4_1: llama_ftype = 3;
pub const llama_ftype_LLAMA_FTYPE_MOSTLY_Q4_1_SOME_F16: llama_ftype = 4;
pub const llama_ftype_LLAMA_FTYPE_MOSTLY_Q8_0: llama_ftype = 7;
pub const llama_ftype_LLAMA_FTYPE_MOSTLY_Q5_0: llama_ftype = 8;
pub const llama_ftype_LLAMA_FTYPE_MOSTLY_Q5_1: llama_ftype = 9;
pub const llama_ftype_LLAMA_FTYPE_MOSTLY_Q2_K: llama_ftype = 10;
pub const llama_ftype_LLAMA_FTYPE_MOSTLY_Q3_K_S: llama_ftype = 11;
pub const llama_ftype_LLAMA_FTYPE_MOSTLY_Q3_K_M: llama_ftype = 12;
pub const llama_ftype_LLAMA_FTYPE_MOSTLY_Q3_K_L: llama_ftype = 13;
pub const llama_ftype_LLAMA_FTYPE_MOSTLY_Q4_K_S: llama_ftype = 14;
pub const llama_ftype_LLAMA_FTYPE_MOSTLY_Q4_K_M: llama_ftype = 15;
pub const llama_ftype_LLAMA_FTYPE_MOSTLY_Q5_K_S: llama_ftype = 16;
pub const llama_ftype_LLAMA_FTYPE_MOSTLY_Q5_K_M: llama_ftype = 17;
pub const llama_ftype_LLAMA_FTYPE_MOSTLY_Q6_K: llama_ftype = 18;
pub const llama_ftype_LLAMA_FTYPE_MOSTLY_IQ2_XXS: llama_ftype = 19;
pub const llama_ftype_LLAMA_FTYPE_MOSTLY_IQ2_XS: llama_ftype = 20;
pub const llama_ftype_LLAMA_FTYPE_MOSTLY_Q2_K_S: llama_ftype = 21;
pub const llama_ftype_LLAMA_FTYPE_GUESSED: llama_ftype = 1024;
pub const llama_rope_scaling_type_LLAMA_ROPE_SCALING_UNSPECIFIED: llama_rope_scaling_type = -1;
pub const llama_rope_scaling_type_LLAMA_ROPE_SCALING_NONE: llama_rope_scaling_type = 0;
pub const llama_rope_scaling_type_LLAMA_ROPE_SCALING_LINEAR: llama_rope_scaling_type = 1;
pub const llama_rope_scaling_type_LLAMA_ROPE_SCALING_YARN: llama_rope_scaling_type = 2;
pub const llama_rope_scaling_type_LLAMA_ROPE_SCALING_MAX_VALUE: llama_rope_scaling_type = 2;
pub const llama_split_mode_LLAMA_SPLIT_NONE: llama_split_mode = 0;
pub const llama_split_mode_LLAMA_SPLIT_LAYER: llama_split_mode = 1;
pub const llama_split_mode_LLAMA_SPLIT_ROW: llama_split_mode = 2;
pub const llama_model_kv_override_type_LLAMA_KV_OVERRIDE_INT: llama_model_kv_override_type = 0;
pub const llama_model_kv_override_type_LLAMA_KV_OVERRIDE_FLOAT: llama_model_kv_override_type = 1;
pub const llama_model_kv_override_type_LLAMA_KV_OVERRIDE_BOOL: llama_model_kv_override_type = 2;
pub const llama_gretype_LLAMA_GRETYPE_END: llama_gretype = 0;
pub const llama_gretype_LLAMA_GRETYPE_ALT: llama_gretype = 1;
pub const llama_gretype_LLAMA_GRETYPE_RULE_REF: llama_gretype = 2;
pub const llama_gretype_LLAMA_GRETYPE_CHAR: llama_gretype = 3;
pub const llama_gretype_LLAMA_GRETYPE_CHAR_NOT: llama_gretype = 4;
pub const llama_gretype_LLAMA_GRETYPE_CHAR_RNG_UPPER: llama_gretype = 5;
pub const llama_gretype_LLAMA_GRETYPE_CHAR_ALT: llama_gretype = 6;
#[test]
fn bindgen_test_layout_ggml_object() {
const UNINIT: ::std::mem::MaybeUninit<ggml_object> = ::std::mem::MaybeUninit::uninit();
let ptr = UNINIT.as_ptr();
assert_eq!(
::std::mem::size_of::<ggml_object>(),
32usize,
concat!("Size of: ", stringify!(ggml_object))
);
assert_eq!(
::std::mem::align_of::<ggml_object>(),
8usize,
concat!("Alignment of ", stringify!(ggml_object))
);
assert_eq!(
unsafe { ::std::ptr::addr_of!((*ptr).offs) as usize - ptr as usize },
0usize,
concat!(
"Offset of field: ",
stringify!(ggml_object),
"::",
stringify!(offs)
)
);
assert_eq!(
unsafe { ::std::ptr::addr_of!((*ptr).size) as usize - ptr as usize },
8usize,
concat!(
"Offset of field: ",
stringify!(ggml_object),
"::",
stringify!(size)
)
);
assert_eq!(
unsafe { ::std::ptr::addr_of!((*ptr).next) as usize - ptr as usize },
16usize,
concat!(
"Offset of field: ",
stringify!(ggml_object),
"::",
stringify!(next)
)
);
assert_eq!(
unsafe { ::std::ptr::addr_of!((*ptr).type_) as usize - ptr as usize },
24usize,
concat!(
"Offset of field: ",
stringify!(ggml_object),
"::",
stringify!(type_)
)
);
assert_eq!(
unsafe { ::std::ptr::addr_of!((*ptr).padding) as usize - ptr as usize },
28usize,
concat!(
"Offset of field: ",
stringify!(ggml_object),
"::",
stringify!(padding)
)
);
}
#[test]
fn bindgen_test_layout_ggml_tensor() {
const UNINIT: ::std::mem::MaybeUninit<ggml_tensor> = ::std::mem::MaybeUninit::uninit();
let ptr = UNINIT.as_ptr();
assert_eq!(
::std::mem::size_of::<ggml_tensor>(),
368usize,
concat!("Size of: ", stringify!(ggml_tensor))
);
assert_eq!(
::std::mem::align_of::<ggml_tensor>(),
8usize,
concat!("Alignment of ", stringify!(ggml_tensor))
);
assert_eq!(
unsafe { ::std::ptr::addr_of!((*ptr).type_) as usize - ptr as usize },
0usize,
concat!(
"Offset of field: ",
stringify!(ggml_tensor),
"::",
stringify!(type_)
)
);
assert_eq!(
unsafe { ::std::ptr::addr_of!((*ptr).backend) as usize - ptr as usize },
4usize,
concat!(
"Offset of field: ",
stringify!(ggml_tensor),
"::",
stringify!(backend)
)
);
assert_eq!(
unsafe { ::std::ptr::addr_of!((*ptr).buffer) as usize - ptr as usize },
8usize,
concat!(
"Offset of field: ",
stringify!(ggml_tensor),
"::",
stringify!(buffer)
)
);
assert_eq!(
unsafe { ::std::ptr::addr_of!((*ptr).ne) as usize - ptr as usize },
16usize,
concat!(
"Offset of field: ",
stringify!(ggml_tensor),
"::",
stringify!(ne)
)
);
assert_eq!(
unsafe { ::std::ptr::addr_of!((*ptr).nb) as usize - ptr as usize },
48usize,
concat!(
"Offset of field: ",
stringify!(ggml_tensor),
"::",
stringify!(nb)
)
);
assert_eq!(
unsafe { ::std::ptr::addr_of!((*ptr).op) as usize - ptr as usize },
80usize,
concat!(
"Offset of field: ",
stringify!(ggml_tensor),
"::",
stringify!(op)
)
);
assert_eq!(
unsafe { ::std::ptr::addr_of!((*ptr).op_params) as usize - ptr as usize },
84usize,
concat!(
"Offset of field: ",
stringify!(ggml_tensor),
"::",
stringify!(op_params)
)
);
assert_eq!(
unsafe { ::std::ptr::addr_of!((*ptr).is_param) as usize - ptr as usize },
148usize,
concat!(
"Offset of field: ",
stringify!(ggml_tensor),
"::",
stringify!(is_param)
)
);
assert_eq!(
unsafe { ::std::ptr::addr_of!((*ptr).grad) as usize - ptr as usize },
152usize,
concat!(
"Offset of field: ",
stringify!(ggml_tensor),
"::",
stringify!(grad)
)
);
assert_eq!(
unsafe { ::std::ptr::addr_of!((*ptr).src) as usize - ptr as usize },
160usize,
concat!(
"Offset of field: ",
stringify!(ggml_tensor),
"::",
stringify!(src)
)
);
assert_eq!(
unsafe { ::std::ptr::addr_of!((*ptr).perf_runs) as usize - ptr as usize },
240usize,
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 },
248usize,
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 },
256usize,
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 },
264usize,
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 },
272usize,
concat!(
"Offset of field: ",
stringify!(ggml_tensor),
"::",
stringify!(view_offs)
)
);
assert_eq!(
unsafe { ::std::ptr::addr_of!((*ptr).data) as usize - ptr as usize },
280usize,
concat!(
"Offset of field: ",
stringify!(ggml_tensor),
"::",
stringify!(data)
)
);
assert_eq!(
unsafe { ::std::ptr::addr_of!((*ptr).name) as usize - ptr as usize },
288usize,
concat!(
"Offset of field: ",
stringify!(ggml_tensor),
"::",
stringify!(name)
)
);
assert_eq!(
unsafe { ::std::ptr::addr_of!((*ptr).extra) as usize - ptr as usize },
352usize,
concat!(
"Offset of field: ",
stringify!(ggml_tensor),
"::",
stringify!(extra)
)
);
assert_eq!(
unsafe { ::std::ptr::addr_of!((*ptr).padding) as usize - ptr as usize },
360usize,
concat!(
"Offset of field: ",
stringify!(ggml_tensor),
"::",
stringify!(padding)
)
);
}
#[test]
fn bindgen_test_layout_ggml_cplan() {
const UNINIT: ::std::mem::MaybeUninit<ggml_cplan> = ::std::mem::MaybeUninit::uninit();
let ptr = UNINIT.as_ptr();
assert_eq!(
::std::mem::size_of::<ggml_cplan>(),
40usize,
concat!("Size of: ", stringify!(ggml_cplan))
);
assert_eq!(
::std::mem::align_of::<ggml_cplan>(),
8usize,
concat!("Alignment of ", stringify!(ggml_cplan))
);
assert_eq!(
unsafe { ::std::ptr::addr_of!((*ptr).work_size) as usize - ptr as usize },
0usize,
concat!(
"Offset of field: ",
stringify!(ggml_cplan),
"::",
stringify!(work_size)
)
);
assert_eq!(
unsafe { ::std::ptr::addr_of!((*ptr).work_data) as usize - ptr as usize },
8usize,
concat!(
"Offset of field: ",
stringify!(ggml_cplan),
"::",
stringify!(work_data)
)
);
assert_eq!(
unsafe { ::std::ptr::addr_of!((*ptr).n_threads) as usize - ptr as usize },
16usize,
concat!(
"Offset of field: ",
stringify!(ggml_cplan),
"::",
stringify!(n_threads)
)
);
assert_eq!(
unsafe { ::std::ptr::addr_of!((*ptr).abort_callback) as usize - ptr as usize },
24usize,
concat!(
"Offset of field: ",
stringify!(ggml_cplan),
"::",
stringify!(abort_callback)
)
);
assert_eq!(
unsafe { ::std::ptr::addr_of!((*ptr).abort_callback_data) as usize - ptr as usize },
32usize,
concat!(
"Offset of field: ",
stringify!(ggml_cplan),
"::",
stringify!(abort_callback_data)
)
);
}
#[test]
fn bindgen_test_layout_ggml_hash_set() {
const UNINIT: ::std::mem::MaybeUninit<ggml_hash_set> = ::std::mem::MaybeUninit::uninit();
let ptr = UNINIT.as_ptr();
assert_eq!(
::std::mem::size_of::<ggml_hash_set>(),
16usize,
concat!("Size of: ", stringify!(ggml_hash_set))
);
assert_eq!(
::std::mem::align_of::<ggml_hash_set>(),
8usize,
concat!("Alignment of ", stringify!(ggml_hash_set))
);
assert_eq!(
unsafe { ::std::ptr::addr_of!((*ptr).size) as usize - ptr as usize },
0usize,
concat!(
"Offset of field: ",
stringify!(ggml_hash_set),
"::",
stringify!(size)
)
);
assert_eq!(
unsafe { ::std::ptr::addr_of!((*ptr).keys) as usize - ptr as usize },
8usize,
concat!(
"Offset of field: ",
stringify!(ggml_hash_set),
"::",
stringify!(keys)
)
);
}
#[test]
fn bindgen_test_layout_ggml_cgraph() {
const UNINIT: ::std::mem::MaybeUninit<ggml_cgraph> = ::std::mem::MaybeUninit::uninit();
let ptr = UNINIT.as_ptr();
assert_eq!(
::std::mem::size_of::<ggml_cgraph>(),
80usize,
concat!("Size of: ", stringify!(ggml_cgraph))
);
assert_eq!(
::std::mem::align_of::<ggml_cgraph>(),
8usize,
concat!("Alignment of ", stringify!(ggml_cgraph))
);
assert_eq!(
unsafe { ::std::ptr::addr_of!((*ptr).size) as usize - ptr as usize },
0usize,
concat!(
"Offset of field: ",
stringify!(ggml_cgraph),
"::",
stringify!(size)
)
);
assert_eq!(
unsafe { ::std::ptr::addr_of!((*ptr).n_nodes) as usize - ptr as usize },
4usize,
concat!(
"Offset of field: ",
stringify!(ggml_cgraph),
"::",
stringify!(n_nodes)
)
);
assert_eq!(
unsafe { ::std::ptr::addr_of!((*ptr).n_leafs) as usize - ptr as usize },
8usize,
concat!(
"Offset of field: ",
stringify!(ggml_cgraph),
"::",
stringify!(n_leafs)
)
);
assert_eq!(
unsafe { ::std::ptr::addr_of!((*ptr).nodes) as usize - ptr as usize },
16usize,
concat!(
"Offset of field: ",
stringify!(ggml_cgraph),
"::",
stringify!(nodes)
)
);
assert_eq!(
unsafe { ::std::ptr::addr_of!((*ptr).grads) as usize - ptr as usize },
24usize,
concat!(
"Offset of field: ",
stringify!(ggml_cgraph),
"::",
stringify!(grads)
)
);
assert_eq!(
unsafe { ::std::ptr::addr_of!((*ptr).leafs) as usize - ptr as usize },
32usize,
concat!(
"Offset of field: ",
stringify!(ggml_cgraph),
"::",
stringify!(leafs)
)
);
assert_eq!(
unsafe { ::std::ptr::addr_of!((*ptr).visited_hash_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)
)
);
}
#[test]
fn bindgen_test_layout_ggml_scratch() {
const UNINIT: ::std::mem::MaybeUninit<ggml_scratch> = ::std::mem::MaybeUninit::uninit();
let ptr = UNINIT.as_ptr();
assert_eq!(
::std::mem::size_of::<ggml_scratch>(),
24usize,
concat!("Size of: ", stringify!(ggml_scratch))
);
assert_eq!(
::std::mem::align_of::<ggml_scratch>(),
8usize,
concat!("Alignment of ", stringify!(ggml_scratch))
);
assert_eq!(
unsafe { ::std::ptr::addr_of!((*ptr).offs) as usize - ptr as usize },
0usize,
concat!(
"Offset of field: ",
stringify!(ggml_scratch),
"::",
stringify!(offs)
)
);
assert_eq!(
unsafe { ::std::ptr::addr_of!((*ptr).size) as usize - ptr as usize },
8usize,
concat!(
"Offset of field: ",
stringify!(ggml_scratch),
"::",
stringify!(size)
)
);
assert_eq!(
unsafe { ::std::ptr::addr_of!((*ptr).data) as usize - ptr as usize },
16usize,
concat!(
"Offset of field: ",
stringify!(ggml_scratch),
"::",
stringify!(data)
)
);
}
#[test]
fn bindgen_test_layout_ggml_init_params() {
const UNINIT: ::std::mem::MaybeUninit<ggml_init_params> = ::std::mem::MaybeUninit::uninit();
let ptr = UNINIT.as_ptr();
assert_eq!(
::std::mem::size_of::<ggml_init_params>(),
24usize,
concat!("Size of: ", stringify!(ggml_init_params))
);
assert_eq!(
::std::mem::align_of::<ggml_init_params>(),
8usize,
concat!("Alignment of ", stringify!(ggml_init_params))
);
assert_eq!(
unsafe { ::std::ptr::addr_of!((*ptr).mem_size) as usize - ptr as usize },
0usize,
concat!(
"Offset of field: ",
stringify!(ggml_init_params),
"::",
stringify!(mem_size)
)
);
assert_eq!(
unsafe { ::std::ptr::addr_of!((*ptr).mem_buffer) as usize - ptr as usize },
8usize,
concat!(
"Offset of field: ",
stringify!(ggml_init_params),
"::",
stringify!(mem_buffer)
)
);
assert_eq!(
unsafe { ::std::ptr::addr_of!((*ptr).no_alloc) as usize - ptr as usize },
16usize,
concat!(
"Offset of field: ",
stringify!(ggml_init_params),
"::",
stringify!(no_alloc)
)
);
}
#[test]
fn bindgen_test_layout_ggml_compute_params() {
const UNINIT: ::std::mem::MaybeUninit<ggml_compute_params> = ::std::mem::MaybeUninit::uninit();
let ptr = UNINIT.as_ptr();
assert_eq!(
::std::mem::size_of::<ggml_compute_params>(),
32usize,
concat!("Size of: ", stringify!(ggml_compute_params))
);
assert_eq!(
::std::mem::align_of::<ggml_compute_params>(),
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)
)
);
}
#[test]
fn bindgen_test_layout_ggml_opt_params__bindgen_ty_1() {
const UNINIT: ::std::mem::MaybeUninit<ggml_opt_params__bindgen_ty_1> =
::std::mem::MaybeUninit::uninit();
let ptr = UNINIT.as_ptr();
assert_eq!(
::std::mem::size_of::<ggml_opt_params__bindgen_ty_1>(),
44usize,
concat!("Size of: ", stringify!(ggml_opt_params__bindgen_ty_1))
);
assert_eq!(
::std::mem::align_of::<ggml_opt_params__bindgen_ty_1>(),
4usize,
concat!("Alignment of ", stringify!(ggml_opt_params__bindgen_ty_1))
);
assert_eq!(
unsafe { ::std::ptr::addr_of!((*ptr).n_iter) as usize - ptr as usize },
0usize,
concat!(
"Offset of field: ",
stringify!(ggml_opt_params__bindgen_ty_1),
"::",
stringify!(n_iter)
)
);
assert_eq!(
unsafe { ::std::ptr::addr_of!((*ptr).sched) as usize - ptr as usize },
4usize,
concat!(
"Offset of field: ",
stringify!(ggml_opt_params__bindgen_ty_1),
"::",
stringify!(sched)
)
);
assert_eq!(
unsafe { ::std::ptr::addr_of!((*ptr).decay) as usize - ptr as usize },
8usize,
concat!(
"Offset of field: ",
stringify!(ggml_opt_params__bindgen_ty_1),
"::",
stringify!(decay)
)
);
assert_eq!(
unsafe { ::std::ptr::addr_of!((*ptr).decay_min_ndim) as usize - ptr as usize },
12usize,
concat!(
"Offset of field: ",
stringify!(ggml_opt_params__bindgen_ty_1),
"::",
stringify!(decay_min_ndim)
)
);
assert_eq!(
unsafe { ::std::ptr::addr_of!((*ptr).alpha) as usize - ptr as usize },
16usize,
concat!(
"Offset of field: ",
stringify!(ggml_opt_params__bindgen_ty_1),
"::",
stringify!(alpha)
)
);
assert_eq!(
unsafe { ::std::ptr::addr_of!((*ptr).beta1) as usize - ptr as usize },
20usize,
concat!(
"Offset of field: ",
stringify!(ggml_opt_params__bindgen_ty_1),
"::",
stringify!(beta1)
)
);
assert_eq!(
unsafe { ::std::ptr::addr_of!((*ptr).beta2) as usize - ptr as usize },
24usize,
concat!(
"Offset of field: ",
stringify!(ggml_opt_params__bindgen_ty_1),
"::",
stringify!(beta2)
)
);
assert_eq!(
unsafe { ::std::ptr::addr_of!((*ptr).eps) as usize - ptr as usize },
28usize,
concat!(
"Offset of field: ",
stringify!(ggml_opt_params__bindgen_ty_1),
"::",
stringify!(eps)
)
);
assert_eq!(
unsafe { ::std::ptr::addr_of!((*ptr).eps_f) as usize - ptr as usize },
32usize,
concat!(
"Offset of field: ",
stringify!(ggml_opt_params__bindgen_ty_1),
"::",
stringify!(eps_f)
)
);
assert_eq!(
unsafe { ::std::ptr::addr_of!((*ptr).eps_g) as usize - ptr as usize },
36usize,
concat!(
"Offset of field: ",
stringify!(ggml_opt_params__bindgen_ty_1),
"::",
stringify!(eps_g)
)
);
assert_eq!(
unsafe { ::std::ptr::addr_of!((*ptr).gclip) as usize - ptr as usize },
40usize,
concat!(
"Offset of field: ",
stringify!(ggml_opt_params__bindgen_ty_1),
"::",
stringify!(gclip)
)
);
}
#[test]
fn bindgen_test_layout_ggml_opt_params__bindgen_ty_2() {
const UNINIT: ::std::mem::MaybeUninit<ggml_opt_params__bindgen_ty_2> =
::std::mem::MaybeUninit::uninit();
let ptr = UNINIT.as_ptr();
assert_eq!(
::std::mem::size_of::<ggml_opt_params__bindgen_ty_2>(),
36usize,
concat!("Size of: ", stringify!(ggml_opt_params__bindgen_ty_2))
);
assert_eq!(
::std::mem::align_of::<ggml_opt_params__bindgen_ty_2>(),
4usize,
concat!("Alignment of ", stringify!(ggml_opt_params__bindgen_ty_2))
);
assert_eq!(
unsafe { ::std::ptr::addr_of!((*ptr).m) as usize - ptr as usize },
0usize,
concat!(
"Offset of field: ",
stringify!(ggml_opt_params__bindgen_ty_2),
"::",
stringify!(m)
)
);
assert_eq!(
unsafe { ::std::ptr::addr_of!((*ptr).n_iter) as usize - ptr as usize },
4usize,
concat!(
"Offset of field: ",
stringify!(ggml_opt_params__bindgen_ty_2),
"::",
stringify!(n_iter)
)
);
assert_eq!(
unsafe { ::std::ptr::addr_of!((*ptr).max_linesearch) as usize - ptr as usize },
8usize,
concat!(
"Offset of field: ",
stringify!(ggml_opt_params__bindgen_ty_2),
"::",
stringify!(max_linesearch)
)
);
assert_eq!(
unsafe { ::std::ptr::addr_of!((*ptr).eps) as usize - ptr as usize },
12usize,
concat!(
"Offset of field: ",
stringify!(ggml_opt_params__bindgen_ty_2),
"::",
stringify!(eps)
)
);
assert_eq!(
unsafe { ::std::ptr::addr_of!((*ptr).ftol) as usize - ptr as usize },
16usize,
concat!(
"Offset of field: ",
stringify!(ggml_opt_params__bindgen_ty_2),
"::",
stringify!(ftol)
)
);
assert_eq!(
unsafe { ::std::ptr::addr_of!((*ptr).wolfe) as usize - ptr as usize },
20usize,
concat!(
"Offset of field: ",
stringify!(ggml_opt_params__bindgen_ty_2),
"::",
stringify!(wolfe)
)
);
assert_eq!(
unsafe { ::std::ptr::addr_of!((*ptr).min_step) as usize - ptr as usize },
24usize,
concat!(
"Offset of field: ",
stringify!(ggml_opt_params__bindgen_ty_2),
"::",
stringify!(min_step)
)
);
assert_eq!(
unsafe { ::std::ptr::addr_of!((*ptr).max_step) as usize - ptr as usize },
28usize,
concat!(
"Offset of field: ",
stringify!(ggml_opt_params__bindgen_ty_2),
"::",
stringify!(max_step)
)
);
assert_eq!(
unsafe { ::std::ptr::addr_of!((*ptr).linesearch) as usize - ptr as usize },
32usize,
concat!(
"Offset of field: ",
stringify!(ggml_opt_params__bindgen_ty_2),
"::",
stringify!(linesearch)
)
);
}
#[test]
fn bindgen_test_layout_ggml_opt_params() {
const UNINIT: ::std::mem::MaybeUninit<ggml_opt_params> = ::std::mem::MaybeUninit::uninit();
let ptr = UNINIT.as_ptr();
assert_eq!(
::std::mem::size_of::<ggml_opt_params>(),
120usize,
concat!("Size of: ", stringify!(ggml_opt_params))
);
assert_eq!(
::std::mem::align_of::<ggml_opt_params>(),
8usize,
concat!("Alignment of ", stringify!(ggml_opt_params))
);
assert_eq!(
unsafe { ::std::ptr::addr_of!((*ptr).type_) as usize - ptr as usize },
0usize,
concat!(
"Offset of field: ",
stringify!(ggml_opt_params),
"::",
stringify!(type_)
)
);
assert_eq!(
unsafe { ::std::ptr::addr_of!((*ptr).graph_size) as usize - ptr as usize },
8usize,
concat!(
"Offset of field: ",
stringify!(ggml_opt_params),
"::",
stringify!(graph_size)
)
);
assert_eq!(
unsafe { ::std::ptr::addr_of!((*ptr).n_threads) as usize - ptr as usize },
16usize,
concat!(
"Offset of field: ",
stringify!(ggml_opt_params),
"::",
stringify!(n_threads)
)
);
assert_eq!(
unsafe { ::std::ptr::addr_of!((*ptr).past) as usize - ptr as usize },
20usize,
concat!(
"Offset of field: ",
stringify!(ggml_opt_params),
"::",
stringify!(past)
)
);
assert_eq!(
unsafe { ::std::ptr::addr_of!((*ptr).delta) as usize - ptr as usize },
24usize,
concat!(
"Offset of field: ",
stringify!(ggml_opt_params),
"::",
stringify!(delta)
)
);
assert_eq!(
unsafe { ::std::ptr::addr_of!((*ptr).max_no_improvement) as usize - ptr as usize },
28usize,
concat!(
"Offset of field: ",
stringify!(ggml_opt_params),
"::",
stringify!(max_no_improvement)
)
);
assert_eq!(
unsafe { ::std::ptr::addr_of!((*ptr).print_forward_graph) as usize - ptr as usize },
32usize,
concat!(
"Offset of field: ",
stringify!(ggml_opt_params),
"::",
stringify!(print_forward_graph)
)
);
assert_eq!(
unsafe { ::std::ptr::addr_of!((*ptr).print_backward_graph) as usize - ptr as usize },
33usize,
concat!(
"Offset of field: ",
stringify!(ggml_opt_params),
"::",
stringify!(print_backward_graph)
)
);
assert_eq!(
unsafe { ::std::ptr::addr_of!((*ptr).n_gradient_accumulation) as usize - ptr as usize },
36usize,
concat!(
"Offset of field: ",
stringify!(ggml_opt_params),
"::",
stringify!(n_gradient_accumulation)
)
);
assert_eq!(
unsafe { ::std::ptr::addr_of!((*ptr).adam) as usize - ptr as usize },
40usize,
concat!(
"Offset of field: ",
stringify!(ggml_opt_params),
"::",
stringify!(adam)
)
);
assert_eq!(
unsafe { ::std::ptr::addr_of!((*ptr).lbfgs) as usize - ptr as usize },
84usize,
concat!(
"Offset of field: ",
stringify!(ggml_opt_params),
"::",
stringify!(lbfgs)
)
);
}
#[test]
fn bindgen_test_layout_ggml_opt_context__bindgen_ty_1() {
const UNINIT: ::std::mem::MaybeUninit<ggml_opt_context__bindgen_ty_1> =
::std::mem::MaybeUninit::uninit();
let ptr = UNINIT.as_ptr();
assert_eq!(
::std::mem::size_of::<ggml_opt_context__bindgen_ty_1>(),
48usize,
concat!("Size of: ", stringify!(ggml_opt_context__bindgen_ty_1))
);
assert_eq!(
::std::mem::align_of::<ggml_opt_context__bindgen_ty_1>(),
8usize,
concat!("Alignment of ", stringify!(ggml_opt_context__bindgen_ty_1))
);
assert_eq!(
unsafe { ::std::ptr::addr_of!((*ptr).g) as usize - ptr as usize },
0usize,
concat!(
"Offset of field: ",
stringify!(ggml_opt_context__bindgen_ty_1),
"::",
stringify!(g)
)
);
assert_eq!(
unsafe { ::std::ptr::addr_of!((*ptr).m) as usize - ptr as usize },
8usize,
concat!(
"Offset of field: ",
stringify!(ggml_opt_context__bindgen_ty_1),
"::",
stringify!(m)
)
);
assert_eq!(
unsafe { ::std::ptr::addr_of!((*ptr).v) as usize - ptr as usize },
16usize,
concat!(
"Offset of field: ",
stringify!(ggml_opt_context__bindgen_ty_1),
"::",
stringify!(v)
)
);
assert_eq!(
unsafe { ::std::ptr::addr_of!((*ptr).pf) as usize - ptr as usize },
24usize,
concat!(
"Offset of field: ",
stringify!(ggml_opt_context__bindgen_ty_1),
"::",
stringify!(pf)
)
);
assert_eq!(
unsafe { ::std::ptr::addr_of!((*ptr).fx_best) as usize - ptr as usize },
32usize,
concat!(
"Offset of field: ",
stringify!(ggml_opt_context__bindgen_ty_1),
"::",
stringify!(fx_best)
)
);
assert_eq!(
unsafe { ::std::ptr::addr_of!((*ptr).fx_prev) as usize - ptr as usize },
36usize,
concat!(
"Offset of field: ",
stringify!(ggml_opt_context__bindgen_ty_1),
"::",
stringify!(fx_prev)
)
);
assert_eq!(
unsafe { ::std::ptr::addr_of!((*ptr).n_no_improvement) as usize - ptr as usize },
40usize,
concat!(
"Offset of field: ",
stringify!(ggml_opt_context__bindgen_ty_1),
"::",
stringify!(n_no_improvement)
)
);
}
#[test]
fn bindgen_test_layout_ggml_opt_context__bindgen_ty_2() {
const UNINIT: ::std::mem::MaybeUninit<ggml_opt_context__bindgen_ty_2> =
::std::mem::MaybeUninit::uninit();
let ptr = UNINIT.as_ptr();
assert_eq!(
::std::mem::size_of::<ggml_opt_context__bindgen_ty_2>(),
104usize,
concat!("Size of: ", stringify!(ggml_opt_context__bindgen_ty_2))
);
assert_eq!(
::std::mem::align_of::<ggml_opt_context__bindgen_ty_2>(),
8usize,
concat!("Alignment of ", stringify!(ggml_opt_context__bindgen_ty_2))
);
assert_eq!(
unsafe { ::std::ptr::addr_of!((*ptr).x) as usize - ptr as usize },
0usize,
concat!(
"Offset of field: ",
stringify!(ggml_opt_context__bindgen_ty_2),
"::",
stringify!(x)
)
);
assert_eq!(
unsafe { ::std::ptr::addr_of!((*ptr).xp) as usize - ptr as usize },
8usize,
concat!(
"Offset of field: ",
stringify!(ggml_opt_context__bindgen_ty_2),
"::",
stringify!(xp)
)
);
assert_eq!(
unsafe { ::std::ptr::addr_of!((*ptr).g) as usize - ptr as usize },
16usize,
concat!(
"Offset of field: ",
stringify!(ggml_opt_context__bindgen_ty_2),
"::",
stringify!(g)
)
);
assert_eq!(
unsafe { ::std::ptr::addr_of!((*ptr).gp) as usize - ptr as usize },
24usize,
concat!(
"Offset of field: ",
stringify!(ggml_opt_context__bindgen_ty_2),
"::",
stringify!(gp)
)
);
assert_eq!(
unsafe { ::std::ptr::addr_of!((*ptr).d) as usize - ptr as usize },
32usize,
concat!(
"Offset of field: ",
stringify!(ggml_opt_context__bindgen_ty_2),
"::",
stringify!(d)
)
);
assert_eq!(
unsafe { ::std::ptr::addr_of!((*ptr).pf) as usize - ptr as usize },
40usize,
concat!(
"Offset of field: ",
stringify!(ggml_opt_context__bindgen_ty_2),
"::",
stringify!(pf)
)
);
assert_eq!(
unsafe { ::std::ptr::addr_of!((*ptr).lmal) as usize - ptr as usize },
48usize,
concat!(
"Offset of field: ",
stringify!(ggml_opt_context__bindgen_ty_2),
"::",
stringify!(lmal)
)
);
assert_eq!(
unsafe { ::std::ptr::addr_of!((*ptr).lmys) as usize - ptr as usize },
56usize,
concat!(
"Offset of field: ",
stringify!(ggml_opt_context__bindgen_ty_2),
"::",
stringify!(lmys)
)
);
assert_eq!(
unsafe { ::std::ptr::addr_of!((*ptr).lms) as usize - ptr as usize },
64usize,
concat!(
"Offset of field: ",
stringify!(ggml_opt_context__bindgen_ty_2),
"::",
stringify!(lms)
)
);
assert_eq!(
unsafe { ::std::ptr::addr_of!((*ptr).lmy) as usize - ptr as usize },
72usize,
concat!(
"Offset of field: ",
stringify!(ggml_opt_context__bindgen_ty_2),
"::",
stringify!(lmy)
)
);
assert_eq!(
unsafe { ::std::ptr::addr_of!((*ptr).fx_best) as usize - ptr as usize },
80usize,
concat!(
"Offset of field: ",
stringify!(ggml_opt_context__bindgen_ty_2),
"::",
stringify!(fx_best)
)
);
assert_eq!(
unsafe { ::std::ptr::addr_of!((*ptr).step) as usize - ptr as usize },
84usize,
concat!(
"Offset of field: ",
stringify!(ggml_opt_context__bindgen_ty_2),
"::",
stringify!(step)
)
);
assert_eq!(
unsafe { ::std::ptr::addr_of!((*ptr).j) as usize - ptr as usize },
88usize,
concat!(
"Offset of field: ",
stringify!(ggml_opt_context__bindgen_ty_2),
"::",
stringify!(j)
)
);
assert_eq!(
unsafe { ::std::ptr::addr_of!((*ptr).k) as usize - ptr as usize },
92usize,
concat!(
"Offset of field: ",
stringify!(ggml_opt_context__bindgen_ty_2),
"::",
stringify!(k)
)
);
assert_eq!(
unsafe { ::std::ptr::addr_of!((*ptr).end) as usize - ptr as usize },
96usize,
concat!(
"Offset of field: ",
stringify!(ggml_opt_context__bindgen_ty_2),
"::",
stringify!(end)
)
);
assert_eq!(
unsafe { ::std::ptr::addr_of!((*ptr).n_no_improvement) as usize - ptr as usize },
100usize,
concat!(
"Offset of field: ",
stringify!(ggml_opt_context__bindgen_ty_2),
"::",
stringify!(n_no_improvement)
)
);
}
#[test]
fn bindgen_test_layout_ggml_opt_context() {
const UNINIT: ::std::mem::MaybeUninit<ggml_opt_context> = ::std::mem::MaybeUninit::uninit();
let ptr = UNINIT.as_ptr();
assert_eq!(
::std::mem::size_of::<ggml_opt_context>(),
312usize,
concat!("Size of: ", stringify!(ggml_opt_context))
);
assert_eq!(
::std::mem::align_of::<ggml_opt_context>(),
8usize,
concat!("Alignment of ", stringify!(ggml_opt_context))
);
assert_eq!(
unsafe { ::std::ptr::addr_of!((*ptr).ctx) as usize - ptr as usize },
0usize,
concat!(
"Offset of field: ",
stringify!(ggml_opt_context),
"::",
stringify!(ctx)
)
);
assert_eq!(
unsafe { ::std::ptr::addr_of!((*ptr).params) as usize - ptr as usize },
8usize,
concat!(
"Offset of field: ",
stringify!(ggml_opt_context),
"::",
stringify!(params)
)
);
assert_eq!(
unsafe { ::std::ptr::addr_of!((*ptr).iter) as usize - ptr as usize },
128usize,
concat!(
"Offset of field: ",
stringify!(ggml_opt_context),
"::",
stringify!(iter)
)
);
assert_eq!(
unsafe { ::std::ptr::addr_of!((*ptr).nx) as usize - ptr as usize },
136usize,
concat!(
"Offset of field: ",
stringify!(ggml_opt_context),
"::",
stringify!(nx)
)
);
assert_eq!(
unsafe { ::std::ptr::addr_of!((*ptr).just_initialized) as usize - ptr as usize },
144usize,
concat!(
"Offset of field: ",
stringify!(ggml_opt_context),
"::",
stringify!(just_initialized)
)
);
assert_eq!(
unsafe { ::std::ptr::addr_of!((*ptr).loss_before) as usize - ptr as usize },
148usize,
concat!(
"Offset of field: ",
stringify!(ggml_opt_context),
"::",
stringify!(loss_before)
)
);
assert_eq!(
unsafe { ::std::ptr::addr_of!((*ptr).loss_after) as usize - ptr as usize },
152usize,
concat!(
"Offset of field: ",
stringify!(ggml_opt_context),
"::",
stringify!(loss_after)
)
);
assert_eq!(
unsafe { ::std::ptr::addr_of!((*ptr).adam) as usize - ptr as usize },
160usize,
concat!(
"Offset of field: ",
stringify!(ggml_opt_context),
"::",
stringify!(adam)
)
);
assert_eq!(
unsafe { ::std::ptr::addr_of!((*ptr).lbfgs) as usize - ptr as usize },
208usize,
concat!(
"Offset of field: ",
stringify!(ggml_opt_context),
"::",
stringify!(lbfgs)
)
);
}
#[test]
fn bindgen_test_layout_gguf_init_params() {
const UNINIT: ::std::mem::MaybeUninit<gguf_init_params> = ::std::mem::MaybeUninit::uninit();
let ptr = UNINIT.as_ptr();
assert_eq!(
::std::mem::size_of::<gguf_init_params>(),
16usize,
concat!("Size of: ", stringify!(gguf_init_params))
);
assert_eq!(
::std::mem::align_of::<gguf_init_params>(),
8usize,
concat!("Alignment of ", stringify!(gguf_init_params))
);
assert_eq!(
unsafe { ::std::ptr::addr_of!((*ptr).no_alloc) as usize - ptr as usize },
0usize,
concat!(
"Offset of field: ",
stringify!(gguf_init_params),
"::",
stringify!(no_alloc)
)
);
assert_eq!(
unsafe { ::std::ptr::addr_of!((*ptr).ctx) as usize - ptr as usize },
8usize,
concat!(
"Offset of field: ",
stringify!(gguf_init_params),
"::",
stringify!(ctx)
)
);
}
#[test]
fn bindgen_test_layout_ggml_type_traits_t() {
const UNINIT: ::std::mem::MaybeUninit<ggml_type_traits_t> = ::std::mem::MaybeUninit::uninit();
let ptr = UNINIT.as_ptr();
assert_eq!(
::std::mem::size_of::<ggml_type_traits_t>(),
72usize,
concat!("Size of: ", stringify!(ggml_type_traits_t))
);
assert_eq!(
::std::mem::align_of::<ggml_type_traits_t>(),
8usize,
concat!("Alignment of ", stringify!(ggml_type_traits_t))
);
assert_eq!(
unsafe { ::std::ptr::addr_of!((*ptr).type_name) as usize - ptr as usize },
0usize,
concat!(
"Offset of field: ",
stringify!(ggml_type_traits_t),
"::",
stringify!(type_name)
)
);
assert_eq!(
unsafe { ::std::ptr::addr_of!((*ptr).blck_size) as usize - ptr as usize },
8usize,
concat!(
"Offset of field: ",
stringify!(ggml_type_traits_t),
"::",
stringify!(blck_size)
)
);
assert_eq!(
unsafe { ::std::ptr::addr_of!((*ptr).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)
)
);
}
#[test]
fn bindgen_test_layout__IO_FILE() {
const UNINIT: ::std::mem::MaybeUninit<_IO_FILE> = ::std::mem::MaybeUninit::uninit();
let ptr = UNINIT.as_ptr();
assert_eq!(
::std::mem::size_of::<_IO_FILE>(),
216usize,
concat!("Size of: ", stringify!(_IO_FILE))
);
assert_eq!(
::std::mem::align_of::<_IO_FILE>(),
8usize,
concat!("Alignment of ", stringify!(_IO_FILE))
);
assert_eq!(
unsafe { ::std::ptr::addr_of!((*ptr)._flags) as usize - ptr as usize },
0usize,
concat!(
"Offset of field: ",
stringify!(_IO_FILE),
"::",
stringify!(_flags)
)
);
assert_eq!(
unsafe { ::std::ptr::addr_of!((*ptr)._IO_read_ptr) as usize - ptr as usize },
8usize,
concat!(
"Offset of field: ",
stringify!(_IO_FILE),
"::",
stringify!(_IO_read_ptr)
)
);
assert_eq!(
unsafe { ::std::ptr::addr_of!((*ptr)._IO_read_end) as usize - ptr as usize },
16usize,
concat!(
"Offset of field: ",
stringify!(_IO_FILE),
"::",
stringify!(_IO_read_end)
)
);
assert_eq!(
unsafe { ::std::ptr::addr_of!((*ptr)._IO_read_base) as usize - ptr as usize },
24usize,
concat!(
"Offset of field: ",
stringify!(_IO_FILE),
"::",
stringify!(_IO_read_base)
)
);
assert_eq!(
unsafe { ::std::ptr::addr_of!((*ptr)._IO_write_base) as usize - ptr as usize },
32usize,
concat!(
"Offset of field: ",
stringify!(_IO_FILE),
"::",
stringify!(_IO_write_base)
)
);
assert_eq!(
unsafe { ::std::ptr::addr_of!((*ptr)._IO_write_ptr) as usize - ptr as usize },
40usize,
concat!(
"Offset of field: ",
stringify!(_IO_FILE),
"::",
stringify!(_IO_write_ptr)
)
);
assert_eq!(
unsafe { ::std::ptr::addr_of!((*ptr)._IO_write_end) as usize - ptr as usize },
48usize,
concat!(
"Offset of field: ",
stringify!(_IO_FILE),
"::",
stringify!(_IO_write_end)
)
);
assert_eq!(
unsafe { ::std::ptr::addr_of!((*ptr)._IO_buf_base) as usize - ptr as usize },
56usize,
concat!(
"Offset of field: ",
stringify!(_IO_FILE),
"::",
stringify!(_IO_buf_base)
)
);
assert_eq!(
unsafe { ::std::ptr::addr_of!((*ptr)._IO_buf_end) as usize - ptr as usize },
64usize,
concat!(
"Offset of field: ",
stringify!(_IO_FILE),
"::",
stringify!(_IO_buf_end)
)
);
assert_eq!(
unsafe { ::std::ptr::addr_of!((*ptr)._IO_save_base) as usize - ptr as usize },
72usize,
concat!(
"Offset of field: ",
stringify!(_IO_FILE),
"::",
stringify!(_IO_save_base)
)
);
assert_eq!(
unsafe { ::std::ptr::addr_of!((*ptr)._IO_backup_base) as usize - ptr as usize },
80usize,
concat!(
"Offset of field: ",
stringify!(_IO_FILE),
"::",
stringify!(_IO_backup_base)
)
);
assert_eq!(
unsafe { ::std::ptr::addr_of!((*ptr)._IO_save_end) as usize - ptr as usize },
88usize,
concat!(
"Offset of field: ",
stringify!(_IO_FILE),
"::",
stringify!(_IO_save_end)
)
);
assert_eq!(
unsafe { ::std::ptr::addr_of!((*ptr)._markers) as usize - ptr as usize },
96usize,
concat!(
"Offset of field: ",
stringify!(_IO_FILE),
"::",
stringify!(_markers)
)
);
assert_eq!(
unsafe { ::std::ptr::addr_of!((*ptr)._chain) as usize - ptr as usize },
104usize,
concat!(
"Offset of field: ",
stringify!(_IO_FILE),
"::",
stringify!(_chain)
)
);
assert_eq!(
unsafe { ::std::ptr::addr_of!((*ptr)._fileno) as usize - ptr as usize },
112usize,
concat!(
"Offset of field: ",
stringify!(_IO_FILE),
"::",
stringify!(_fileno)
)
);
assert_eq!(
unsafe { ::std::ptr::addr_of!((*ptr)._flags2) as usize - ptr as usize },
116usize,
concat!(
"Offset of field: ",
stringify!(_IO_FILE),
"::",
stringify!(_flags2)
)
);
assert_eq!(
unsafe { ::std::ptr::addr_of!((*ptr)._old_offset) as usize - ptr as usize },
120usize,
concat!(
"Offset of field: ",
stringify!(_IO_FILE),
"::",
stringify!(_old_offset)
)
);
assert_eq!(
unsafe { ::std::ptr::addr_of!((*ptr)._cur_column) as usize - ptr as usize },
128usize,
concat!(
"Offset of field: ",
stringify!(_IO_FILE),
"::",
stringify!(_cur_column)
)
);
assert_eq!(
unsafe { ::std::ptr::addr_of!((*ptr)._vtable_offset) as usize - ptr as usize },
130usize,
concat!(
"Offset of field: ",
stringify!(_IO_FILE),
"::",
stringify!(_vtable_offset)
)
);
assert_eq!(
unsafe { ::std::ptr::addr_of!((*ptr)._shortbuf) as usize - ptr as usize },
131usize,
concat!(
"Offset of field: ",
stringify!(_IO_FILE),
"::",
stringify!(_shortbuf)
)
);
assert_eq!(
unsafe { ::std::ptr::addr_of!((*ptr)._lock) as usize - ptr as usize },
136usize,
concat!(
"Offset of field: ",
stringify!(_IO_FILE),
"::",
stringify!(_lock)
)
);
assert_eq!(
unsafe { ::std::ptr::addr_of!((*ptr)._offset) as usize - ptr as usize },
144usize,
concat!(
"Offset of field: ",
stringify!(_IO_FILE),
"::",
stringify!(_offset)
)
);
assert_eq!(
unsafe { ::std::ptr::addr_of!((*ptr)._codecvt) as usize - ptr as usize },
152usize,
concat!(
"Offset of field: ",
stringify!(_IO_FILE),
"::",
stringify!(_codecvt)
)
);
assert_eq!(
unsafe { ::std::ptr::addr_of!((*ptr)._wide_data) as usize - ptr as usize },
160usize,
concat!(
"Offset of field: ",
stringify!(_IO_FILE),
"::",
stringify!(_wide_data)
)
);
assert_eq!(
unsafe { ::std::ptr::addr_of!((*ptr)._freeres_list) as usize - ptr as usize },
168usize,
concat!(
"Offset of field: ",
stringify!(_IO_FILE),
"::",
stringify!(_freeres_list)
)
);
assert_eq!(
unsafe { ::std::ptr::addr_of!((*ptr)._freeres_buf) as usize - ptr as usize },
176usize,
concat!(
"Offset of field: ",
stringify!(_IO_FILE),
"::",
stringify!(_freeres_buf)
)
);
assert_eq!(
unsafe { ::std::ptr::addr_of!((*ptr).__pad5) as usize - ptr as usize },
184usize,
concat!(
"Offset of field: ",
stringify!(_IO_FILE),
"::",
stringify!(__pad5)
)
);
assert_eq!(
unsafe { ::std::ptr::addr_of!((*ptr)._mode) as usize - ptr as usize },
192usize,
concat!(
"Offset of field: ",
stringify!(_IO_FILE),
"::",
stringify!(_mode)
)
);
assert_eq!(
unsafe { ::std::ptr::addr_of!((*ptr)._unused2) as usize - ptr as usize },
196usize,
concat!(
"Offset of field: ",
stringify!(_IO_FILE),
"::",
stringify!(_unused2)
)
);
}
#[test]
fn bindgen_test_layout_llama_token_data() {
const UNINIT: ::std::mem::MaybeUninit<llama_token_data> = ::std::mem::MaybeUninit::uninit();
let ptr = UNINIT.as_ptr();
assert_eq!(
::std::mem::size_of::<llama_token_data>(),
12usize,
concat!("Size of: ", stringify!(llama_token_data))
);
assert_eq!(
::std::mem::align_of::<llama_token_data>(),
4usize,
concat!("Alignment of ", stringify!(llama_token_data))
);
assert_eq!(
unsafe { ::std::ptr::addr_of!((*ptr).id) as usize - ptr as usize },
0usize,
concat!(
"Offset of field: ",
stringify!(llama_token_data),
"::",
stringify!(id)
)
);
assert_eq!(
unsafe { ::std::ptr::addr_of!((*ptr).logit) as usize - ptr as usize },
4usize,
concat!(
"Offset of field: ",
stringify!(llama_token_data),
"::",
stringify!(logit)
)
);
assert_eq!(
unsafe { ::std::ptr::addr_of!((*ptr).p) as usize - ptr as usize },
8usize,
concat!(
"Offset of field: ",
stringify!(llama_token_data),
"::",
stringify!(p)
)
);
}
#[test]
fn bindgen_test_layout_llama_token_data_array() {
const UNINIT: ::std::mem::MaybeUninit<llama_token_data_array> =
::std::mem::MaybeUninit::uninit();
let ptr = UNINIT.as_ptr();
assert_eq!(
::std::mem::size_of::<llama_token_data_array>(),
24usize,
concat!("Size of: ", stringify!(llama_token_data_array))
);
assert_eq!(
::std::mem::align_of::<llama_token_data_array>(),
8usize,
concat!("Alignment of ", stringify!(llama_token_data_array))
);
assert_eq!(
unsafe { ::std::ptr::addr_of!((*ptr).data) as usize - ptr as usize },
0usize,
concat!(
"Offset of field: ",
stringify!(llama_token_data_array),
"::",
stringify!(data)
)
);
assert_eq!(
unsafe { ::std::ptr::addr_of!((*ptr).size) as usize - ptr as usize },
8usize,
concat!(
"Offset of field: ",
stringify!(llama_token_data_array),
"::",
stringify!(size)
)
);
assert_eq!(
unsafe { ::std::ptr::addr_of!((*ptr).sorted) as usize - ptr as usize },
16usize,
concat!(
"Offset of field: ",
stringify!(llama_token_data_array),
"::",
stringify!(sorted)
)
);
}
#[test]
fn bindgen_test_layout_llama_batch() {
const UNINIT: ::std::mem::MaybeUninit<llama_batch> = ::std::mem::MaybeUninit::uninit();
let ptr = UNINIT.as_ptr();
assert_eq!(
::std::mem::size_of::<llama_batch>(),
72usize,
concat!("Size of: ", stringify!(llama_batch))
);
assert_eq!(
::std::mem::align_of::<llama_batch>(),
8usize,
concat!("Alignment of ", stringify!(llama_batch))
);
assert_eq!(
unsafe { ::std::ptr::addr_of!((*ptr).n_tokens) as usize - ptr as usize },
0usize,
concat!(
"Offset of field: ",
stringify!(llama_batch),
"::",
stringify!(n_tokens)
)
);
assert_eq!(
unsafe { ::std::ptr::addr_of!((*ptr).token) as usize - ptr as usize },
8usize,
concat!(
"Offset of field: ",
stringify!(llama_batch),
"::",
stringify!(token)
)
);
assert_eq!(
unsafe { ::std::ptr::addr_of!((*ptr).embd) as usize - ptr as usize },
16usize,
concat!(
"Offset of field: ",
stringify!(llama_batch),
"::",
stringify!(embd)
)
);
assert_eq!(
unsafe { ::std::ptr::addr_of!((*ptr).pos) as usize - ptr as usize },
24usize,
concat!(
"Offset of field: ",
stringify!(llama_batch),
"::",
stringify!(pos)
)
);
assert_eq!(
unsafe { ::std::ptr::addr_of!((*ptr).n_seq_id) as usize - ptr as usize },
32usize,
concat!(
"Offset of field: ",
stringify!(llama_batch),
"::",
stringify!(n_seq_id)
)
);
assert_eq!(
unsafe { ::std::ptr::addr_of!((*ptr).seq_id) as usize - ptr as usize },
40usize,
concat!(
"Offset of field: ",
stringify!(llama_batch),
"::",
stringify!(seq_id)
)
);
assert_eq!(
unsafe { ::std::ptr::addr_of!((*ptr).logits) as usize - ptr as usize },
48usize,
concat!(
"Offset of field: ",
stringify!(llama_batch),
"::",
stringify!(logits)
)
);
assert_eq!(
unsafe { ::std::ptr::addr_of!((*ptr).all_pos_0) as usize - ptr as usize },
56usize,
concat!(
"Offset of field: ",
stringify!(llama_batch),
"::",
stringify!(all_pos_0)
)
);
assert_eq!(
unsafe { ::std::ptr::addr_of!((*ptr).all_pos_1) as usize - ptr as usize },
60usize,
concat!(
"Offset of field: ",
stringify!(llama_batch),
"::",
stringify!(all_pos_1)
)
);
assert_eq!(
unsafe { ::std::ptr::addr_of!((*ptr).all_seq_id) as usize - ptr as usize },
64usize,
concat!(
"Offset of field: ",
stringify!(llama_batch),
"::",
stringify!(all_seq_id)
)
);
}
#[test]
fn bindgen_test_layout_llama_model_kv_override__bindgen_ty_1() {
const UNINIT: ::std::mem::MaybeUninit<llama_model_kv_override__bindgen_ty_1> =
::std::mem::MaybeUninit::uninit();
let ptr = UNINIT.as_ptr();
assert_eq!(
::std::mem::size_of::<llama_model_kv_override__bindgen_ty_1>(),
8usize,
concat!(
"Size of: ",
stringify!(llama_model_kv_override__bindgen_ty_1)
)
);
assert_eq!(
::std::mem::align_of::<llama_model_kv_override__bindgen_ty_1>(),
8usize,
concat!(
"Alignment of ",
stringify!(llama_model_kv_override__bindgen_ty_1)
)
);
assert_eq!(
unsafe { ::std::ptr::addr_of!((*ptr).int_value) as usize - ptr as usize },
0usize,
concat!(
"Offset of field: ",
stringify!(llama_model_kv_override__bindgen_ty_1),
"::",
stringify!(int_value)
)
);
assert_eq!(
unsafe { ::std::ptr::addr_of!((*ptr).float_value) as usize - ptr as usize },
0usize,
concat!(
"Offset of field: ",
stringify!(llama_model_kv_override__bindgen_ty_1),
"::",
stringify!(float_value)
)
);
assert_eq!(
unsafe { ::std::ptr::addr_of!((*ptr).bool_value) as usize - ptr as usize },
0usize,
concat!(
"Offset of field: ",
stringify!(llama_model_kv_override__bindgen_ty_1),
"::",
stringify!(bool_value)
)
);
}
#[test]
fn bindgen_test_layout_llama_model_kv_override() {
const UNINIT: ::std::mem::MaybeUninit<llama_model_kv_override> =
::std::mem::MaybeUninit::uninit();
let ptr = UNINIT.as_ptr();
assert_eq!(
::std::mem::size_of::<llama_model_kv_override>(),
144usize,
concat!("Size of: ", stringify!(llama_model_kv_override))
);
assert_eq!(
::std::mem::align_of::<llama_model_kv_override>(),
8usize,
concat!("Alignment of ", stringify!(llama_model_kv_override))
);
assert_eq!(
unsafe { ::std::ptr::addr_of!((*ptr).key) as usize - ptr as usize },
0usize,
concat!(
"Offset of field: ",
stringify!(llama_model_kv_override),
"::",
stringify!(key)
)
);
assert_eq!(
unsafe { ::std::ptr::addr_of!((*ptr).tag) as usize - ptr as usize },
128usize,
concat!(
"Offset of field: ",
stringify!(llama_model_kv_override),
"::",
stringify!(tag)
)
);
}
#[test]
fn bindgen_test_layout_llama_model_params() {
const UNINIT: ::std::mem::MaybeUninit<llama_model_params> = ::std::mem::MaybeUninit::uninit();
let ptr = UNINIT.as_ptr();
assert_eq!(
::std::mem::size_of::<llama_model_params>(),
56usize,
concat!("Size of: ", stringify!(llama_model_params))
);
assert_eq!(
::std::mem::align_of::<llama_model_params>(),
8usize,
concat!("Alignment of ", stringify!(llama_model_params))
);
assert_eq!(
unsafe { ::std::ptr::addr_of!((*ptr).n_gpu_layers) as usize - ptr as usize },
0usize,
concat!(
"Offset of field: ",
stringify!(llama_model_params),
"::",
stringify!(n_gpu_layers)
)
);
assert_eq!(
unsafe { ::std::ptr::addr_of!((*ptr).split_mode) as usize - ptr as usize },
4usize,
concat!(
"Offset of field: ",
stringify!(llama_model_params),
"::",
stringify!(split_mode)
)
);
assert_eq!(
unsafe { ::std::ptr::addr_of!((*ptr).main_gpu) as usize - ptr as usize },
8usize,
concat!(
"Offset of field: ",
stringify!(llama_model_params),
"::",
stringify!(main_gpu)
)
);
assert_eq!(
unsafe { ::std::ptr::addr_of!((*ptr).tensor_split) as usize - ptr as usize },
16usize,
concat!(
"Offset of field: ",
stringify!(llama_model_params),
"::",
stringify!(tensor_split)
)
);
assert_eq!(
unsafe { ::std::ptr::addr_of!((*ptr).progress_callback) as usize - ptr as usize },
24usize,
concat!(
"Offset of field: ",
stringify!(llama_model_params),
"::",
stringify!(progress_callback)
)
);
assert_eq!(
unsafe { ::std::ptr::addr_of!((*ptr).progress_callback_user_data) as usize - ptr as usize },
32usize,
concat!(
"Offset of field: ",
stringify!(llama_model_params),
"::",
stringify!(progress_callback_user_data)
)
);
assert_eq!(
unsafe { ::std::ptr::addr_of!((*ptr).kv_overrides) as usize - ptr as usize },
40usize,
concat!(
"Offset of field: ",
stringify!(llama_model_params),
"::",
stringify!(kv_overrides)
)
);
assert_eq!(
unsafe { ::std::ptr::addr_of!((*ptr).vocab_only) as usize - ptr as usize },
48usize,
concat!(
"Offset of field: ",
stringify!(llama_model_params),
"::",
stringify!(vocab_only)
)
);
assert_eq!(
unsafe { ::std::ptr::addr_of!((*ptr).use_mmap) as usize - ptr as usize },
49usize,
concat!(
"Offset of field: ",
stringify!(llama_model_params),
"::",
stringify!(use_mmap)
)
);
assert_eq!(
unsafe { ::std::ptr::addr_of!((*ptr).use_mlock) as usize - ptr as usize },
50usize,
concat!(
"Offset of field: ",
stringify!(llama_model_params),
"::",
stringify!(use_mlock)
)
);
}
#[test]
fn bindgen_test_layout_llama_context_params() {
const UNINIT: ::std::mem::MaybeUninit<llama_context_params> = ::std::mem::MaybeUninit::uninit();
let ptr = UNINIT.as_ptr();
assert_eq!(
::std::mem::size_of::<llama_context_params>(),
64usize,
concat!("Size of: ", stringify!(llama_context_params))
);
assert_eq!(
::std::mem::align_of::<llama_context_params>(),
4usize,
concat!("Alignment of ", stringify!(llama_context_params))
);
assert_eq!(
unsafe { ::std::ptr::addr_of!((*ptr).seed) as usize - ptr as usize },
0usize,
concat!(
"Offset of field: ",
stringify!(llama_context_params),
"::",
stringify!(seed)
)
);
assert_eq!(
unsafe { ::std::ptr::addr_of!((*ptr).n_ctx) as usize - ptr as usize },
4usize,
concat!(
"Offset of field: ",
stringify!(llama_context_params),
"::",
stringify!(n_ctx)
)
);
assert_eq!(
unsafe { ::std::ptr::addr_of!((*ptr).n_batch) as usize - ptr as usize },
8usize,
concat!(
"Offset of field: ",
stringify!(llama_context_params),
"::",
stringify!(n_batch)
)
);
assert_eq!(
unsafe { ::std::ptr::addr_of!((*ptr).n_threads) as usize - ptr as usize },
12usize,
concat!(
"Offset of field: ",
stringify!(llama_context_params),
"::",
stringify!(n_threads)
)
);
assert_eq!(
unsafe { ::std::ptr::addr_of!((*ptr).n_threads_batch) as usize - ptr as usize },
16usize,
concat!(
"Offset of field: ",
stringify!(llama_context_params),
"::",
stringify!(n_threads_batch)
)
);
assert_eq!(
unsafe { ::std::ptr::addr_of!((*ptr).rope_scaling_type) as usize - ptr as usize },
20usize,
concat!(
"Offset of field: ",
stringify!(llama_context_params),
"::",
stringify!(rope_scaling_type)
)
);
assert_eq!(
unsafe { ::std::ptr::addr_of!((*ptr).rope_freq_base) as usize - ptr as usize },
24usize,
concat!(
"Offset of field: ",
stringify!(llama_context_params),
"::",
stringify!(rope_freq_base)
)
);
assert_eq!(
unsafe { ::std::ptr::addr_of!((*ptr).rope_freq_scale) as usize - ptr as usize },
28usize,
concat!(
"Offset of field: ",
stringify!(llama_context_params),
"::",
stringify!(rope_freq_scale)
)
);
assert_eq!(
unsafe { ::std::ptr::addr_of!((*ptr).yarn_ext_factor) as usize - ptr as usize },
32usize,
concat!(
"Offset of field: ",
stringify!(llama_context_params),
"::",
stringify!(yarn_ext_factor)
)
);
assert_eq!(
unsafe { ::std::ptr::addr_of!((*ptr).yarn_attn_factor) as usize - ptr as usize },
36usize,
concat!(
"Offset of field: ",
stringify!(llama_context_params),
"::",
stringify!(yarn_attn_factor)
)
);
assert_eq!(
unsafe { ::std::ptr::addr_of!((*ptr).yarn_beta_fast) as usize - ptr as usize },
40usize,
concat!(
"Offset of field: ",
stringify!(llama_context_params),
"::",
stringify!(yarn_beta_fast)
)
);
assert_eq!(
unsafe { ::std::ptr::addr_of!((*ptr).yarn_beta_slow) as usize - ptr as usize },
44usize,
concat!(
"Offset of field: ",
stringify!(llama_context_params),
"::",
stringify!(yarn_beta_slow)
)
);
assert_eq!(
unsafe { ::std::ptr::addr_of!((*ptr).yarn_orig_ctx) as usize - ptr as usize },
48usize,
concat!(
"Offset of field: ",
stringify!(llama_context_params),
"::",
stringify!(yarn_orig_ctx)
)
);
assert_eq!(
unsafe { ::std::ptr::addr_of!((*ptr).type_k) as usize - ptr as usize },
52usize,
concat!(
"Offset of field: ",
stringify!(llama_context_params),
"::",
stringify!(type_k)
)
);
assert_eq!(
unsafe { ::std::ptr::addr_of!((*ptr).type_v) as usize - ptr as usize },
56usize,
concat!(
"Offset of field: ",
stringify!(llama_context_params),
"::",
stringify!(type_v)
)
);
assert_eq!(
unsafe { ::std::ptr::addr_of!((*ptr).mul_mat_q) as usize - ptr as usize },
60usize,
concat!(
"Offset of field: ",
stringify!(llama_context_params),
"::",
stringify!(mul_mat_q)
)
);
assert_eq!(
unsafe { ::std::ptr::addr_of!((*ptr).logits_all) as usize - ptr as usize },
61usize,
concat!(
"Offset of field: ",
stringify!(llama_context_params),
"::",
stringify!(logits_all)
)
);
assert_eq!(
unsafe { ::std::ptr::addr_of!((*ptr).embedding) as usize - ptr as usize },
62usize,
concat!(
"Offset of field: ",
stringify!(llama_context_params),
"::",
stringify!(embedding)
)
);
assert_eq!(
unsafe { ::std::ptr::addr_of!((*ptr).offload_kqv) as usize - ptr as usize },
63usize,
concat!(
"Offset of field: ",
stringify!(llama_context_params),
"::",
stringify!(offload_kqv)
)
);
}
#[test]
fn bindgen_test_layout_llama_model_quantize_params() {
const UNINIT: ::std::mem::MaybeUninit<llama_model_quantize_params> =
::std::mem::MaybeUninit::uninit();
let ptr = UNINIT.as_ptr();
assert_eq!(
::std::mem::size_of::<llama_model_quantize_params>(),
24usize,
concat!("Size of: ", stringify!(llama_model_quantize_params))
);
assert_eq!(
::std::mem::align_of::<llama_model_quantize_params>(),
8usize,
concat!("Alignment of ", stringify!(llama_model_quantize_params))
);
assert_eq!(
unsafe { ::std::ptr::addr_of!((*ptr).nthread) as usize - ptr as usize },
0usize,
concat!(
"Offset of field: ",
stringify!(llama_model_quantize_params),
"::",
stringify!(nthread)
)
);
assert_eq!(
unsafe { ::std::ptr::addr_of!((*ptr).ftype) as usize - ptr as usize },
4usize,
concat!(
"Offset of field: ",
stringify!(llama_model_quantize_params),
"::",
stringify!(ftype)
)
);
assert_eq!(
unsafe { ::std::ptr::addr_of!((*ptr).allow_requantize) as usize - ptr as usize },
8usize,
concat!(
"Offset of field: ",
stringify!(llama_model_quantize_params),
"::",
stringify!(allow_requantize)
)
);
assert_eq!(
unsafe { ::std::ptr::addr_of!((*ptr).quantize_output_tensor) as usize - ptr as usize },
9usize,
concat!(
"Offset of field: ",
stringify!(llama_model_quantize_params),
"::",
stringify!(quantize_output_tensor)
)
);
assert_eq!(
unsafe { ::std::ptr::addr_of!((*ptr).only_copy) as usize - ptr as usize },
10usize,
concat!(
"Offset of field: ",
stringify!(llama_model_quantize_params),
"::",
stringify!(only_copy)
)
);
assert_eq!(
unsafe { ::std::ptr::addr_of!((*ptr).pure_) as usize - ptr as usize },
11usize,
concat!(
"Offset of field: ",
stringify!(llama_model_quantize_params),
"::",
stringify!(pure_)
)
);
assert_eq!(
unsafe { ::std::ptr::addr_of!((*ptr).imatrix) as usize - ptr as usize },
16usize,
concat!(
"Offset of field: ",
stringify!(llama_model_quantize_params),
"::",
stringify!(imatrix)
)
);
}
#[test]
fn bindgen_test_layout_llama_grammar_element() {
const UNINIT: ::std::mem::MaybeUninit<llama_grammar_element> =
::std::mem::MaybeUninit::uninit();
let ptr = UNINIT.as_ptr();
assert_eq!(
::std::mem::size_of::<llama_grammar_element>(),
8usize,
concat!("Size of: ", stringify!(llama_grammar_element))
);
assert_eq!(
::std::mem::align_of::<llama_grammar_element>(),
4usize,
concat!("Alignment of ", stringify!(llama_grammar_element))
);
assert_eq!(
unsafe { ::std::ptr::addr_of!((*ptr).type_) as usize - ptr as usize },
0usize,
concat!(
"Offset of field: ",
stringify!(llama_grammar_element),
"::",
stringify!(type_)
)
);
assert_eq!(
unsafe { ::std::ptr::addr_of!((*ptr).value) as usize - ptr as usize },
4usize,
concat!(
"Offset of field: ",
stringify!(llama_grammar_element),
"::",
stringify!(value)
)
);
}
#[test]
fn bindgen_test_layout_llama_timings() {
const UNINIT: ::std::mem::MaybeUninit<llama_timings> = ::std::mem::MaybeUninit::uninit();
let ptr = UNINIT.as_ptr();
assert_eq!(
::std::mem::size_of::<llama_timings>(),
64usize,
concat!("Size of: ", stringify!(llama_timings))
);
assert_eq!(
::std::mem::align_of::<llama_timings>(),
8usize,
concat!("Alignment of ", stringify!(llama_timings))
);
assert_eq!(
unsafe { ::std::ptr::addr_of!((*ptr).t_start_ms) as usize - ptr as usize },
0usize,
concat!(
"Offset of field: ",
stringify!(llama_timings),
"::",
stringify!(t_start_ms)
)
);
assert_eq!(
unsafe { ::std::ptr::addr_of!((*ptr).t_end_ms) as usize - ptr as usize },
8usize,
concat!(
"Offset of field: ",
stringify!(llama_timings),
"::",
stringify!(t_end_ms)
)
);
assert_eq!(
unsafe { ::std::ptr::addr_of!((*ptr).t_load_ms) as usize - ptr as usize },
16usize,
concat!(
"Offset of field: ",
stringify!(llama_timings),
"::",
stringify!(t_load_ms)
)
);
assert_eq!(
unsafe { ::std::ptr::addr_of!((*ptr).t_sample_ms) as usize - ptr as usize },
24usize,
concat!(
"Offset of field: ",
stringify!(llama_timings),
"::",
stringify!(t_sample_ms)
)
);
assert_eq!(
unsafe { ::std::ptr::addr_of!((*ptr).t_p_eval_ms) as usize - ptr as usize },
32usize,
concat!(
"Offset of field: ",
stringify!(llama_timings),
"::",
stringify!(t_p_eval_ms)
)
);
assert_eq!(
unsafe { ::std::ptr::addr_of!((*ptr).t_eval_ms) as usize - ptr as usize },
40usize,
concat!(
"Offset of field: ",
stringify!(llama_timings),
"::",
stringify!(t_eval_ms)
)
);
assert_eq!(
unsafe { ::std::ptr::addr_of!((*ptr).n_sample) as usize - ptr as usize },
48usize,
concat!(
"Offset of field: ",
stringify!(llama_timings),
"::",
stringify!(n_sample)
)
);
assert_eq!(
unsafe { ::std::ptr::addr_of!((*ptr).n_p_eval) as usize - ptr as usize },
52usize,
concat!(
"Offset of field: ",
stringify!(llama_timings),
"::",
stringify!(n_p_eval)
)
);
assert_eq!(
unsafe { ::std::ptr::addr_of!((*ptr).n_eval) as usize - ptr as usize },
56usize,
concat!(
"Offset of field: ",
stringify!(llama_timings),
"::",
stringify!(n_eval)
)
);
}
#[test]
fn bindgen_test_layout_llama_kv_cache_view_cell() {
const UNINIT: ::std::mem::MaybeUninit<llama_kv_cache_view_cell> =
::std::mem::MaybeUninit::uninit();
let ptr = UNINIT.as_ptr();
assert_eq!(
::std::mem::size_of::<llama_kv_cache_view_cell>(),
4usize,
concat!("Size of: ", stringify!(llama_kv_cache_view_cell))
);
assert_eq!(
::std::mem::align_of::<llama_kv_cache_view_cell>(),
4usize,
concat!("Alignment of ", stringify!(llama_kv_cache_view_cell))
);
assert_eq!(
unsafe { ::std::ptr::addr_of!((*ptr).pos) as usize - ptr as usize },
0usize,
concat!(
"Offset of field: ",
stringify!(llama_kv_cache_view_cell),
"::",
stringify!(pos)
)
);
}
#[test]
fn bindgen_test_layout_llama_kv_cache_view() {
const UNINIT: ::std::mem::MaybeUninit<llama_kv_cache_view> = ::std::mem::MaybeUninit::uninit();
let ptr = UNINIT.as_ptr();
assert_eq!(
::std::mem::size_of::<llama_kv_cache_view>(),
40usize,
concat!("Size of: ", stringify!(llama_kv_cache_view))
);
assert_eq!(
::std::mem::align_of::<llama_kv_cache_view>(),
8usize,
concat!("Alignment of ", stringify!(llama_kv_cache_view))
);
assert_eq!(
unsafe { ::std::ptr::addr_of!((*ptr).n_cells) as usize - ptr as usize },
0usize,
concat!(
"Offset of field: ",
stringify!(llama_kv_cache_view),
"::",
stringify!(n_cells)
)
);
assert_eq!(
unsafe { ::std::ptr::addr_of!((*ptr).n_max_seq) as usize - ptr as usize },
4usize,
concat!(
"Offset of field: ",
stringify!(llama_kv_cache_view),
"::",
stringify!(n_max_seq)
)
);
assert_eq!(
unsafe { ::std::ptr::addr_of!((*ptr).token_count) as usize - ptr as usize },
8usize,
concat!(
"Offset of field: ",
stringify!(llama_kv_cache_view),
"::",
stringify!(token_count)
)
);
assert_eq!(
unsafe { ::std::ptr::addr_of!((*ptr).used_cells) as usize - ptr as usize },
12usize,
concat!(
"Offset of field: ",
stringify!(llama_kv_cache_view),
"::",
stringify!(used_cells)
)
);
assert_eq!(
unsafe { ::std::ptr::addr_of!((*ptr).max_contiguous) as usize - ptr as usize },
16usize,
concat!(
"Offset of field: ",
stringify!(llama_kv_cache_view),
"::",
stringify!(max_contiguous)
)
);
assert_eq!(
unsafe { ::std::ptr::addr_of!((*ptr).max_contiguous_idx) as usize - ptr as usize },
20usize,
concat!(
"Offset of field: ",
stringify!(llama_kv_cache_view),
"::",
stringify!(max_contiguous_idx)
)
);
assert_eq!(
unsafe { ::std::ptr::addr_of!((*ptr).cells) as usize - ptr as usize },
24usize,
concat!(
"Offset of field: ",
stringify!(llama_kv_cache_view),
"::",
stringify!(cells)
)
);
assert_eq!(
unsafe { ::std::ptr::addr_of!((*ptr).cells_sequences) as usize - ptr as usize },
32usize,
concat!(
"Offset of field: ",
stringify!(llama_kv_cache_view),
"::",
stringify!(cells_sequences)
)
);
}
#[test]
fn bindgen_test_layout_llama_beam_view() {
const UNINIT: ::std::mem::MaybeUninit<llama_beam_view> = ::std::mem::MaybeUninit::uninit();
let ptr = UNINIT.as_ptr();
assert_eq!(
::std::mem::size_of::<llama_beam_view>(),
24usize,
concat!("Size of: ", stringify!(llama_beam_view))
);
assert_eq!(
::std::mem::align_of::<llama_beam_view>(),
8usize,
concat!("Alignment of ", stringify!(llama_beam_view))
);
assert_eq!(
unsafe { ::std::ptr::addr_of!((*ptr).tokens) as usize - ptr as usize },
0usize,
concat!(
"Offset of field: ",
stringify!(llama_beam_view),
"::",
stringify!(tokens)
)
);
assert_eq!(
unsafe { ::std::ptr::addr_of!((*ptr).n_tokens) as usize - ptr as usize },
8usize,
concat!(
"Offset of field: ",
stringify!(llama_beam_view),
"::",
stringify!(n_tokens)
)
);
assert_eq!(
unsafe { ::std::ptr::addr_of!((*ptr).p) as usize - ptr as usize },
16usize,
concat!(
"Offset of field: ",
stringify!(llama_beam_view),
"::",
stringify!(p)
)
);
assert_eq!(
unsafe { ::std::ptr::addr_of!((*ptr).eob) as usize - ptr as usize },
20usize,
concat!(
"Offset of field: ",
stringify!(llama_beam_view),
"::",
stringify!(eob)
)
);
}
#[test]
fn bindgen_test_layout_llama_beams_state() {
const UNINIT: ::std::mem::MaybeUninit<llama_beams_state> = ::std::mem::MaybeUninit::uninit();
let ptr = UNINIT.as_ptr();
assert_eq!(
::std::mem::size_of::<llama_beams_state>(),
32usize,
concat!("Size of: ", stringify!(llama_beams_state))
);
assert_eq!(
::std::mem::align_of::<llama_beams_state>(),
8usize,
concat!("Alignment of ", stringify!(llama_beams_state))
);
assert_eq!(
unsafe { ::std::ptr::addr_of!((*ptr).beam_views) as usize - ptr as usize },
0usize,
concat!(
"Offset of field: ",
stringify!(llama_beams_state),
"::",
stringify!(beam_views)
)
);
assert_eq!(
unsafe { ::std::ptr::addr_of!((*ptr).n_beams) as usize - ptr as usize },
8usize,
concat!(
"Offset of field: ",
stringify!(llama_beams_state),
"::",
stringify!(n_beams)
)
);
assert_eq!(
unsafe { ::std::ptr::addr_of!((*ptr).common_prefix_length) as usize - ptr as usize },
16usize,
concat!(
"Offset of field: ",
stringify!(llama_beams_state),
"::",
stringify!(common_prefix_length)
)
);
assert_eq!(
unsafe { ::std::ptr::addr_of!((*ptr).last_call) as usize - ptr as usize },
24usize,
concat!(
"Offset of field: ",
stringify!(llama_beams_state),
"::",
stringify!(last_call)
)
);
}
#[repr(C)]
#[derive(Copy, Clone)]
pub union llama_model_kv_override__bindgen_ty_1 {
pub int_value: i64,
pub float_value: f64,
pub bool_value: bool,
}
impl ::std::fmt::Debug for llama_model_kv_override__bindgen_ty_1 {
fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
write!(f, "llama_model_kv_override__bindgen_ty_1 {{ union }}")
}
}
impl ::std::fmt::Debug for llama_model_kv_override {
fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
write!(
f,
"llama_model_kv_override {{ key: {:?}, tag: {:?}, __bindgen_anon_1: {:?} }}",
self.key, self.tag, self.__bindgen_anon_1
)
}
}
extern "C" {
pub fn ggml_fp16_to_fp32(x: ggml_fp16_t) -> f32;
pub fn ggml_fp32_to_fp16(x: f32) -> ggml_fp16_t;
pub fn ggml_fp16_to_fp32_row(x: *const ggml_fp16_t, y: *mut f32, n: ::std::os::raw::c_int);
pub fn ggml_fp32_to_fp16_row(x: *const f32, y: *mut ggml_fp16_t, n: ::std::os::raw::c_int);
pub fn ggml_time_init();
pub fn ggml_time_ms() -> i64;
pub fn ggml_time_us() -> i64;
pub fn ggml_cycles() -> i64;
pub fn ggml_cycles_per_ms() -> i64;
pub fn ggml_print_backtrace();
pub fn ggml_numa_init();
pub fn ggml_is_numa() -> bool;
pub fn ggml_print_object(obj: *const ggml_object);
pub fn ggml_print_objects(ctx: *const ggml_context);
pub fn ggml_nelements(tensor: *const ggml_tensor) -> i64;
pub fn ggml_nrows(tensor: *const ggml_tensor) -> i64;
pub fn ggml_nbytes(tensor: *const ggml_tensor) -> usize;
pub fn ggml_nbytes_pad(tensor: *const ggml_tensor) -> usize;
pub fn ggml_blck_size(type_: ggml_type) -> ::std::os::raw::c_int;
pub fn ggml_type_size(type_: ggml_type) -> usize;
pub fn ggml_row_size(type_: ggml_type, ne: i64) -> usize;
pub fn ggml_type_sizef(type_: ggml_type) -> f64;
pub fn ggml_type_name(type_: ggml_type) -> *const ::std::os::raw::c_char;
pub fn ggml_op_name(op: ggml_op) -> *const ::std::os::raw::c_char;
pub fn ggml_op_symbol(op: ggml_op) -> *const ::std::os::raw::c_char;
pub fn ggml_unary_op_name(op: ggml_unary_op) -> *const ::std::os::raw::c_char;
pub fn ggml_op_desc(t: *const ggml_tensor) -> *const ::std::os::raw::c_char;
pub fn ggml_element_size(tensor: *const ggml_tensor) -> usize;
pub fn ggml_is_quantized(type_: ggml_type) -> bool;
pub fn ggml_ftype_to_ggml_type(ftype: ggml_ftype) -> ggml_type;
pub fn ggml_is_transposed(tensor: *const ggml_tensor) -> bool;
pub fn ggml_is_contiguous(tensor: *const ggml_tensor) -> bool;
pub fn ggml_is_permuted(tensor: *const ggml_tensor) -> bool;
pub fn ggml_is_scalar(tensor: *const ggml_tensor) -> bool;
pub fn ggml_is_vector(tensor: *const ggml_tensor) -> bool;
pub fn ggml_is_matrix(tensor: *const ggml_tensor) -> bool;
pub fn ggml_is_3d(tensor: *const ggml_tensor) -> bool;
pub fn ggml_n_dims(tensor: *const ggml_tensor) -> ::std::os::raw::c_int;
pub fn ggml_are_same_shape(t0: *const ggml_tensor, t1: *const ggml_tensor) -> bool;
pub fn ggml_tensor_overhead() -> usize;
pub fn ggml_init(params: ggml_init_params) -> *mut ggml_context;
pub fn ggml_free(ctx: *mut ggml_context);
pub fn ggml_used_mem(ctx: *const ggml_context) -> usize;
pub fn ggml_set_scratch(ctx: *mut ggml_context, scratch: ggml_scratch) -> usize;
pub fn ggml_get_no_alloc(ctx: *mut ggml_context) -> bool;
pub fn ggml_set_no_alloc(ctx: *mut ggml_context, no_alloc: bool);
pub fn ggml_get_mem_buffer(ctx: *const ggml_context) -> *mut ::std::os::raw::c_void;
pub fn ggml_get_mem_size(ctx: *const ggml_context) -> usize;
pub fn ggml_get_max_tensor_size(ctx: *const ggml_context) -> usize;
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;
pub fn ggml_new_tensor_1d(
ctx: *mut ggml_context,
type_: ggml_type,
ne0: i64,
) -> *mut ggml_tensor;
pub fn ggml_new_tensor_2d(
ctx: *mut ggml_context,
type_: ggml_type,
ne0: i64,
ne1: i64,
) -> *mut ggml_tensor;
pub fn ggml_new_tensor_3d(
ctx: *mut ggml_context,
type_: ggml_type,
ne0: i64,
ne1: i64,
ne2: i64,
) -> *mut ggml_tensor;
pub fn ggml_new_tensor_4d(
ctx: *mut ggml_context,
type_: ggml_type,
ne0: i64,
ne1: i64,
ne2: i64,
ne3: i64,
) -> *mut ggml_tensor;
pub fn ggml_new_i32(ctx: *mut ggml_context, value: i32) -> *mut ggml_tensor;
pub fn ggml_new_f32(ctx: *mut ggml_context, value: f32) -> *mut ggml_tensor;
pub fn ggml_dup_tensor(ctx: *mut ggml_context, src: *const ggml_tensor) -> *mut ggml_tensor;
pub fn ggml_view_tensor(ctx: *mut ggml_context, src: *mut ggml_tensor) -> *mut ggml_tensor;
pub fn ggml_get_first_tensor(ctx: *const ggml_context) -> *mut ggml_tensor;
pub fn ggml_get_next_tensor(
ctx: *const ggml_context,
tensor: *mut ggml_tensor,
) -> *mut ggml_tensor;
pub fn ggml_get_tensor(
ctx: *mut ggml_context,
name: *const ::std::os::raw::c_char,
) -> *mut ggml_tensor;
pub fn ggml_set_zero(tensor: *mut ggml_tensor) -> *mut ggml_tensor;
pub fn ggml_set_i32(tensor: *mut ggml_tensor, value: i32) -> *mut ggml_tensor;
pub fn ggml_set_f32(tensor: *mut ggml_tensor, value: f32) -> *mut ggml_tensor;
pub fn ggml_unravel_index(
tensor: *const ggml_tensor,
i: i64,
i0: *mut i64,
i1: *mut i64,
i2: *mut i64,
i3: *mut i64,
);
pub fn ggml_get_i32_1d(tensor: *const ggml_tensor, i: ::std::os::raw::c_int) -> i32;
pub fn ggml_set_i32_1d(tensor: *const ggml_tensor, i: ::std::os::raw::c_int, value: i32);
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;
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,
);
pub fn ggml_get_f32_1d(tensor: *const ggml_tensor, i: ::std::os::raw::c_int) -> f32;
pub fn ggml_set_f32_1d(tensor: *const ggml_tensor, i: ::std::os::raw::c_int, value: f32);
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;
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,
);
pub fn ggml_get_data(tensor: *const ggml_tensor) -> *mut ::std::os::raw::c_void;
pub fn ggml_get_data_f32(tensor: *const ggml_tensor) -> *mut f32;
pub fn ggml_get_unary_op(tensor: *const ggml_tensor) -> ggml_unary_op;
pub fn ggml_get_name(tensor: *const ggml_tensor) -> *const ::std::os::raw::c_char;
pub fn ggml_set_name(
tensor: *mut ggml_tensor,
name: *const ::std::os::raw::c_char,
) -> *mut ggml_tensor;
pub fn ggml_format_name(
tensor: *mut ggml_tensor,
fmt: *const ::std::os::raw::c_char,
...
) -> *mut ggml_tensor;
pub fn ggml_dup(ctx: *mut ggml_context, a: *mut ggml_tensor) -> *mut ggml_tensor;
pub fn ggml_dup_inplace(ctx: *mut ggml_context, a: *mut ggml_tensor) -> *mut ggml_tensor;
pub fn ggml_add(
ctx: *mut ggml_context,
a: *mut ggml_tensor,
b: *mut ggml_tensor,
) -> *mut ggml_tensor;
pub fn ggml_add_inplace(
ctx: *mut ggml_context,
a: *mut ggml_tensor,
b: *mut ggml_tensor,
) -> *mut ggml_tensor;
pub fn ggml_add_cast(
ctx: *mut ggml_context,
a: *mut ggml_tensor,
b: *mut ggml_tensor,
type_: ggml_type,
) -> *mut ggml_tensor;
pub fn ggml_add1(
ctx: *mut ggml_context,
a: *mut ggml_tensor,
b: *mut ggml_tensor,
) -> *mut ggml_tensor;
pub fn ggml_add1_inplace(
ctx: *mut ggml_context,
a: *mut ggml_tensor,
b: *mut ggml_tensor,
) -> *mut ggml_tensor;
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;
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;
pub fn ggml_sub(
ctx: *mut ggml_context,
a: *mut ggml_tensor,
b: *mut ggml_tensor,
) -> *mut ggml_tensor;
pub fn ggml_sub_inplace(
ctx: *mut ggml_context,
a: *mut ggml_tensor,
b: *mut ggml_tensor,
) -> *mut ggml_tensor;
pub fn ggml_mul(
ctx: *mut ggml_context,
a: *mut ggml_tensor,
b: *mut ggml_tensor,
) -> *mut ggml_tensor;
pub fn ggml_mul_inplace(
ctx: *mut ggml_context,
a: *mut ggml_tensor,
b: *mut ggml_tensor,
) -> *mut ggml_tensor;
pub fn ggml_div(
ctx: *mut ggml_context,
a: *mut ggml_tensor,
b: *mut ggml_tensor,
) -> *mut ggml_tensor;
pub fn ggml_div_inplace(
ctx: *mut ggml_context,
a: *mut ggml_tensor,
b: *mut ggml_tensor,
) -> *mut ggml_tensor;
pub fn ggml_sqr(ctx: *mut ggml_context, a: *mut ggml_tensor) -> *mut ggml_tensor;
pub fn ggml_sqr_inplace(ctx: *mut ggml_context, a: *mut ggml_tensor) -> *mut ggml_tensor;
pub fn ggml_sqrt(ctx: *mut ggml_context, a: *mut ggml_tensor) -> *mut ggml_tensor;
pub fn ggml_sqrt_inplace(ctx: *mut ggml_context, a: *mut ggml_tensor) -> *mut ggml_tensor;
pub fn ggml_log(ctx: *mut ggml_context, a: *mut ggml_tensor) -> *mut ggml_tensor;
pub fn ggml_log_inplace(ctx: *mut ggml_context, a: *mut ggml_tensor) -> *mut ggml_tensor;
pub fn ggml_sum(ctx: *mut ggml_context, a: *mut ggml_tensor) -> *mut ggml_tensor;
pub fn ggml_sum_rows(ctx: *mut ggml_context, a: *mut ggml_tensor) -> *mut ggml_tensor;
pub fn ggml_mean(ctx: *mut ggml_context, a: *mut ggml_tensor) -> *mut ggml_tensor;
pub fn ggml_argmax(ctx: *mut ggml_context, a: *mut ggml_tensor) -> *mut ggml_tensor;
pub fn ggml_repeat(
ctx: *mut ggml_context,
a: *mut ggml_tensor,
b: *mut ggml_tensor,
) -> *mut ggml_tensor;
pub fn ggml_repeat_back(
ctx: *mut ggml_context,
a: *mut ggml_tensor,
b: *mut ggml_tensor,
) -> *mut ggml_tensor;
pub fn ggml_concat(
ctx: *mut ggml_context,
a: *mut ggml_tensor,
b: *mut ggml_tensor,
) -> *mut ggml_tensor;
pub fn ggml_abs(ctx: *mut ggml_context, a: *mut ggml_tensor) -> *mut ggml_tensor;
pub fn ggml_abs_inplace(ctx: *mut ggml_context, a: *mut ggml_tensor) -> *mut ggml_tensor;
pub fn ggml_sgn(ctx: *mut ggml_context, a: *mut ggml_tensor) -> *mut ggml_tensor;
pub fn ggml_sgn_inplace(ctx: *mut ggml_context, a: *mut ggml_tensor) -> *mut ggml_tensor;
pub fn ggml_neg(ctx: *mut ggml_context, a: *mut ggml_tensor) -> *mut ggml_tensor;
pub fn ggml_neg_inplace(ctx: *mut ggml_context, a: *mut ggml_tensor) -> *mut ggml_tensor;
pub fn ggml_step(ctx: *mut ggml_context, a: *mut ggml_tensor) -> *mut ggml_tensor;
pub fn ggml_step_inplace(ctx: *mut ggml_context, a: *mut ggml_tensor) -> *mut ggml_tensor;
pub fn ggml_tanh(ctx: *mut ggml_context, a: *mut ggml_tensor) -> *mut ggml_tensor;
pub fn ggml_tanh_inplace(ctx: *mut ggml_context, a: *mut ggml_tensor) -> *mut ggml_tensor;
pub fn ggml_elu(ctx: *mut ggml_context, a: *mut ggml_tensor) -> *mut ggml_tensor;
pub fn ggml_elu_inplace(ctx: *mut ggml_context, a: *mut ggml_tensor) -> *mut ggml_tensor;
pub fn ggml_relu(ctx: *mut ggml_context, a: *mut ggml_tensor) -> *mut ggml_tensor;
pub fn ggml_leaky_relu(
ctx: *mut ggml_context,
a: *mut ggml_tensor,
negative_slope: f32,
inplace: bool,
) -> *mut ggml_tensor;
pub fn ggml_relu_inplace(ctx: *mut ggml_context, a: *mut ggml_tensor) -> *mut ggml_tensor;
pub fn ggml_gelu(ctx: *mut ggml_context, a: *mut ggml_tensor) -> *mut ggml_tensor;
pub fn ggml_gelu_inplace(ctx: *mut ggml_context, a: *mut ggml_tensor) -> *mut ggml_tensor;
pub fn ggml_gelu_quick(ctx: *mut ggml_context, a: *mut ggml_tensor) -> *mut ggml_tensor;
pub fn ggml_gelu_quick_inplace(ctx: *mut ggml_context, a: *mut ggml_tensor)
-> *mut ggml_tensor;
pub fn ggml_silu(ctx: *mut ggml_context, a: *mut ggml_tensor) -> *mut ggml_tensor;
pub fn ggml_silu_inplace(ctx: *mut ggml_context, a: *mut ggml_tensor) -> *mut ggml_tensor;
pub fn ggml_silu_back(
ctx: *mut ggml_context,
a: *mut ggml_tensor,
b: *mut ggml_tensor,
) -> *mut ggml_tensor;
pub fn ggml_norm(ctx: *mut ggml_context, a: *mut ggml_tensor, eps: f32) -> *mut ggml_tensor;
pub fn ggml_norm_inplace(
ctx: *mut ggml_context,
a: *mut ggml_tensor,
eps: f32,
) -> *mut ggml_tensor;
pub fn ggml_rms_norm(ctx: *mut ggml_context, a: *mut ggml_tensor, eps: f32)
-> *mut ggml_tensor;
pub fn ggml_rms_norm_inplace(
ctx: *mut ggml_context,
a: *mut ggml_tensor,
eps: f32,
) -> *mut ggml_tensor;
pub fn ggml_group_norm(
ctx: *mut ggml_context,
a: *mut ggml_tensor,
n_groups: ::std::os::raw::c_int,
) -> *mut ggml_tensor;
pub fn ggml_group_norm_inplace(
ctx: *mut ggml_context,
a: *mut ggml_tensor,
n_groups: ::std::os::raw::c_int,
) -> *mut ggml_tensor;
pub fn ggml_rms_norm_back(
ctx: *mut ggml_context,
a: *mut ggml_tensor,
b: *mut ggml_tensor,
eps: f32,
) -> *mut ggml_tensor;
pub fn ggml_mul_mat(
ctx: *mut ggml_context,
a: *mut ggml_tensor,
b: *mut ggml_tensor,
) -> *mut ggml_tensor;
pub fn ggml_mul_mat_set_prec(a: *mut ggml_tensor, prec: ggml_prec);
pub fn ggml_mul_mat_id(
ctx: *mut ggml_context,
as_: *const *mut ggml_tensor,
n_as: ::std::os::raw::c_int,
ids: *mut ggml_tensor,
id: ::std::os::raw::c_int,
b: *mut ggml_tensor,
) -> *mut ggml_tensor;
pub fn ggml_out_prod(
ctx: *mut ggml_context,
a: *mut ggml_tensor,
b: *mut ggml_tensor,
) -> *mut ggml_tensor;
pub fn ggml_scale(ctx: *mut ggml_context, a: *mut ggml_tensor, s: f32) -> *mut ggml_tensor;
pub fn ggml_scale_inplace(
ctx: *mut ggml_context,
a: *mut ggml_tensor,
s: f32,
) -> *mut ggml_tensor;
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;
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;
pub fn ggml_set_1d(
ctx: *mut ggml_context,
a: *mut ggml_tensor,
b: *mut ggml_tensor,
offset: usize,
) -> *mut ggml_tensor;
pub fn ggml_set_1d_inplace(
ctx: *mut ggml_context,
a: *mut ggml_tensor,
b: *mut ggml_tensor,
offset: usize,
) -> *mut ggml_tensor;
pub fn ggml_set_2d(
ctx: *mut ggml_context,
a: *mut ggml_tensor,
b: *mut ggml_tensor,
nb1: usize,
offset: usize,
) -> *mut ggml_tensor;
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;
pub fn ggml_cpy(
ctx: *mut ggml_context,
a: *mut ggml_tensor,
b: *mut ggml_tensor,
) -> *mut ggml_tensor;
pub fn ggml_cast(
ctx: *mut ggml_context,
a: *mut ggml_tensor,
type_: ggml_type,
) -> *mut ggml_tensor;
pub fn ggml_cont(ctx: *mut ggml_context, a: *mut ggml_tensor) -> *mut ggml_tensor;
pub fn ggml_cont_1d(ctx: *mut ggml_context, a: *mut ggml_tensor, ne0: i64) -> *mut ggml_tensor;
pub fn ggml_cont_2d(
ctx: *mut ggml_context,
a: *mut ggml_tensor,
ne0: i64,
ne1: i64,
) -> *mut ggml_tensor;
pub fn ggml_cont_3d(
ctx: *mut ggml_context,
a: *mut ggml_tensor,
ne0: i64,
ne1: i64,
ne2: i64,
) -> *mut ggml_tensor;
pub fn ggml_cont_4d(
ctx: *mut ggml_context,
a: *mut ggml_tensor,
ne0: i64,
ne1: i64,
ne2: i64,
ne3: i64,
) -> *mut ggml_tensor;
pub fn ggml_reshape(
ctx: *mut ggml_context,
a: *mut ggml_tensor,
b: *mut ggml_tensor,
) -> *mut ggml_tensor;
pub fn ggml_reshape_1d(
ctx: *mut ggml_context,
a: *mut ggml_tensor,
ne0: i64,
) -> *mut ggml_tensor;
pub fn ggml_reshape_2d(
ctx: *mut ggml_context,
a: *mut ggml_tensor,
ne0: i64,
ne1: i64,
) -> *mut ggml_tensor;
pub fn ggml_reshape_3d(
ctx: *mut ggml_context,
a: *mut ggml_tensor,
ne0: i64,
ne1: i64,
ne2: i64,
) -> *mut ggml_tensor;
pub fn ggml_reshape_4d(
ctx: *mut ggml_context,
a: *mut ggml_tensor,
ne0: i64,
ne1: i64,
ne2: i64,
ne3: i64,
) -> *mut ggml_tensor;
pub fn ggml_view_1d(
ctx: *mut ggml_context,
a: *mut ggml_tensor,
ne0: i64,
offset: usize,
) -> *mut ggml_tensor;
pub fn ggml_view_2d(
ctx: *mut ggml_context,
a: *mut ggml_tensor,
ne0: i64,
ne1: i64,
nb1: usize,
offset: usize,
) -> *mut ggml_tensor;
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;
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;
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;
pub fn ggml_transpose(ctx: *mut ggml_context, a: *mut ggml_tensor) -> *mut ggml_tensor;
pub fn ggml_get_rows(
ctx: *mut ggml_context,
a: *mut ggml_tensor,
b: *mut ggml_tensor,
) -> *mut ggml_tensor;
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;
pub fn ggml_diag(ctx: *mut ggml_context, a: *mut ggml_tensor) -> *mut ggml_tensor;
pub fn ggml_diag_mask_inf(
ctx: *mut ggml_context,
a: *mut ggml_tensor,
n_past: ::std::os::raw::c_int,
) -> *mut ggml_tensor;
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;
pub fn ggml_diag_mask_zero(
ctx: *mut ggml_context,
a: *mut ggml_tensor,
n_past: ::std::os::raw::c_int,
) -> *mut ggml_tensor;
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;
pub fn ggml_soft_max(ctx: *mut ggml_context, a: *mut ggml_tensor) -> *mut ggml_tensor;
pub fn ggml_soft_max_inplace(ctx: *mut ggml_context, a: *mut ggml_tensor) -> *mut ggml_tensor;
pub fn ggml_soft_max_ext(
ctx: *mut ggml_context,
a: *mut ggml_tensor,
mask: *mut ggml_tensor,
scale: f32,
) -> *mut ggml_tensor;
pub fn ggml_soft_max_back(
ctx: *mut ggml_context,
a: *mut ggml_tensor,
b: *mut ggml_tensor,
) -> *mut ggml_tensor;
pub fn ggml_soft_max_back_inplace(
ctx: *mut ggml_context,
a: *mut ggml_tensor,
b: *mut ggml_tensor,
) -> *mut ggml_tensor;
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;
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;
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;
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;
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,
);
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;
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,
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,
xpos_base: f32,
xpos_down: bool,
) -> *mut ggml_tensor;
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;
pub fn ggml_clamp(
ctx: *mut ggml_context,
a: *mut ggml_tensor,
min: f32,
max: f32,
) -> *mut ggml_tensor;
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;
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;
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;
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;
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;
pub fn ggml_conv_2d_sk_p0(
ctx: *mut ggml_context,
a: *mut ggml_tensor,
b: *mut ggml_tensor,
) -> *mut ggml_tensor;
pub fn ggml_conv_2d_s1_ph(
ctx: *mut ggml_context,
a: *mut ggml_tensor,
b: *mut ggml_tensor,
) -> *mut ggml_tensor;
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 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;
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;
pub fn ggml_upscale(
ctx: *mut ggml_context,
a: *mut ggml_tensor,
scale_factor: ::std::os::raw::c_int,
) -> *mut ggml_tensor;
pub fn ggml_pad(
ctx: *mut ggml_context,
a: *mut ggml_tensor,
p0: ::std::os::raw::c_int,
p1: ::std::os::raw::c_int,
p2: ::std::os::raw::c_int,
p3: ::std::os::raw::c_int,
) -> *mut ggml_tensor;
pub fn ggml_argsort(
ctx: *mut ggml_context,
a: *mut ggml_tensor,
order: ggml_sort_order,
) -> *mut ggml_tensor;
pub fn ggml_top_k(
ctx: *mut ggml_context,
a: *mut ggml_tensor,
k: ::std::os::raw::c_int,
) -> *mut ggml_tensor;
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;
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;
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;
pub fn ggml_win_part(
ctx: *mut ggml_context,
a: *mut ggml_tensor,
w: ::std::os::raw::c_int,
) -> *mut ggml_tensor;
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;
pub fn ggml_unary(
ctx: *mut ggml_context,
a: *mut ggml_tensor,
op: ggml_unary_op,
) -> *mut ggml_tensor;
pub fn ggml_unary_inplace(
ctx: *mut ggml_context,
a: *mut ggml_tensor,
op: ggml_unary_op,
) -> *mut ggml_tensor;
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;
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;
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 fn ggml_map_unary_f32(
ctx: *mut ggml_context,
a: *mut ggml_tensor,
fun: ggml_unary_op_f32_t,
) -> *mut ggml_tensor;
pub fn ggml_map_unary_inplace_f32(
ctx: *mut ggml_context,
a: *mut ggml_tensor,
fun: ggml_unary_op_f32_t,
) -> *mut ggml_tensor;
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;
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;
pub fn ggml_map_custom1_f32(
ctx: *mut ggml_context,
a: *mut ggml_tensor,
fun: ggml_custom1_op_f32_t,
) -> *mut ggml_tensor;
pub fn ggml_map_custom1_inplace_f32(
ctx: *mut ggml_context,
a: *mut ggml_tensor,
fun: ggml_custom1_op_f32_t,
) -> *mut ggml_tensor;
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;
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;
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;
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 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;
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;
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;
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;
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;
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;
pub fn ggml_cross_entropy_loss(
ctx: *mut ggml_context,
a: *mut ggml_tensor,
b: *mut ggml_tensor,
) -> *mut ggml_tensor;
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;
pub fn ggml_set_param(ctx: *mut ggml_context, tensor: *mut ggml_tensor);
pub fn ggml_build_forward_expand(cgraph: *mut ggml_cgraph, tensor: *mut ggml_tensor);
pub fn ggml_build_backward_expand(
ctx: *mut ggml_context,
gf: *mut ggml_cgraph,
gb: *mut ggml_cgraph,
keep: bool,
);
pub fn ggml_new_graph(ctx: *mut ggml_context) -> *mut ggml_cgraph;
pub fn ggml_new_graph_custom(
ctx: *mut ggml_context,
size: usize,
grads: bool,
) -> *mut ggml_cgraph;
pub fn ggml_graph_dup(ctx: *mut ggml_context, cgraph: *mut ggml_cgraph) -> *mut ggml_cgraph;
pub fn ggml_graph_view(
cgraph: *mut ggml_cgraph,
i0: ::std::os::raw::c_int,
i1: ::std::os::raw::c_int,
) -> ggml_cgraph;
pub fn ggml_graph_cpy(src: *mut ggml_cgraph, dst: *mut ggml_cgraph);
pub fn ggml_graph_reset(cgraph: *mut ggml_cgraph);
pub fn ggml_graph_clear(cgraph: *mut ggml_cgraph);
pub fn ggml_graph_overhead() -> usize;
pub fn ggml_graph_overhead_custom(size: usize, grads: bool) -> usize;
pub fn ggml_graph_plan(
cgraph: *const ggml_cgraph,
n_threads: ::std::os::raw::c_int,
) -> ggml_cplan;
pub fn ggml_graph_compute(
cgraph: *mut ggml_cgraph,
cplan: *mut ggml_cplan,
) -> ::std::os::raw::c_int;
pub fn ggml_graph_compute_with_ctx(
ctx: *mut ggml_context,
cgraph: *mut ggml_cgraph,
n_threads: ::std::os::raw::c_int,
);
pub fn ggml_graph_get_tensor(
cgraph: *mut ggml_cgraph,
name: *const ::std::os::raw::c_char,
) -> *mut ggml_tensor;
pub fn ggml_graph_export(cgraph: *const ggml_cgraph, fname: *const ::std::os::raw::c_char);
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;
pub fn ggml_graph_print(cgraph: *const ggml_cgraph);
pub fn ggml_graph_dump_dot(
gb: *const ggml_cgraph,
gf: *const ggml_cgraph,
filename: *const ::std::os::raw::c_char,
);
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 fn ggml_opt_default_params(type_: ggml_opt_type) -> ggml_opt_params;
pub fn ggml_opt(
ctx: *mut ggml_context,
params: ggml_opt_params,
f: *mut ggml_tensor,
) -> ggml_opt_result;
pub fn ggml_opt_init(
ctx: *mut ggml_context,
opt: *mut ggml_opt_context,
params: ggml_opt_params,
nx: i64,
);
pub fn ggml_opt_resume(
ctx: *mut ggml_context,
opt: *mut ggml_opt_context,
f: *mut ggml_tensor,
) -> ggml_opt_result;
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;
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;
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;
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;
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;
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;
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;
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;
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;
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;
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;
pub fn ggml_quantize_chunk(
type_: ggml_type,
src: *const f32,
dst: *mut ::std::os::raw::c_void,
start: ::std::os::raw::c_int,
nrows: ::std::os::raw::c_int,
n_per_row: ::std::os::raw::c_int,
hist: *mut i64,
imatrix: *const f32,
) -> usize;
pub fn ggml_init_iq2_quantization(type_: ggml_type);
pub fn ggml_deinit_iq2_quantization(type_: ggml_type);
pub fn ggml_set_imatrix_collection(imatrix_collect: ggml_collect_imatrix_t);
pub fn gguf_init_empty() -> *mut gguf_context;
pub fn gguf_init_from_file(
fname: *const ::std::os::raw::c_char,
params: gguf_init_params,
) -> *mut gguf_context;
pub fn gguf_free(ctx: *mut gguf_context);
pub fn gguf_type_name(type_: gguf_type) -> *const ::std::os::raw::c_char;
pub fn gguf_get_version(ctx: *const gguf_context) -> ::std::os::raw::c_int;
pub fn gguf_get_alignment(ctx: *const gguf_context) -> usize;
pub fn gguf_get_data_offset(ctx: *const gguf_context) -> usize;
pub fn gguf_get_data(ctx: *const gguf_context) -> *mut ::std::os::raw::c_void;
pub fn gguf_get_n_kv(ctx: *const gguf_context) -> ::std::os::raw::c_int;
pub fn gguf_find_key(
ctx: *const gguf_context,
key: *const ::std::os::raw::c_char,
) -> ::std::os::raw::c_int;
pub fn gguf_get_key(
ctx: *const gguf_context,
key_id: ::std::os::raw::c_int,
) -> *const ::std::os::raw::c_char;
pub fn gguf_get_kv_type(ctx: *const gguf_context, key_id: ::std::os::raw::c_int) -> gguf_type;
pub fn gguf_get_arr_type(ctx: *const gguf_context, key_id: ::std::os::raw::c_int) -> gguf_type;
pub fn gguf_get_val_u8(ctx: *const gguf_context, key_id: ::std::os::raw::c_int) -> u8;
pub fn gguf_get_val_i8(ctx: *const gguf_context, key_id: ::std::os::raw::c_int) -> i8;
pub fn gguf_get_val_u16(ctx: *const gguf_context, key_id: ::std::os::raw::c_int) -> u16;
pub fn gguf_get_val_i16(ctx: *const gguf_context, key_id: ::std::os::raw::c_int) -> i16;
pub fn gguf_get_val_u32(ctx: *const gguf_context, key_id: ::std::os::raw::c_int) -> u32;
pub fn gguf_get_val_i32(ctx: *const gguf_context, key_id: ::std::os::raw::c_int) -> i32;
pub fn gguf_get_val_f32(ctx: *const gguf_context, key_id: ::std::os::raw::c_int) -> f32;
pub fn gguf_get_val_u64(ctx: *const gguf_context, key_id: ::std::os::raw::c_int) -> u64;
pub fn gguf_get_val_i64(ctx: *const gguf_context, key_id: ::std::os::raw::c_int) -> i64;
pub fn gguf_get_val_f64(ctx: *const gguf_context, key_id: ::std::os::raw::c_int) -> f64;
pub fn gguf_get_val_bool(ctx: *const gguf_context, key_id: ::std::os::raw::c_int) -> bool;
pub fn gguf_get_val_str(
ctx: *const gguf_context,
key_id: ::std::os::raw::c_int,
) -> *const ::std::os::raw::c_char;
pub fn gguf_get_val_data(
ctx: *const gguf_context,
key_id: ::std::os::raw::c_int,
) -> *const ::std::os::raw::c_void;
pub fn gguf_get_arr_n(
ctx: *const gguf_context,
key_id: ::std::os::raw::c_int,
) -> ::std::os::raw::c_int;
pub fn gguf_get_arr_data(
ctx: *const gguf_context,
key_id: ::std::os::raw::c_int,
) -> *const ::std::os::raw::c_void;
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;
pub fn gguf_get_n_tensors(ctx: *const gguf_context) -> ::std::os::raw::c_int;
pub fn gguf_find_tensor(
ctx: *const gguf_context,
name: *const ::std::os::raw::c_char,
) -> ::std::os::raw::c_int;
pub fn gguf_get_tensor_offset(ctx: *const gguf_context, i: ::std::os::raw::c_int) -> usize;
pub fn gguf_get_tensor_name(
ctx: *const gguf_context,
i: ::std::os::raw::c_int,
) -> *mut ::std::os::raw::c_char;
pub fn gguf_get_tensor_type(ctx: *const gguf_context, i: ::std::os::raw::c_int) -> ggml_type;
pub fn gguf_set_val_u8(ctx: *mut gguf_context, key: *const ::std::os::raw::c_char, val: u8);
pub fn gguf_set_val_i8(ctx: *mut gguf_context, key: *const ::std::os::raw::c_char, val: i8);
pub fn gguf_set_val_u16(ctx: *mut gguf_context, key: *const ::std::os::raw::c_char, val: u16);
pub fn gguf_set_val_i16(ctx: *mut gguf_context, key: *const ::std::os::raw::c_char, val: i16);
pub fn gguf_set_val_u32(ctx: *mut gguf_context, key: *const ::std::os::raw::c_char, val: u32);
pub fn gguf_set_val_i32(ctx: *mut gguf_context, key: *const ::std::os::raw::c_char, val: i32);
pub fn gguf_set_val_f32(ctx: *mut gguf_context, key: *const ::std::os::raw::c_char, val: f32);
pub fn gguf_set_val_u64(ctx: *mut gguf_context, key: *const ::std::os::raw::c_char, val: u64);
pub fn gguf_set_val_i64(ctx: *mut gguf_context, key: *const ::std::os::raw::c_char, val: i64);
pub fn gguf_set_val_f64(ctx: *mut gguf_context, key: *const ::std::os::raw::c_char, val: f64);
pub fn gguf_set_val_bool(ctx: *mut gguf_context, key: *const ::std::os::raw::c_char, val: bool);
pub fn gguf_set_val_str(
ctx: *mut gguf_context,
key: *const ::std::os::raw::c_char,
val: *const ::std::os::raw::c_char,
);
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,
);
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,
);
pub fn gguf_set_kv(ctx: *mut gguf_context, src: *mut gguf_context);
pub fn gguf_add_tensor(ctx: *mut gguf_context, tensor: *const ggml_tensor);
pub fn gguf_set_tensor_type(
ctx: *mut gguf_context,
name: *const ::std::os::raw::c_char,
type_: ggml_type,
);
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,
);
pub fn gguf_write_to_file(
ctx: *const gguf_context,
fname: *const ::std::os::raw::c_char,
only_meta: bool,
);
pub fn gguf_get_meta_size(ctx: *const gguf_context) -> usize;
pub fn gguf_get_meta_data(ctx: *const gguf_context, data: *mut ::std::os::raw::c_void);
pub fn ggml_cpu_has_avx() -> ::std::os::raw::c_int;
pub fn ggml_cpu_has_avx_vnni() -> ::std::os::raw::c_int;
pub fn ggml_cpu_has_avx2() -> ::std::os::raw::c_int;
pub fn ggml_cpu_has_avx512() -> ::std::os::raw::c_int;
pub fn ggml_cpu_has_avx512_vbmi() -> ::std::os::raw::c_int;
pub fn ggml_cpu_has_avx512_vnni() -> ::std::os::raw::c_int;
pub fn ggml_cpu_has_fma() -> ::std::os::raw::c_int;
pub fn ggml_cpu_has_neon() -> ::std::os::raw::c_int;
pub fn ggml_cpu_has_arm_fma() -> ::std::os::raw::c_int;
pub fn ggml_cpu_has_metal() -> ::std::os::raw::c_int;
pub fn ggml_cpu_has_f16c() -> ::std::os::raw::c_int;
pub fn ggml_cpu_has_fp16_va() -> ::std::os::raw::c_int;
pub fn ggml_cpu_has_wasm_simd() -> ::std::os::raw::c_int;
pub fn ggml_cpu_has_blas() -> ::std::os::raw::c_int;
pub fn ggml_cpu_has_cublas() -> ::std::os::raw::c_int;
pub fn ggml_cpu_has_clblast() -> ::std::os::raw::c_int;
pub fn ggml_cpu_has_gpublas() -> ::std::os::raw::c_int;
pub fn ggml_cpu_has_sse3() -> ::std::os::raw::c_int;
pub fn ggml_cpu_has_ssse3() -> ::std::os::raw::c_int;
pub fn ggml_cpu_has_vsx() -> ::std::os::raw::c_int;
pub fn ggml_internal_get_type_traits(type_: ggml_type) -> ggml_type_traits_t;
pub fn llama_model_default_params() -> llama_model_params;
pub fn llama_context_default_params() -> llama_context_params;
pub fn llama_model_quantize_default_params() -> llama_model_quantize_params;
pub fn llama_backend_init(numa: bool);
pub fn llama_backend_free();
pub fn llama_load_model_from_file(
path_model: *const ::std::os::raw::c_char,
params: llama_model_params,
) -> *mut llama_model;
pub fn llama_free_model(model: *mut llama_model);
pub fn llama_new_context_with_model(
model: *mut llama_model,
params: llama_context_params,
) -> *mut llama_context;
pub fn llama_free(ctx: *mut llama_context);
pub fn llama_time_us() -> i64;
pub fn llama_max_devices() -> i32;
pub fn llama_mmap_supported() -> bool;
pub fn llama_mlock_supported() -> bool;
pub fn llama_get_model(ctx: *const llama_context) -> *const llama_model;
pub fn llama_n_ctx(ctx: *const llama_context) -> u32;
pub fn llama_n_batch(ctx: *const llama_context) -> u32;
pub fn llama_vocab_type(model: *const llama_model) -> llama_vocab_type;
pub fn llama_n_vocab(model: *const llama_model) -> i32;
pub fn llama_n_ctx_train(model: *const llama_model) -> i32;
pub fn llama_n_embd(model: *const llama_model) -> i32;
pub fn llama_rope_freq_scale_train(model: *const llama_model) -> f32;
pub fn llama_model_meta_val_str(
model: *const llama_model,
key: *const ::std::os::raw::c_char,
buf: *mut ::std::os::raw::c_char,
buf_size: usize,
) -> i32;
pub fn llama_model_meta_count(model: *const llama_model) -> i32;
pub fn llama_model_meta_key_by_index(
model: *const llama_model,
i: i32,
buf: *mut ::std::os::raw::c_char,
buf_size: usize,
) -> i32;
pub fn llama_model_meta_val_str_by_index(
model: *const llama_model,
i: i32,
buf: *mut ::std::os::raw::c_char,
buf_size: usize,
) -> i32;
pub fn llama_model_desc(
model: *const llama_model,
buf: *mut ::std::os::raw::c_char,
buf_size: usize,
) -> i32;
pub fn llama_model_size(model: *const llama_model) -> u64;
pub fn llama_model_n_params(model: *const llama_model) -> u64;
pub fn llama_get_model_tensor(
model: *mut llama_model,
name: *const ::std::os::raw::c_char,
) -> *mut ggml_tensor;
pub fn llama_model_quantize(
fname_inp: *const ::std::os::raw::c_char,
fname_out: *const ::std::os::raw::c_char,
params: *const llama_model_quantize_params,
) -> u32;
pub fn llama_apply_lora_from_file(
ctx: *mut llama_context,
path_lora: *const ::std::os::raw::c_char,
scale: f32,
path_base_model: *const ::std::os::raw::c_char,
n_threads: i32,
) -> i32;
pub fn llama_model_apply_lora_from_file(
model: *const llama_model,
path_lora: *const ::std::os::raw::c_char,
scale: f32,
path_base_model: *const ::std::os::raw::c_char,
n_threads: i32,
) -> i32;
pub fn llama_kv_cache_view_init(
ctx: *const llama_context,
n_max_seq: i32,
) -> llama_kv_cache_view;
pub fn llama_kv_cache_view_free(view: *mut llama_kv_cache_view);
pub fn llama_kv_cache_view_update(ctx: *const llama_context, view: *mut llama_kv_cache_view);
pub fn llama_get_kv_cache_token_count(ctx: *const llama_context) -> i32;
pub fn llama_get_kv_cache_used_cells(ctx: *const llama_context) -> i32;
pub fn llama_kv_cache_clear(ctx: *mut llama_context);
pub fn llama_kv_cache_seq_rm(
ctx: *mut llama_context,
seq_id: llama_seq_id,
p0: llama_pos,
p1: llama_pos,
);
pub fn llama_kv_cache_seq_cp(
ctx: *mut llama_context,
seq_id_src: llama_seq_id,
seq_id_dst: llama_seq_id,
p0: llama_pos,
p1: llama_pos,
);
pub fn llama_kv_cache_seq_keep(ctx: *mut llama_context, seq_id: llama_seq_id);
pub fn llama_kv_cache_seq_shift(
ctx: *mut llama_context,
seq_id: llama_seq_id,
p0: llama_pos,
p1: llama_pos,
delta: llama_pos,
);
pub fn llama_kv_cache_seq_div(
ctx: *mut llama_context,
seq_id: llama_seq_id,
p0: llama_pos,
p1: llama_pos,
d: ::std::os::raw::c_int,
);
pub fn llama_get_state_size(ctx: *const llama_context) -> usize;
pub fn llama_copy_state_data(ctx: *mut llama_context, dst: *mut u8) -> usize;
pub fn llama_set_state_data(ctx: *mut llama_context, src: *mut u8) -> usize;
pub fn llama_load_session_file(
ctx: *mut llama_context,
path_session: *const ::std::os::raw::c_char,
tokens_out: *mut llama_token,
n_token_capacity: usize,
n_token_count_out: *mut usize,
) -> bool;
pub fn llama_save_session_file(
ctx: *mut llama_context,
path_session: *const ::std::os::raw::c_char,
tokens: *const llama_token,
n_token_count: usize,
) -> bool;
pub fn llama_eval(
ctx: *mut llama_context,
tokens: *mut llama_token,
n_tokens: i32,
n_past: i32,
) -> ::std::os::raw::c_int;
pub fn llama_eval_embd(
ctx: *mut llama_context,
embd: *mut f32,
n_tokens: i32,
n_past: i32,
) -> ::std::os::raw::c_int;
pub fn llama_batch_get_one(
tokens: *mut llama_token,
n_tokens: i32,
pos_0: llama_pos,
seq_id: llama_seq_id,
) -> llama_batch;
pub fn llama_batch_init(n_tokens: i32, embd: i32, n_seq_max: i32) -> llama_batch;
pub fn llama_batch_free(batch: llama_batch);
pub fn llama_decode(ctx: *mut llama_context, batch: llama_batch) -> i32;
pub fn llama_set_n_threads(ctx: *mut llama_context, n_threads: u32, n_threads_batch: u32);
pub fn llama_get_logits(ctx: *mut llama_context) -> *mut f32;
pub fn llama_get_logits_ith(ctx: *mut llama_context, i: i32) -> *mut f32;
pub fn llama_get_embeddings(ctx: *mut llama_context) -> *mut f32;
pub fn llama_token_get_text(
model: *const llama_model,
token: llama_token,
) -> *const ::std::os::raw::c_char;
pub fn llama_token_get_score(model: *const llama_model, token: llama_token) -> f32;
pub fn llama_token_get_type(model: *const llama_model, token: llama_token) -> llama_token_type;
pub fn llama_token_bos(model: *const llama_model) -> llama_token;
pub fn llama_token_eos(model: *const llama_model) -> llama_token;
pub fn llama_token_nl(model: *const llama_model) -> llama_token;
pub fn llama_add_bos_token(model: *const llama_model) -> i32;
pub fn llama_add_eos_token(model: *const llama_model) -> i32;
pub fn llama_token_prefix(model: *const llama_model) -> llama_token;
pub fn llama_token_middle(model: *const llama_model) -> llama_token;
pub fn llama_token_suffix(model: *const llama_model) -> llama_token;
pub fn llama_token_eot(model: *const llama_model) -> llama_token;
#[doc = " @details Convert the provided text into tokens.\n @param tokens The tokens pointer must be large enough to hold the resulting tokens.\n @return Returns the number of tokens on success, no more than n_max_tokens\n @return Returns a negative number on failure - the number of tokens that would have been returned\n @param special Allow tokenizing special and/or control tokens which otherwise are not exposed and treated as plaintext.\n Does not insert a leading space."]
pub fn llama_tokenize(
model: *const llama_model,
text: *const ::std::os::raw::c_char,
text_len: i32,
tokens: *mut llama_token,
n_max_tokens: i32,
add_bos: bool,
special: bool,
) -> i32;
pub fn llama_token_to_piece(
model: *const llama_model,
token: llama_token,
buf: *mut ::std::os::raw::c_char,
length: i32,
) -> i32;
pub fn llama_grammar_init(
rules: *mut *const llama_grammar_element,
n_rules: usize,
start_rule_index: usize,
) -> *mut llama_grammar;
pub fn llama_grammar_free(grammar: *mut llama_grammar);
pub fn llama_grammar_copy(grammar: *const llama_grammar) -> *mut llama_grammar;
pub fn llama_set_rng_seed(ctx: *mut llama_context, seed: u32);
#[doc = " @details Repetition penalty described in CTRL academic paper https://arxiv.org/abs/1909.05858, with negative logit fix.\n @details Frequency and presence penalties described in OpenAI API https://platform.openai.com/docs/api-reference/parameter-details."]
pub fn llama_sample_repetition_penalties(
ctx: *mut llama_context,
candidates: *mut llama_token_data_array,
last_tokens: *const llama_token,
penalty_last_n: usize,
penalty_repeat: f32,
penalty_freq: f32,
penalty_present: f32,
);
#[doc = " @details Apply classifier-free guidance to the logits as described in academic paper \"Stay on topic with Classifier-Free Guidance\" https://arxiv.org/abs/2306.17806\n @param candidates A vector of `llama_token_data` containing the candidate tokens, the logits must be directly extracted from the original generation context without being sorted.\n @params guidance_ctx A separate context from the same model. Other than a negative prompt at the beginning, it should have all generated and user input tokens copied from the main context.\n @params scale Guidance strength. 1.0f means no guidance. Higher values mean stronger guidance."]
pub fn llama_sample_classifier_free_guidance(
ctx: *mut llama_context,
candidates: *mut llama_token_data_array,
guidance_ctx: *mut llama_context,
scale: f32,
);
#[doc = " @details Sorts candidate tokens by their logits in descending order and calculate probabilities based on logits."]
pub fn llama_sample_softmax(ctx: *mut llama_context, candidates: *mut llama_token_data_array);
#[doc = " @details Top-K sampling described in academic paper \"The Curious Case of Neural Text Degeneration\" https://arxiv.org/abs/1904.09751"]
pub fn llama_sample_top_k(
ctx: *mut llama_context,
candidates: *mut llama_token_data_array,
k: i32,
min_keep: usize,
);
#[doc = " @details Nucleus sampling described in academic paper \"The Curious Case of Neural Text Degeneration\" https://arxiv.org/abs/1904.09751"]
pub fn llama_sample_top_p(
ctx: *mut llama_context,
candidates: *mut llama_token_data_array,
p: f32,
min_keep: usize,
);
#[doc = " @details Minimum P sampling as described in https://github.com/ggerganov/llama.cpp/pull/3841"]
pub fn llama_sample_min_p(
ctx: *mut llama_context,
candidates: *mut llama_token_data_array,
p: f32,
min_keep: usize,
);
#[doc = " @details Tail Free Sampling described in https://www.trentonbricken.com/Tail-Free-Sampling/."]
pub fn llama_sample_tail_free(
ctx: *mut llama_context,
candidates: *mut llama_token_data_array,
z: f32,
min_keep: usize,
);
#[doc = " @details Locally Typical Sampling implementation described in the paper https://arxiv.org/abs/2202.00666."]
pub fn llama_sample_typical(
ctx: *mut llama_context,
candidates: *mut llama_token_data_array,
p: f32,
min_keep: usize,
);
pub fn llama_sample_temp(
ctx: *mut llama_context,
candidates: *mut llama_token_data_array,
temp: f32,
);
pub fn llama_sample_temperature(
ctx: *mut llama_context,
candidates: *mut llama_token_data_array,
temp: f32,
);
#[doc = " @details Apply constraints from grammar"]
pub fn llama_sample_grammar(
ctx: *mut llama_context,
candidates: *mut llama_token_data_array,
grammar: *const llama_grammar,
);
#[doc = " @details Mirostat 1.0 algorithm described in the paper https://arxiv.org/abs/2007.14966. Uses tokens instead of words.\n @param candidates A vector of `llama_token_data` containing the candidate tokens, their probabilities (p), and log-odds (logit) for the current position in the generated text.\n @param tau The target cross-entropy (or surprise) value you want to achieve for the generated text. A higher value corresponds to more surprising or less predictable text, while a lower value corresponds to less surprising or more predictable text.\n @param eta The learning rate used to update `mu` based on the error between the target and observed surprisal of the sampled word. A larger learning rate will cause `mu` to be updated more quickly, while a smaller learning rate will result in slower updates.\n @param m The number of tokens considered in the estimation of `s_hat`. This is an arbitrary value that is used to calculate `s_hat`, which in turn helps to calculate the value of `k`. In the paper, they use `m = 100`, but you can experiment with different values to see how it affects the performance of the algorithm.\n @param mu Maximum cross-entropy. This value is initialized to be twice the target cross-entropy (`2 * tau`) and is updated in the algorithm based on the error between the target and observed surprisal."]
pub fn llama_sample_token_mirostat(
ctx: *mut llama_context,
candidates: *mut llama_token_data_array,
tau: f32,
eta: f32,
m: i32,
mu: *mut f32,
) -> llama_token;
#[doc = " @details Mirostat 2.0 algorithm described in the paper https://arxiv.org/abs/2007.14966. Uses tokens instead of words.\n @param candidates A vector of `llama_token_data` containing the candidate tokens, their probabilities (p), and log-odds (logit) for the current position in the generated text.\n @param tau The target cross-entropy (or surprise) value you want to achieve for the generated text. A higher value corresponds to more surprising or less predictable text, while a lower value corresponds to less surprising or more predictable text.\n @param eta The learning rate used to update `mu` based on the error between the target and observed surprisal of the sampled word. A larger learning rate will cause `mu` to be updated more quickly, while a smaller learning rate will result in slower updates.\n @param mu Maximum cross-entropy. This value is initialized to be twice the target cross-entropy (`2 * tau`) and is updated in the algorithm based on the error between the target and observed surprisal."]
pub fn llama_sample_token_mirostat_v2(
ctx: *mut llama_context,
candidates: *mut llama_token_data_array,
tau: f32,
eta: f32,
mu: *mut f32,
) -> llama_token;
#[doc = " @details Selects the token with the highest probability.\n Does not compute the token probabilities. Use llama_sample_softmax() instead."]
pub fn llama_sample_token_greedy(
ctx: *mut llama_context,
candidates: *mut llama_token_data_array,
) -> llama_token;
#[doc = " @details Randomly selects a token from the candidates based on their probabilities."]
pub fn llama_sample_token(
ctx: *mut llama_context,
candidates: *mut llama_token_data_array,
) -> llama_token;
#[doc = " @details Accepts the sampled token into the grammar"]
pub fn llama_grammar_accept_token(
ctx: *mut llama_context,
grammar: *mut llama_grammar,
token: llama_token,
);
#[doc = " @details Deterministically returns entire sentence constructed by a beam search.\n @param ctx Pointer to the llama_context.\n @param callback Invoked for each iteration of the beam_search loop, passing in beams_state.\n @param callback_data A pointer that is simply passed back to callback.\n @param n_beams Number of beams to use.\n @param n_past Number of tokens already evaluated.\n @param n_predict Maximum number of tokens to predict. EOS may occur earlier."]
pub fn llama_beam_search(
ctx: *mut llama_context,
callback: llama_beam_search_callback_fn_t,
callback_data: *mut ::std::os::raw::c_void,
n_beams: usize,
n_past: i32,
n_predict: i32,
);
pub fn llama_get_timings(ctx: *mut llama_context) -> llama_timings;
pub fn llama_print_timings(ctx: *mut llama_context);
pub fn llama_reset_timings(ctx: *mut llama_context);
pub fn llama_print_system_info() -> *const ::std::os::raw::c_char;
pub fn llama_log_set(log_callback: ggml_log_callback, user_data: *mut ::std::os::raw::c_void);
pub fn llama_dump_timing_info_yaml(stream: *mut FILE, ctx: *const llama_context);
}