flint_sys/
thread_support.rs1use crate::deps::*;
4use crate::flint::*;
5
6
7pub const FLINT_DEFAULT_THREAD_LIMIT: u32 = 99999;
8pub const FLINT_PARALLEL_UNIFORM: u32 = 1;
9pub const FLINT_PARALLEL_STRIDED: u32 = 2;
10pub const FLINT_PARALLEL_DYNAMIC: u32 = 4;
11pub const FLINT_PARALLEL_BSPLIT_LEFT_INPLACE: u32 = 8;
12pub const FLINT_PARALLEL_VERBOSE: u32 = 512;
13pub type do_func_t = ::std::option::Option<unsafe extern "C" fn(i: slong, args: *mut libc::c_void)>;
14pub type bsplit_merge_func_t = ::std::option::Option<
15 unsafe extern "C" fn(
16 arg1: *mut libc::c_void,
17 arg2: *mut libc::c_void,
18 arg3: *mut libc::c_void,
19 arg4: *mut libc::c_void,
20 ),
21>;
22pub type bsplit_basecase_func_t = ::std::option::Option<
23 unsafe extern "C" fn(
24 arg1: *mut libc::c_void,
25 arg2: slong,
26 arg3: slong,
27 arg4: *mut libc::c_void,
28 ),
29>;
30pub type bsplit_init_func_t =
31 ::std::option::Option<unsafe extern "C" fn(arg1: *mut libc::c_void, arg2: *mut libc::c_void)>;
32pub type bsplit_clear_func_t =
33 ::std::option::Option<unsafe extern "C" fn(arg1: *mut libc::c_void, arg2: *mut libc::c_void)>;
34extern "C" {
35 pub fn flint_request_threads(
36 handles: *mut *mut thread_pool_handle,
37 thread_limit: slong,
38 ) -> slong;
39 pub fn flint_give_back_threads(handles: *mut thread_pool_handle, num_handles: slong);
40 pub fn flint_get_num_available_threads() -> slong;
41 pub fn flint_parallel_do(
42 f: do_func_t,
43 args: *mut libc::c_void,
44 n: slong,
45 thread_limit: libc::c_int,
46 flags: libc::c_int,
47 );
48 pub fn flint_parallel_binary_splitting(
49 res: *mut libc::c_void,
50 basecase: bsplit_basecase_func_t,
51 merge: bsplit_merge_func_t,
52 sizeof_res: usize,
53 init: bsplit_init_func_t,
54 clear: bsplit_clear_func_t,
55 args: *mut libc::c_void,
56 a: slong,
57 b: slong,
58 basecase_cutoff: slong,
59 thread_limit: libc::c_int,
60 flags: libc::c_int,
61 );
62}