#![allow(warnings)]
pub type size_t = ::std::os::raw::c_ulong;
pub type __int8_t = ::std::os::raw::c_schar;
pub type __uint8_t = ::std::os::raw::c_uchar;
pub type __int16_t = ::std::os::raw::c_short;
pub type __uint16_t = ::std::os::raw::c_ushort;
pub type __int32_t = ::std::os::raw::c_int;
pub type __uint32_t = ::std::os::raw::c_uint;
pub type __int64_t = ::std::os::raw::c_long;
pub type __uint64_t = ::std::os::raw::c_ulong;
extern "C" {
pub fn halide_print(
user_context: *mut ::std::os::raw::c_void,
arg1: *const ::std::os::raw::c_char,
);
}
extern "C" {
pub fn halide_default_print(
user_context: *mut ::std::os::raw::c_void,
arg1: *const ::std::os::raw::c_char,
);
}
pub type halide_print_t = ::std::option::Option<
unsafe extern "C" fn(arg1: *mut ::std::os::raw::c_void, arg2: *const ::std::os::raw::c_char),
>;
extern "C" {
pub fn halide_set_custom_print(print: halide_print_t) -> halide_print_t;
}
extern "C" {
pub fn halide_error(
user_context: *mut ::std::os::raw::c_void,
arg1: *const ::std::os::raw::c_char,
);
}
extern "C" {
pub fn halide_default_error(
user_context: *mut ::std::os::raw::c_void,
arg1: *const ::std::os::raw::c_char,
);
}
pub type halide_error_handler_t = ::std::option::Option<
unsafe extern "C" fn(arg1: *mut ::std::os::raw::c_void, arg2: *const ::std::os::raw::c_char),
>;
extern "C" {
pub fn halide_set_error_handler(handler: halide_error_handler_t) -> halide_error_handler_t;
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct halide_mutex {
pub _private: [usize; 1usize],
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct halide_cond {
pub _private: [usize; 1usize],
}
extern "C" {
pub fn halide_mutex_lock(mutex: *mut halide_mutex);
}
extern "C" {
pub fn halide_mutex_unlock(mutex: *mut halide_mutex);
}
extern "C" {
pub fn halide_cond_signal(cond: *mut halide_cond);
}
extern "C" {
pub fn halide_cond_broadcast(cond: *mut halide_cond);
}
extern "C" {
pub fn halide_cond_wait(cond: *mut halide_cond, mutex: *mut halide_mutex);
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct halide_mutex_array {
_unused: [u8; 0],
}
extern "C" {
pub fn halide_mutex_array_create(sz: ::std::os::raw::c_int) -> *mut halide_mutex_array;
}
extern "C" {
pub fn halide_mutex_array_destroy(
user_context: *mut ::std::os::raw::c_void,
array: *mut ::std::os::raw::c_void,
);
}
extern "C" {
pub fn halide_mutex_array_lock(
array: *mut halide_mutex_array,
entry: ::std::os::raw::c_int,
) -> ::std::os::raw::c_int;
}
extern "C" {
pub fn halide_mutex_array_unlock(
array: *mut halide_mutex_array,
entry: ::std::os::raw::c_int,
) -> ::std::os::raw::c_int;
}
pub type halide_task_t = ::std::option::Option<
unsafe extern "C" fn(
user_context: *mut ::std::os::raw::c_void,
task_number: ::std::os::raw::c_int,
closure: *mut u8,
) -> ::std::os::raw::c_int,
>;
extern "C" {
pub fn halide_do_par_for(
user_context: *mut ::std::os::raw::c_void,
task: halide_task_t,
min: ::std::os::raw::c_int,
size: ::std::os::raw::c_int,
closure: *mut u8,
) -> ::std::os::raw::c_int;
}
extern "C" {
pub fn halide_shutdown_thread_pool();
}
pub type halide_do_par_for_t = ::std::option::Option<
unsafe extern "C" fn(
arg1: *mut ::std::os::raw::c_void,
arg2: halide_task_t,
arg3: ::std::os::raw::c_int,
arg4: ::std::os::raw::c_int,
arg5: *mut u8,
) -> ::std::os::raw::c_int,
>;
extern "C" {
pub fn halide_set_custom_do_par_for(do_par_for: halide_do_par_for_t) -> halide_do_par_for_t;
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct halide_semaphore_t {
pub _private: [u64; 2usize],
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct halide_semaphore_acquire_t {
pub semaphore: *mut halide_semaphore_t,
pub count: ::std::os::raw::c_int,
}
extern "C" {
pub fn halide_semaphore_init(
arg1: *mut halide_semaphore_t,
n: ::std::os::raw::c_int,
) -> ::std::os::raw::c_int;
}
extern "C" {
pub fn halide_semaphore_release(
arg1: *mut halide_semaphore_t,
n: ::std::os::raw::c_int,
) -> ::std::os::raw::c_int;
}
extern "C" {
pub fn halide_semaphore_try_acquire(
arg1: *mut halide_semaphore_t,
n: ::std::os::raw::c_int,
) -> bool;
}
pub type halide_semaphore_init_t = ::std::option::Option<
unsafe extern "C" fn(
arg1: *mut halide_semaphore_t,
arg2: ::std::os::raw::c_int,
) -> ::std::os::raw::c_int,
>;
pub type halide_semaphore_release_t = ::std::option::Option<
unsafe extern "C" fn(
arg1: *mut halide_semaphore_t,
arg2: ::std::os::raw::c_int,
) -> ::std::os::raw::c_int,
>;
pub type halide_semaphore_try_acquire_t = ::std::option::Option<
unsafe extern "C" fn(arg1: *mut halide_semaphore_t, arg2: ::std::os::raw::c_int) -> bool,
>;
pub type halide_loop_task_t = ::std::option::Option<
unsafe extern "C" fn(
user_context: *mut ::std::os::raw::c_void,
min: ::std::os::raw::c_int,
extent: ::std::os::raw::c_int,
closure: *mut u8,
task_parent: *mut ::std::os::raw::c_void,
) -> ::std::os::raw::c_int,
>;
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct halide_parallel_task_t {
pub fn_: halide_loop_task_t,
pub closure: *mut u8,
pub name: *const ::std::os::raw::c_char,
pub semaphores: *mut halide_semaphore_acquire_t,
pub num_semaphores: ::std::os::raw::c_int,
pub min: ::std::os::raw::c_int,
pub extent: ::std::os::raw::c_int,
pub min_threads: ::std::os::raw::c_int,
pub serial: bool,
}
extern "C" {
pub fn halide_do_parallel_tasks(
user_context: *mut ::std::os::raw::c_void,
num_tasks: ::std::os::raw::c_int,
tasks: *mut halide_parallel_task_t,
task_parent: *mut ::std::os::raw::c_void,
) -> ::std::os::raw::c_int;
}
pub type halide_do_task_t = ::std::option::Option<
unsafe extern "C" fn(
arg1: *mut ::std::os::raw::c_void,
arg2: halide_task_t,
arg3: ::std::os::raw::c_int,
arg4: *mut u8,
) -> ::std::os::raw::c_int,
>;
extern "C" {
pub fn halide_set_custom_do_task(do_task: halide_do_task_t) -> halide_do_task_t;
}
extern "C" {
pub fn halide_do_task(
user_context: *mut ::std::os::raw::c_void,
f: halide_task_t,
idx: ::std::os::raw::c_int,
closure: *mut u8,
) -> ::std::os::raw::c_int;
}
pub type halide_do_loop_task_t = ::std::option::Option<
unsafe extern "C" fn(
arg1: *mut ::std::os::raw::c_void,
arg2: halide_loop_task_t,
arg3: ::std::os::raw::c_int,
arg4: ::std::os::raw::c_int,
arg5: *mut u8,
arg6: *mut ::std::os::raw::c_void,
) -> ::std::os::raw::c_int,
>;
extern "C" {
pub fn halide_set_custom_do_loop_task(do_task: halide_do_loop_task_t) -> halide_do_loop_task_t;
}
extern "C" {
pub fn halide_do_loop_task(
user_context: *mut ::std::os::raw::c_void,
f: halide_loop_task_t,
min: ::std::os::raw::c_int,
extent: ::std::os::raw::c_int,
closure: *mut u8,
task_parent: *mut ::std::os::raw::c_void,
) -> ::std::os::raw::c_int;
}
pub type halide_do_parallel_tasks_t = ::std::option::Option<
unsafe extern "C" fn(
arg1: *mut ::std::os::raw::c_void,
arg2: ::std::os::raw::c_int,
arg3: *mut halide_parallel_task_t,
task_parent: *mut ::std::os::raw::c_void,
) -> ::std::os::raw::c_int,
>;
extern "C" {
pub fn halide_set_custom_parallel_runtime(
arg1: halide_do_par_for_t,
arg2: halide_do_task_t,
arg3: halide_do_loop_task_t,
arg4: halide_do_parallel_tasks_t,
arg5: halide_semaphore_init_t,
arg6: halide_semaphore_try_acquire_t,
arg7: halide_semaphore_release_t,
);
}
extern "C" {
pub fn halide_default_do_par_for(
user_context: *mut ::std::os::raw::c_void,
task: halide_task_t,
min: ::std::os::raw::c_int,
size: ::std::os::raw::c_int,
closure: *mut u8,
) -> ::std::os::raw::c_int;
}
extern "C" {
pub fn halide_default_do_parallel_tasks(
user_context: *mut ::std::os::raw::c_void,
num_tasks: ::std::os::raw::c_int,
tasks: *mut halide_parallel_task_t,
task_parent: *mut ::std::os::raw::c_void,
) -> ::std::os::raw::c_int;
}
extern "C" {
pub fn halide_default_do_task(
user_context: *mut ::std::os::raw::c_void,
f: halide_task_t,
idx: ::std::os::raw::c_int,
closure: *mut u8,
) -> ::std::os::raw::c_int;
}
extern "C" {
pub fn halide_default_do_loop_task(
user_context: *mut ::std::os::raw::c_void,
f: halide_loop_task_t,
min: ::std::os::raw::c_int,
extent: ::std::os::raw::c_int,
closure: *mut u8,
task_parent: *mut ::std::os::raw::c_void,
) -> ::std::os::raw::c_int;
}
extern "C" {
pub fn halide_default_semaphore_init(
arg1: *mut halide_semaphore_t,
n: ::std::os::raw::c_int,
) -> ::std::os::raw::c_int;
}
extern "C" {
pub fn halide_default_semaphore_release(
arg1: *mut halide_semaphore_t,
n: ::std::os::raw::c_int,
) -> ::std::os::raw::c_int;
}
extern "C" {
pub fn halide_default_semaphore_try_acquire(
arg1: *mut halide_semaphore_t,
n: ::std::os::raw::c_int,
) -> bool;
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct halide_thread {
_unused: [u8; 0],
}
extern "C" {
pub fn halide_spawn_thread(
f: ::std::option::Option<unsafe extern "C" fn(arg1: *mut ::std::os::raw::c_void)>,
closure: *mut ::std::os::raw::c_void,
) -> *mut halide_thread;
}
extern "C" {
pub fn halide_join_thread(arg1: *mut halide_thread);
}
extern "C" {
pub fn halide_set_num_threads(n: ::std::os::raw::c_int) -> ::std::os::raw::c_int;
}
extern "C" {
pub fn halide_malloc(
user_context: *mut ::std::os::raw::c_void,
x: size_t,
) -> *mut ::std::os::raw::c_void;
}
extern "C" {
pub fn halide_free(user_context: *mut ::std::os::raw::c_void, ptr: *mut ::std::os::raw::c_void);
}
extern "C" {
pub fn halide_default_malloc(
user_context: *mut ::std::os::raw::c_void,
x: size_t,
) -> *mut ::std::os::raw::c_void;
}
extern "C" {
pub fn halide_default_free(
user_context: *mut ::std::os::raw::c_void,
ptr: *mut ::std::os::raw::c_void,
);
}
pub type halide_malloc_t = ::std::option::Option<
unsafe extern "C" fn(
arg1: *mut ::std::os::raw::c_void,
arg2: size_t,
) -> *mut ::std::os::raw::c_void,
>;
pub type halide_free_t = ::std::option::Option<
unsafe extern "C" fn(arg1: *mut ::std::os::raw::c_void, arg2: *mut ::std::os::raw::c_void),
>;
extern "C" {
pub fn halide_set_custom_malloc(user_malloc: halide_malloc_t) -> halide_malloc_t;
}
extern "C" {
pub fn halide_set_custom_free(user_free: halide_free_t) -> halide_free_t;
}
extern "C" {
pub fn halide_get_symbol(name: *const ::std::os::raw::c_char) -> *mut ::std::os::raw::c_void;
}
extern "C" {
pub fn halide_load_library(name: *const ::std::os::raw::c_char) -> *mut ::std::os::raw::c_void;
}
extern "C" {
pub fn halide_get_library_symbol(
lib: *mut ::std::os::raw::c_void,
name: *const ::std::os::raw::c_char,
) -> *mut ::std::os::raw::c_void;
}
extern "C" {
pub fn halide_default_get_symbol(
name: *const ::std::os::raw::c_char,
) -> *mut ::std::os::raw::c_void;
}
extern "C" {
pub fn halide_default_load_library(
name: *const ::std::os::raw::c_char,
) -> *mut ::std::os::raw::c_void;
}
extern "C" {
pub fn halide_default_get_library_symbol(
lib: *mut ::std::os::raw::c_void,
name: *const ::std::os::raw::c_char,
) -> *mut ::std::os::raw::c_void;
}
pub type halide_get_symbol_t = ::std::option::Option<
unsafe extern "C" fn(name: *const ::std::os::raw::c_char) -> *mut ::std::os::raw::c_void,
>;
pub type halide_load_library_t = ::std::option::Option<
unsafe extern "C" fn(name: *const ::std::os::raw::c_char) -> *mut ::std::os::raw::c_void,
>;
pub type halide_get_library_symbol_t = ::std::option::Option<
unsafe extern "C" fn(
lib: *mut ::std::os::raw::c_void,
name: *const ::std::os::raw::c_char,
) -> *mut ::std::os::raw::c_void,
>;
extern "C" {
pub fn halide_set_custom_get_symbol(
user_get_symbol: halide_get_symbol_t,
) -> halide_get_symbol_t;
}
extern "C" {
pub fn halide_set_custom_load_library(
user_load_library: halide_load_library_t,
) -> halide_load_library_t;
}
extern "C" {
pub fn halide_set_custom_get_library_symbol(
user_get_library_symbol: halide_get_library_symbol_t,
) -> halide_get_library_symbol_t;
}
extern "C" {
pub fn halide_debug_to_file(
user_context: *mut ::std::os::raw::c_void,
filename: *const ::std::os::raw::c_char,
type_code: i32,
buf: *mut halide_buffer_t,
) -> i32;
}
#[repr(u32)]
#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)]
pub enum halide_type_code_t {
halide_type_int = 0,
halide_type_uint = 1,
halide_type_float = 2,
halide_type_handle = 3,
halide_type_bfloat = 4,
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct halide_type_t {
pub code: u8,
pub bits: u8,
pub lanes: u16,
}
#[repr(u32)]
#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)]
pub enum halide_trace_event_code_t {
halide_trace_load = 0,
halide_trace_store = 1,
halide_trace_begin_realization = 2,
halide_trace_end_realization = 3,
halide_trace_produce = 4,
halide_trace_end_produce = 5,
halide_trace_consume = 6,
halide_trace_end_consume = 7,
halide_trace_begin_pipeline = 8,
halide_trace_end_pipeline = 9,
halide_trace_tag = 10,
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct halide_trace_event_t {
pub func: *const ::std::os::raw::c_char,
pub value: *mut ::std::os::raw::c_void,
pub coordinates: *mut i32,
pub trace_tag: *const ::std::os::raw::c_char,
pub type_: halide_type_t,
pub event: halide_trace_event_code_t,
pub parent_id: i32,
pub value_index: i32,
pub dimensions: i32,
}
extern "C" {
pub fn halide_trace(
user_context: *mut ::std::os::raw::c_void,
event: *const halide_trace_event_t,
) -> i32;
}
extern "C" {
pub fn halide_default_trace(
user_context: *mut ::std::os::raw::c_void,
event: *const halide_trace_event_t,
) -> i32;
}
pub type halide_trace_t = ::std::option::Option<
unsafe extern "C" fn(
user_context: *mut ::std::os::raw::c_void,
arg1: *const halide_trace_event_t,
) -> i32,
>;
extern "C" {
pub fn halide_set_custom_trace(trace: halide_trace_t) -> halide_trace_t;
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct halide_trace_packet_t {
pub size: u32,
pub id: i32,
pub type_: halide_type_t,
pub event: halide_trace_event_code_t,
pub parent_id: i32,
pub value_index: i32,
pub dimensions: i32,
}
extern "C" {
pub fn halide_set_trace_file(fd: ::std::os::raw::c_int);
}
extern "C" {
pub fn halide_get_trace_file(
user_context: *mut ::std::os::raw::c_void,
) -> ::std::os::raw::c_int;
}
extern "C" {
pub fn halide_shutdown_trace() -> ::std::os::raw::c_int;
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct halide_device_interface_impl_t {
_unused: [u8; 0],
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct halide_device_interface_t {
pub device_malloc: ::std::option::Option<
unsafe extern "C" fn(
user_context: *mut ::std::os::raw::c_void,
buf: *mut halide_buffer_t,
device_interface: *const halide_device_interface_t,
) -> ::std::os::raw::c_int,
>,
pub device_free: ::std::option::Option<
unsafe extern "C" fn(
user_context: *mut ::std::os::raw::c_void,
buf: *mut halide_buffer_t,
) -> ::std::os::raw::c_int,
>,
pub device_sync: ::std::option::Option<
unsafe extern "C" fn(
user_context: *mut ::std::os::raw::c_void,
buf: *mut halide_buffer_t,
) -> ::std::os::raw::c_int,
>,
pub device_release: ::std::option::Option<
unsafe extern "C" fn(
user_context: *mut ::std::os::raw::c_void,
device_interface: *const halide_device_interface_t,
),
>,
pub copy_to_host: ::std::option::Option<
unsafe extern "C" fn(
user_context: *mut ::std::os::raw::c_void,
buf: *mut halide_buffer_t,
) -> ::std::os::raw::c_int,
>,
pub copy_to_device: ::std::option::Option<
unsafe extern "C" fn(
user_context: *mut ::std::os::raw::c_void,
buf: *mut halide_buffer_t,
device_interface: *const halide_device_interface_t,
) -> ::std::os::raw::c_int,
>,
pub device_and_host_malloc: ::std::option::Option<
unsafe extern "C" fn(
user_context: *mut ::std::os::raw::c_void,
buf: *mut halide_buffer_t,
device_interface: *const halide_device_interface_t,
) -> ::std::os::raw::c_int,
>,
pub device_and_host_free: ::std::option::Option<
unsafe extern "C" fn(
user_context: *mut ::std::os::raw::c_void,
buf: *mut halide_buffer_t,
) -> ::std::os::raw::c_int,
>,
pub buffer_copy: ::std::option::Option<
unsafe extern "C" fn(
user_context: *mut ::std::os::raw::c_void,
src: *mut halide_buffer_t,
dst_device_interface: *const halide_device_interface_t,
dst: *mut halide_buffer_t,
) -> ::std::os::raw::c_int,
>,
pub device_crop: ::std::option::Option<
unsafe extern "C" fn(
user_context: *mut ::std::os::raw::c_void,
src: *const halide_buffer_t,
dst: *mut halide_buffer_t,
) -> ::std::os::raw::c_int,
>,
pub device_slice: ::std::option::Option<
unsafe extern "C" fn(
user_context: *mut ::std::os::raw::c_void,
src: *const halide_buffer_t,
slice_dim: ::std::os::raw::c_int,
slice_pos: ::std::os::raw::c_int,
dst: *mut halide_buffer_t,
) -> ::std::os::raw::c_int,
>,
pub device_release_crop: ::std::option::Option<
unsafe extern "C" fn(
user_context: *mut ::std::os::raw::c_void,
buf: *mut halide_buffer_t,
) -> ::std::os::raw::c_int,
>,
pub wrap_native: ::std::option::Option<
unsafe extern "C" fn(
user_context: *mut ::std::os::raw::c_void,
buf: *mut halide_buffer_t,
handle: u64,
device_interface: *const halide_device_interface_t,
) -> ::std::os::raw::c_int,
>,
pub detach_native: ::std::option::Option<
unsafe extern "C" fn(
user_context: *mut ::std::os::raw::c_void,
buf: *mut halide_buffer_t,
) -> ::std::os::raw::c_int,
>,
pub compute_capability: ::std::option::Option<
unsafe extern "C" fn(
user_context: *mut ::std::os::raw::c_void,
major: *mut ::std::os::raw::c_int,
minor: *mut ::std::os::raw::c_int,
) -> ::std::os::raw::c_int,
>,
pub impl_: *const halide_device_interface_impl_t,
}
extern "C" {
pub fn halide_device_release(
user_context: *mut ::std::os::raw::c_void,
device_interface: *const halide_device_interface_t,
);
}
extern "C" {
pub fn halide_copy_to_host(
user_context: *mut ::std::os::raw::c_void,
buf: *mut halide_buffer_t,
) -> ::std::os::raw::c_int;
}
extern "C" {
pub fn halide_copy_to_device(
user_context: *mut ::std::os::raw::c_void,
buf: *mut halide_buffer_t,
device_interface: *const halide_device_interface_t,
) -> ::std::os::raw::c_int;
}
extern "C" {
pub fn halide_buffer_copy(
user_context: *mut ::std::os::raw::c_void,
src: *mut halide_buffer_t,
dst_device_interface: *const halide_device_interface_t,
dst: *mut halide_buffer_t,
) -> ::std::os::raw::c_int;
}
extern "C" {
pub fn halide_device_crop(
user_context: *mut ::std::os::raw::c_void,
src: *const halide_buffer_t,
dst: *mut halide_buffer_t,
) -> ::std::os::raw::c_int;
}
extern "C" {
pub fn halide_device_slice(
user_context: *mut ::std::os::raw::c_void,
src: *const halide_buffer_t,
slice_dim: ::std::os::raw::c_int,
slice_pos: ::std::os::raw::c_int,
dst: *mut halide_buffer_t,
) -> ::std::os::raw::c_int;
}
extern "C" {
pub fn halide_device_release_crop(
user_context: *mut ::std::os::raw::c_void,
buf: *mut halide_buffer_t,
) -> ::std::os::raw::c_int;
}
extern "C" {
pub fn halide_device_sync(
user_context: *mut ::std::os::raw::c_void,
buf: *mut halide_buffer_t,
) -> ::std::os::raw::c_int;
}
extern "C" {
pub fn halide_device_malloc(
user_context: *mut ::std::os::raw::c_void,
buf: *mut halide_buffer_t,
device_interface: *const halide_device_interface_t,
) -> ::std::os::raw::c_int;
}
extern "C" {
pub fn halide_device_free(
user_context: *mut ::std::os::raw::c_void,
buf: *mut halide_buffer_t,
) -> ::std::os::raw::c_int;
}
extern "C" {
pub fn halide_device_wrap_native(
user_context: *mut ::std::os::raw::c_void,
buf: *mut halide_buffer_t,
handle: u64,
device_interface: *const halide_device_interface_t,
) -> ::std::os::raw::c_int;
}
extern "C" {
pub fn halide_device_detach_native(
user_context: *mut ::std::os::raw::c_void,
buf: *mut halide_buffer_t,
) -> ::std::os::raw::c_int;
}
extern "C" {
pub fn halide_set_gpu_device(n: ::std::os::raw::c_int);
}
extern "C" {
pub fn halide_get_gpu_device(
user_context: *mut ::std::os::raw::c_void,
) -> ::std::os::raw::c_int;
}
extern "C" {
pub fn halide_memoization_cache_set_size(size: i64);
}
extern "C" {
pub fn halide_memoization_cache_lookup(
user_context: *mut ::std::os::raw::c_void,
cache_key: *const u8,
size: i32,
realized_bounds: *mut halide_buffer_t,
tuple_count: i32,
tuple_buffers: *mut *mut halide_buffer_t,
) -> ::std::os::raw::c_int;
}
extern "C" {
pub fn halide_memoization_cache_store(
user_context: *mut ::std::os::raw::c_void,
cache_key: *const u8,
size: i32,
realized_bounds: *mut halide_buffer_t,
tuple_count: i32,
tuple_buffers: *mut *mut halide_buffer_t,
) -> ::std::os::raw::c_int;
}
extern "C" {
pub fn halide_memoization_cache_release(
user_context: *mut ::std::os::raw::c_void,
host: *mut ::std::os::raw::c_void,
);
}
extern "C" {
pub fn halide_memoization_cache_cleanup();
}
extern "C" {
pub fn halide_msan_check_memory_is_initialized(
user_context: *mut ::std::os::raw::c_void,
ptr: *const ::std::os::raw::c_void,
len: u64,
name: *const ::std::os::raw::c_char,
) -> ::std::os::raw::c_int;
}
extern "C" {
pub fn halide_msan_check_buffer_is_initialized(
user_context: *mut ::std::os::raw::c_void,
buffer: *mut halide_buffer_t,
buf_name: *const ::std::os::raw::c_char,
) -> ::std::os::raw::c_int;
}
extern "C" {
pub fn halide_msan_annotate_memory_is_initialized(
user_context: *mut ::std::os::raw::c_void,
ptr: *const ::std::os::raw::c_void,
len: u64,
) -> ::std::os::raw::c_int;
}
extern "C" {
pub fn halide_msan_annotate_buffer_is_initialized(
user_context: *mut ::std::os::raw::c_void,
buffer: *mut halide_buffer_t,
) -> ::std::os::raw::c_int;
}
extern "C" {
pub fn halide_msan_annotate_buffer_is_initialized_as_destructor(
user_context: *mut ::std::os::raw::c_void,
buffer: *mut ::std::os::raw::c_void,
);
}
#[repr(i32)]
#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)]
pub enum halide_error_code_t {
halide_error_code_success = 0,
halide_error_code_generic_error = -1,
halide_error_code_explicit_bounds_too_small = -2,
halide_error_code_bad_type = -3,
halide_error_code_access_out_of_bounds = -4,
halide_error_code_buffer_allocation_too_large = -5,
halide_error_code_buffer_extents_too_large = -6,
halide_error_code_constraints_make_required_region_smaller = -7,
halide_error_code_constraint_violated = -8,
halide_error_code_param_too_small = -9,
halide_error_code_param_too_large = -10,
halide_error_code_out_of_memory = -11,
halide_error_code_buffer_argument_is_null = -12,
halide_error_code_debug_to_file_failed = -13,
halide_error_code_copy_to_host_failed = -14,
halide_error_code_copy_to_device_failed = -15,
halide_error_code_device_malloc_failed = -16,
halide_error_code_device_sync_failed = -17,
halide_error_code_device_free_failed = -18,
halide_error_code_no_device_interface = -19,
halide_error_code_matlab_init_failed = -20,
halide_error_code_matlab_bad_param_type = -21,
halide_error_code_internal_error = -22,
halide_error_code_device_run_failed = -23,
halide_error_code_unaligned_host_ptr = -24,
halide_error_code_bad_fold = -25,
halide_error_code_fold_factor_too_small = -26,
halide_error_code_requirement_failed = -27,
halide_error_code_buffer_extents_negative = -28,
halide_error_code_unused_29 = -29,
halide_error_code_unused_30 = -30,
halide_error_code_specialize_fail = -31,
halide_error_code_device_wrap_native_failed = -32,
halide_error_code_device_detach_native_failed = -33,
halide_error_code_host_is_null = -34,
halide_error_code_bad_extern_fold = -35,
halide_error_code_device_interface_no_device = -36,
halide_error_code_host_and_device_dirty = -37,
halide_error_code_buffer_is_null = -38,
halide_error_code_device_buffer_copy_failed = -39,
halide_error_code_device_crop_unsupported = -40,
halide_error_code_device_crop_failed = -41,
halide_error_code_incompatible_device_interface = -42,
halide_error_code_bad_dimensions = -43,
halide_error_code_device_dirty_with_no_device_support = -44,
}
extern "C" {
pub fn halide_error_bounds_inference_call_failed(
user_context: *mut ::std::os::raw::c_void,
extern_stage_name: *const ::std::os::raw::c_char,
result: ::std::os::raw::c_int,
) -> ::std::os::raw::c_int;
}
extern "C" {
pub fn halide_error_extern_stage_failed(
user_context: *mut ::std::os::raw::c_void,
extern_stage_name: *const ::std::os::raw::c_char,
result: ::std::os::raw::c_int,
) -> ::std::os::raw::c_int;
}
extern "C" {
pub fn halide_error_explicit_bounds_too_small(
user_context: *mut ::std::os::raw::c_void,
func_name: *const ::std::os::raw::c_char,
var_name: *const ::std::os::raw::c_char,
min_bound: ::std::os::raw::c_int,
max_bound: ::std::os::raw::c_int,
min_required: ::std::os::raw::c_int,
max_required: ::std::os::raw::c_int,
) -> ::std::os::raw::c_int;
}
extern "C" {
pub fn halide_error_bad_type(
user_context: *mut ::std::os::raw::c_void,
func_name: *const ::std::os::raw::c_char,
type_given: u32,
correct_type: u32,
) -> ::std::os::raw::c_int;
}
extern "C" {
pub fn halide_error_bad_dimensions(
user_context: *mut ::std::os::raw::c_void,
func_name: *const ::std::os::raw::c_char,
dimensions_given: i32,
correct_dimensions: i32,
) -> ::std::os::raw::c_int;
}
extern "C" {
pub fn halide_error_access_out_of_bounds(
user_context: *mut ::std::os::raw::c_void,
func_name: *const ::std::os::raw::c_char,
dimension: ::std::os::raw::c_int,
min_touched: ::std::os::raw::c_int,
max_touched: ::std::os::raw::c_int,
min_valid: ::std::os::raw::c_int,
max_valid: ::std::os::raw::c_int,
) -> ::std::os::raw::c_int;
}
extern "C" {
pub fn halide_error_buffer_allocation_too_large(
user_context: *mut ::std::os::raw::c_void,
buffer_name: *const ::std::os::raw::c_char,
allocation_size: u64,
max_size: u64,
) -> ::std::os::raw::c_int;
}
extern "C" {
pub fn halide_error_buffer_extents_negative(
user_context: *mut ::std::os::raw::c_void,
buffer_name: *const ::std::os::raw::c_char,
dimension: ::std::os::raw::c_int,
extent: ::std::os::raw::c_int,
) -> ::std::os::raw::c_int;
}
extern "C" {
pub fn halide_error_buffer_extents_too_large(
user_context: *mut ::std::os::raw::c_void,
buffer_name: *const ::std::os::raw::c_char,
actual_size: i64,
max_size: i64,
) -> ::std::os::raw::c_int;
}
extern "C" {
pub fn halide_error_constraints_make_required_region_smaller(
user_context: *mut ::std::os::raw::c_void,
buffer_name: *const ::std::os::raw::c_char,
dimension: ::std::os::raw::c_int,
constrained_min: ::std::os::raw::c_int,
constrained_extent: ::std::os::raw::c_int,
required_min: ::std::os::raw::c_int,
required_extent: ::std::os::raw::c_int,
) -> ::std::os::raw::c_int;
}
extern "C" {
pub fn halide_error_constraint_violated(
user_context: *mut ::std::os::raw::c_void,
var: *const ::std::os::raw::c_char,
val: ::std::os::raw::c_int,
constrained_var: *const ::std::os::raw::c_char,
constrained_val: ::std::os::raw::c_int,
) -> ::std::os::raw::c_int;
}
extern "C" {
pub fn halide_error_param_too_small_i64(
user_context: *mut ::std::os::raw::c_void,
param_name: *const ::std::os::raw::c_char,
val: i64,
min_val: i64,
) -> ::std::os::raw::c_int;
}
extern "C" {
pub fn halide_error_param_too_small_u64(
user_context: *mut ::std::os::raw::c_void,
param_name: *const ::std::os::raw::c_char,
val: u64,
min_val: u64,
) -> ::std::os::raw::c_int;
}
extern "C" {
pub fn halide_error_param_too_small_f64(
user_context: *mut ::std::os::raw::c_void,
param_name: *const ::std::os::raw::c_char,
val: f64,
min_val: f64,
) -> ::std::os::raw::c_int;
}
extern "C" {
pub fn halide_error_param_too_large_i64(
user_context: *mut ::std::os::raw::c_void,
param_name: *const ::std::os::raw::c_char,
val: i64,
max_val: i64,
) -> ::std::os::raw::c_int;
}
extern "C" {
pub fn halide_error_param_too_large_u64(
user_context: *mut ::std::os::raw::c_void,
param_name: *const ::std::os::raw::c_char,
val: u64,
max_val: u64,
) -> ::std::os::raw::c_int;
}
extern "C" {
pub fn halide_error_param_too_large_f64(
user_context: *mut ::std::os::raw::c_void,
param_name: *const ::std::os::raw::c_char,
val: f64,
max_val: f64,
) -> ::std::os::raw::c_int;
}
extern "C" {
pub fn halide_error_out_of_memory(
user_context: *mut ::std::os::raw::c_void,
) -> ::std::os::raw::c_int;
}
extern "C" {
pub fn halide_error_buffer_argument_is_null(
user_context: *mut ::std::os::raw::c_void,
buffer_name: *const ::std::os::raw::c_char,
) -> ::std::os::raw::c_int;
}
extern "C" {
pub fn halide_error_debug_to_file_failed(
user_context: *mut ::std::os::raw::c_void,
func: *const ::std::os::raw::c_char,
filename: *const ::std::os::raw::c_char,
error_code: ::std::os::raw::c_int,
) -> ::std::os::raw::c_int;
}
extern "C" {
pub fn halide_error_unaligned_host_ptr(
user_context: *mut ::std::os::raw::c_void,
func_name: *const ::std::os::raw::c_char,
alignment: ::std::os::raw::c_int,
) -> ::std::os::raw::c_int;
}
extern "C" {
pub fn halide_error_host_is_null(
user_context: *mut ::std::os::raw::c_void,
func_name: *const ::std::os::raw::c_char,
) -> ::std::os::raw::c_int;
}
extern "C" {
pub fn halide_error_bad_fold(
user_context: *mut ::std::os::raw::c_void,
func_name: *const ::std::os::raw::c_char,
var_name: *const ::std::os::raw::c_char,
loop_name: *const ::std::os::raw::c_char,
) -> ::std::os::raw::c_int;
}
extern "C" {
pub fn halide_error_bad_extern_fold(
user_context: *mut ::std::os::raw::c_void,
func_name: *const ::std::os::raw::c_char,
dim: ::std::os::raw::c_int,
min: ::std::os::raw::c_int,
extent: ::std::os::raw::c_int,
valid_min: ::std::os::raw::c_int,
fold_factor: ::std::os::raw::c_int,
) -> ::std::os::raw::c_int;
}
extern "C" {
pub fn halide_error_fold_factor_too_small(
user_context: *mut ::std::os::raw::c_void,
func_name: *const ::std::os::raw::c_char,
var_name: *const ::std::os::raw::c_char,
fold_factor: ::std::os::raw::c_int,
loop_name: *const ::std::os::raw::c_char,
required_extent: ::std::os::raw::c_int,
) -> ::std::os::raw::c_int;
}
extern "C" {
pub fn halide_error_requirement_failed(
user_context: *mut ::std::os::raw::c_void,
condition: *const ::std::os::raw::c_char,
message: *const ::std::os::raw::c_char,
) -> ::std::os::raw::c_int;
}
extern "C" {
pub fn halide_error_specialize_fail(
user_context: *mut ::std::os::raw::c_void,
message: *const ::std::os::raw::c_char,
) -> ::std::os::raw::c_int;
}
extern "C" {
pub fn halide_error_no_device_interface(
user_context: *mut ::std::os::raw::c_void,
) -> ::std::os::raw::c_int;
}
extern "C" {
pub fn halide_error_device_interface_no_device(
user_context: *mut ::std::os::raw::c_void,
) -> ::std::os::raw::c_int;
}
extern "C" {
pub fn halide_error_host_and_device_dirty(
user_context: *mut ::std::os::raw::c_void,
) -> ::std::os::raw::c_int;
}
extern "C" {
pub fn halide_error_buffer_is_null(
user_context: *mut ::std::os::raw::c_void,
routine: *const ::std::os::raw::c_char,
) -> ::std::os::raw::c_int;
}
extern "C" {
pub fn halide_error_device_dirty_with_no_device_support(
user_context: *mut ::std::os::raw::c_void,
buffer_name: *const ::std::os::raw::c_char,
) -> ::std::os::raw::c_int;
}
#[repr(u32)]
#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)]
pub enum halide_target_feature_t {
halide_target_feature_jit = 0,
halide_target_feature_debug = 1,
halide_target_feature_no_asserts = 2,
halide_target_feature_no_bounds_query = 3,
halide_target_feature_sse41 = 4,
halide_target_feature_avx = 5,
halide_target_feature_avx2 = 6,
halide_target_feature_fma = 7,
halide_target_feature_fma4 = 8,
halide_target_feature_f16c = 9,
halide_target_feature_armv7s = 10,
halide_target_feature_no_neon = 11,
halide_target_feature_vsx = 12,
halide_target_feature_power_arch_2_07 = 13,
halide_target_feature_cuda = 14,
halide_target_feature_cuda_capability30 = 15,
halide_target_feature_cuda_capability32 = 16,
halide_target_feature_cuda_capability35 = 17,
halide_target_feature_cuda_capability50 = 18,
halide_target_feature_opencl = 19,
halide_target_feature_cl_doubles = 20,
halide_target_feature_cl_atomic64 = 21,
halide_target_feature_opengl = 22,
halide_target_feature_openglcompute = 23,
halide_target_feature_user_context = 24,
halide_target_feature_matlab = 25,
halide_target_feature_profile = 26,
halide_target_feature_no_runtime = 27,
halide_target_feature_metal = 28,
halide_target_feature_mingw = 29,
halide_target_feature_c_plus_plus_mangling = 30,
halide_target_feature_large_buffers = 31,
halide_target_feature_hvx_64 = 32,
halide_target_feature_hvx_128 = 33,
halide_target_feature_hvx_v62 = 34,
halide_target_feature_fuzz_float_stores = 35,
halide_target_feature_soft_float_abi = 36,
halide_target_feature_msan = 37,
halide_target_feature_avx512 = 38,
halide_target_feature_avx512_knl = 39,
halide_target_feature_avx512_skylake = 40,
halide_target_feature_avx512_cannonlake = 41,
halide_target_feature_hvx_use_shared_object = 42,
halide_target_feature_trace_loads = 43,
halide_target_feature_trace_stores = 44,
halide_target_feature_trace_realizations = 45,
halide_target_feature_trace_pipeline = 46,
halide_target_feature_cuda_capability61 = 47,
halide_target_feature_hvx_v65 = 48,
halide_target_feature_hvx_v66 = 49,
halide_target_feature_cl_half = 50,
halide_target_feature_strict_float = 51,
halide_target_feature_tsan = 52,
halide_target_feature_asan = 53,
halide_target_feature_d3d12compute = 54,
halide_target_feature_check_unsafe_promises = 55,
halide_target_feature_hexagon_dma = 56,
halide_target_feature_embed_bitcode = 57,
halide_target_feature_enable_llvm_loop_opt = 58,
halide_target_feature_disable_llvm_loop_opt = 59,
halide_target_feature_wasm_simd128 = 60,
halide_target_feature_wasm_signext = 61,
halide_target_feature_sve = 62,
halide_target_feature_sve2 = 63,
halide_target_feature_egl = 64,
halide_target_feature_end = 65,
}
extern "C" {
pub fn halide_can_use_target_features(
count: ::std::os::raw::c_int,
features: *const u64,
) -> ::std::os::raw::c_int;
}
pub type halide_can_use_target_features_t = ::std::option::Option<
unsafe extern "C" fn(
count: ::std::os::raw::c_int,
features: *const u64,
) -> ::std::os::raw::c_int,
>;
extern "C" {
pub fn halide_set_custom_can_use_target_features(
arg1: halide_can_use_target_features_t,
) -> halide_can_use_target_features_t;
}
extern "C" {
pub fn halide_default_can_use_target_features(
count: ::std::os::raw::c_int,
features: *const u64,
) -> ::std::os::raw::c_int;
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct halide_dimension_t {
pub min: i32,
pub extent: i32,
pub stride: i32,
pub flags: u32,
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct halide_buffer_t {
pub device: u64,
pub device_interface: *const halide_device_interface_t,
pub host: *mut u8,
pub flags: u64,
pub type_: halide_type_t,
pub dimensions: i32,
pub dim: *mut halide_dimension_t,
pub padding: *mut ::std::os::raw::c_void,
}
#[repr(C)]
#[derive(Copy, Clone)]
pub struct halide_scalar_value_t {
pub u: halide_scalar_value_t__bindgen_ty_1,
}
#[repr(C)]
#[derive(Copy, Clone)]
pub union halide_scalar_value_t__bindgen_ty_1 {
pub b: bool,
pub i8: i8,
pub i16: i16,
pub i32: i32,
pub i64: i64,
pub u8: u8,
pub u16: u16,
pub u32: u32,
pub u64: u64,
pub f32: f32,
pub f64: f64,
pub handle: *mut ::std::os::raw::c_void,
_bindgen_union_align: u64,
}
#[repr(u32)]
#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)]
pub enum halide_argument_kind_t {
halide_argument_kind_input_scalar = 0,
halide_argument_kind_input_buffer = 1,
halide_argument_kind_output_buffer = 2,
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct halide_filter_argument_t {
pub name: *const ::std::os::raw::c_char,
pub kind: i32,
pub dimensions: i32,
pub type_: halide_type_t,
pub scalar_def: *const halide_scalar_value_t,
pub scalar_min: *const halide_scalar_value_t,
pub scalar_max: *const halide_scalar_value_t,
pub scalar_estimate: *const halide_scalar_value_t,
pub buffer_estimates: *const *const i64,
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct halide_filter_metadata_t {
pub version: i32,
pub num_arguments: i32,
pub arguments: *const halide_filter_argument_t,
pub target: *const ::std::os::raw::c_char,
pub name: *const ::std::os::raw::c_char,
}
extern "C" {
pub fn halide_register_argv_and_metadata(
filter_argv_call: ::std::option::Option<
unsafe extern "C" fn(arg1: *mut *mut ::std::os::raw::c_void) -> ::std::os::raw::c_int,
>,
filter_metadata: *const halide_filter_metadata_t,
extra_key_value_pairs: *const *const ::std::os::raw::c_char,
);
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct halide_profiler_func_stats {
pub time: u64,
pub memory_current: u64,
pub memory_peak: u64,
pub memory_total: u64,
pub stack_peak: u64,
pub active_threads_numerator: u64,
pub active_threads_denominator: u64,
pub name: *const ::std::os::raw::c_char,
pub num_allocs: ::std::os::raw::c_int,
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct halide_profiler_pipeline_stats {
pub time: u64,
pub memory_current: u64,
pub memory_peak: u64,
pub memory_total: u64,
pub active_threads_numerator: u64,
pub active_threads_denominator: u64,
pub name: *const ::std::os::raw::c_char,
pub funcs: *mut halide_profiler_func_stats,
pub next: *mut ::std::os::raw::c_void,
pub num_funcs: ::std::os::raw::c_int,
pub first_func_id: ::std::os::raw::c_int,
pub runs: ::std::os::raw::c_int,
pub samples: ::std::os::raw::c_int,
pub num_allocs: ::std::os::raw::c_int,
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct halide_profiler_state {
pub lock: halide_mutex,
pub sleep_time: ::std::os::raw::c_int,
pub first_free_id: ::std::os::raw::c_int,
pub current_func: ::std::os::raw::c_int,
pub active_threads: ::std::os::raw::c_int,
pub pipelines: *mut halide_profiler_pipeline_stats,
pub get_remote_profiler_state: ::std::option::Option<
unsafe extern "C" fn(
func: *mut ::std::os::raw::c_int,
active_workers: *mut ::std::os::raw::c_int,
),
>,
pub sampling_thread: *mut halide_thread,
}
extern "C" {
pub fn halide_profiler_get_state() -> *mut halide_profiler_state;
}
extern "C" {
pub fn halide_profiler_get_pipeline_state(
pipeline_name: *const ::std::os::raw::c_char,
) -> *mut halide_profiler_pipeline_stats;
}
extern "C" {
pub fn halide_profiler_reset();
}
extern "C" {
pub fn halide_profiler_shutdown();
}
extern "C" {
pub fn halide_profiler_report(user_context: *mut ::std::os::raw::c_void);
}
extern "C" {
pub fn halide_float16_bits_to_float(arg1: u16) -> f32;
}
extern "C" {
pub fn halide_float16_bits_to_double(arg1: u16) -> f64;
}
extern "C" {
pub fn halide_reuse_device_allocations(
user_context: *mut ::std::os::raw::c_void,
arg1: bool,
) -> ::std::os::raw::c_int;
}
extern "C" {
pub fn halide_can_reuse_device_allocations(user_context: *mut ::std::os::raw::c_void) -> bool;
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct halide_device_allocation_pool {
pub release_unused: ::std::option::Option<
unsafe extern "C" fn(user_context: *mut ::std::os::raw::c_void) -> ::std::os::raw::c_int,
>,
pub next: *mut halide_device_allocation_pool,
}
extern "C" {
pub fn halide_register_device_allocation_pool(arg1: *mut halide_device_allocation_pool);
}