type FILE = ::std::ffi::c_void;
#[derive(PartialEq, Copy, Clone, Hash, Debug, Default)]
#[repr(C)]
pub struct __BindgenComplex<T> {
pub re: T,
pub im: T,
}
#[derive(PartialEq, Copy, Clone, Hash, Debug, Default)]
#[repr(transparent)]
pub struct __BindgenFloat16(pub u16);
#[repr(C)]
#[derive(Copy, Clone)]
pub struct mlx_string_ {
pub ctx: *mut ::std::os::raw::c_void,
}
#[allow(clippy::unnecessary_operation, clippy::identity_op)]
const _: () = {
["Size of mlx_string_"][::std::mem::size_of::<mlx_string_>() - 8usize];
["Alignment of mlx_string_"][::std::mem::align_of::<mlx_string_>() - 8usize];
["Offset of field: mlx_string_::ctx"][::std::mem::offset_of!(mlx_string_, ctx) - 0usize];
};
pub type mlx_string = mlx_string_;
unsafe extern "C" {
pub fn mlx_string_new() -> mlx_string;
}
unsafe extern "C" {
pub fn mlx_string_new_data(str_: *const ::std::os::raw::c_char) -> mlx_string;
}
unsafe extern "C" {
pub fn mlx_string_set(str_: *mut mlx_string, src: mlx_string) -> ::std::os::raw::c_int;
}
unsafe extern "C" {
pub fn mlx_string_data(str_: mlx_string) -> *const ::std::os::raw::c_char;
}
unsafe extern "C" {
pub fn mlx_string_free(str_: mlx_string) -> ::std::os::raw::c_int;
}
pub type __int64_t = ::std::os::raw::c_longlong;
pub type __darwin_off_t = __int64_t;
pub type mlx_complex64_t = __BindgenComplex<f32>;
pub type float16_t = __BindgenFloat16;
pub type bfloat16_t = u16;
#[repr(C)]
#[derive(Copy, Clone)]
pub struct mlx_array_ {
pub ctx: *mut ::std::os::raw::c_void,
}
#[allow(clippy::unnecessary_operation, clippy::identity_op)]
const _: () = {
["Size of mlx_array_"][::std::mem::size_of::<mlx_array_>() - 8usize];
["Alignment of mlx_array_"][::std::mem::align_of::<mlx_array_>() - 8usize];
["Offset of field: mlx_array_::ctx"][::std::mem::offset_of!(mlx_array_, ctx) - 0usize];
};
pub type mlx_array = mlx_array_;
pub const mlx_dtype__MLX_BOOL: mlx_dtype_ = 0;
pub const mlx_dtype__MLX_UINT8: mlx_dtype_ = 1;
pub const mlx_dtype__MLX_UINT16: mlx_dtype_ = 2;
pub const mlx_dtype__MLX_UINT32: mlx_dtype_ = 3;
pub const mlx_dtype__MLX_UINT64: mlx_dtype_ = 4;
pub const mlx_dtype__MLX_INT8: mlx_dtype_ = 5;
pub const mlx_dtype__MLX_INT16: mlx_dtype_ = 6;
pub const mlx_dtype__MLX_INT32: mlx_dtype_ = 7;
pub const mlx_dtype__MLX_INT64: mlx_dtype_ = 8;
pub const mlx_dtype__MLX_FLOAT16: mlx_dtype_ = 9;
pub const mlx_dtype__MLX_FLOAT32: mlx_dtype_ = 10;
pub const mlx_dtype__MLX_FLOAT64: mlx_dtype_ = 11;
pub const mlx_dtype__MLX_BFLOAT16: mlx_dtype_ = 12;
pub const mlx_dtype__MLX_COMPLEX64: mlx_dtype_ = 13;
pub type mlx_dtype_ = ::std::os::raw::c_uint;
pub use self::mlx_dtype_ as mlx_dtype;
unsafe extern "C" {
pub fn mlx_dtype_size(dtype: mlx_dtype) -> usize;
}
unsafe extern "C" {
pub fn mlx_array_tostring(str_: *mut mlx_string, arr: mlx_array) -> ::std::os::raw::c_int;
}
unsafe extern "C" {
pub fn mlx_array_new() -> mlx_array;
}
unsafe extern "C" {
pub fn mlx_array_free(arr: mlx_array) -> ::std::os::raw::c_int;
}
unsafe extern "C" {
pub fn mlx_array_new_bool(val: bool) -> mlx_array;
}
unsafe extern "C" {
pub fn mlx_array_new_int(val: ::std::os::raw::c_int) -> mlx_array;
}
unsafe extern "C" {
pub fn mlx_array_new_float32(val: f32) -> mlx_array;
}
unsafe extern "C" {
pub fn mlx_array_new_float(val: f32) -> mlx_array;
}
unsafe extern "C" {
pub fn mlx_array_new_float64(val: f64) -> mlx_array;
}
unsafe extern "C" {
pub fn mlx_array_new_double(val: f64) -> mlx_array;
}
unsafe extern "C" {
pub fn mlx_array_new_complex(real_val: f32, imag_val: f32) -> mlx_array;
}
unsafe extern "C" {
pub fn mlx_array_new_data(
data: *const ::std::os::raw::c_void,
shape: *const ::std::os::raw::c_int,
dim: ::std::os::raw::c_int,
dtype: mlx_dtype,
) -> mlx_array;
}
unsafe extern "C" {
pub fn mlx_array_new_data_managed(
data: *mut ::std::os::raw::c_void,
shape: *const ::std::os::raw::c_int,
dim: ::std::os::raw::c_int,
dtype: mlx_dtype,
dtor: ::std::option::Option<unsafe extern "C" fn(arg1: *mut ::std::os::raw::c_void)>,
) -> mlx_array;
}
unsafe extern "C" {
pub fn mlx_array_new_data_managed_payload(
data: *mut ::std::os::raw::c_void,
shape: *const ::std::os::raw::c_int,
dim: ::std::os::raw::c_int,
dtype: mlx_dtype,
payload: *mut ::std::os::raw::c_void,
dtor: ::std::option::Option<unsafe extern "C" fn(arg1: *mut ::std::os::raw::c_void)>,
) -> mlx_array;
}
unsafe extern "C" {
pub fn mlx_array_set(arr: *mut mlx_array, src: mlx_array) -> ::std::os::raw::c_int;
}
unsafe extern "C" {
pub fn mlx_array_set_bool(arr: *mut mlx_array, val: bool) -> ::std::os::raw::c_int;
}
unsafe extern "C" {
pub fn mlx_array_set_int(
arr: *mut mlx_array,
val: ::std::os::raw::c_int,
) -> ::std::os::raw::c_int;
}
unsafe extern "C" {
pub fn mlx_array_set_float32(arr: *mut mlx_array, val: f32) -> ::std::os::raw::c_int;
}
unsafe extern "C" {
pub fn mlx_array_set_float(arr: *mut mlx_array, val: f32) -> ::std::os::raw::c_int;
}
unsafe extern "C" {
pub fn mlx_array_set_float64(arr: *mut mlx_array, val: f64) -> ::std::os::raw::c_int;
}
unsafe extern "C" {
pub fn mlx_array_set_double(arr: *mut mlx_array, val: f64) -> ::std::os::raw::c_int;
}
unsafe extern "C" {
pub fn mlx_array_set_complex(
arr: *mut mlx_array,
real_val: f32,
imag_val: f32,
) -> ::std::os::raw::c_int;
}
unsafe extern "C" {
pub fn mlx_array_set_data(
arr: *mut mlx_array,
data: *const ::std::os::raw::c_void,
shape: *const ::std::os::raw::c_int,
dim: ::std::os::raw::c_int,
dtype: mlx_dtype,
) -> ::std::os::raw::c_int;
}
unsafe extern "C" {
pub fn mlx_array_itemsize(arr: mlx_array) -> usize;
}
unsafe extern "C" {
pub fn mlx_array_size(arr: mlx_array) -> usize;
}
unsafe extern "C" {
pub fn mlx_array_nbytes(arr: mlx_array) -> usize;
}
unsafe extern "C" {
pub fn mlx_array_ndim(arr: mlx_array) -> usize;
}
unsafe extern "C" {
pub fn mlx_array_shape(arr: mlx_array) -> *const ::std::os::raw::c_int;
}
unsafe extern "C" {
pub fn mlx_array_strides(arr: mlx_array) -> *const usize;
}
unsafe extern "C" {
pub fn mlx_array_dim(arr: mlx_array, dim: ::std::os::raw::c_int) -> ::std::os::raw::c_int;
}
unsafe extern "C" {
pub fn mlx_array_dtype(arr: mlx_array) -> mlx_dtype;
}
unsafe extern "C" {
pub fn mlx_array_eval(arr: mlx_array) -> ::std::os::raw::c_int;
}
unsafe extern "C" {
pub fn mlx_array_item_bool(res: *mut bool, arr: mlx_array) -> ::std::os::raw::c_int;
}
unsafe extern "C" {
pub fn mlx_array_item_uint8(res: *mut u8, arr: mlx_array) -> ::std::os::raw::c_int;
}
unsafe extern "C" {
pub fn mlx_array_item_uint16(res: *mut u16, arr: mlx_array) -> ::std::os::raw::c_int;
}
unsafe extern "C" {
pub fn mlx_array_item_uint32(res: *mut u32, arr: mlx_array) -> ::std::os::raw::c_int;
}
unsafe extern "C" {
pub fn mlx_array_item_uint64(res: *mut u64, arr: mlx_array) -> ::std::os::raw::c_int;
}
unsafe extern "C" {
pub fn mlx_array_item_int8(res: *mut i8, arr: mlx_array) -> ::std::os::raw::c_int;
}
unsafe extern "C" {
pub fn mlx_array_item_int16(res: *mut i16, arr: mlx_array) -> ::std::os::raw::c_int;
}
unsafe extern "C" {
pub fn mlx_array_item_int32(res: *mut i32, arr: mlx_array) -> ::std::os::raw::c_int;
}
unsafe extern "C" {
pub fn mlx_array_item_int64(res: *mut i64, arr: mlx_array) -> ::std::os::raw::c_int;
}
unsafe extern "C" {
pub fn mlx_array_item_float32(res: *mut f32, arr: mlx_array) -> ::std::os::raw::c_int;
}
unsafe extern "C" {
pub fn mlx_array_item_float64(res: *mut f64, arr: mlx_array) -> ::std::os::raw::c_int;
}
unsafe extern "C" {
pub fn mlx_array_item_complex64(
res: *mut mlx_complex64_t,
arr: mlx_array,
) -> ::std::os::raw::c_int;
}
unsafe extern "C" {
pub fn mlx_array_item_float16(res: *mut float16_t, arr: mlx_array) -> ::std::os::raw::c_int;
}
unsafe extern "C" {
pub fn mlx_array_item_bfloat16(res: *mut bfloat16_t, arr: mlx_array) -> ::std::os::raw::c_int;
}
unsafe extern "C" {
pub fn mlx_array_data_bool(arr: mlx_array) -> *const bool;
}
unsafe extern "C" {
pub fn mlx_array_data_uint8(arr: mlx_array) -> *const u8;
}
unsafe extern "C" {
pub fn mlx_array_data_uint16(arr: mlx_array) -> *const u16;
}
unsafe extern "C" {
pub fn mlx_array_data_uint32(arr: mlx_array) -> *const u32;
}
unsafe extern "C" {
pub fn mlx_array_data_uint64(arr: mlx_array) -> *const u64;
}
unsafe extern "C" {
pub fn mlx_array_data_int8(arr: mlx_array) -> *const i8;
}
unsafe extern "C" {
pub fn mlx_array_data_int16(arr: mlx_array) -> *const i16;
}
unsafe extern "C" {
pub fn mlx_array_data_int32(arr: mlx_array) -> *const i32;
}
unsafe extern "C" {
pub fn mlx_array_data_int64(arr: mlx_array) -> *const i64;
}
unsafe extern "C" {
pub fn mlx_array_data_float32(arr: mlx_array) -> *const f32;
}
unsafe extern "C" {
pub fn mlx_array_data_float64(arr: mlx_array) -> *const f64;
}
unsafe extern "C" {
pub fn mlx_array_data_complex64(arr: mlx_array) -> *const mlx_complex64_t;
}
unsafe extern "C" {
pub fn mlx_array_data_float16(arr: mlx_array) -> *const float16_t;
}
unsafe extern "C" {
pub fn mlx_array_data_bfloat16(arr: mlx_array) -> *const bfloat16_t;
}
#[repr(C)]
#[derive(Copy, Clone)]
pub struct mlx_map_string_to_array_ {
pub ctx: *mut ::std::os::raw::c_void,
}
#[allow(clippy::unnecessary_operation, clippy::identity_op)]
const _: () = {
["Size of mlx_map_string_to_array_"][::std::mem::size_of::<mlx_map_string_to_array_>() - 8usize];
["Alignment of mlx_map_string_to_array_"]
[::std::mem::align_of::<mlx_map_string_to_array_>() - 8usize];
["Offset of field: mlx_map_string_to_array_::ctx"]
[::std::mem::offset_of!(mlx_map_string_to_array_, ctx) - 0usize];
};
pub type mlx_map_string_to_array = mlx_map_string_to_array_;
unsafe extern "C" {
pub fn mlx_map_string_to_array_new() -> mlx_map_string_to_array;
}
unsafe extern "C" {
pub fn mlx_map_string_to_array_set(
map: *mut mlx_map_string_to_array,
src: mlx_map_string_to_array,
) -> ::std::os::raw::c_int;
}
unsafe extern "C" {
pub fn mlx_map_string_to_array_free(map: mlx_map_string_to_array) -> ::std::os::raw::c_int;
}
unsafe extern "C" {
pub fn mlx_map_string_to_array_insert(
map: mlx_map_string_to_array,
key: *const ::std::os::raw::c_char,
value: mlx_array,
) -> ::std::os::raw::c_int;
}
unsafe extern "C" {
pub fn mlx_map_string_to_array_get(
value: *mut mlx_array,
map: mlx_map_string_to_array,
key: *const ::std::os::raw::c_char,
) -> ::std::os::raw::c_int;
}
#[repr(C)]
#[derive(Copy, Clone)]
pub struct mlx_map_string_to_array_iterator_ {
pub ctx: *mut ::std::os::raw::c_void,
pub map_ctx: *mut ::std::os::raw::c_void,
}
#[allow(clippy::unnecessary_operation, clippy::identity_op)]
const _: () = {
["Size of mlx_map_string_to_array_iterator_"]
[::std::mem::size_of::<mlx_map_string_to_array_iterator_>() - 16usize];
["Alignment of mlx_map_string_to_array_iterator_"]
[::std::mem::align_of::<mlx_map_string_to_array_iterator_>() - 8usize];
["Offset of field: mlx_map_string_to_array_iterator_::ctx"]
[::std::mem::offset_of!(mlx_map_string_to_array_iterator_, ctx) - 0usize];
["Offset of field: mlx_map_string_to_array_iterator_::map_ctx"]
[::std::mem::offset_of!(mlx_map_string_to_array_iterator_, map_ctx) - 8usize];
};
pub type mlx_map_string_to_array_iterator = mlx_map_string_to_array_iterator_;
unsafe extern "C" {
pub fn mlx_map_string_to_array_iterator_new(
map: mlx_map_string_to_array,
) -> mlx_map_string_to_array_iterator;
}
unsafe extern "C" {
pub fn mlx_map_string_to_array_iterator_free(
it: mlx_map_string_to_array_iterator,
) -> ::std::os::raw::c_int;
}
unsafe extern "C" {
pub fn mlx_map_string_to_array_iterator_next(
key: *mut *const ::std::os::raw::c_char,
value: *mut mlx_array,
it: mlx_map_string_to_array_iterator,
) -> ::std::os::raw::c_int;
}
#[repr(C)]
#[derive(Copy, Clone)]
pub struct mlx_map_string_to_string_ {
pub ctx: *mut ::std::os::raw::c_void,
}
#[allow(clippy::unnecessary_operation, clippy::identity_op)]
const _: () = {
["Size of mlx_map_string_to_string_"]
[::std::mem::size_of::<mlx_map_string_to_string_>() - 8usize];
["Alignment of mlx_map_string_to_string_"]
[::std::mem::align_of::<mlx_map_string_to_string_>() - 8usize];
["Offset of field: mlx_map_string_to_string_::ctx"]
[::std::mem::offset_of!(mlx_map_string_to_string_, ctx) - 0usize];
};
pub type mlx_map_string_to_string = mlx_map_string_to_string_;
unsafe extern "C" {
pub fn mlx_map_string_to_string_new() -> mlx_map_string_to_string;
}
unsafe extern "C" {
pub fn mlx_map_string_to_string_set(
map: *mut mlx_map_string_to_string,
src: mlx_map_string_to_string,
) -> ::std::os::raw::c_int;
}
unsafe extern "C" {
pub fn mlx_map_string_to_string_free(map: mlx_map_string_to_string) -> ::std::os::raw::c_int;
}
unsafe extern "C" {
pub fn mlx_map_string_to_string_insert(
map: mlx_map_string_to_string,
key: *const ::std::os::raw::c_char,
value: *const ::std::os::raw::c_char,
) -> ::std::os::raw::c_int;
}
unsafe extern "C" {
pub fn mlx_map_string_to_string_get(
value: *mut *const ::std::os::raw::c_char,
map: mlx_map_string_to_string,
key: *const ::std::os::raw::c_char,
) -> ::std::os::raw::c_int;
}
#[repr(C)]
#[derive(Copy, Clone)]
pub struct mlx_map_string_to_string_iterator_ {
pub ctx: *mut ::std::os::raw::c_void,
pub map_ctx: *mut ::std::os::raw::c_void,
}
#[allow(clippy::unnecessary_operation, clippy::identity_op)]
const _: () = {
["Size of mlx_map_string_to_string_iterator_"]
[::std::mem::size_of::<mlx_map_string_to_string_iterator_>() - 16usize];
["Alignment of mlx_map_string_to_string_iterator_"]
[::std::mem::align_of::<mlx_map_string_to_string_iterator_>() - 8usize];
["Offset of field: mlx_map_string_to_string_iterator_::ctx"]
[::std::mem::offset_of!(mlx_map_string_to_string_iterator_, ctx) - 0usize];
["Offset of field: mlx_map_string_to_string_iterator_::map_ctx"]
[::std::mem::offset_of!(mlx_map_string_to_string_iterator_, map_ctx) - 8usize];
};
pub type mlx_map_string_to_string_iterator = mlx_map_string_to_string_iterator_;
unsafe extern "C" {
pub fn mlx_map_string_to_string_iterator_new(
map: mlx_map_string_to_string,
) -> mlx_map_string_to_string_iterator;
}
unsafe extern "C" {
pub fn mlx_map_string_to_string_iterator_free(
it: mlx_map_string_to_string_iterator,
) -> ::std::os::raw::c_int;
}
unsafe extern "C" {
pub fn mlx_map_string_to_string_iterator_next(
key: *mut *const ::std::os::raw::c_char,
value: *mut *const ::std::os::raw::c_char,
it: mlx_map_string_to_string_iterator,
) -> ::std::os::raw::c_int;
}
#[repr(C)]
#[derive(Copy, Clone)]
pub struct mlx_optional_int_ {
pub value: ::std::os::raw::c_int,
pub has_value: bool,
}
#[allow(clippy::unnecessary_operation, clippy::identity_op)]
const _: () = {
["Size of mlx_optional_int_"][::std::mem::size_of::<mlx_optional_int_>() - 8usize];
["Alignment of mlx_optional_int_"][::std::mem::align_of::<mlx_optional_int_>() - 4usize];
["Offset of field: mlx_optional_int_::value"]
[::std::mem::offset_of!(mlx_optional_int_, value) - 0usize];
["Offset of field: mlx_optional_int_::has_value"]
[::std::mem::offset_of!(mlx_optional_int_, has_value) - 4usize];
};
pub type mlx_optional_int = mlx_optional_int_;
#[repr(C)]
#[derive(Copy, Clone)]
pub struct mlx_optional_float_ {
pub value: f32,
pub has_value: bool,
}
#[allow(clippy::unnecessary_operation, clippy::identity_op)]
const _: () = {
["Size of mlx_optional_float_"][::std::mem::size_of::<mlx_optional_float_>() - 8usize];
["Alignment of mlx_optional_float_"][::std::mem::align_of::<mlx_optional_float_>() - 4usize];
["Offset of field: mlx_optional_float_::value"]
[::std::mem::offset_of!(mlx_optional_float_, value) - 0usize];
["Offset of field: mlx_optional_float_::has_value"]
[::std::mem::offset_of!(mlx_optional_float_, has_value) - 4usize];
};
pub type mlx_optional_float = mlx_optional_float_;
#[repr(C)]
#[derive(Copy, Clone)]
pub struct mlx_optional_dtype_ {
pub value: mlx_dtype,
pub has_value: bool,
}
#[allow(clippy::unnecessary_operation, clippy::identity_op)]
const _: () = {
["Size of mlx_optional_dtype_"][::std::mem::size_of::<mlx_optional_dtype_>() - 8usize];
["Alignment of mlx_optional_dtype_"][::std::mem::align_of::<mlx_optional_dtype_>() - 4usize];
["Offset of field: mlx_optional_dtype_::value"]
[::std::mem::offset_of!(mlx_optional_dtype_, value) - 0usize];
["Offset of field: mlx_optional_dtype_::has_value"]
[::std::mem::offset_of!(mlx_optional_dtype_, has_value) - 4usize];
};
pub type mlx_optional_dtype = mlx_optional_dtype_;
#[repr(C)]
#[derive(Copy, Clone)]
pub struct mlx_vector_array_ {
pub ctx: *mut ::std::os::raw::c_void,
}
#[allow(clippy::unnecessary_operation, clippy::identity_op)]
const _: () = {
["Size of mlx_vector_array_"][::std::mem::size_of::<mlx_vector_array_>() - 8usize];
["Alignment of mlx_vector_array_"][::std::mem::align_of::<mlx_vector_array_>() - 8usize];
["Offset of field: mlx_vector_array_::ctx"]
[::std::mem::offset_of!(mlx_vector_array_, ctx) - 0usize];
};
pub type mlx_vector_array = mlx_vector_array_;
unsafe extern "C" {
pub fn mlx_vector_array_new() -> mlx_vector_array;
}
unsafe extern "C" {
pub fn mlx_vector_array_set(
vec: *mut mlx_vector_array,
src: mlx_vector_array,
) -> ::std::os::raw::c_int;
}
unsafe extern "C" {
pub fn mlx_vector_array_free(vec: mlx_vector_array) -> ::std::os::raw::c_int;
}
unsafe extern "C" {
pub fn mlx_vector_array_new_data(data: *const mlx_array, size: usize) -> mlx_vector_array;
}
unsafe extern "C" {
pub fn mlx_vector_array_new_value(val: mlx_array) -> mlx_vector_array;
}
unsafe extern "C" {
pub fn mlx_vector_array_set_data(
vec: *mut mlx_vector_array,
data: *const mlx_array,
size: usize,
) -> ::std::os::raw::c_int;
}
unsafe extern "C" {
pub fn mlx_vector_array_set_value(
vec: *mut mlx_vector_array,
val: mlx_array,
) -> ::std::os::raw::c_int;
}
unsafe extern "C" {
pub fn mlx_vector_array_append_data(
vec: mlx_vector_array,
data: *const mlx_array,
size: usize,
) -> ::std::os::raw::c_int;
}
unsafe extern "C" {
pub fn mlx_vector_array_append_value(
vec: mlx_vector_array,
val: mlx_array,
) -> ::std::os::raw::c_int;
}
unsafe extern "C" {
pub fn mlx_vector_array_size(vec: mlx_vector_array) -> usize;
}
unsafe extern "C" {
pub fn mlx_vector_array_get(
res: *mut mlx_array,
vec: mlx_vector_array,
idx: usize,
) -> ::std::os::raw::c_int;
}
#[repr(C)]
#[derive(Copy, Clone)]
pub struct mlx_vector_vector_array_ {
pub ctx: *mut ::std::os::raw::c_void,
}
#[allow(clippy::unnecessary_operation, clippy::identity_op)]
const _: () = {
["Size of mlx_vector_vector_array_"][::std::mem::size_of::<mlx_vector_vector_array_>() - 8usize];
["Alignment of mlx_vector_vector_array_"]
[::std::mem::align_of::<mlx_vector_vector_array_>() - 8usize];
["Offset of field: mlx_vector_vector_array_::ctx"]
[::std::mem::offset_of!(mlx_vector_vector_array_, ctx) - 0usize];
};
pub type mlx_vector_vector_array = mlx_vector_vector_array_;
unsafe extern "C" {
pub fn mlx_vector_vector_array_new() -> mlx_vector_vector_array;
}
unsafe extern "C" {
pub fn mlx_vector_vector_array_set(
vec: *mut mlx_vector_vector_array,
src: mlx_vector_vector_array,
) -> ::std::os::raw::c_int;
}
unsafe extern "C" {
pub fn mlx_vector_vector_array_free(vec: mlx_vector_vector_array) -> ::std::os::raw::c_int;
}
unsafe extern "C" {
pub fn mlx_vector_vector_array_new_data(
data: *const mlx_vector_array,
size: usize,
) -> mlx_vector_vector_array;
}
unsafe extern "C" {
pub fn mlx_vector_vector_array_new_value(val: mlx_vector_array) -> mlx_vector_vector_array;
}
unsafe extern "C" {
pub fn mlx_vector_vector_array_set_data(
vec: *mut mlx_vector_vector_array,
data: *const mlx_vector_array,
size: usize,
) -> ::std::os::raw::c_int;
}
unsafe extern "C" {
pub fn mlx_vector_vector_array_set_value(
vec: *mut mlx_vector_vector_array,
val: mlx_vector_array,
) -> ::std::os::raw::c_int;
}
unsafe extern "C" {
pub fn mlx_vector_vector_array_append_data(
vec: mlx_vector_vector_array,
data: *const mlx_vector_array,
size: usize,
) -> ::std::os::raw::c_int;
}
unsafe extern "C" {
pub fn mlx_vector_vector_array_append_value(
vec: mlx_vector_vector_array,
val: mlx_vector_array,
) -> ::std::os::raw::c_int;
}
unsafe extern "C" {
pub fn mlx_vector_vector_array_size(vec: mlx_vector_vector_array) -> usize;
}
unsafe extern "C" {
pub fn mlx_vector_vector_array_get(
res: *mut mlx_vector_array,
vec: mlx_vector_vector_array,
idx: usize,
) -> ::std::os::raw::c_int;
}
#[repr(C)]
#[derive(Copy, Clone)]
pub struct mlx_vector_int_ {
pub ctx: *mut ::std::os::raw::c_void,
}
#[allow(clippy::unnecessary_operation, clippy::identity_op)]
const _: () = {
["Size of mlx_vector_int_"][::std::mem::size_of::<mlx_vector_int_>() - 8usize];
["Alignment of mlx_vector_int_"][::std::mem::align_of::<mlx_vector_int_>() - 8usize];
["Offset of field: mlx_vector_int_::ctx"][::std::mem::offset_of!(mlx_vector_int_, ctx) - 0usize];
};
pub type mlx_vector_int = mlx_vector_int_;
unsafe extern "C" {
pub fn mlx_vector_int_new() -> mlx_vector_int;
}
unsafe extern "C" {
pub fn mlx_vector_int_set(vec: *mut mlx_vector_int, src: mlx_vector_int)
-> ::std::os::raw::c_int;
}
unsafe extern "C" {
pub fn mlx_vector_int_free(vec: mlx_vector_int) -> ::std::os::raw::c_int;
}
unsafe extern "C" {
pub fn mlx_vector_int_new_data(data: *mut ::std::os::raw::c_int, size: usize) -> mlx_vector_int;
}
unsafe extern "C" {
pub fn mlx_vector_int_new_value(val: ::std::os::raw::c_int) -> mlx_vector_int;
}
unsafe extern "C" {
pub fn mlx_vector_int_set_data(
vec: *mut mlx_vector_int,
data: *mut ::std::os::raw::c_int,
size: usize,
) -> ::std::os::raw::c_int;
}
unsafe extern "C" {
pub fn mlx_vector_int_set_value(
vec: *mut mlx_vector_int,
val: ::std::os::raw::c_int,
) -> ::std::os::raw::c_int;
}
unsafe extern "C" {
pub fn mlx_vector_int_append_data(
vec: mlx_vector_int,
data: *mut ::std::os::raw::c_int,
size: usize,
) -> ::std::os::raw::c_int;
}
unsafe extern "C" {
pub fn mlx_vector_int_append_value(
vec: mlx_vector_int,
val: ::std::os::raw::c_int,
) -> ::std::os::raw::c_int;
}
unsafe extern "C" {
pub fn mlx_vector_int_size(vec: mlx_vector_int) -> usize;
}
unsafe extern "C" {
pub fn mlx_vector_int_get(
res: *mut ::std::os::raw::c_int,
vec: mlx_vector_int,
idx: usize,
) -> ::std::os::raw::c_int;
}
#[repr(C)]
#[derive(Copy, Clone)]
pub struct mlx_vector_string_ {
pub ctx: *mut ::std::os::raw::c_void,
}
#[allow(clippy::unnecessary_operation, clippy::identity_op)]
const _: () = {
["Size of mlx_vector_string_"][::std::mem::size_of::<mlx_vector_string_>() - 8usize];
["Alignment of mlx_vector_string_"][::std::mem::align_of::<mlx_vector_string_>() - 8usize];
["Offset of field: mlx_vector_string_::ctx"]
[::std::mem::offset_of!(mlx_vector_string_, ctx) - 0usize];
};
pub type mlx_vector_string = mlx_vector_string_;
unsafe extern "C" {
pub fn mlx_vector_string_new() -> mlx_vector_string;
}
unsafe extern "C" {
pub fn mlx_vector_string_set(
vec: *mut mlx_vector_string,
src: mlx_vector_string,
) -> ::std::os::raw::c_int;
}
unsafe extern "C" {
pub fn mlx_vector_string_free(vec: mlx_vector_string) -> ::std::os::raw::c_int;
}
unsafe extern "C" {
pub fn mlx_vector_string_new_data(
data: *mut *const ::std::os::raw::c_char,
size: usize,
) -> mlx_vector_string;
}
unsafe extern "C" {
pub fn mlx_vector_string_new_value(val: *const ::std::os::raw::c_char) -> mlx_vector_string;
}
unsafe extern "C" {
pub fn mlx_vector_string_set_data(
vec: *mut mlx_vector_string,
data: *mut *const ::std::os::raw::c_char,
size: usize,
) -> ::std::os::raw::c_int;
}
unsafe extern "C" {
pub fn mlx_vector_string_set_value(
vec: *mut mlx_vector_string,
val: *const ::std::os::raw::c_char,
) -> ::std::os::raw::c_int;
}
unsafe extern "C" {
pub fn mlx_vector_string_append_data(
vec: mlx_vector_string,
data: *mut *const ::std::os::raw::c_char,
size: usize,
) -> ::std::os::raw::c_int;
}
unsafe extern "C" {
pub fn mlx_vector_string_append_value(
vec: mlx_vector_string,
val: *const ::std::os::raw::c_char,
) -> ::std::os::raw::c_int;
}
unsafe extern "C" {
pub fn mlx_vector_string_size(vec: mlx_vector_string) -> usize;
}
unsafe extern "C" {
pub fn mlx_vector_string_get(
res: *mut *mut ::std::os::raw::c_char,
vec: mlx_vector_string,
idx: usize,
) -> ::std::os::raw::c_int;
}
#[repr(C)]
#[derive(Copy, Clone)]
pub struct mlx_device_ {
pub ctx: *mut ::std::os::raw::c_void,
}
#[allow(clippy::unnecessary_operation, clippy::identity_op)]
const _: () = {
["Size of mlx_device_"][::std::mem::size_of::<mlx_device_>() - 8usize];
["Alignment of mlx_device_"][::std::mem::align_of::<mlx_device_>() - 8usize];
["Offset of field: mlx_device_::ctx"][::std::mem::offset_of!(mlx_device_, ctx) - 0usize];
};
pub type mlx_device = mlx_device_;
pub const mlx_device_type__MLX_CPU: mlx_device_type_ = 0;
pub const mlx_device_type__MLX_GPU: mlx_device_type_ = 1;
pub type mlx_device_type_ = ::std::os::raw::c_uint;
pub use self::mlx_device_type_ as mlx_device_type;
unsafe extern "C" {
pub fn mlx_device_new() -> mlx_device;
}
unsafe extern "C" {
pub fn mlx_device_new_type(type_: mlx_device_type, index: ::std::os::raw::c_int) -> mlx_device;
}
unsafe extern "C" {
pub fn mlx_device_free(dev: mlx_device) -> ::std::os::raw::c_int;
}
unsafe extern "C" {
pub fn mlx_device_set(dev: *mut mlx_device, src: mlx_device) -> ::std::os::raw::c_int;
}
unsafe extern "C" {
pub fn mlx_device_tostring(str_: *mut mlx_string, dev: mlx_device) -> ::std::os::raw::c_int;
}
unsafe extern "C" {
pub fn mlx_device_equal(lhs: mlx_device, rhs: mlx_device) -> bool;
}
unsafe extern "C" {
pub fn mlx_device_get_index(
index: *mut ::std::os::raw::c_int,
dev: mlx_device,
) -> ::std::os::raw::c_int;
}
unsafe extern "C" {
pub fn mlx_device_get_type(type_: *mut mlx_device_type, dev: mlx_device)
-> ::std::os::raw::c_int;
}
unsafe extern "C" {
pub fn mlx_get_default_device(dev: *mut mlx_device) -> ::std::os::raw::c_int;
}
unsafe extern "C" {
pub fn mlx_set_default_device(dev: mlx_device) -> ::std::os::raw::c_int;
}
unsafe extern "C" {
pub fn mlx_device_is_available(avail: *mut bool, dev: mlx_device) -> ::std::os::raw::c_int;
}
unsafe extern "C" {
pub fn mlx_device_count(
count: *mut ::std::os::raw::c_int,
type_: mlx_device_type,
) -> ::std::os::raw::c_int;
}
#[repr(C)]
#[derive(Copy, Clone)]
pub struct mlx_device_info_ {
pub ctx: *mut ::std::os::raw::c_void,
}
#[allow(clippy::unnecessary_operation, clippy::identity_op)]
const _: () = {
["Size of mlx_device_info_"][::std::mem::size_of::<mlx_device_info_>() - 8usize];
["Alignment of mlx_device_info_"][::std::mem::align_of::<mlx_device_info_>() - 8usize];
["Offset of field: mlx_device_info_::ctx"]
[::std::mem::offset_of!(mlx_device_info_, ctx) - 0usize];
};
pub type mlx_device_info = mlx_device_info_;
unsafe extern "C" {
pub fn mlx_device_info_new() -> mlx_device_info;
}
unsafe extern "C" {
pub fn mlx_device_info_get(info: *mut mlx_device_info, dev: mlx_device) -> ::std::os::raw::c_int;
}
unsafe extern "C" {
pub fn mlx_device_info_free(info: mlx_device_info) -> ::std::os::raw::c_int;
}
unsafe extern "C" {
pub fn mlx_device_info_has_key(
exists: *mut bool,
info: mlx_device_info,
key: *const ::std::os::raw::c_char,
) -> ::std::os::raw::c_int;
}
unsafe extern "C" {
pub fn mlx_device_info_is_string(
is_string: *mut bool,
info: mlx_device_info,
key: *const ::std::os::raw::c_char,
) -> ::std::os::raw::c_int;
}
unsafe extern "C" {
pub fn mlx_device_info_get_string(
value: *mut *const ::std::os::raw::c_char,
info: mlx_device_info,
key: *const ::std::os::raw::c_char,
) -> ::std::os::raw::c_int;
}
unsafe extern "C" {
pub fn mlx_device_info_get_size(
value: *mut usize,
info: mlx_device_info,
key: *const ::std::os::raw::c_char,
) -> ::std::os::raw::c_int;
}
unsafe extern "C" {
pub fn mlx_device_info_get_keys(
keys: *mut mlx_vector_string,
info: mlx_device_info,
) -> ::std::os::raw::c_int;
}
#[repr(C)]
#[derive(Copy, Clone)]
pub struct mlx_stream_ {
pub ctx: *mut ::std::os::raw::c_void,
}
#[allow(clippy::unnecessary_operation, clippy::identity_op)]
const _: () = {
["Size of mlx_stream_"][::std::mem::size_of::<mlx_stream_>() - 8usize];
["Alignment of mlx_stream_"][::std::mem::align_of::<mlx_stream_>() - 8usize];
["Offset of field: mlx_stream_::ctx"][::std::mem::offset_of!(mlx_stream_, ctx) - 0usize];
};
pub type mlx_stream = mlx_stream_;
unsafe extern "C" {
pub fn mlx_stream_new() -> mlx_stream;
}
unsafe extern "C" {
pub fn mlx_stream_new_device(dev: mlx_device) -> mlx_stream;
}
unsafe extern "C" {
pub fn mlx_stream_set(stream: *mut mlx_stream, src: mlx_stream) -> ::std::os::raw::c_int;
}
unsafe extern "C" {
pub fn mlx_stream_free(stream: mlx_stream) -> ::std::os::raw::c_int;
}
unsafe extern "C" {
pub fn mlx_stream_tostring(str_: *mut mlx_string, stream: mlx_stream) -> ::std::os::raw::c_int;
}
unsafe extern "C" {
pub fn mlx_stream_equal(lhs: mlx_stream, rhs: mlx_stream) -> bool;
}
unsafe extern "C" {
pub fn mlx_stream_get_device(dev: *mut mlx_device, stream: mlx_stream) -> ::std::os::raw::c_int;
}
unsafe extern "C" {
pub fn mlx_stream_get_index(
index: *mut ::std::os::raw::c_int,
stream: mlx_stream,
) -> ::std::os::raw::c_int;
}
unsafe extern "C" {
pub fn mlx_synchronize(stream: mlx_stream) -> ::std::os::raw::c_int;
}
unsafe extern "C" {
pub fn mlx_get_default_stream(stream: *mut mlx_stream, dev: mlx_device) -> ::std::os::raw::c_int;
}
unsafe extern "C" {
pub fn mlx_set_default_stream(stream: mlx_stream) -> ::std::os::raw::c_int;
}
unsafe extern "C" {
pub fn mlx_default_cpu_stream_new() -> mlx_stream;
}
unsafe extern "C" {
pub fn mlx_default_gpu_stream_new() -> mlx_stream;
}
#[repr(C)]
#[derive(Copy, Clone)]
pub struct mlx_closure_ {
pub ctx: *mut ::std::os::raw::c_void,
}
#[allow(clippy::unnecessary_operation, clippy::identity_op)]
const _: () = {
["Size of mlx_closure_"][::std::mem::size_of::<mlx_closure_>() - 8usize];
["Alignment of mlx_closure_"][::std::mem::align_of::<mlx_closure_>() - 8usize];
["Offset of field: mlx_closure_::ctx"][::std::mem::offset_of!(mlx_closure_, ctx) - 0usize];
};
pub type mlx_closure = mlx_closure_;
unsafe extern "C" {
pub fn mlx_closure_new() -> mlx_closure;
}
unsafe extern "C" {
pub fn mlx_closure_free(cls: mlx_closure) -> ::std::os::raw::c_int;
}
unsafe extern "C" {
pub fn mlx_closure_new_func(
fun: ::std::option::Option<
unsafe extern "C" fn(
arg1: *mut mlx_vector_array,
arg2: mlx_vector_array,
) -> ::std::os::raw::c_int,
>,
) -> mlx_closure;
}
unsafe extern "C" {
pub fn mlx_closure_new_func_payload(
fun: ::std::option::Option<
unsafe extern "C" fn(
arg1: *mut mlx_vector_array,
arg2: mlx_vector_array,
arg3: *mut ::std::os::raw::c_void,
) -> ::std::os::raw::c_int,
>,
payload: *mut ::std::os::raw::c_void,
dtor: ::std::option::Option<unsafe extern "C" fn(arg1: *mut ::std::os::raw::c_void)>,
) -> mlx_closure;
}
unsafe extern "C" {
pub fn mlx_closure_set(cls: *mut mlx_closure, src: mlx_closure) -> ::std::os::raw::c_int;
}
unsafe extern "C" {
pub fn mlx_closure_apply(
res: *mut mlx_vector_array,
cls: mlx_closure,
input: mlx_vector_array,
) -> ::std::os::raw::c_int;
}
unsafe extern "C" {
pub fn mlx_closure_new_unary(
fun: ::std::option::Option<
unsafe extern "C" fn(arg1: *mut mlx_array, arg2: mlx_array) -> ::std::os::raw::c_int,
>,
) -> mlx_closure;
}
#[repr(C)]
#[derive(Copy, Clone)]
pub struct mlx_closure_kwargs_ {
pub ctx: *mut ::std::os::raw::c_void,
}
#[allow(clippy::unnecessary_operation, clippy::identity_op)]
const _: () = {
["Size of mlx_closure_kwargs_"][::std::mem::size_of::<mlx_closure_kwargs_>() - 8usize];
["Alignment of mlx_closure_kwargs_"][::std::mem::align_of::<mlx_closure_kwargs_>() - 8usize];
["Offset of field: mlx_closure_kwargs_::ctx"]
[::std::mem::offset_of!(mlx_closure_kwargs_, ctx) - 0usize];
};
pub type mlx_closure_kwargs = mlx_closure_kwargs_;
unsafe extern "C" {
pub fn mlx_closure_kwargs_new() -> mlx_closure_kwargs;
}
unsafe extern "C" {
pub fn mlx_closure_kwargs_free(cls: mlx_closure_kwargs) -> ::std::os::raw::c_int;
}
unsafe extern "C" {
pub fn mlx_closure_kwargs_new_func(
fun: ::std::option::Option<
unsafe extern "C" fn(
arg1: *mut mlx_vector_array,
arg2: mlx_vector_array,
arg3: mlx_map_string_to_array,
) -> ::std::os::raw::c_int,
>,
) -> mlx_closure_kwargs;
}
unsafe extern "C" {
pub fn mlx_closure_kwargs_new_func_payload(
fun: ::std::option::Option<
unsafe extern "C" fn(
arg1: *mut mlx_vector_array,
arg2: mlx_vector_array,
arg3: mlx_map_string_to_array,
arg4: *mut ::std::os::raw::c_void,
) -> ::std::os::raw::c_int,
>,
payload: *mut ::std::os::raw::c_void,
dtor: ::std::option::Option<unsafe extern "C" fn(arg1: *mut ::std::os::raw::c_void)>,
) -> mlx_closure_kwargs;
}
unsafe extern "C" {
pub fn mlx_closure_kwargs_set(
cls: *mut mlx_closure_kwargs,
src: mlx_closure_kwargs,
) -> ::std::os::raw::c_int;
}
unsafe extern "C" {
pub fn mlx_closure_kwargs_apply(
res: *mut mlx_vector_array,
cls: mlx_closure_kwargs,
input_0: mlx_vector_array,
input_1: mlx_map_string_to_array,
) -> ::std::os::raw::c_int;
}
#[repr(C)]
#[derive(Copy, Clone)]
pub struct mlx_closure_value_and_grad_ {
pub ctx: *mut ::std::os::raw::c_void,
}
#[allow(clippy::unnecessary_operation, clippy::identity_op)]
const _: () = {
["Size of mlx_closure_value_and_grad_"]
[::std::mem::size_of::<mlx_closure_value_and_grad_>() - 8usize];
["Alignment of mlx_closure_value_and_grad_"]
[::std::mem::align_of::<mlx_closure_value_and_grad_>() - 8usize];
["Offset of field: mlx_closure_value_and_grad_::ctx"]
[::std::mem::offset_of!(mlx_closure_value_and_grad_, ctx) - 0usize];
};
pub type mlx_closure_value_and_grad = mlx_closure_value_and_grad_;
unsafe extern "C" {
pub fn mlx_closure_value_and_grad_new() -> mlx_closure_value_and_grad;
}
unsafe extern "C" {
pub fn mlx_closure_value_and_grad_free(cls: mlx_closure_value_and_grad) -> ::std::os::raw::c_int;
}
unsafe extern "C" {
pub fn mlx_closure_value_and_grad_new_func(
fun: ::std::option::Option<
unsafe extern "C" fn(
arg1: *mut mlx_vector_array,
arg2: *mut mlx_vector_array,
arg3: mlx_vector_array,
) -> ::std::os::raw::c_int,
>,
) -> mlx_closure_value_and_grad;
}
unsafe extern "C" {
pub fn mlx_closure_value_and_grad_new_func_payload(
fun: ::std::option::Option<
unsafe extern "C" fn(
arg1: *mut mlx_vector_array,
arg2: *mut mlx_vector_array,
arg3: mlx_vector_array,
arg4: *mut ::std::os::raw::c_void,
) -> ::std::os::raw::c_int,
>,
payload: *mut ::std::os::raw::c_void,
dtor: ::std::option::Option<unsafe extern "C" fn(arg1: *mut ::std::os::raw::c_void)>,
) -> mlx_closure_value_and_grad;
}
unsafe extern "C" {
pub fn mlx_closure_value_and_grad_set(
cls: *mut mlx_closure_value_and_grad,
src: mlx_closure_value_and_grad,
) -> ::std::os::raw::c_int;
}
unsafe extern "C" {
pub fn mlx_closure_value_and_grad_apply(
res_0: *mut mlx_vector_array,
res_1: *mut mlx_vector_array,
cls: mlx_closure_value_and_grad,
input: mlx_vector_array,
) -> ::std::os::raw::c_int;
}
#[repr(C)]
#[derive(Copy, Clone)]
pub struct mlx_closure_custom_ {
pub ctx: *mut ::std::os::raw::c_void,
}
#[allow(clippy::unnecessary_operation, clippy::identity_op)]
const _: () = {
["Size of mlx_closure_custom_"][::std::mem::size_of::<mlx_closure_custom_>() - 8usize];
["Alignment of mlx_closure_custom_"][::std::mem::align_of::<mlx_closure_custom_>() - 8usize];
["Offset of field: mlx_closure_custom_::ctx"]
[::std::mem::offset_of!(mlx_closure_custom_, ctx) - 0usize];
};
pub type mlx_closure_custom = mlx_closure_custom_;
unsafe extern "C" {
pub fn mlx_closure_custom_new() -> mlx_closure_custom;
}
unsafe extern "C" {
pub fn mlx_closure_custom_free(cls: mlx_closure_custom) -> ::std::os::raw::c_int;
}
unsafe extern "C" {
pub fn mlx_closure_custom_new_func(
fun: ::std::option::Option<
unsafe extern "C" fn(
arg1: *mut mlx_vector_array,
arg2: mlx_vector_array,
arg3: mlx_vector_array,
arg4: mlx_vector_array,
) -> ::std::os::raw::c_int,
>,
) -> mlx_closure_custom;
}
unsafe extern "C" {
pub fn mlx_closure_custom_new_func_payload(
fun: ::std::option::Option<
unsafe extern "C" fn(
arg1: *mut mlx_vector_array,
arg2: mlx_vector_array,
arg3: mlx_vector_array,
arg4: mlx_vector_array,
arg5: *mut ::std::os::raw::c_void,
) -> ::std::os::raw::c_int,
>,
payload: *mut ::std::os::raw::c_void,
dtor: ::std::option::Option<unsafe extern "C" fn(arg1: *mut ::std::os::raw::c_void)>,
) -> mlx_closure_custom;
}
unsafe extern "C" {
pub fn mlx_closure_custom_set(
cls: *mut mlx_closure_custom,
src: mlx_closure_custom,
) -> ::std::os::raw::c_int;
}
unsafe extern "C" {
pub fn mlx_closure_custom_apply(
res: *mut mlx_vector_array,
cls: mlx_closure_custom,
input_0: mlx_vector_array,
input_1: mlx_vector_array,
input_2: mlx_vector_array,
) -> ::std::os::raw::c_int;
}
#[repr(C)]
#[derive(Copy, Clone)]
pub struct mlx_closure_custom_jvp_ {
pub ctx: *mut ::std::os::raw::c_void,
}
#[allow(clippy::unnecessary_operation, clippy::identity_op)]
const _: () = {
["Size of mlx_closure_custom_jvp_"][::std::mem::size_of::<mlx_closure_custom_jvp_>() - 8usize];
["Alignment of mlx_closure_custom_jvp_"]
[::std::mem::align_of::<mlx_closure_custom_jvp_>() - 8usize];
["Offset of field: mlx_closure_custom_jvp_::ctx"]
[::std::mem::offset_of!(mlx_closure_custom_jvp_, ctx) - 0usize];
};
pub type mlx_closure_custom_jvp = mlx_closure_custom_jvp_;
unsafe extern "C" {
pub fn mlx_closure_custom_jvp_new() -> mlx_closure_custom_jvp;
}
unsafe extern "C" {
pub fn mlx_closure_custom_jvp_free(cls: mlx_closure_custom_jvp) -> ::std::os::raw::c_int;
}
unsafe extern "C" {
pub fn mlx_closure_custom_jvp_new_func(
fun: ::std::option::Option<
unsafe extern "C" fn(
arg1: *mut mlx_vector_array,
arg2: mlx_vector_array,
arg3: mlx_vector_array,
arg4: *const ::std::os::raw::c_int,
_num: usize,
) -> ::std::os::raw::c_int,
>,
) -> mlx_closure_custom_jvp;
}
unsafe extern "C" {
pub fn mlx_closure_custom_jvp_new_func_payload(
fun: ::std::option::Option<
unsafe extern "C" fn(
arg1: *mut mlx_vector_array,
arg2: mlx_vector_array,
arg3: mlx_vector_array,
arg4: *const ::std::os::raw::c_int,
_num: usize,
arg5: *mut ::std::os::raw::c_void,
) -> ::std::os::raw::c_int,
>,
payload: *mut ::std::os::raw::c_void,
dtor: ::std::option::Option<unsafe extern "C" fn(arg1: *mut ::std::os::raw::c_void)>,
) -> mlx_closure_custom_jvp;
}
unsafe extern "C" {
pub fn mlx_closure_custom_jvp_set(
cls: *mut mlx_closure_custom_jvp,
src: mlx_closure_custom_jvp,
) -> ::std::os::raw::c_int;
}
unsafe extern "C" {
pub fn mlx_closure_custom_jvp_apply(
res: *mut mlx_vector_array,
cls: mlx_closure_custom_jvp,
input_0: mlx_vector_array,
input_1: mlx_vector_array,
input_2: *const ::std::os::raw::c_int,
input_2_num: usize,
) -> ::std::os::raw::c_int;
}
#[repr(C)]
#[derive(Copy, Clone)]
pub struct mlx_closure_custom_vmap_ {
pub ctx: *mut ::std::os::raw::c_void,
}
#[allow(clippy::unnecessary_operation, clippy::identity_op)]
const _: () = {
["Size of mlx_closure_custom_vmap_"][::std::mem::size_of::<mlx_closure_custom_vmap_>() - 8usize];
["Alignment of mlx_closure_custom_vmap_"]
[::std::mem::align_of::<mlx_closure_custom_vmap_>() - 8usize];
["Offset of field: mlx_closure_custom_vmap_::ctx"]
[::std::mem::offset_of!(mlx_closure_custom_vmap_, ctx) - 0usize];
};
pub type mlx_closure_custom_vmap = mlx_closure_custom_vmap_;
unsafe extern "C" {
pub fn mlx_closure_custom_vmap_new() -> mlx_closure_custom_vmap;
}
unsafe extern "C" {
pub fn mlx_closure_custom_vmap_free(cls: mlx_closure_custom_vmap) -> ::std::os::raw::c_int;
}
unsafe extern "C" {
pub fn mlx_closure_custom_vmap_new_func(
fun: ::std::option::Option<
unsafe extern "C" fn(
arg1: *mut mlx_vector_array,
arg2: *mut mlx_vector_int,
arg3: mlx_vector_array,
arg4: *const ::std::os::raw::c_int,
_num: usize,
) -> ::std::os::raw::c_int,
>,
) -> mlx_closure_custom_vmap;
}
unsafe extern "C" {
pub fn mlx_closure_custom_vmap_new_func_payload(
fun: ::std::option::Option<
unsafe extern "C" fn(
arg1: *mut mlx_vector_array,
arg2: *mut mlx_vector_int,
arg3: mlx_vector_array,
arg4: *const ::std::os::raw::c_int,
_num: usize,
arg5: *mut ::std::os::raw::c_void,
) -> ::std::os::raw::c_int,
>,
payload: *mut ::std::os::raw::c_void,
dtor: ::std::option::Option<unsafe extern "C" fn(arg1: *mut ::std::os::raw::c_void)>,
) -> mlx_closure_custom_vmap;
}
unsafe extern "C" {
pub fn mlx_closure_custom_vmap_set(
cls: *mut mlx_closure_custom_vmap,
src: mlx_closure_custom_vmap,
) -> ::std::os::raw::c_int;
}
unsafe extern "C" {
pub fn mlx_closure_custom_vmap_apply(
res_0: *mut mlx_vector_array,
res_1: *mut mlx_vector_int,
cls: mlx_closure_custom_vmap,
input_0: mlx_vector_array,
input_1: *const ::std::os::raw::c_int,
input_1_num: usize,
) -> ::std::os::raw::c_int;
}
pub type fpos_t = __darwin_off_t;
#[repr(C)]
#[derive(Copy, Clone)]
pub struct mlx_distributed_group_ {
pub ctx: *mut ::std::os::raw::c_void,
}
#[allow(clippy::unnecessary_operation, clippy::identity_op)]
const _: () = {
["Size of mlx_distributed_group_"][::std::mem::size_of::<mlx_distributed_group_>() - 8usize];
["Alignment of mlx_distributed_group_"]
[::std::mem::align_of::<mlx_distributed_group_>() - 8usize];
["Offset of field: mlx_distributed_group_::ctx"]
[::std::mem::offset_of!(mlx_distributed_group_, ctx) - 0usize];
};
pub type mlx_distributed_group = mlx_distributed_group_;
unsafe extern "C" {
pub fn mlx_distributed_group_new() -> mlx_distributed_group;
}
unsafe extern "C" {
pub fn mlx_distributed_group_free(group: mlx_distributed_group) -> ::std::os::raw::c_int;
}
unsafe extern "C" {
pub fn mlx_distributed_init(
res: *mut mlx_distributed_group,
strict: bool,
bk: *const ::std::os::raw::c_char,
) -> ::std::os::raw::c_int;
}
unsafe extern "C" {
pub fn mlx_distributed_group_rank(group: mlx_distributed_group) -> ::std::os::raw::c_int;
}
unsafe extern "C" {
pub fn mlx_distributed_group_size(group: mlx_distributed_group) -> ::std::os::raw::c_int;
}
unsafe extern "C" {
pub fn mlx_distributed_group_split(
res: *mut mlx_distributed_group,
group: mlx_distributed_group,
color: ::std::os::raw::c_int,
key: ::std::os::raw::c_int,
) -> ::std::os::raw::c_int;
}
unsafe extern "C" {
pub fn mlx_distributed_is_available(bk: *const ::std::os::raw::c_char) -> bool;
}
#[repr(C)]
#[derive(Copy, Clone)]
pub struct mlx_io_reader_ {
pub ctx: *mut ::std::os::raw::c_void,
}
#[allow(clippy::unnecessary_operation, clippy::identity_op)]
const _: () = {
["Size of mlx_io_reader_"][::std::mem::size_of::<mlx_io_reader_>() - 8usize];
["Alignment of mlx_io_reader_"][::std::mem::align_of::<mlx_io_reader_>() - 8usize];
["Offset of field: mlx_io_reader_::ctx"][::std::mem::offset_of!(mlx_io_reader_, ctx) - 0usize];
};
pub type mlx_io_reader = mlx_io_reader_;
#[repr(C)]
#[derive(Copy, Clone)]
pub struct mlx_io_writer_ {
pub ctx: *mut ::std::os::raw::c_void,
}
#[allow(clippy::unnecessary_operation, clippy::identity_op)]
const _: () = {
["Size of mlx_io_writer_"][::std::mem::size_of::<mlx_io_writer_>() - 8usize];
["Alignment of mlx_io_writer_"][::std::mem::align_of::<mlx_io_writer_>() - 8usize];
["Offset of field: mlx_io_writer_::ctx"][::std::mem::offset_of!(mlx_io_writer_, ctx) - 0usize];
};
pub type mlx_io_writer = mlx_io_writer_;
#[repr(C)]
#[derive(Copy, Clone)]
pub struct mlx_io_vtable_ {
pub is_open:
::std::option::Option<unsafe extern "C" fn(arg1: *mut ::std::os::raw::c_void) -> bool>,
pub good: ::std::option::Option<unsafe extern "C" fn(arg1: *mut ::std::os::raw::c_void) -> bool>,
pub tell: ::std::option::Option<unsafe extern "C" fn(arg1: *mut ::std::os::raw::c_void) -> usize>,
pub seek: ::std::option::Option<
unsafe extern "C" fn(
arg1: *mut ::std::os::raw::c_void,
off: i64,
whence: ::std::os::raw::c_int,
),
>,
pub read: ::std::option::Option<
unsafe extern "C" fn(
arg1: *mut ::std::os::raw::c_void,
data: *mut ::std::os::raw::c_char,
n: usize,
),
>,
pub read_at_offset: ::std::option::Option<
unsafe extern "C" fn(
arg1: *mut ::std::os::raw::c_void,
data: *mut ::std::os::raw::c_char,
n: usize,
off: usize,
),
>,
pub write: ::std::option::Option<
unsafe extern "C" fn(
arg1: *mut ::std::os::raw::c_void,
data: *const ::std::os::raw::c_char,
n: usize,
),
>,
pub label: ::std::option::Option<
unsafe extern "C" fn(arg1: *mut ::std::os::raw::c_void) -> *const ::std::os::raw::c_char,
>,
pub free: ::std::option::Option<unsafe extern "C" fn(arg1: *mut ::std::os::raw::c_void)>,
}
#[allow(clippy::unnecessary_operation, clippy::identity_op)]
const _: () = {
["Size of mlx_io_vtable_"][::std::mem::size_of::<mlx_io_vtable_>() - 72usize];
["Alignment of mlx_io_vtable_"][::std::mem::align_of::<mlx_io_vtable_>() - 8usize];
["Offset of field: mlx_io_vtable_::is_open"]
[::std::mem::offset_of!(mlx_io_vtable_, is_open) - 0usize];
["Offset of field: mlx_io_vtable_::good"][::std::mem::offset_of!(mlx_io_vtable_, good) - 8usize];
["Offset of field: mlx_io_vtable_::tell"][::std::mem::offset_of!(mlx_io_vtable_, tell) - 16usize];
["Offset of field: mlx_io_vtable_::seek"][::std::mem::offset_of!(mlx_io_vtable_, seek) - 24usize];
["Offset of field: mlx_io_vtable_::read"][::std::mem::offset_of!(mlx_io_vtable_, read) - 32usize];
["Offset of field: mlx_io_vtable_::read_at_offset"]
[::std::mem::offset_of!(mlx_io_vtable_, read_at_offset) - 40usize];
["Offset of field: mlx_io_vtable_::write"]
[::std::mem::offset_of!(mlx_io_vtable_, write) - 48usize];
["Offset of field: mlx_io_vtable_::label"]
[::std::mem::offset_of!(mlx_io_vtable_, label) - 56usize];
["Offset of field: mlx_io_vtable_::free"][::std::mem::offset_of!(mlx_io_vtable_, free) - 64usize];
};
pub type mlx_io_vtable = mlx_io_vtable_;
unsafe extern "C" {
pub fn mlx_io_reader_new(
desc: *mut ::std::os::raw::c_void,
vtable: mlx_io_vtable,
) -> mlx_io_reader;
}
unsafe extern "C" {
pub fn mlx_io_reader_descriptor(
desc_: *mut *mut ::std::os::raw::c_void,
io: mlx_io_reader,
) -> ::std::os::raw::c_int;
}
unsafe extern "C" {
pub fn mlx_io_reader_tostring(str_: *mut mlx_string, io: mlx_io_reader) -> ::std::os::raw::c_int;
}
unsafe extern "C" {
pub fn mlx_io_reader_free(io: mlx_io_reader) -> ::std::os::raw::c_int;
}
unsafe extern "C" {
pub fn mlx_io_writer_new(
desc: *mut ::std::os::raw::c_void,
vtable: mlx_io_vtable,
) -> mlx_io_writer;
}
unsafe extern "C" {
pub fn mlx_io_writer_descriptor(
desc_: *mut *mut ::std::os::raw::c_void,
io: mlx_io_writer,
) -> ::std::os::raw::c_int;
}
unsafe extern "C" {
pub fn mlx_io_writer_tostring(str_: *mut mlx_string, io: mlx_io_writer) -> ::std::os::raw::c_int;
}
unsafe extern "C" {
pub fn mlx_io_writer_free(io: mlx_io_writer) -> ::std::os::raw::c_int;
}
#[repr(C)]
#[derive(Copy, Clone)]
pub struct mlx_io_gguf_ {
pub ctx: *mut ::std::os::raw::c_void,
}
#[allow(clippy::unnecessary_operation, clippy::identity_op)]
const _: () = {
["Size of mlx_io_gguf_"][::std::mem::size_of::<mlx_io_gguf_>() - 8usize];
["Alignment of mlx_io_gguf_"][::std::mem::align_of::<mlx_io_gguf_>() - 8usize];
["Offset of field: mlx_io_gguf_::ctx"][::std::mem::offset_of!(mlx_io_gguf_, ctx) - 0usize];
};
pub type mlx_io_gguf = mlx_io_gguf_;
unsafe extern "C" {
pub fn mlx_io_gguf_new() -> mlx_io_gguf;
}
unsafe extern "C" {
pub fn mlx_io_gguf_free(io: mlx_io_gguf) -> ::std::os::raw::c_int;
}
unsafe extern "C" {
pub fn mlx_io_gguf_get_keys(
keys: *mut mlx_vector_string,
io: mlx_io_gguf,
) -> ::std::os::raw::c_int;
}
unsafe extern "C" {
pub fn mlx_io_gguf_get_array(
arr: *mut mlx_array,
io: mlx_io_gguf,
key: *const ::std::os::raw::c_char,
) -> ::std::os::raw::c_int;
}
unsafe extern "C" {
pub fn mlx_io_gguf_get_metadata_array(
arr: *mut mlx_array,
io: mlx_io_gguf,
key: *const ::std::os::raw::c_char,
) -> ::std::os::raw::c_int;
}
unsafe extern "C" {
pub fn mlx_io_gguf_get_metadata_string(
str_: *mut mlx_string,
io: mlx_io_gguf,
key: *const ::std::os::raw::c_char,
) -> ::std::os::raw::c_int;
}
unsafe extern "C" {
pub fn mlx_io_gguf_get_metadata_vector_string(
vstr: *mut mlx_vector_string,
io: mlx_io_gguf,
key: *const ::std::os::raw::c_char,
) -> ::std::os::raw::c_int;
}
unsafe extern "C" {
pub fn mlx_io_gguf_has_metadata_array(
flag: *mut bool,
io: mlx_io_gguf,
key: *const ::std::os::raw::c_char,
) -> ::std::os::raw::c_int;
}
unsafe extern "C" {
pub fn mlx_io_gguf_has_metadata_string(
flag: *mut bool,
io: mlx_io_gguf,
key: *const ::std::os::raw::c_char,
) -> ::std::os::raw::c_int;
}
unsafe extern "C" {
pub fn mlx_io_gguf_has_metadata_vector_string(
flag: *mut bool,
io: mlx_io_gguf,
key: *const ::std::os::raw::c_char,
) -> ::std::os::raw::c_int;
}
unsafe extern "C" {
pub fn mlx_io_gguf_set_array(
io: mlx_io_gguf,
key: *const ::std::os::raw::c_char,
arr: mlx_array,
) -> ::std::os::raw::c_int;
}
unsafe extern "C" {
pub fn mlx_io_gguf_set_metadata_array(
io: mlx_io_gguf,
key: *const ::std::os::raw::c_char,
marr: mlx_array,
) -> ::std::os::raw::c_int;
}
unsafe extern "C" {
pub fn mlx_io_gguf_set_metadata_string(
io: mlx_io_gguf,
key: *const ::std::os::raw::c_char,
mstr: *const ::std::os::raw::c_char,
) -> ::std::os::raw::c_int;
}
unsafe extern "C" {
pub fn mlx_io_gguf_set_metadata_vector_string(
io: mlx_io_gguf,
key: *const ::std::os::raw::c_char,
mvstr: mlx_vector_string,
) -> ::std::os::raw::c_int;
}
pub const mlx_compile_mode__MLX_COMPILE_MODE_DISABLED: mlx_compile_mode_ = 0;
pub const mlx_compile_mode__MLX_COMPILE_MODE_NO_SIMPLIFY: mlx_compile_mode_ = 1;
pub const mlx_compile_mode__MLX_COMPILE_MODE_NO_FUSE: mlx_compile_mode_ = 2;
pub const mlx_compile_mode__MLX_COMPILE_MODE_ENABLED: mlx_compile_mode_ = 3;
pub type mlx_compile_mode_ = ::std::os::raw::c_uint;
pub use self::mlx_compile_mode_ as mlx_compile_mode;
unsafe extern "C" {
pub fn mlx_compile(
res: *mut mlx_closure,
fun: mlx_closure,
shapeless: bool,
) -> ::std::os::raw::c_int;
}
unsafe extern "C" {
pub fn mlx_detail_compile(
res: *mut mlx_closure,
fun: mlx_closure,
fun_id: usize,
shapeless: bool,
constants: *const u64,
constants_num: usize,
) -> ::std::os::raw::c_int;
}
unsafe extern "C" {
pub fn mlx_detail_compile_clear_cache() -> ::std::os::raw::c_int;
}
unsafe extern "C" {
pub fn mlx_detail_compile_erase(fun_id: usize) -> ::std::os::raw::c_int;
}
unsafe extern "C" {
pub fn mlx_disable_compile() -> ::std::os::raw::c_int;
}
unsafe extern "C" {
pub fn mlx_enable_compile() -> ::std::os::raw::c_int;
}
unsafe extern "C" {
pub fn mlx_set_compile_mode(mode: mlx_compile_mode) -> ::std::os::raw::c_int;
}
unsafe extern "C" {
pub fn mlx_cuda_is_available(res: *mut bool) -> ::std::os::raw::c_int;
}
unsafe extern "C" {
pub fn mlx_distributed_all_gather(
res: *mut mlx_array,
x: mlx_array,
group: mlx_distributed_group,
S: mlx_stream,
) -> ::std::os::raw::c_int;
}
unsafe extern "C" {
pub fn mlx_distributed_all_max(
res: *mut mlx_array,
x: mlx_array,
group: mlx_distributed_group,
s: mlx_stream,
) -> ::std::os::raw::c_int;
}
unsafe extern "C" {
pub fn mlx_distributed_all_min(
res: *mut mlx_array,
x: mlx_array,
group: mlx_distributed_group,
s: mlx_stream,
) -> ::std::os::raw::c_int;
}
unsafe extern "C" {
pub fn mlx_distributed_all_sum(
res: *mut mlx_array,
x: mlx_array,
group: mlx_distributed_group,
s: mlx_stream,
) -> ::std::os::raw::c_int;
}
unsafe extern "C" {
pub fn mlx_distributed_recv(
res: *mut mlx_array,
shape: *const ::std::os::raw::c_int,
shape_num: usize,
dtype: mlx_dtype,
src: ::std::os::raw::c_int,
group: mlx_distributed_group,
s: mlx_stream,
) -> ::std::os::raw::c_int;
}
unsafe extern "C" {
pub fn mlx_distributed_recv_like(
res: *mut mlx_array,
x: mlx_array,
src: ::std::os::raw::c_int,
group: mlx_distributed_group,
s: mlx_stream,
) -> ::std::os::raw::c_int;
}
unsafe extern "C" {
pub fn mlx_distributed_send(
res: *mut mlx_array,
x: mlx_array,
dst: ::std::os::raw::c_int,
group: mlx_distributed_group,
s: mlx_stream,
) -> ::std::os::raw::c_int;
}
unsafe extern "C" {
pub fn mlx_distributed_sum_scatter(
res: *mut mlx_array,
x: mlx_array,
group: mlx_distributed_group,
s: mlx_stream,
) -> ::std::os::raw::c_int;
}
pub type mlx_error_handler_func = ::std::option::Option<
unsafe extern "C" fn(msg: *const ::std::os::raw::c_char, data: *mut ::std::os::raw::c_void),
>;
unsafe extern "C" {
pub fn mlx_set_error_handler(
handler: mlx_error_handler_func,
data: *mut ::std::os::raw::c_void,
dtor: ::std::option::Option<unsafe extern "C" fn(arg1: *mut ::std::os::raw::c_void)>,
);
}
unsafe extern "C" {
pub fn mlx_export_function(
file: *const ::std::os::raw::c_char,
fun: mlx_closure,
args: mlx_vector_array,
shapeless: bool,
) -> ::std::os::raw::c_int;
}
unsafe extern "C" {
pub fn mlx_export_function_kwargs(
file: *const ::std::os::raw::c_char,
fun: mlx_closure_kwargs,
args: mlx_vector_array,
kwargs: mlx_map_string_to_array,
shapeless: bool,
) -> ::std::os::raw::c_int;
}
#[repr(C)]
#[derive(Copy, Clone)]
pub struct mlx_function_exporter_ {
pub ctx: *mut ::std::os::raw::c_void,
}
#[allow(clippy::unnecessary_operation, clippy::identity_op)]
const _: () = {
["Size of mlx_function_exporter_"][::std::mem::size_of::<mlx_function_exporter_>() - 8usize];
["Alignment of mlx_function_exporter_"]
[::std::mem::align_of::<mlx_function_exporter_>() - 8usize];
["Offset of field: mlx_function_exporter_::ctx"]
[::std::mem::offset_of!(mlx_function_exporter_, ctx) - 0usize];
};
pub type mlx_function_exporter = mlx_function_exporter_;
unsafe extern "C" {
pub fn mlx_function_exporter_new(
file: *const ::std::os::raw::c_char,
fun: mlx_closure,
shapeless: bool,
) -> mlx_function_exporter;
}
unsafe extern "C" {
pub fn mlx_function_exporter_free(xfunc: mlx_function_exporter) -> ::std::os::raw::c_int;
}
unsafe extern "C" {
pub fn mlx_function_exporter_apply(
xfunc: mlx_function_exporter,
args: mlx_vector_array,
) -> ::std::os::raw::c_int;
}
unsafe extern "C" {
pub fn mlx_function_exporter_apply_kwargs(
xfunc: mlx_function_exporter,
args: mlx_vector_array,
kwargs: mlx_map_string_to_array,
) -> ::std::os::raw::c_int;
}
#[repr(C)]
#[derive(Copy, Clone)]
pub struct mlx_imported_function_ {
pub ctx: *mut ::std::os::raw::c_void,
}
#[allow(clippy::unnecessary_operation, clippy::identity_op)]
const _: () = {
["Size of mlx_imported_function_"][::std::mem::size_of::<mlx_imported_function_>() - 8usize];
["Alignment of mlx_imported_function_"]
[::std::mem::align_of::<mlx_imported_function_>() - 8usize];
["Offset of field: mlx_imported_function_::ctx"]
[::std::mem::offset_of!(mlx_imported_function_, ctx) - 0usize];
};
pub type mlx_imported_function = mlx_imported_function_;
unsafe extern "C" {
pub fn mlx_imported_function_new(file: *const ::std::os::raw::c_char) -> mlx_imported_function;
}
unsafe extern "C" {
pub fn mlx_imported_function_free(xfunc: mlx_imported_function) -> ::std::os::raw::c_int;
}
unsafe extern "C" {
pub fn mlx_imported_function_apply(
res: *mut mlx_vector_array,
xfunc: mlx_imported_function,
args: mlx_vector_array,
) -> ::std::os::raw::c_int;
}
unsafe extern "C" {
pub fn mlx_imported_function_apply_kwargs(
res: *mut mlx_vector_array,
xfunc: mlx_imported_function,
args: mlx_vector_array,
kwargs: mlx_map_string_to_array,
) -> ::std::os::raw::c_int;
}
#[repr(C)]
#[derive(Copy, Clone)]
pub struct mlx_fast_cuda_kernel_config_ {
pub ctx: *mut ::std::os::raw::c_void,
}
#[allow(clippy::unnecessary_operation, clippy::identity_op)]
const _: () = {
["Size of mlx_fast_cuda_kernel_config_"]
[::std::mem::size_of::<mlx_fast_cuda_kernel_config_>() - 8usize];
["Alignment of mlx_fast_cuda_kernel_config_"]
[::std::mem::align_of::<mlx_fast_cuda_kernel_config_>() - 8usize];
["Offset of field: mlx_fast_cuda_kernel_config_::ctx"]
[::std::mem::offset_of!(mlx_fast_cuda_kernel_config_, ctx) - 0usize];
};
pub type mlx_fast_cuda_kernel_config = mlx_fast_cuda_kernel_config_;
unsafe extern "C" {
pub fn mlx_fast_cuda_kernel_config_new() -> mlx_fast_cuda_kernel_config;
}
unsafe extern "C" {
pub fn mlx_fast_cuda_kernel_config_free(cls: mlx_fast_cuda_kernel_config);
}
unsafe extern "C" {
pub fn mlx_fast_cuda_kernel_config_add_output_arg(
cls: mlx_fast_cuda_kernel_config,
shape: *const ::std::os::raw::c_int,
size: usize,
dtype: mlx_dtype,
) -> ::std::os::raw::c_int;
}
unsafe extern "C" {
pub fn mlx_fast_cuda_kernel_config_set_grid(
cls: mlx_fast_cuda_kernel_config,
grid1: ::std::os::raw::c_int,
grid2: ::std::os::raw::c_int,
grid3: ::std::os::raw::c_int,
) -> ::std::os::raw::c_int;
}
unsafe extern "C" {
pub fn mlx_fast_cuda_kernel_config_set_thread_group(
cls: mlx_fast_cuda_kernel_config,
thread1: ::std::os::raw::c_int,
thread2: ::std::os::raw::c_int,
thread3: ::std::os::raw::c_int,
) -> ::std::os::raw::c_int;
}
unsafe extern "C" {
pub fn mlx_fast_cuda_kernel_config_set_init_value(
cls: mlx_fast_cuda_kernel_config,
value: f32,
) -> ::std::os::raw::c_int;
}
unsafe extern "C" {
pub fn mlx_fast_cuda_kernel_config_set_verbose(
cls: mlx_fast_cuda_kernel_config,
verbose: bool,
) -> ::std::os::raw::c_int;
}
unsafe extern "C" {
pub fn mlx_fast_cuda_kernel_config_add_template_arg_dtype(
cls: mlx_fast_cuda_kernel_config,
name: *const ::std::os::raw::c_char,
dtype: mlx_dtype,
) -> ::std::os::raw::c_int;
}
unsafe extern "C" {
pub fn mlx_fast_cuda_kernel_config_add_template_arg_int(
cls: mlx_fast_cuda_kernel_config,
name: *const ::std::os::raw::c_char,
value: ::std::os::raw::c_int,
) -> ::std::os::raw::c_int;
}
unsafe extern "C" {
pub fn mlx_fast_cuda_kernel_config_add_template_arg_bool(
cls: mlx_fast_cuda_kernel_config,
name: *const ::std::os::raw::c_char,
value: bool,
) -> ::std::os::raw::c_int;
}
#[repr(C)]
#[derive(Copy, Clone)]
pub struct mlx_fast_cuda_kernel_ {
pub ctx: *mut ::std::os::raw::c_void,
}
#[allow(clippy::unnecessary_operation, clippy::identity_op)]
const _: () = {
["Size of mlx_fast_cuda_kernel_"][::std::mem::size_of::<mlx_fast_cuda_kernel_>() - 8usize];
["Alignment of mlx_fast_cuda_kernel_"][::std::mem::align_of::<mlx_fast_cuda_kernel_>() - 8usize];
["Offset of field: mlx_fast_cuda_kernel_::ctx"]
[::std::mem::offset_of!(mlx_fast_cuda_kernel_, ctx) - 0usize];
};
pub type mlx_fast_cuda_kernel = mlx_fast_cuda_kernel_;
unsafe extern "C" {
pub fn mlx_fast_cuda_kernel_new(
name: *const ::std::os::raw::c_char,
input_names: mlx_vector_string,
output_names: mlx_vector_string,
source: *const ::std::os::raw::c_char,
header: *const ::std::os::raw::c_char,
ensure_row_contiguous: bool,
shared_memory: ::std::os::raw::c_int,
) -> mlx_fast_cuda_kernel;
}
unsafe extern "C" {
pub fn mlx_fast_cuda_kernel_free(cls: mlx_fast_cuda_kernel);
}
unsafe extern "C" {
pub fn mlx_fast_cuda_kernel_apply(
outputs: *mut mlx_vector_array,
cls: mlx_fast_cuda_kernel,
inputs: mlx_vector_array,
config: mlx_fast_cuda_kernel_config,
stream: mlx_stream,
) -> ::std::os::raw::c_int;
}
unsafe extern "C" {
pub fn mlx_fast_layer_norm(
res: *mut mlx_array,
x: mlx_array,
weight: mlx_array,
bias: mlx_array,
eps: f32,
s: mlx_stream,
) -> ::std::os::raw::c_int;
}
#[repr(C)]
#[derive(Copy, Clone)]
pub struct mlx_fast_metal_kernel_config_ {
pub ctx: *mut ::std::os::raw::c_void,
}
#[allow(clippy::unnecessary_operation, clippy::identity_op)]
const _: () = {
["Size of mlx_fast_metal_kernel_config_"]
[::std::mem::size_of::<mlx_fast_metal_kernel_config_>() - 8usize];
["Alignment of mlx_fast_metal_kernel_config_"]
[::std::mem::align_of::<mlx_fast_metal_kernel_config_>() - 8usize];
["Offset of field: mlx_fast_metal_kernel_config_::ctx"]
[::std::mem::offset_of!(mlx_fast_metal_kernel_config_, ctx) - 0usize];
};
pub type mlx_fast_metal_kernel_config = mlx_fast_metal_kernel_config_;
unsafe extern "C" {
pub fn mlx_fast_metal_kernel_config_new() -> mlx_fast_metal_kernel_config;
}
unsafe extern "C" {
pub fn mlx_fast_metal_kernel_config_free(cls: mlx_fast_metal_kernel_config);
}
unsafe extern "C" {
pub fn mlx_fast_metal_kernel_config_add_output_arg(
cls: mlx_fast_metal_kernel_config,
shape: *const ::std::os::raw::c_int,
size: usize,
dtype: mlx_dtype,
) -> ::std::os::raw::c_int;
}
unsafe extern "C" {
pub fn mlx_fast_metal_kernel_config_set_grid(
cls: mlx_fast_metal_kernel_config,
grid1: ::std::os::raw::c_int,
grid2: ::std::os::raw::c_int,
grid3: ::std::os::raw::c_int,
) -> ::std::os::raw::c_int;
}
unsafe extern "C" {
pub fn mlx_fast_metal_kernel_config_set_thread_group(
cls: mlx_fast_metal_kernel_config,
thread1: ::std::os::raw::c_int,
thread2: ::std::os::raw::c_int,
thread3: ::std::os::raw::c_int,
) -> ::std::os::raw::c_int;
}
unsafe extern "C" {
pub fn mlx_fast_metal_kernel_config_set_init_value(
cls: mlx_fast_metal_kernel_config,
value: f32,
) -> ::std::os::raw::c_int;
}
unsafe extern "C" {
pub fn mlx_fast_metal_kernel_config_set_verbose(
cls: mlx_fast_metal_kernel_config,
verbose: bool,
) -> ::std::os::raw::c_int;
}
unsafe extern "C" {
pub fn mlx_fast_metal_kernel_config_add_template_arg_dtype(
cls: mlx_fast_metal_kernel_config,
name: *const ::std::os::raw::c_char,
dtype: mlx_dtype,
) -> ::std::os::raw::c_int;
}
unsafe extern "C" {
pub fn mlx_fast_metal_kernel_config_add_template_arg_int(
cls: mlx_fast_metal_kernel_config,
name: *const ::std::os::raw::c_char,
value: ::std::os::raw::c_int,
) -> ::std::os::raw::c_int;
}
unsafe extern "C" {
pub fn mlx_fast_metal_kernel_config_add_template_arg_bool(
cls: mlx_fast_metal_kernel_config,
name: *const ::std::os::raw::c_char,
value: bool,
) -> ::std::os::raw::c_int;
}
#[repr(C)]
#[derive(Copy, Clone)]
pub struct mlx_fast_metal_kernel_ {
pub ctx: *mut ::std::os::raw::c_void,
}
#[allow(clippy::unnecessary_operation, clippy::identity_op)]
const _: () = {
["Size of mlx_fast_metal_kernel_"][::std::mem::size_of::<mlx_fast_metal_kernel_>() - 8usize];
["Alignment of mlx_fast_metal_kernel_"]
[::std::mem::align_of::<mlx_fast_metal_kernel_>() - 8usize];
["Offset of field: mlx_fast_metal_kernel_::ctx"]
[::std::mem::offset_of!(mlx_fast_metal_kernel_, ctx) - 0usize];
};
pub type mlx_fast_metal_kernel = mlx_fast_metal_kernel_;
unsafe extern "C" {
pub fn mlx_fast_metal_kernel_new(
name: *const ::std::os::raw::c_char,
input_names: mlx_vector_string,
output_names: mlx_vector_string,
source: *const ::std::os::raw::c_char,
header: *const ::std::os::raw::c_char,
ensure_row_contiguous: bool,
atomic_outputs: bool,
) -> mlx_fast_metal_kernel;
}
unsafe extern "C" {
pub fn mlx_fast_metal_kernel_free(cls: mlx_fast_metal_kernel);
}
unsafe extern "C" {
pub fn mlx_fast_metal_kernel_apply(
outputs: *mut mlx_vector_array,
cls: mlx_fast_metal_kernel,
inputs: mlx_vector_array,
config: mlx_fast_metal_kernel_config,
stream: mlx_stream,
) -> ::std::os::raw::c_int;
}
unsafe extern "C" {
pub fn mlx_fast_rms_norm(
res: *mut mlx_array,
x: mlx_array,
weight: mlx_array,
eps: f32,
s: mlx_stream,
) -> ::std::os::raw::c_int;
}
unsafe extern "C" {
pub fn mlx_fast_rope(
res: *mut mlx_array,
x: mlx_array,
dims: ::std::os::raw::c_int,
traditional: bool,
base: mlx_optional_float,
scale: f32,
offset: ::std::os::raw::c_int,
freqs: mlx_array,
s: mlx_stream,
) -> ::std::os::raw::c_int;
}
unsafe extern "C" {
pub fn mlx_fast_rope_dynamic(
res: *mut mlx_array,
x: mlx_array,
dims: ::std::os::raw::c_int,
traditional: bool,
base: mlx_optional_float,
scale: f32,
offset: mlx_array,
freqs: mlx_array,
s: mlx_stream,
) -> ::std::os::raw::c_int;
}
unsafe extern "C" {
pub fn mlx_fast_scaled_dot_product_attention(
res: *mut mlx_array,
queries: mlx_array,
keys: mlx_array,
values: mlx_array,
scale: f32,
mask_mode: *const ::std::os::raw::c_char,
mask_arr: mlx_array,
sinks: mlx_array,
s: mlx_stream,
) -> ::std::os::raw::c_int;
}
pub const mlx_fft_norm__MLX_FFT_NORM_BACKWARD: mlx_fft_norm_ = 0;
pub const mlx_fft_norm__MLX_FFT_NORM_ORTHO: mlx_fft_norm_ = 1;
pub const mlx_fft_norm__MLX_FFT_NORM_FORWARD: mlx_fft_norm_ = 2;
pub type mlx_fft_norm_ = ::std::os::raw::c_uint;
pub use self::mlx_fft_norm_ as mlx_fft_norm;
unsafe extern "C" {
pub fn mlx_fft_fft(
res: *mut mlx_array,
a: mlx_array,
n: ::std::os::raw::c_int,
axis: ::std::os::raw::c_int,
norm: mlx_fft_norm,
s: mlx_stream,
) -> ::std::os::raw::c_int;
}
unsafe extern "C" {
pub fn mlx_fft_fft2(
res: *mut mlx_array,
a: mlx_array,
n: *const ::std::os::raw::c_int,
n_num: usize,
axes: *const ::std::os::raw::c_int,
axes_num: usize,
norm: mlx_fft_norm,
s: mlx_stream,
) -> ::std::os::raw::c_int;
}
unsafe extern "C" {
pub fn mlx_fft_fftfreq(
res: *mut mlx_array,
n: ::std::os::raw::c_int,
d: f64,
s: mlx_stream,
) -> ::std::os::raw::c_int;
}
unsafe extern "C" {
pub fn mlx_fft_fftn(
res: *mut mlx_array,
a: mlx_array,
n: *const ::std::os::raw::c_int,
n_num: usize,
axes: *const ::std::os::raw::c_int,
axes_num: usize,
norm: mlx_fft_norm,
s: mlx_stream,
) -> ::std::os::raw::c_int;
}
unsafe extern "C" {
pub fn mlx_fft_fftshift(
res: *mut mlx_array,
a: mlx_array,
axes: *const ::std::os::raw::c_int,
axes_num: usize,
s: mlx_stream,
) -> ::std::os::raw::c_int;
}
unsafe extern "C" {
pub fn mlx_fft_ifft(
res: *mut mlx_array,
a: mlx_array,
n: ::std::os::raw::c_int,
axis: ::std::os::raw::c_int,
norm: mlx_fft_norm,
s: mlx_stream,
) -> ::std::os::raw::c_int;
}
unsafe extern "C" {
pub fn mlx_fft_ifft2(
res: *mut mlx_array,
a: mlx_array,
n: *const ::std::os::raw::c_int,
n_num: usize,
axes: *const ::std::os::raw::c_int,
axes_num: usize,
norm: mlx_fft_norm,
s: mlx_stream,
) -> ::std::os::raw::c_int;
}
unsafe extern "C" {
pub fn mlx_fft_ifftn(
res: *mut mlx_array,
a: mlx_array,
n: *const ::std::os::raw::c_int,
n_num: usize,
axes: *const ::std::os::raw::c_int,
axes_num: usize,
norm: mlx_fft_norm,
s: mlx_stream,
) -> ::std::os::raw::c_int;
}
unsafe extern "C" {
pub fn mlx_fft_ifftshift(
res: *mut mlx_array,
a: mlx_array,
axes: *const ::std::os::raw::c_int,
axes_num: usize,
s: mlx_stream,
) -> ::std::os::raw::c_int;
}
unsafe extern "C" {
pub fn mlx_fft_irfft(
res: *mut mlx_array,
a: mlx_array,
n: ::std::os::raw::c_int,
axis: ::std::os::raw::c_int,
norm: mlx_fft_norm,
s: mlx_stream,
) -> ::std::os::raw::c_int;
}
unsafe extern "C" {
pub fn mlx_fft_irfft2(
res: *mut mlx_array,
a: mlx_array,
n: *const ::std::os::raw::c_int,
n_num: usize,
axes: *const ::std::os::raw::c_int,
axes_num: usize,
norm: mlx_fft_norm,
s: mlx_stream,
) -> ::std::os::raw::c_int;
}
unsafe extern "C" {
pub fn mlx_fft_irfftn(
res: *mut mlx_array,
a: mlx_array,
n: *const ::std::os::raw::c_int,
n_num: usize,
axes: *const ::std::os::raw::c_int,
axes_num: usize,
norm: mlx_fft_norm,
s: mlx_stream,
) -> ::std::os::raw::c_int;
}
unsafe extern "C" {
pub fn mlx_fft_rfft(
res: *mut mlx_array,
a: mlx_array,
n: ::std::os::raw::c_int,
axis: ::std::os::raw::c_int,
norm: mlx_fft_norm,
s: mlx_stream,
) -> ::std::os::raw::c_int;
}
unsafe extern "C" {
pub fn mlx_fft_rfft2(
res: *mut mlx_array,
a: mlx_array,
n: *const ::std::os::raw::c_int,
n_num: usize,
axes: *const ::std::os::raw::c_int,
axes_num: usize,
norm: mlx_fft_norm,
s: mlx_stream,
) -> ::std::os::raw::c_int;
}
unsafe extern "C" {
pub fn mlx_fft_rfftfreq(
res: *mut mlx_array,
n: ::std::os::raw::c_int,
d: f64,
s: mlx_stream,
) -> ::std::os::raw::c_int;
}
unsafe extern "C" {
pub fn mlx_fft_rfftn(
res: *mut mlx_array,
a: mlx_array,
n: *const ::std::os::raw::c_int,
n_num: usize,
axes: *const ::std::os::raw::c_int,
axes_num: usize,
norm: mlx_fft_norm,
s: mlx_stream,
) -> ::std::os::raw::c_int;
}
#[repr(C)]
#[derive(Copy, Clone)]
pub struct mlx_node_namer_ {
pub ctx: *mut ::std::os::raw::c_void,
}
#[allow(clippy::unnecessary_operation, clippy::identity_op)]
const _: () = {
["Size of mlx_node_namer_"][::std::mem::size_of::<mlx_node_namer_>() - 8usize];
["Alignment of mlx_node_namer_"][::std::mem::align_of::<mlx_node_namer_>() - 8usize];
["Offset of field: mlx_node_namer_::ctx"][::std::mem::offset_of!(mlx_node_namer_, ctx) - 0usize];
};
pub type mlx_node_namer = mlx_node_namer_;
unsafe extern "C" {
pub fn mlx_node_namer_new() -> mlx_node_namer;
}
unsafe extern "C" {
pub fn mlx_node_namer_free(namer: mlx_node_namer) -> ::std::os::raw::c_int;
}
unsafe extern "C" {
pub fn mlx_node_namer_set_name(
namer: mlx_node_namer,
arr: mlx_array,
name: *const ::std::os::raw::c_char,
) -> ::std::os::raw::c_int;
}
unsafe extern "C" {
pub fn mlx_node_namer_get_name(
name: *mut *const ::std::os::raw::c_char,
namer: mlx_node_namer,
arr: mlx_array,
) -> ::std::os::raw::c_int;
}
unsafe extern "C" {
pub fn mlx_export_to_dot(
os: *mut FILE,
namer: mlx_node_namer,
outputs: mlx_vector_array,
) -> ::std::os::raw::c_int;
}
unsafe extern "C" {
pub fn mlx_print_graph(
os: *mut FILE,
namer: mlx_node_namer,
outputs: mlx_vector_array,
) -> ::std::os::raw::c_int;
}
unsafe extern "C" {
pub fn mlx_load_reader(
res: *mut mlx_array,
in_stream: mlx_io_reader,
s: mlx_stream,
) -> ::std::os::raw::c_int;
}
unsafe extern "C" {
pub fn mlx_load(
res: *mut mlx_array,
file: *const ::std::os::raw::c_char,
s: mlx_stream,
) -> ::std::os::raw::c_int;
}
unsafe extern "C" {
pub fn mlx_load_gguf(
gguf: *mut mlx_io_gguf,
file: *const ::std::os::raw::c_char,
s: mlx_stream,
) -> ::std::os::raw::c_int;
}
unsafe extern "C" {
pub fn mlx_load_safetensors_reader(
res_0: *mut mlx_map_string_to_array,
res_1: *mut mlx_map_string_to_string,
in_stream: mlx_io_reader,
s: mlx_stream,
) -> ::std::os::raw::c_int;
}
unsafe extern "C" {
pub fn mlx_load_safetensors(
res_0: *mut mlx_map_string_to_array,
res_1: *mut mlx_map_string_to_string,
file: *const ::std::os::raw::c_char,
s: mlx_stream,
) -> ::std::os::raw::c_int;
}
unsafe extern "C" {
pub fn mlx_save_writer(out_stream: mlx_io_writer, a: mlx_array) -> ::std::os::raw::c_int;
}
unsafe extern "C" {
pub fn mlx_save(file: *const ::std::os::raw::c_char, a: mlx_array) -> ::std::os::raw::c_int;
}
unsafe extern "C" {
pub fn mlx_save_gguf(
file: *const ::std::os::raw::c_char,
gguf: mlx_io_gguf,
) -> ::std::os::raw::c_int;
}
unsafe extern "C" {
pub fn mlx_save_safetensors_writer(
in_stream: mlx_io_writer,
param: mlx_map_string_to_array,
metadata: mlx_map_string_to_string,
) -> ::std::os::raw::c_int;
}
unsafe extern "C" {
pub fn mlx_save_safetensors(
file: *const ::std::os::raw::c_char,
param: mlx_map_string_to_array,
metadata: mlx_map_string_to_string,
) -> ::std::os::raw::c_int;
}
unsafe extern "C" {
pub fn mlx_linalg_cholesky(
res: *mut mlx_array,
a: mlx_array,
upper: bool,
s: mlx_stream,
) -> ::std::os::raw::c_int;
}
unsafe extern "C" {
pub fn mlx_linalg_cholesky_inv(
res: *mut mlx_array,
a: mlx_array,
upper: bool,
s: mlx_stream,
) -> ::std::os::raw::c_int;
}
unsafe extern "C" {
pub fn mlx_linalg_cross(
res: *mut mlx_array,
a: mlx_array,
b: mlx_array,
axis: ::std::os::raw::c_int,
s: mlx_stream,
) -> ::std::os::raw::c_int;
}
unsafe extern "C" {
pub fn mlx_linalg_eig(
res_0: *mut mlx_array,
res_1: *mut mlx_array,
a: mlx_array,
s: mlx_stream,
) -> ::std::os::raw::c_int;
}
unsafe extern "C" {
pub fn mlx_linalg_eigh(
res_0: *mut mlx_array,
res_1: *mut mlx_array,
a: mlx_array,
UPLO: *const ::std::os::raw::c_char,
s: mlx_stream,
) -> ::std::os::raw::c_int;
}
unsafe extern "C" {
pub fn mlx_linalg_eigvals(
res: *mut mlx_array,
a: mlx_array,
s: mlx_stream,
) -> ::std::os::raw::c_int;
}
unsafe extern "C" {
pub fn mlx_linalg_eigvalsh(
res: *mut mlx_array,
a: mlx_array,
UPLO: *const ::std::os::raw::c_char,
s: mlx_stream,
) -> ::std::os::raw::c_int;
}
unsafe extern "C" {
pub fn mlx_linalg_inv(res: *mut mlx_array, a: mlx_array, s: mlx_stream) -> ::std::os::raw::c_int;
}
unsafe extern "C" {
pub fn mlx_linalg_lu(
res: *mut mlx_vector_array,
a: mlx_array,
s: mlx_stream,
) -> ::std::os::raw::c_int;
}
unsafe extern "C" {
pub fn mlx_linalg_lu_factor(
res_0: *mut mlx_array,
res_1: *mut mlx_array,
a: mlx_array,
s: mlx_stream,
) -> ::std::os::raw::c_int;
}
unsafe extern "C" {
pub fn mlx_linalg_norm(
res: *mut mlx_array,
a: mlx_array,
ord: f64,
axis: *const ::std::os::raw::c_int,
axis_num: usize,
keepdims: bool,
s: mlx_stream,
) -> ::std::os::raw::c_int;
}
unsafe extern "C" {
pub fn mlx_linalg_norm_matrix(
res: *mut mlx_array,
a: mlx_array,
ord: *const ::std::os::raw::c_char,
axis: *const ::std::os::raw::c_int,
axis_num: usize,
keepdims: bool,
s: mlx_stream,
) -> ::std::os::raw::c_int;
}
unsafe extern "C" {
pub fn mlx_linalg_norm_l2(
res: *mut mlx_array,
a: mlx_array,
axis: *const ::std::os::raw::c_int,
axis_num: usize,
keepdims: bool,
s: mlx_stream,
) -> ::std::os::raw::c_int;
}
unsafe extern "C" {
pub fn mlx_linalg_pinv(res: *mut mlx_array, a: mlx_array, s: mlx_stream)
-> ::std::os::raw::c_int;
}
unsafe extern "C" {
pub fn mlx_linalg_qr(
res_0: *mut mlx_array,
res_1: *mut mlx_array,
a: mlx_array,
s: mlx_stream,
) -> ::std::os::raw::c_int;
}
unsafe extern "C" {
pub fn mlx_linalg_solve(
res: *mut mlx_array,
a: mlx_array,
b: mlx_array,
s: mlx_stream,
) -> ::std::os::raw::c_int;
}
unsafe extern "C" {
pub fn mlx_linalg_solve_triangular(
res: *mut mlx_array,
a: mlx_array,
b: mlx_array,
upper: bool,
s: mlx_stream,
) -> ::std::os::raw::c_int;
}
unsafe extern "C" {
pub fn mlx_linalg_svd(
res: *mut mlx_vector_array,
a: mlx_array,
compute_uv: bool,
s: mlx_stream,
) -> ::std::os::raw::c_int;
}
unsafe extern "C" {
pub fn mlx_linalg_tri_inv(
res: *mut mlx_array,
a: mlx_array,
upper: bool,
s: mlx_stream,
) -> ::std::os::raw::c_int;
}
unsafe extern "C" {
pub fn mlx_clear_cache() -> ::std::os::raw::c_int;
}
unsafe extern "C" {
pub fn mlx_get_active_memory(res: *mut usize) -> ::std::os::raw::c_int;
}
unsafe extern "C" {
pub fn mlx_get_cache_memory(res: *mut usize) -> ::std::os::raw::c_int;
}
unsafe extern "C" {
pub fn mlx_get_memory_limit(res: *mut usize) -> ::std::os::raw::c_int;
}
unsafe extern "C" {
pub fn mlx_get_peak_memory(res: *mut usize) -> ::std::os::raw::c_int;
}
unsafe extern "C" {
pub fn mlx_reset_peak_memory() -> ::std::os::raw::c_int;
}
unsafe extern "C" {
pub fn mlx_set_cache_limit(res: *mut usize, limit: usize) -> ::std::os::raw::c_int;
}
unsafe extern "C" {
pub fn mlx_set_memory_limit(res: *mut usize, limit: usize) -> ::std::os::raw::c_int;
}
unsafe extern "C" {
pub fn mlx_set_wired_limit(res: *mut usize, limit: usize) -> ::std::os::raw::c_int;
}
unsafe extern "C" {
pub fn mlx_metal_is_available(res: *mut bool) -> ::std::os::raw::c_int;
}
unsafe extern "C" {
pub fn mlx_metal_start_capture(path: *const ::std::os::raw::c_char) -> ::std::os::raw::c_int;
}
unsafe extern "C" {
pub fn mlx_metal_stop_capture() -> ::std::os::raw::c_int;
}
unsafe extern "C" {
pub fn mlx_abs(res: *mut mlx_array, a: mlx_array, s: mlx_stream) -> ::std::os::raw::c_int;
}
unsafe extern "C" {
pub fn mlx_add(
res: *mut mlx_array,
a: mlx_array,
b: mlx_array,
s: mlx_stream,
) -> ::std::os::raw::c_int;
}
unsafe extern "C" {
pub fn mlx_addmm(
res: *mut mlx_array,
c: mlx_array,
a: mlx_array,
b: mlx_array,
alpha: f32,
beta: f32,
s: mlx_stream,
) -> ::std::os::raw::c_int;
}
unsafe extern "C" {
pub fn mlx_all_axes(
res: *mut mlx_array,
a: mlx_array,
axes: *const ::std::os::raw::c_int,
axes_num: usize,
keepdims: bool,
s: mlx_stream,
) -> ::std::os::raw::c_int;
}
unsafe extern "C" {
pub fn mlx_all_axis(
res: *mut mlx_array,
a: mlx_array,
axis: ::std::os::raw::c_int,
keepdims: bool,
s: mlx_stream,
) -> ::std::os::raw::c_int;
}
unsafe extern "C" {
pub fn mlx_all(
res: *mut mlx_array,
a: mlx_array,
keepdims: bool,
s: mlx_stream,
) -> ::std::os::raw::c_int;
}
unsafe extern "C" {
pub fn mlx_allclose(
res: *mut mlx_array,
a: mlx_array,
b: mlx_array,
rtol: f64,
atol: f64,
equal_nan: bool,
s: mlx_stream,
) -> ::std::os::raw::c_int;
}
unsafe extern "C" {
pub fn mlx_any_axes(
res: *mut mlx_array,
a: mlx_array,
axes: *const ::std::os::raw::c_int,
axes_num: usize,
keepdims: bool,
s: mlx_stream,
) -> ::std::os::raw::c_int;
}
unsafe extern "C" {
pub fn mlx_any_axis(
res: *mut mlx_array,
a: mlx_array,
axis: ::std::os::raw::c_int,
keepdims: bool,
s: mlx_stream,
) -> ::std::os::raw::c_int;
}
unsafe extern "C" {
pub fn mlx_any(
res: *mut mlx_array,
a: mlx_array,
keepdims: bool,
s: mlx_stream,
) -> ::std::os::raw::c_int;
}
unsafe extern "C" {
pub fn mlx_arange(
res: *mut mlx_array,
start: f64,
stop: f64,
step: f64,
dtype: mlx_dtype,
s: mlx_stream,
) -> ::std::os::raw::c_int;
}
unsafe extern "C" {
pub fn mlx_arccos(res: *mut mlx_array, a: mlx_array, s: mlx_stream) -> ::std::os::raw::c_int;
}
unsafe extern "C" {
pub fn mlx_arccosh(res: *mut mlx_array, a: mlx_array, s: mlx_stream) -> ::std::os::raw::c_int;
}
unsafe extern "C" {
pub fn mlx_arcsin(res: *mut mlx_array, a: mlx_array, s: mlx_stream) -> ::std::os::raw::c_int;
}
unsafe extern "C" {
pub fn mlx_arcsinh(res: *mut mlx_array, a: mlx_array, s: mlx_stream) -> ::std::os::raw::c_int;
}
unsafe extern "C" {
pub fn mlx_arctan(res: *mut mlx_array, a: mlx_array, s: mlx_stream) -> ::std::os::raw::c_int;
}
unsafe extern "C" {
pub fn mlx_arctan2(
res: *mut mlx_array,
a: mlx_array,
b: mlx_array,
s: mlx_stream,
) -> ::std::os::raw::c_int;
}
unsafe extern "C" {
pub fn mlx_arctanh(res: *mut mlx_array, a: mlx_array, s: mlx_stream) -> ::std::os::raw::c_int;
}
unsafe extern "C" {
pub fn mlx_argmax_axis(
res: *mut mlx_array,
a: mlx_array,
axis: ::std::os::raw::c_int,
keepdims: bool,
s: mlx_stream,
) -> ::std::os::raw::c_int;
}
unsafe extern "C" {
pub fn mlx_argmax(
res: *mut mlx_array,
a: mlx_array,
keepdims: bool,
s: mlx_stream,
) -> ::std::os::raw::c_int;
}
unsafe extern "C" {
pub fn mlx_argmin_axis(
res: *mut mlx_array,
a: mlx_array,
axis: ::std::os::raw::c_int,
keepdims: bool,
s: mlx_stream,
) -> ::std::os::raw::c_int;
}
unsafe extern "C" {
pub fn mlx_argmin(
res: *mut mlx_array,
a: mlx_array,
keepdims: bool,
s: mlx_stream,
) -> ::std::os::raw::c_int;
}
unsafe extern "C" {
pub fn mlx_argpartition_axis(
res: *mut mlx_array,
a: mlx_array,
kth: ::std::os::raw::c_int,
axis: ::std::os::raw::c_int,
s: mlx_stream,
) -> ::std::os::raw::c_int;
}
unsafe extern "C" {
pub fn mlx_argpartition(
res: *mut mlx_array,
a: mlx_array,
kth: ::std::os::raw::c_int,
s: mlx_stream,
) -> ::std::os::raw::c_int;
}
unsafe extern "C" {
pub fn mlx_argsort_axis(
res: *mut mlx_array,
a: mlx_array,
axis: ::std::os::raw::c_int,
s: mlx_stream,
) -> ::std::os::raw::c_int;
}
unsafe extern "C" {
pub fn mlx_argsort(res: *mut mlx_array, a: mlx_array, s: mlx_stream) -> ::std::os::raw::c_int;
}
unsafe extern "C" {
pub fn mlx_array_equal(
res: *mut mlx_array,
a: mlx_array,
b: mlx_array,
equal_nan: bool,
s: mlx_stream,
) -> ::std::os::raw::c_int;
}
unsafe extern "C" {
pub fn mlx_as_strided(
res: *mut mlx_array,
a: mlx_array,
shape: *const ::std::os::raw::c_int,
shape_num: usize,
strides: *const i64,
strides_num: usize,
offset: usize,
s: mlx_stream,
) -> ::std::os::raw::c_int;
}
unsafe extern "C" {
pub fn mlx_astype(
res: *mut mlx_array,
a: mlx_array,
dtype: mlx_dtype,
s: mlx_stream,
) -> ::std::os::raw::c_int;
}
unsafe extern "C" {
pub fn mlx_atleast_1d(res: *mut mlx_array, a: mlx_array, s: mlx_stream) -> ::std::os::raw::c_int;
}
unsafe extern "C" {
pub fn mlx_atleast_2d(res: *mut mlx_array, a: mlx_array, s: mlx_stream) -> ::std::os::raw::c_int;
}
unsafe extern "C" {
pub fn mlx_atleast_3d(res: *mut mlx_array, a: mlx_array, s: mlx_stream) -> ::std::os::raw::c_int;
}
unsafe extern "C" {
pub fn mlx_bartlett(
res: *mut mlx_array,
M: ::std::os::raw::c_int,
s: mlx_stream,
) -> ::std::os::raw::c_int;
}
unsafe extern "C" {
pub fn mlx_bitwise_and(
res: *mut mlx_array,
a: mlx_array,
b: mlx_array,
s: mlx_stream,
) -> ::std::os::raw::c_int;
}
unsafe extern "C" {
pub fn mlx_bitwise_invert(
res: *mut mlx_array,
a: mlx_array,
s: mlx_stream,
) -> ::std::os::raw::c_int;
}
unsafe extern "C" {
pub fn mlx_bitwise_or(
res: *mut mlx_array,
a: mlx_array,
b: mlx_array,
s: mlx_stream,
) -> ::std::os::raw::c_int;
}
unsafe extern "C" {
pub fn mlx_bitwise_xor(
res: *mut mlx_array,
a: mlx_array,
b: mlx_array,
s: mlx_stream,
) -> ::std::os::raw::c_int;
}
unsafe extern "C" {
pub fn mlx_blackman(
res: *mut mlx_array,
M: ::std::os::raw::c_int,
s: mlx_stream,
) -> ::std::os::raw::c_int;
}
unsafe extern "C" {
pub fn mlx_block_masked_mm(
res: *mut mlx_array,
a: mlx_array,
b: mlx_array,
block_size: ::std::os::raw::c_int,
mask_out: mlx_array,
mask_lhs: mlx_array,
mask_rhs: mlx_array,
s: mlx_stream,
) -> ::std::os::raw::c_int;
}
unsafe extern "C" {
pub fn mlx_broadcast_arrays(
res: *mut mlx_vector_array,
inputs: mlx_vector_array,
s: mlx_stream,
) -> ::std::os::raw::c_int;
}
unsafe extern "C" {
pub fn mlx_broadcast_to(
res: *mut mlx_array,
a: mlx_array,
shape: *const ::std::os::raw::c_int,
shape_num: usize,
s: mlx_stream,
) -> ::std::os::raw::c_int;
}
unsafe extern "C" {
pub fn mlx_ceil(res: *mut mlx_array, a: mlx_array, s: mlx_stream) -> ::std::os::raw::c_int;
}
unsafe extern "C" {
pub fn mlx_clip(
res: *mut mlx_array,
a: mlx_array,
a_min: mlx_array,
a_max: mlx_array,
s: mlx_stream,
) -> ::std::os::raw::c_int;
}
unsafe extern "C" {
pub fn mlx_concatenate_axis(
res: *mut mlx_array,
arrays: mlx_vector_array,
axis: ::std::os::raw::c_int,
s: mlx_stream,
) -> ::std::os::raw::c_int;
}
unsafe extern "C" {
pub fn mlx_concatenate(
res: *mut mlx_array,
arrays: mlx_vector_array,
s: mlx_stream,
) -> ::std::os::raw::c_int;
}
unsafe extern "C" {
pub fn mlx_conjugate(res: *mut mlx_array, a: mlx_array, s: mlx_stream) -> ::std::os::raw::c_int;
}
unsafe extern "C" {
pub fn mlx_contiguous(
res: *mut mlx_array,
a: mlx_array,
allow_col_major: bool,
s: mlx_stream,
) -> ::std::os::raw::c_int;
}
unsafe extern "C" {
pub fn mlx_conv1d(
res: *mut mlx_array,
input: mlx_array,
weight: mlx_array,
stride: ::std::os::raw::c_int,
padding: ::std::os::raw::c_int,
dilation: ::std::os::raw::c_int,
groups: ::std::os::raw::c_int,
s: mlx_stream,
) -> ::std::os::raw::c_int;
}
unsafe extern "C" {
pub fn mlx_conv2d(
res: *mut mlx_array,
input: mlx_array,
weight: mlx_array,
stride_0: ::std::os::raw::c_int,
stride_1: ::std::os::raw::c_int,
padding_0: ::std::os::raw::c_int,
padding_1: ::std::os::raw::c_int,
dilation_0: ::std::os::raw::c_int,
dilation_1: ::std::os::raw::c_int,
groups: ::std::os::raw::c_int,
s: mlx_stream,
) -> ::std::os::raw::c_int;
}
unsafe extern "C" {
pub fn mlx_conv3d(
res: *mut mlx_array,
input: mlx_array,
weight: mlx_array,
stride_0: ::std::os::raw::c_int,
stride_1: ::std::os::raw::c_int,
stride_2: ::std::os::raw::c_int,
padding_0: ::std::os::raw::c_int,
padding_1: ::std::os::raw::c_int,
padding_2: ::std::os::raw::c_int,
dilation_0: ::std::os::raw::c_int,
dilation_1: ::std::os::raw::c_int,
dilation_2: ::std::os::raw::c_int,
groups: ::std::os::raw::c_int,
s: mlx_stream,
) -> ::std::os::raw::c_int;
}
unsafe extern "C" {
pub fn mlx_conv_general(
res: *mut mlx_array,
input: mlx_array,
weight: mlx_array,
stride: *const ::std::os::raw::c_int,
stride_num: usize,
padding_lo: *const ::std::os::raw::c_int,
padding_lo_num: usize,
padding_hi: *const ::std::os::raw::c_int,
padding_hi_num: usize,
kernel_dilation: *const ::std::os::raw::c_int,
kernel_dilation_num: usize,
input_dilation: *const ::std::os::raw::c_int,
input_dilation_num: usize,
groups: ::std::os::raw::c_int,
flip: bool,
s: mlx_stream,
) -> ::std::os::raw::c_int;
}
unsafe extern "C" {
pub fn mlx_conv_transpose1d(
res: *mut mlx_array,
input: mlx_array,
weight: mlx_array,
stride: ::std::os::raw::c_int,
padding: ::std::os::raw::c_int,
dilation: ::std::os::raw::c_int,
output_padding: ::std::os::raw::c_int,
groups: ::std::os::raw::c_int,
s: mlx_stream,
) -> ::std::os::raw::c_int;
}
unsafe extern "C" {
pub fn mlx_conv_transpose2d(
res: *mut mlx_array,
input: mlx_array,
weight: mlx_array,
stride_0: ::std::os::raw::c_int,
stride_1: ::std::os::raw::c_int,
padding_0: ::std::os::raw::c_int,
padding_1: ::std::os::raw::c_int,
dilation_0: ::std::os::raw::c_int,
dilation_1: ::std::os::raw::c_int,
output_padding_0: ::std::os::raw::c_int,
output_padding_1: ::std::os::raw::c_int,
groups: ::std::os::raw::c_int,
s: mlx_stream,
) -> ::std::os::raw::c_int;
}
unsafe extern "C" {
pub fn mlx_conv_transpose3d(
res: *mut mlx_array,
input: mlx_array,
weight: mlx_array,
stride_0: ::std::os::raw::c_int,
stride_1: ::std::os::raw::c_int,
stride_2: ::std::os::raw::c_int,
padding_0: ::std::os::raw::c_int,
padding_1: ::std::os::raw::c_int,
padding_2: ::std::os::raw::c_int,
dilation_0: ::std::os::raw::c_int,
dilation_1: ::std::os::raw::c_int,
dilation_2: ::std::os::raw::c_int,
output_padding_0: ::std::os::raw::c_int,
output_padding_1: ::std::os::raw::c_int,
output_padding_2: ::std::os::raw::c_int,
groups: ::std::os::raw::c_int,
s: mlx_stream,
) -> ::std::os::raw::c_int;
}
unsafe extern "C" {
pub fn mlx_copy(res: *mut mlx_array, a: mlx_array, s: mlx_stream) -> ::std::os::raw::c_int;
}
unsafe extern "C" {
pub fn mlx_cos(res: *mut mlx_array, a: mlx_array, s: mlx_stream) -> ::std::os::raw::c_int;
}
unsafe extern "C" {
pub fn mlx_cosh(res: *mut mlx_array, a: mlx_array, s: mlx_stream) -> ::std::os::raw::c_int;
}
unsafe extern "C" {
pub fn mlx_cummax(
res: *mut mlx_array,
a: mlx_array,
axis: ::std::os::raw::c_int,
reverse: bool,
inclusive: bool,
s: mlx_stream,
) -> ::std::os::raw::c_int;
}
unsafe extern "C" {
pub fn mlx_cummin(
res: *mut mlx_array,
a: mlx_array,
axis: ::std::os::raw::c_int,
reverse: bool,
inclusive: bool,
s: mlx_stream,
) -> ::std::os::raw::c_int;
}
unsafe extern "C" {
pub fn mlx_cumprod(
res: *mut mlx_array,
a: mlx_array,
axis: ::std::os::raw::c_int,
reverse: bool,
inclusive: bool,
s: mlx_stream,
) -> ::std::os::raw::c_int;
}
unsafe extern "C" {
pub fn mlx_cumsum(
res: *mut mlx_array,
a: mlx_array,
axis: ::std::os::raw::c_int,
reverse: bool,
inclusive: bool,
s: mlx_stream,
) -> ::std::os::raw::c_int;
}
unsafe extern "C" {
pub fn mlx_degrees(res: *mut mlx_array, a: mlx_array, s: mlx_stream) -> ::std::os::raw::c_int;
}
unsafe extern "C" {
pub fn mlx_depends(
res: *mut mlx_vector_array,
inputs: mlx_vector_array,
dependencies: mlx_vector_array,
) -> ::std::os::raw::c_int;
}
unsafe extern "C" {
pub fn mlx_dequantize(
res: *mut mlx_array,
w: mlx_array,
scales: mlx_array,
biases: mlx_array,
group_size: mlx_optional_int,
bits: mlx_optional_int,
mode: *const ::std::os::raw::c_char,
global_scale: mlx_array,
dtype: mlx_optional_dtype,
s: mlx_stream,
) -> ::std::os::raw::c_int;
}
unsafe extern "C" {
pub fn mlx_diag(
res: *mut mlx_array,
a: mlx_array,
k: ::std::os::raw::c_int,
s: mlx_stream,
) -> ::std::os::raw::c_int;
}
unsafe extern "C" {
pub fn mlx_diagonal(
res: *mut mlx_array,
a: mlx_array,
offset: ::std::os::raw::c_int,
axis1: ::std::os::raw::c_int,
axis2: ::std::os::raw::c_int,
s: mlx_stream,
) -> ::std::os::raw::c_int;
}
unsafe extern "C" {
pub fn mlx_divide(
res: *mut mlx_array,
a: mlx_array,
b: mlx_array,
s: mlx_stream,
) -> ::std::os::raw::c_int;
}
unsafe extern "C" {
pub fn mlx_divmod(
res: *mut mlx_vector_array,
a: mlx_array,
b: mlx_array,
s: mlx_stream,
) -> ::std::os::raw::c_int;
}
unsafe extern "C" {
pub fn mlx_einsum(
res: *mut mlx_array,
subscripts: *const ::std::os::raw::c_char,
operands: mlx_vector_array,
s: mlx_stream,
) -> ::std::os::raw::c_int;
}
unsafe extern "C" {
pub fn mlx_equal(
res: *mut mlx_array,
a: mlx_array,
b: mlx_array,
s: mlx_stream,
) -> ::std::os::raw::c_int;
}
unsafe extern "C" {
pub fn mlx_erf(res: *mut mlx_array, a: mlx_array, s: mlx_stream) -> ::std::os::raw::c_int;
}
unsafe extern "C" {
pub fn mlx_erfinv(res: *mut mlx_array, a: mlx_array, s: mlx_stream) -> ::std::os::raw::c_int;
}
unsafe extern "C" {
pub fn mlx_exp(res: *mut mlx_array, a: mlx_array, s: mlx_stream) -> ::std::os::raw::c_int;
}
unsafe extern "C" {
pub fn mlx_expand_dims_axes(
res: *mut mlx_array,
a: mlx_array,
axes: *const ::std::os::raw::c_int,
axes_num: usize,
s: mlx_stream,
) -> ::std::os::raw::c_int;
}
unsafe extern "C" {
pub fn mlx_expand_dims(
res: *mut mlx_array,
a: mlx_array,
axis: ::std::os::raw::c_int,
s: mlx_stream,
) -> ::std::os::raw::c_int;
}
unsafe extern "C" {
pub fn mlx_expm1(res: *mut mlx_array, a: mlx_array, s: mlx_stream) -> ::std::os::raw::c_int;
}
unsafe extern "C" {
pub fn mlx_eye(
res: *mut mlx_array,
n: ::std::os::raw::c_int,
m: ::std::os::raw::c_int,
k: ::std::os::raw::c_int,
dtype: mlx_dtype,
s: mlx_stream,
) -> ::std::os::raw::c_int;
}
unsafe extern "C" {
pub fn mlx_flatten(
res: *mut mlx_array,
a: mlx_array,
start_axis: ::std::os::raw::c_int,
end_axis: ::std::os::raw::c_int,
s: mlx_stream,
) -> ::std::os::raw::c_int;
}
unsafe extern "C" {
pub fn mlx_floor(res: *mut mlx_array, a: mlx_array, s: mlx_stream) -> ::std::os::raw::c_int;
}
unsafe extern "C" {
pub fn mlx_floor_divide(
res: *mut mlx_array,
a: mlx_array,
b: mlx_array,
s: mlx_stream,
) -> ::std::os::raw::c_int;
}
unsafe extern "C" {
pub fn mlx_from_fp8(
res: *mut mlx_array,
x: mlx_array,
dtype: mlx_dtype,
s: mlx_stream,
) -> ::std::os::raw::c_int;
}
unsafe extern "C" {
pub fn mlx_full(
res: *mut mlx_array,
shape: *const ::std::os::raw::c_int,
shape_num: usize,
vals: mlx_array,
dtype: mlx_dtype,
s: mlx_stream,
) -> ::std::os::raw::c_int;
}
unsafe extern "C" {
pub fn mlx_full_like(
res: *mut mlx_array,
a: mlx_array,
vals: mlx_array,
dtype: mlx_dtype,
s: mlx_stream,
) -> ::std::os::raw::c_int;
}
unsafe extern "C" {
pub fn mlx_gather(
res: *mut mlx_array,
a: mlx_array,
indices: mlx_vector_array,
axes: *const ::std::os::raw::c_int,
axes_num: usize,
slice_sizes: *const ::std::os::raw::c_int,
slice_sizes_num: usize,
s: mlx_stream,
) -> ::std::os::raw::c_int;
}
unsafe extern "C" {
pub fn mlx_gather_single(
res: *mut mlx_array,
a: mlx_array,
indices: mlx_array,
axis: ::std::os::raw::c_int,
slice_sizes: *const ::std::os::raw::c_int,
slice_sizes_num: usize,
s: mlx_stream,
) -> ::std::os::raw::c_int;
}
unsafe extern "C" {
pub fn mlx_gather_mm(
res: *mut mlx_array,
a: mlx_array,
b: mlx_array,
lhs_indices: mlx_array,
rhs_indices: mlx_array,
sorted_indices: bool,
s: mlx_stream,
) -> ::std::os::raw::c_int;
}
unsafe extern "C" {
pub fn mlx_gather_qmm(
res: *mut mlx_array,
x: mlx_array,
w: mlx_array,
scales: mlx_array,
biases: mlx_array,
lhs_indices: mlx_array,
rhs_indices: mlx_array,
transpose: bool,
group_size: mlx_optional_int,
bits: mlx_optional_int,
mode: *const ::std::os::raw::c_char,
sorted_indices: bool,
s: mlx_stream,
) -> ::std::os::raw::c_int;
}
unsafe extern "C" {
pub fn mlx_greater(
res: *mut mlx_array,
a: mlx_array,
b: mlx_array,
s: mlx_stream,
) -> ::std::os::raw::c_int;
}
unsafe extern "C" {
pub fn mlx_greater_equal(
res: *mut mlx_array,
a: mlx_array,
b: mlx_array,
s: mlx_stream,
) -> ::std::os::raw::c_int;
}
unsafe extern "C" {
pub fn mlx_hadamard_transform(
res: *mut mlx_array,
a: mlx_array,
scale: mlx_optional_float,
s: mlx_stream,
) -> ::std::os::raw::c_int;
}
unsafe extern "C" {
pub fn mlx_hamming(
res: *mut mlx_array,
M: ::std::os::raw::c_int,
s: mlx_stream,
) -> ::std::os::raw::c_int;
}
unsafe extern "C" {
pub fn mlx_hanning(
res: *mut mlx_array,
M: ::std::os::raw::c_int,
s: mlx_stream,
) -> ::std::os::raw::c_int;
}
unsafe extern "C" {
pub fn mlx_identity(
res: *mut mlx_array,
n: ::std::os::raw::c_int,
dtype: mlx_dtype,
s: mlx_stream,
) -> ::std::os::raw::c_int;
}
unsafe extern "C" {
pub fn mlx_imag(res: *mut mlx_array, a: mlx_array, s: mlx_stream) -> ::std::os::raw::c_int;
}
unsafe extern "C" {
pub fn mlx_inner(
res: *mut mlx_array,
a: mlx_array,
b: mlx_array,
s: mlx_stream,
) -> ::std::os::raw::c_int;
}
unsafe extern "C" {
pub fn mlx_isclose(
res: *mut mlx_array,
a: mlx_array,
b: mlx_array,
rtol: f64,
atol: f64,
equal_nan: bool,
s: mlx_stream,
) -> ::std::os::raw::c_int;
}
unsafe extern "C" {
pub fn mlx_isfinite(res: *mut mlx_array, a: mlx_array, s: mlx_stream) -> ::std::os::raw::c_int;
}
unsafe extern "C" {
pub fn mlx_isinf(res: *mut mlx_array, a: mlx_array, s: mlx_stream) -> ::std::os::raw::c_int;
}
unsafe extern "C" {
pub fn mlx_isnan(res: *mut mlx_array, a: mlx_array, s: mlx_stream) -> ::std::os::raw::c_int;
}
unsafe extern "C" {
pub fn mlx_isneginf(res: *mut mlx_array, a: mlx_array, s: mlx_stream) -> ::std::os::raw::c_int;
}
unsafe extern "C" {
pub fn mlx_isposinf(res: *mut mlx_array, a: mlx_array, s: mlx_stream) -> ::std::os::raw::c_int;
}
unsafe extern "C" {
pub fn mlx_kron(
res: *mut mlx_array,
a: mlx_array,
b: mlx_array,
s: mlx_stream,
) -> ::std::os::raw::c_int;
}
unsafe extern "C" {
pub fn mlx_left_shift(
res: *mut mlx_array,
a: mlx_array,
b: mlx_array,
s: mlx_stream,
) -> ::std::os::raw::c_int;
}
unsafe extern "C" {
pub fn mlx_less(
res: *mut mlx_array,
a: mlx_array,
b: mlx_array,
s: mlx_stream,
) -> ::std::os::raw::c_int;
}
unsafe extern "C" {
pub fn mlx_less_equal(
res: *mut mlx_array,
a: mlx_array,
b: mlx_array,
s: mlx_stream,
) -> ::std::os::raw::c_int;
}
unsafe extern "C" {
pub fn mlx_linspace(
res: *mut mlx_array,
start: f64,
stop: f64,
num: ::std::os::raw::c_int,
dtype: mlx_dtype,
s: mlx_stream,
) -> ::std::os::raw::c_int;
}
unsafe extern "C" {
pub fn mlx_log(res: *mut mlx_array, a: mlx_array, s: mlx_stream) -> ::std::os::raw::c_int;
}
unsafe extern "C" {
pub fn mlx_log10(res: *mut mlx_array, a: mlx_array, s: mlx_stream) -> ::std::os::raw::c_int;
}
unsafe extern "C" {
pub fn mlx_log1p(res: *mut mlx_array, a: mlx_array, s: mlx_stream) -> ::std::os::raw::c_int;
}
unsafe extern "C" {
pub fn mlx_log2(res: *mut mlx_array, a: mlx_array, s: mlx_stream) -> ::std::os::raw::c_int;
}
unsafe extern "C" {
pub fn mlx_logaddexp(
res: *mut mlx_array,
a: mlx_array,
b: mlx_array,
s: mlx_stream,
) -> ::std::os::raw::c_int;
}
unsafe extern "C" {
pub fn mlx_logcumsumexp(
res: *mut mlx_array,
a: mlx_array,
axis: ::std::os::raw::c_int,
reverse: bool,
inclusive: bool,
s: mlx_stream,
) -> ::std::os::raw::c_int;
}
unsafe extern "C" {
pub fn mlx_logical_and(
res: *mut mlx_array,
a: mlx_array,
b: mlx_array,
s: mlx_stream,
) -> ::std::os::raw::c_int;
}
unsafe extern "C" {
pub fn mlx_logical_not(res: *mut mlx_array, a: mlx_array, s: mlx_stream)
-> ::std::os::raw::c_int;
}
unsafe extern "C" {
pub fn mlx_logical_or(
res: *mut mlx_array,
a: mlx_array,
b: mlx_array,
s: mlx_stream,
) -> ::std::os::raw::c_int;
}
unsafe extern "C" {
pub fn mlx_logsumexp_axes(
res: *mut mlx_array,
a: mlx_array,
axes: *const ::std::os::raw::c_int,
axes_num: usize,
keepdims: bool,
s: mlx_stream,
) -> ::std::os::raw::c_int;
}
unsafe extern "C" {
pub fn mlx_logsumexp_axis(
res: *mut mlx_array,
a: mlx_array,
axis: ::std::os::raw::c_int,
keepdims: bool,
s: mlx_stream,
) -> ::std::os::raw::c_int;
}
unsafe extern "C" {
pub fn mlx_logsumexp(
res: *mut mlx_array,
a: mlx_array,
keepdims: bool,
s: mlx_stream,
) -> ::std::os::raw::c_int;
}
unsafe extern "C" {
pub fn mlx_masked_scatter(
res: *mut mlx_array,
a: mlx_array,
mask: mlx_array,
src: mlx_array,
s: mlx_stream,
) -> ::std::os::raw::c_int;
}
unsafe extern "C" {
pub fn mlx_matmul(
res: *mut mlx_array,
a: mlx_array,
b: mlx_array,
s: mlx_stream,
) -> ::std::os::raw::c_int;
}
unsafe extern "C" {
pub fn mlx_max_axes(
res: *mut mlx_array,
a: mlx_array,
axes: *const ::std::os::raw::c_int,
axes_num: usize,
keepdims: bool,
s: mlx_stream,
) -> ::std::os::raw::c_int;
}
unsafe extern "C" {
pub fn mlx_max_axis(
res: *mut mlx_array,
a: mlx_array,
axis: ::std::os::raw::c_int,
keepdims: bool,
s: mlx_stream,
) -> ::std::os::raw::c_int;
}
unsafe extern "C" {
pub fn mlx_max(
res: *mut mlx_array,
a: mlx_array,
keepdims: bool,
s: mlx_stream,
) -> ::std::os::raw::c_int;
}
unsafe extern "C" {
pub fn mlx_maximum(
res: *mut mlx_array,
a: mlx_array,
b: mlx_array,
s: mlx_stream,
) -> ::std::os::raw::c_int;
}
unsafe extern "C" {
pub fn mlx_mean_axes(
res: *mut mlx_array,
a: mlx_array,
axes: *const ::std::os::raw::c_int,
axes_num: usize,
keepdims: bool,
s: mlx_stream,
) -> ::std::os::raw::c_int;
}
unsafe extern "C" {
pub fn mlx_mean_axis(
res: *mut mlx_array,
a: mlx_array,
axis: ::std::os::raw::c_int,
keepdims: bool,
s: mlx_stream,
) -> ::std::os::raw::c_int;
}
unsafe extern "C" {
pub fn mlx_mean(
res: *mut mlx_array,
a: mlx_array,
keepdims: bool,
s: mlx_stream,
) -> ::std::os::raw::c_int;
}
unsafe extern "C" {
pub fn mlx_median(
res: *mut mlx_array,
a: mlx_array,
axes: *const ::std::os::raw::c_int,
axes_num: usize,
keepdims: bool,
s: mlx_stream,
) -> ::std::os::raw::c_int;
}
unsafe extern "C" {
pub fn mlx_meshgrid(
res: *mut mlx_vector_array,
arrays: mlx_vector_array,
sparse: bool,
indexing: *const ::std::os::raw::c_char,
s: mlx_stream,
) -> ::std::os::raw::c_int;
}
unsafe extern "C" {
pub fn mlx_min_axes(
res: *mut mlx_array,
a: mlx_array,
axes: *const ::std::os::raw::c_int,
axes_num: usize,
keepdims: bool,
s: mlx_stream,
) -> ::std::os::raw::c_int;
}
unsafe extern "C" {
pub fn mlx_min_axis(
res: *mut mlx_array,
a: mlx_array,
axis: ::std::os::raw::c_int,
keepdims: bool,
s: mlx_stream,
) -> ::std::os::raw::c_int;
}
unsafe extern "C" {
pub fn mlx_min(
res: *mut mlx_array,
a: mlx_array,
keepdims: bool,
s: mlx_stream,
) -> ::std::os::raw::c_int;
}
unsafe extern "C" {
pub fn mlx_minimum(
res: *mut mlx_array,
a: mlx_array,
b: mlx_array,
s: mlx_stream,
) -> ::std::os::raw::c_int;
}
unsafe extern "C" {
pub fn mlx_moveaxis(
res: *mut mlx_array,
a: mlx_array,
source: ::std::os::raw::c_int,
destination: ::std::os::raw::c_int,
s: mlx_stream,
) -> ::std::os::raw::c_int;
}
unsafe extern "C" {
pub fn mlx_multiply(
res: *mut mlx_array,
a: mlx_array,
b: mlx_array,
s: mlx_stream,
) -> ::std::os::raw::c_int;
}
unsafe extern "C" {
pub fn mlx_nan_to_num(
res: *mut mlx_array,
a: mlx_array,
nan: f32,
posinf: mlx_optional_float,
neginf: mlx_optional_float,
s: mlx_stream,
) -> ::std::os::raw::c_int;
}
unsafe extern "C" {
pub fn mlx_negative(res: *mut mlx_array, a: mlx_array, s: mlx_stream) -> ::std::os::raw::c_int;
}
unsafe extern "C" {
pub fn mlx_not_equal(
res: *mut mlx_array,
a: mlx_array,
b: mlx_array,
s: mlx_stream,
) -> ::std::os::raw::c_int;
}
unsafe extern "C" {
pub fn mlx_number_of_elements(
res: *mut mlx_array,
a: mlx_array,
axes: *const ::std::os::raw::c_int,
axes_num: usize,
inverted: bool,
dtype: mlx_dtype,
s: mlx_stream,
) -> ::std::os::raw::c_int;
}
unsafe extern "C" {
pub fn mlx_ones(
res: *mut mlx_array,
shape: *const ::std::os::raw::c_int,
shape_num: usize,
dtype: mlx_dtype,
s: mlx_stream,
) -> ::std::os::raw::c_int;
}
unsafe extern "C" {
pub fn mlx_ones_like(res: *mut mlx_array, a: mlx_array, s: mlx_stream) -> ::std::os::raw::c_int;
}
unsafe extern "C" {
pub fn mlx_outer(
res: *mut mlx_array,
a: mlx_array,
b: mlx_array,
s: mlx_stream,
) -> ::std::os::raw::c_int;
}
unsafe extern "C" {
pub fn mlx_pad(
res: *mut mlx_array,
a: mlx_array,
axes: *const ::std::os::raw::c_int,
axes_num: usize,
low_pad_size: *const ::std::os::raw::c_int,
low_pad_size_num: usize,
high_pad_size: *const ::std::os::raw::c_int,
high_pad_size_num: usize,
pad_value: mlx_array,
mode: *const ::std::os::raw::c_char,
s: mlx_stream,
) -> ::std::os::raw::c_int;
}
unsafe extern "C" {
pub fn mlx_pad_symmetric(
res: *mut mlx_array,
a: mlx_array,
pad_width: ::std::os::raw::c_int,
pad_value: mlx_array,
mode: *const ::std::os::raw::c_char,
s: mlx_stream,
) -> ::std::os::raw::c_int;
}
unsafe extern "C" {
pub fn mlx_partition_axis(
res: *mut mlx_array,
a: mlx_array,
kth: ::std::os::raw::c_int,
axis: ::std::os::raw::c_int,
s: mlx_stream,
) -> ::std::os::raw::c_int;
}
unsafe extern "C" {
pub fn mlx_partition(
res: *mut mlx_array,
a: mlx_array,
kth: ::std::os::raw::c_int,
s: mlx_stream,
) -> ::std::os::raw::c_int;
}
unsafe extern "C" {
pub fn mlx_power(
res: *mut mlx_array,
a: mlx_array,
b: mlx_array,
s: mlx_stream,
) -> ::std::os::raw::c_int;
}
unsafe extern "C" {
pub fn mlx_prod_axes(
res: *mut mlx_array,
a: mlx_array,
axes: *const ::std::os::raw::c_int,
axes_num: usize,
keepdims: bool,
s: mlx_stream,
) -> ::std::os::raw::c_int;
}
unsafe extern "C" {
pub fn mlx_prod_axis(
res: *mut mlx_array,
a: mlx_array,
axis: ::std::os::raw::c_int,
keepdims: bool,
s: mlx_stream,
) -> ::std::os::raw::c_int;
}
unsafe extern "C" {
pub fn mlx_prod(
res: *mut mlx_array,
a: mlx_array,
keepdims: bool,
s: mlx_stream,
) -> ::std::os::raw::c_int;
}
unsafe extern "C" {
pub fn mlx_put_along_axis(
res: *mut mlx_array,
a: mlx_array,
indices: mlx_array,
values: mlx_array,
axis: ::std::os::raw::c_int,
s: mlx_stream,
) -> ::std::os::raw::c_int;
}
unsafe extern "C" {
pub fn mlx_qqmm(
res: *mut mlx_array,
x: mlx_array,
w: mlx_array,
w_scales: mlx_array,
group_size: mlx_optional_int,
bits: mlx_optional_int,
mode: *const ::std::os::raw::c_char,
global_scale_x: mlx_array,
global_scale_w: mlx_array,
s: mlx_stream,
) -> ::std::os::raw::c_int;
}
unsafe extern "C" {
pub fn mlx_quantize(
res: *mut mlx_vector_array,
w: mlx_array,
group_size: mlx_optional_int,
bits: mlx_optional_int,
mode: *const ::std::os::raw::c_char,
global_scale: mlx_array,
s: mlx_stream,
) -> ::std::os::raw::c_int;
}
unsafe extern "C" {
pub fn mlx_quantized_matmul(
res: *mut mlx_array,
x: mlx_array,
w: mlx_array,
scales: mlx_array,
biases: mlx_array,
transpose: bool,
group_size: mlx_optional_int,
bits: mlx_optional_int,
mode: *const ::std::os::raw::c_char,
s: mlx_stream,
) -> ::std::os::raw::c_int;
}
unsafe extern "C" {
pub fn mlx_radians(res: *mut mlx_array, a: mlx_array, s: mlx_stream) -> ::std::os::raw::c_int;
}
unsafe extern "C" {
pub fn mlx_real(res: *mut mlx_array, a: mlx_array, s: mlx_stream) -> ::std::os::raw::c_int;
}
unsafe extern "C" {
pub fn mlx_reciprocal(res: *mut mlx_array, a: mlx_array, s: mlx_stream) -> ::std::os::raw::c_int;
}
unsafe extern "C" {
pub fn mlx_remainder(
res: *mut mlx_array,
a: mlx_array,
b: mlx_array,
s: mlx_stream,
) -> ::std::os::raw::c_int;
}
unsafe extern "C" {
pub fn mlx_repeat_axis(
res: *mut mlx_array,
arr: mlx_array,
repeats: ::std::os::raw::c_int,
axis: ::std::os::raw::c_int,
s: mlx_stream,
) -> ::std::os::raw::c_int;
}
unsafe extern "C" {
pub fn mlx_repeat(
res: *mut mlx_array,
arr: mlx_array,
repeats: ::std::os::raw::c_int,
s: mlx_stream,
) -> ::std::os::raw::c_int;
}
unsafe extern "C" {
pub fn mlx_reshape(
res: *mut mlx_array,
a: mlx_array,
shape: *const ::std::os::raw::c_int,
shape_num: usize,
s: mlx_stream,
) -> ::std::os::raw::c_int;
}
unsafe extern "C" {
pub fn mlx_right_shift(
res: *mut mlx_array,
a: mlx_array,
b: mlx_array,
s: mlx_stream,
) -> ::std::os::raw::c_int;
}
unsafe extern "C" {
pub fn mlx_roll_axis(
res: *mut mlx_array,
a: mlx_array,
shift: *const ::std::os::raw::c_int,
shift_num: usize,
axis: ::std::os::raw::c_int,
s: mlx_stream,
) -> ::std::os::raw::c_int;
}
unsafe extern "C" {
pub fn mlx_roll_axes(
res: *mut mlx_array,
a: mlx_array,
shift: *const ::std::os::raw::c_int,
shift_num: usize,
axes: *const ::std::os::raw::c_int,
axes_num: usize,
s: mlx_stream,
) -> ::std::os::raw::c_int;
}
unsafe extern "C" {
pub fn mlx_roll(
res: *mut mlx_array,
a: mlx_array,
shift: *const ::std::os::raw::c_int,
shift_num: usize,
s: mlx_stream,
) -> ::std::os::raw::c_int;
}
unsafe extern "C" {
pub fn mlx_round(
res: *mut mlx_array,
a: mlx_array,
decimals: ::std::os::raw::c_int,
s: mlx_stream,
) -> ::std::os::raw::c_int;
}
unsafe extern "C" {
pub fn mlx_rsqrt(res: *mut mlx_array, a: mlx_array, s: mlx_stream) -> ::std::os::raw::c_int;
}
unsafe extern "C" {
pub fn mlx_scatter(
res: *mut mlx_array,
a: mlx_array,
indices: mlx_vector_array,
updates: mlx_array,
axes: *const ::std::os::raw::c_int,
axes_num: usize,
s: mlx_stream,
) -> ::std::os::raw::c_int;
}
unsafe extern "C" {
pub fn mlx_scatter_single(
res: *mut mlx_array,
a: mlx_array,
indices: mlx_array,
updates: mlx_array,
axis: ::std::os::raw::c_int,
s: mlx_stream,
) -> ::std::os::raw::c_int;
}
unsafe extern "C" {
pub fn mlx_scatter_add(
res: *mut mlx_array,
a: mlx_array,
indices: mlx_vector_array,
updates: mlx_array,
axes: *const ::std::os::raw::c_int,
axes_num: usize,
s: mlx_stream,
) -> ::std::os::raw::c_int;
}
unsafe extern "C" {
pub fn mlx_scatter_add_single(
res: *mut mlx_array,
a: mlx_array,
indices: mlx_array,
updates: mlx_array,
axis: ::std::os::raw::c_int,
s: mlx_stream,
) -> ::std::os::raw::c_int;
}
unsafe extern "C" {
pub fn mlx_scatter_add_axis(
res: *mut mlx_array,
a: mlx_array,
indices: mlx_array,
values: mlx_array,
axis: ::std::os::raw::c_int,
s: mlx_stream,
) -> ::std::os::raw::c_int;
}
unsafe extern "C" {
pub fn mlx_scatter_max(
res: *mut mlx_array,
a: mlx_array,
indices: mlx_vector_array,
updates: mlx_array,
axes: *const ::std::os::raw::c_int,
axes_num: usize,
s: mlx_stream,
) -> ::std::os::raw::c_int;
}
unsafe extern "C" {
pub fn mlx_scatter_max_single(
res: *mut mlx_array,
a: mlx_array,
indices: mlx_array,
updates: mlx_array,
axis: ::std::os::raw::c_int,
s: mlx_stream,
) -> ::std::os::raw::c_int;
}
unsafe extern "C" {
pub fn mlx_scatter_min(
res: *mut mlx_array,
a: mlx_array,
indices: mlx_vector_array,
updates: mlx_array,
axes: *const ::std::os::raw::c_int,
axes_num: usize,
s: mlx_stream,
) -> ::std::os::raw::c_int;
}
unsafe extern "C" {
pub fn mlx_scatter_min_single(
res: *mut mlx_array,
a: mlx_array,
indices: mlx_array,
updates: mlx_array,
axis: ::std::os::raw::c_int,
s: mlx_stream,
) -> ::std::os::raw::c_int;
}
unsafe extern "C" {
pub fn mlx_scatter_prod(
res: *mut mlx_array,
a: mlx_array,
indices: mlx_vector_array,
updates: mlx_array,
axes: *const ::std::os::raw::c_int,
axes_num: usize,
s: mlx_stream,
) -> ::std::os::raw::c_int;
}
unsafe extern "C" {
pub fn mlx_scatter_prod_single(
res: *mut mlx_array,
a: mlx_array,
indices: mlx_array,
updates: mlx_array,
axis: ::std::os::raw::c_int,
s: mlx_stream,
) -> ::std::os::raw::c_int;
}
unsafe extern "C" {
pub fn mlx_segmented_mm(
res: *mut mlx_array,
a: mlx_array,
b: mlx_array,
segments: mlx_array,
s: mlx_stream,
) -> ::std::os::raw::c_int;
}
unsafe extern "C" {
pub fn mlx_sigmoid(res: *mut mlx_array, a: mlx_array, s: mlx_stream) -> ::std::os::raw::c_int;
}
unsafe extern "C" {
pub fn mlx_sign(res: *mut mlx_array, a: mlx_array, s: mlx_stream) -> ::std::os::raw::c_int;
}
unsafe extern "C" {
pub fn mlx_sin(res: *mut mlx_array, a: mlx_array, s: mlx_stream) -> ::std::os::raw::c_int;
}
unsafe extern "C" {
pub fn mlx_sinh(res: *mut mlx_array, a: mlx_array, s: mlx_stream) -> ::std::os::raw::c_int;
}
unsafe extern "C" {
pub fn mlx_slice(
res: *mut mlx_array,
a: mlx_array,
start: *const ::std::os::raw::c_int,
start_num: usize,
stop: *const ::std::os::raw::c_int,
stop_num: usize,
strides: *const ::std::os::raw::c_int,
strides_num: usize,
s: mlx_stream,
) -> ::std::os::raw::c_int;
}
unsafe extern "C" {
pub fn mlx_slice_dynamic(
res: *mut mlx_array,
a: mlx_array,
start: mlx_array,
axes: *const ::std::os::raw::c_int,
axes_num: usize,
slice_size: *const ::std::os::raw::c_int,
slice_size_num: usize,
s: mlx_stream,
) -> ::std::os::raw::c_int;
}
unsafe extern "C" {
pub fn mlx_slice_update(
res: *mut mlx_array,
src: mlx_array,
update: mlx_array,
start: *const ::std::os::raw::c_int,
start_num: usize,
stop: *const ::std::os::raw::c_int,
stop_num: usize,
strides: *const ::std::os::raw::c_int,
strides_num: usize,
s: mlx_stream,
) -> ::std::os::raw::c_int;
}
unsafe extern "C" {
pub fn mlx_slice_update_dynamic(
res: *mut mlx_array,
src: mlx_array,
update: mlx_array,
start: mlx_array,
axes: *const ::std::os::raw::c_int,
axes_num: usize,
s: mlx_stream,
) -> ::std::os::raw::c_int;
}
unsafe extern "C" {
pub fn mlx_slice_update_add(
res: *mut mlx_array,
src: mlx_array,
update: mlx_array,
start: *const ::std::os::raw::c_int,
start_num: usize,
stop: *const ::std::os::raw::c_int,
stop_num: usize,
strides: *const ::std::os::raw::c_int,
strides_num: usize,
s: mlx_stream,
) -> ::std::os::raw::c_int;
}
unsafe extern "C" {
pub fn mlx_slice_update_max(
res: *mut mlx_array,
src: mlx_array,
update: mlx_array,
start: *const ::std::os::raw::c_int,
start_num: usize,
stop: *const ::std::os::raw::c_int,
stop_num: usize,
strides: *const ::std::os::raw::c_int,
strides_num: usize,
s: mlx_stream,
) -> ::std::os::raw::c_int;
}
unsafe extern "C" {
pub fn mlx_slice_update_min(
res: *mut mlx_array,
src: mlx_array,
update: mlx_array,
start: *const ::std::os::raw::c_int,
start_num: usize,
stop: *const ::std::os::raw::c_int,
stop_num: usize,
strides: *const ::std::os::raw::c_int,
strides_num: usize,
s: mlx_stream,
) -> ::std::os::raw::c_int;
}
unsafe extern "C" {
pub fn mlx_slice_update_prod(
res: *mut mlx_array,
src: mlx_array,
update: mlx_array,
start: *const ::std::os::raw::c_int,
start_num: usize,
stop: *const ::std::os::raw::c_int,
stop_num: usize,
strides: *const ::std::os::raw::c_int,
strides_num: usize,
s: mlx_stream,
) -> ::std::os::raw::c_int;
}
unsafe extern "C" {
pub fn mlx_softmax_axes(
res: *mut mlx_array,
a: mlx_array,
axes: *const ::std::os::raw::c_int,
axes_num: usize,
precise: bool,
s: mlx_stream,
) -> ::std::os::raw::c_int;
}
unsafe extern "C" {
pub fn mlx_softmax_axis(
res: *mut mlx_array,
a: mlx_array,
axis: ::std::os::raw::c_int,
precise: bool,
s: mlx_stream,
) -> ::std::os::raw::c_int;
}
unsafe extern "C" {
pub fn mlx_softmax(
res: *mut mlx_array,
a: mlx_array,
precise: bool,
s: mlx_stream,
) -> ::std::os::raw::c_int;
}
unsafe extern "C" {
pub fn mlx_sort_axis(
res: *mut mlx_array,
a: mlx_array,
axis: ::std::os::raw::c_int,
s: mlx_stream,
) -> ::std::os::raw::c_int;
}
unsafe extern "C" {
pub fn mlx_sort(res: *mut mlx_array, a: mlx_array, s: mlx_stream) -> ::std::os::raw::c_int;
}
unsafe extern "C" {
pub fn mlx_split(
res: *mut mlx_vector_array,
a: mlx_array,
num_splits: ::std::os::raw::c_int,
axis: ::std::os::raw::c_int,
s: mlx_stream,
) -> ::std::os::raw::c_int;
}
unsafe extern "C" {
pub fn mlx_split_sections(
res: *mut mlx_vector_array,
a: mlx_array,
indices: *const ::std::os::raw::c_int,
indices_num: usize,
axis: ::std::os::raw::c_int,
s: mlx_stream,
) -> ::std::os::raw::c_int;
}
unsafe extern "C" {
pub fn mlx_sqrt(res: *mut mlx_array, a: mlx_array, s: mlx_stream) -> ::std::os::raw::c_int;
}
unsafe extern "C" {
pub fn mlx_square(res: *mut mlx_array, a: mlx_array, s: mlx_stream) -> ::std::os::raw::c_int;
}
unsafe extern "C" {
pub fn mlx_squeeze_axes(
res: *mut mlx_array,
a: mlx_array,
axes: *const ::std::os::raw::c_int,
axes_num: usize,
s: mlx_stream,
) -> ::std::os::raw::c_int;
}
unsafe extern "C" {
pub fn mlx_squeeze_axis(
res: *mut mlx_array,
a: mlx_array,
axis: ::std::os::raw::c_int,
s: mlx_stream,
) -> ::std::os::raw::c_int;
}
unsafe extern "C" {
pub fn mlx_squeeze(res: *mut mlx_array, a: mlx_array, s: mlx_stream) -> ::std::os::raw::c_int;
}
unsafe extern "C" {
pub fn mlx_stack_axis(
res: *mut mlx_array,
arrays: mlx_vector_array,
axis: ::std::os::raw::c_int,
s: mlx_stream,
) -> ::std::os::raw::c_int;
}
unsafe extern "C" {
pub fn mlx_stack(
res: *mut mlx_array,
arrays: mlx_vector_array,
s: mlx_stream,
) -> ::std::os::raw::c_int;
}
unsafe extern "C" {
pub fn mlx_std_axes(
res: *mut mlx_array,
a: mlx_array,
axes: *const ::std::os::raw::c_int,
axes_num: usize,
keepdims: bool,
ddof: ::std::os::raw::c_int,
s: mlx_stream,
) -> ::std::os::raw::c_int;
}
unsafe extern "C" {
pub fn mlx_std_axis(
res: *mut mlx_array,
a: mlx_array,
axis: ::std::os::raw::c_int,
keepdims: bool,
ddof: ::std::os::raw::c_int,
s: mlx_stream,
) -> ::std::os::raw::c_int;
}
unsafe extern "C" {
pub fn mlx_std(
res: *mut mlx_array,
a: mlx_array,
keepdims: bool,
ddof: ::std::os::raw::c_int,
s: mlx_stream,
) -> ::std::os::raw::c_int;
}
unsafe extern "C" {
pub fn mlx_stop_gradient(
res: *mut mlx_array,
a: mlx_array,
s: mlx_stream,
) -> ::std::os::raw::c_int;
}
unsafe extern "C" {
pub fn mlx_subtract(
res: *mut mlx_array,
a: mlx_array,
b: mlx_array,
s: mlx_stream,
) -> ::std::os::raw::c_int;
}
unsafe extern "C" {
pub fn mlx_sum_axes(
res: *mut mlx_array,
a: mlx_array,
axes: *const ::std::os::raw::c_int,
axes_num: usize,
keepdims: bool,
s: mlx_stream,
) -> ::std::os::raw::c_int;
}
unsafe extern "C" {
pub fn mlx_sum_axis(
res: *mut mlx_array,
a: mlx_array,
axis: ::std::os::raw::c_int,
keepdims: bool,
s: mlx_stream,
) -> ::std::os::raw::c_int;
}
unsafe extern "C" {
pub fn mlx_sum(
res: *mut mlx_array,
a: mlx_array,
keepdims: bool,
s: mlx_stream,
) -> ::std::os::raw::c_int;
}
unsafe extern "C" {
pub fn mlx_swapaxes(
res: *mut mlx_array,
a: mlx_array,
axis1: ::std::os::raw::c_int,
axis2: ::std::os::raw::c_int,
s: mlx_stream,
) -> ::std::os::raw::c_int;
}
unsafe extern "C" {
pub fn mlx_take_axis(
res: *mut mlx_array,
a: mlx_array,
indices: mlx_array,
axis: ::std::os::raw::c_int,
s: mlx_stream,
) -> ::std::os::raw::c_int;
}
unsafe extern "C" {
pub fn mlx_take(
res: *mut mlx_array,
a: mlx_array,
indices: mlx_array,
s: mlx_stream,
) -> ::std::os::raw::c_int;
}
unsafe extern "C" {
pub fn mlx_take_along_axis(
res: *mut mlx_array,
a: mlx_array,
indices: mlx_array,
axis: ::std::os::raw::c_int,
s: mlx_stream,
) -> ::std::os::raw::c_int;
}
unsafe extern "C" {
pub fn mlx_tan(res: *mut mlx_array, a: mlx_array, s: mlx_stream) -> ::std::os::raw::c_int;
}
unsafe extern "C" {
pub fn mlx_tanh(res: *mut mlx_array, a: mlx_array, s: mlx_stream) -> ::std::os::raw::c_int;
}
unsafe extern "C" {
pub fn mlx_tensordot(
res: *mut mlx_array,
a: mlx_array,
b: mlx_array,
axes_a: *const ::std::os::raw::c_int,
axes_a_num: usize,
axes_b: *const ::std::os::raw::c_int,
axes_b_num: usize,
s: mlx_stream,
) -> ::std::os::raw::c_int;
}
unsafe extern "C" {
pub fn mlx_tensordot_axis(
res: *mut mlx_array,
a: mlx_array,
b: mlx_array,
axis: ::std::os::raw::c_int,
s: mlx_stream,
) -> ::std::os::raw::c_int;
}
unsafe extern "C" {
pub fn mlx_tile(
res: *mut mlx_array,
arr: mlx_array,
reps: *const ::std::os::raw::c_int,
reps_num: usize,
s: mlx_stream,
) -> ::std::os::raw::c_int;
}
unsafe extern "C" {
pub fn mlx_to_fp8(res: *mut mlx_array, x: mlx_array, s: mlx_stream) -> ::std::os::raw::c_int;
}
unsafe extern "C" {
pub fn mlx_topk_axis(
res: *mut mlx_array,
a: mlx_array,
k: ::std::os::raw::c_int,
axis: ::std::os::raw::c_int,
s: mlx_stream,
) -> ::std::os::raw::c_int;
}
unsafe extern "C" {
pub fn mlx_topk(
res: *mut mlx_array,
a: mlx_array,
k: ::std::os::raw::c_int,
s: mlx_stream,
) -> ::std::os::raw::c_int;
}
unsafe extern "C" {
pub fn mlx_trace(
res: *mut mlx_array,
a: mlx_array,
offset: ::std::os::raw::c_int,
axis1: ::std::os::raw::c_int,
axis2: ::std::os::raw::c_int,
dtype: mlx_dtype,
s: mlx_stream,
) -> ::std::os::raw::c_int;
}
unsafe extern "C" {
pub fn mlx_transpose_axes(
res: *mut mlx_array,
a: mlx_array,
axes: *const ::std::os::raw::c_int,
axes_num: usize,
s: mlx_stream,
) -> ::std::os::raw::c_int;
}
unsafe extern "C" {
pub fn mlx_transpose(res: *mut mlx_array, a: mlx_array, s: mlx_stream) -> ::std::os::raw::c_int;
}
unsafe extern "C" {
pub fn mlx_tri(
res: *mut mlx_array,
n: ::std::os::raw::c_int,
m: ::std::os::raw::c_int,
k: ::std::os::raw::c_int,
type_: mlx_dtype,
s: mlx_stream,
) -> ::std::os::raw::c_int;
}
unsafe extern "C" {
pub fn mlx_tril(
res: *mut mlx_array,
x: mlx_array,
k: ::std::os::raw::c_int,
s: mlx_stream,
) -> ::std::os::raw::c_int;
}
unsafe extern "C" {
pub fn mlx_triu(
res: *mut mlx_array,
x: mlx_array,
k: ::std::os::raw::c_int,
s: mlx_stream,
) -> ::std::os::raw::c_int;
}
unsafe extern "C" {
pub fn mlx_unflatten(
res: *mut mlx_array,
a: mlx_array,
axis: ::std::os::raw::c_int,
shape: *const ::std::os::raw::c_int,
shape_num: usize,
s: mlx_stream,
) -> ::std::os::raw::c_int;
}
unsafe extern "C" {
pub fn mlx_var_axes(
res: *mut mlx_array,
a: mlx_array,
axes: *const ::std::os::raw::c_int,
axes_num: usize,
keepdims: bool,
ddof: ::std::os::raw::c_int,
s: mlx_stream,
) -> ::std::os::raw::c_int;
}
unsafe extern "C" {
pub fn mlx_var_axis(
res: *mut mlx_array,
a: mlx_array,
axis: ::std::os::raw::c_int,
keepdims: bool,
ddof: ::std::os::raw::c_int,
s: mlx_stream,
) -> ::std::os::raw::c_int;
}
unsafe extern "C" {
pub fn mlx_var(
res: *mut mlx_array,
a: mlx_array,
keepdims: bool,
ddof: ::std::os::raw::c_int,
s: mlx_stream,
) -> ::std::os::raw::c_int;
}
unsafe extern "C" {
pub fn mlx_view(
res: *mut mlx_array,
a: mlx_array,
dtype: mlx_dtype,
s: mlx_stream,
) -> ::std::os::raw::c_int;
}
unsafe extern "C" {
pub fn mlx_where(
res: *mut mlx_array,
condition: mlx_array,
x: mlx_array,
y: mlx_array,
s: mlx_stream,
) -> ::std::os::raw::c_int;
}
unsafe extern "C" {
pub fn mlx_zeros(
res: *mut mlx_array,
shape: *const ::std::os::raw::c_int,
shape_num: usize,
dtype: mlx_dtype,
s: mlx_stream,
) -> ::std::os::raw::c_int;
}
unsafe extern "C" {
pub fn mlx_zeros_like(res: *mut mlx_array, a: mlx_array, s: mlx_stream) -> ::std::os::raw::c_int;
}
unsafe extern "C" {
pub fn mlx_random_bernoulli(
res: *mut mlx_array,
p: mlx_array,
shape: *const ::std::os::raw::c_int,
shape_num: usize,
key: mlx_array,
s: mlx_stream,
) -> ::std::os::raw::c_int;
}
unsafe extern "C" {
pub fn mlx_random_bits(
res: *mut mlx_array,
shape: *const ::std::os::raw::c_int,
shape_num: usize,
width: ::std::os::raw::c_int,
key: mlx_array,
s: mlx_stream,
) -> ::std::os::raw::c_int;
}
unsafe extern "C" {
pub fn mlx_random_categorical_shape(
res: *mut mlx_array,
logits: mlx_array,
axis: ::std::os::raw::c_int,
shape: *const ::std::os::raw::c_int,
shape_num: usize,
key: mlx_array,
s: mlx_stream,
) -> ::std::os::raw::c_int;
}
unsafe extern "C" {
pub fn mlx_random_categorical_num_samples(
res: *mut mlx_array,
logits_: mlx_array,
axis: ::std::os::raw::c_int,
num_samples: ::std::os::raw::c_int,
key: mlx_array,
s: mlx_stream,
) -> ::std::os::raw::c_int;
}
unsafe extern "C" {
pub fn mlx_random_categorical(
res: *mut mlx_array,
logits: mlx_array,
axis: ::std::os::raw::c_int,
key: mlx_array,
s: mlx_stream,
) -> ::std::os::raw::c_int;
}
unsafe extern "C" {
pub fn mlx_random_gumbel(
res: *mut mlx_array,
shape: *const ::std::os::raw::c_int,
shape_num: usize,
dtype: mlx_dtype,
key: mlx_array,
s: mlx_stream,
) -> ::std::os::raw::c_int;
}
unsafe extern "C" {
pub fn mlx_random_key(res: *mut mlx_array, seed: u64) -> ::std::os::raw::c_int;
}
unsafe extern "C" {
pub fn mlx_random_laplace(
res: *mut mlx_array,
shape: *const ::std::os::raw::c_int,
shape_num: usize,
dtype: mlx_dtype,
loc: f32,
scale: f32,
key: mlx_array,
s: mlx_stream,
) -> ::std::os::raw::c_int;
}
unsafe extern "C" {
pub fn mlx_random_multivariate_normal(
res: *mut mlx_array,
mean: mlx_array,
cov: mlx_array,
shape: *const ::std::os::raw::c_int,
shape_num: usize,
dtype: mlx_dtype,
key: mlx_array,
s: mlx_stream,
) -> ::std::os::raw::c_int;
}
unsafe extern "C" {
pub fn mlx_random_normal_broadcast(
res: *mut mlx_array,
shape: *const ::std::os::raw::c_int,
shape_num: usize,
dtype: mlx_dtype,
loc: mlx_array,
scale: mlx_array,
key: mlx_array,
s: mlx_stream,
) -> ::std::os::raw::c_int;
}
unsafe extern "C" {
pub fn mlx_random_normal(
res: *mut mlx_array,
shape: *const ::std::os::raw::c_int,
shape_num: usize,
dtype: mlx_dtype,
loc: f32,
scale: f32,
key: mlx_array,
s: mlx_stream,
) -> ::std::os::raw::c_int;
}
unsafe extern "C" {
pub fn mlx_random_permutation(
res: *mut mlx_array,
x: mlx_array,
axis: ::std::os::raw::c_int,
key: mlx_array,
s: mlx_stream,
) -> ::std::os::raw::c_int;
}
unsafe extern "C" {
pub fn mlx_random_permutation_arange(
res: *mut mlx_array,
x: ::std::os::raw::c_int,
key: mlx_array,
s: mlx_stream,
) -> ::std::os::raw::c_int;
}
unsafe extern "C" {
pub fn mlx_random_randint(
res: *mut mlx_array,
low: mlx_array,
high: mlx_array,
shape: *const ::std::os::raw::c_int,
shape_num: usize,
dtype: mlx_dtype,
key: mlx_array,
s: mlx_stream,
) -> ::std::os::raw::c_int;
}
unsafe extern "C" {
pub fn mlx_random_seed(seed: u64) -> ::std::os::raw::c_int;
}
unsafe extern "C" {
pub fn mlx_random_split_num(
res: *mut mlx_array,
key: mlx_array,
num: ::std::os::raw::c_int,
s: mlx_stream,
) -> ::std::os::raw::c_int;
}
unsafe extern "C" {
pub fn mlx_random_split(
res_0: *mut mlx_array,
res_1: *mut mlx_array,
key: mlx_array,
s: mlx_stream,
) -> ::std::os::raw::c_int;
}
unsafe extern "C" {
pub fn mlx_random_truncated_normal(
res: *mut mlx_array,
lower: mlx_array,
upper: mlx_array,
shape: *const ::std::os::raw::c_int,
shape_num: usize,
dtype: mlx_dtype,
key: mlx_array,
s: mlx_stream,
) -> ::std::os::raw::c_int;
}
unsafe extern "C" {
pub fn mlx_random_uniform(
res: *mut mlx_array,
low: mlx_array,
high: mlx_array,
shape: *const ::std::os::raw::c_int,
shape_num: usize,
dtype: mlx_dtype,
key: mlx_array,
s: mlx_stream,
) -> ::std::os::raw::c_int;
}
unsafe extern "C" {
pub fn mlx_async_eval(outputs: mlx_vector_array) -> ::std::os::raw::c_int;
}
unsafe extern "C" {
pub fn mlx_checkpoint(res: *mut mlx_closure, fun: mlx_closure) -> ::std::os::raw::c_int;
}
unsafe extern "C" {
pub fn mlx_custom_function(
res: *mut mlx_closure,
fun: mlx_closure,
fun_vjp: mlx_closure_custom,
fun_jvp: mlx_closure_custom_jvp,
fun_vmap: mlx_closure_custom_vmap,
) -> ::std::os::raw::c_int;
}
unsafe extern "C" {
pub fn mlx_custom_vjp(
res: *mut mlx_closure,
fun: mlx_closure,
fun_vjp: mlx_closure_custom,
) -> ::std::os::raw::c_int;
}
unsafe extern "C" {
pub fn mlx_eval(outputs: mlx_vector_array) -> ::std::os::raw::c_int;
}
unsafe extern "C" {
pub fn mlx_jvp(
res_0: *mut mlx_vector_array,
res_1: *mut mlx_vector_array,
fun: mlx_closure,
primals: mlx_vector_array,
tangents: mlx_vector_array,
) -> ::std::os::raw::c_int;
}
unsafe extern "C" {
pub fn mlx_value_and_grad(
res: *mut mlx_closure_value_and_grad,
fun: mlx_closure,
argnums: *const ::std::os::raw::c_int,
argnums_num: usize,
) -> ::std::os::raw::c_int;
}
unsafe extern "C" {
pub fn mlx_vjp(
res_0: *mut mlx_vector_array,
res_1: *mut mlx_vector_array,
fun: mlx_closure,
primals: mlx_vector_array,
cotangents: mlx_vector_array,
) -> ::std::os::raw::c_int;
}
unsafe extern "C" {
pub fn mlx_detail_vmap_replace(
res: *mut mlx_vector_array,
inputs: mlx_vector_array,
s_inputs: mlx_vector_array,
s_outputs: mlx_vector_array,
in_axes: *const ::std::os::raw::c_int,
in_axes_num: usize,
out_axes: *const ::std::os::raw::c_int,
out_axes_num: usize,
) -> ::std::os::raw::c_int;
}
unsafe extern "C" {
pub fn mlx_detail_vmap_trace(
res_0: *mut mlx_vector_array,
res_1: *mut mlx_vector_array,
fun: mlx_closure,
inputs: mlx_vector_array,
in_axes: *const ::std::os::raw::c_int,
in_axes_num: usize,
) -> ::std::os::raw::c_int;
}
unsafe extern "C" {
pub fn mlx_version(str_: *mut mlx_string) -> ::std::os::raw::c_int;
}