CppADCodeGen 2.4.3
A C++ Algorithmic Differentiation Package with Source Code Generation
Loading...
Searching...
No Matches
pthread_pool_h.hpp
1const char CPPADCG_PTHREAD_POOL_H_FILE[] = R"*=*(#ifndef CPPADCG_PTHREAD_POOL_H
2#define CPPADCG_PTHREAD_POOL_H
3/* --------------------------------------------------------------------------
4 * CppADCodeGen: C++ Algorithmic Differentiation with Source Code Generation:
5 * Copyright (C) 2016 Ciengis
6 *
7 * CppADCodeGen is distributed under multiple licenses:
8 *
9 * - Eclipse Public License Version 1.0 (EPL1), and
10 * - GNU General Public License Version 3 (GPL3).
11 *
12 * EPL1 terms and conditions can be found in the file "epl-v10.txt", while
13 * terms and conditions for the GPL3 can be found in the file "gpl3.txt".
14 * ----------------------------------------------------------------------------
15 * Author: Joao Leal
16 */
17
18#ifdef __cplusplus
19extern "C" {
20#endif
21
22enum ScheduleStrategy {SCHED_STATIC = 1,
23 SCHED_DYNAMIC = 2,
24 SCHED_GUIDED = 3
25 };
26
27enum ElapsedTimeReference {ELAPSED_TIME_AVG,
28 ELAPSED_TIME_MIN};
29
30typedef void (*cppadcg_thpool_function_type)(void*);
31
32
33void cppadcg_thpool_set_threads(int n);
34
35int cppadcg_thpool_get_threads();
36
37
38void cppadcg_thpool_set_scheduler_strategy(enum ScheduleStrategy s);
39
40enum ScheduleStrategy cppadcg_thpool_get_scheduler_strategy();
41
42
43void cppadcg_thpool_set_guided_maxgroupwork(float v);
44
45float cppadcg_thpool_get_guided_maxgroupwork();
46
47
48unsigned int cppadcg_thpool_get_n_time_meas();
49
50void cppadcg_thpool_set_n_time_meas(unsigned int n);
51
52
53enum ElapsedTimeReference cppadcg_thpool_get_time_meas_ref();
54
55void cppadcg_thpool_set_time_meas_ref(enum ElapsedTimeReference r);
56
57
58void cppadcg_thpool_set_verbose(int v);
59
60int cppadcg_thpool_is_verbose();
61
62
63void cppadcg_thpool_set_disabled(int disabled);
64
65int cppadcg_thpool_is_disabled();
66
67
68void cppadcg_thpool_prepare();
69
70void cppadcg_thpool_add_job(cppadcg_thpool_function_type function,
71 void* arg,
72 const float* avgElapsed,
73 float* elapsed);
74
75void cppadcg_thpool_add_jobs(cppadcg_thpool_function_type functions[],
76 void* args[],
77 const float refElapsed[],
78 float elapsed[],
79 const int order[],
80 int job2Thread[],
81 int nJobs,
82 int lastElapsedChanged);
83
84void cppadcg_thpool_wait();
85
86void cppadcg_thpool_update_order(float refElapsed[],
87 unsigned int nTimeMeas,
88 const float elapsed[],
89 int order[],
90 int nJobs);
91
92void cppadcg_thpool_shutdown();
93
94#ifdef __cplusplus
95}
96#endif
97
98#endif
99)*=*";
100
101const size_t CPPADCG_PTHREAD_POOL_H_FILE_SIZE = 2730;
102