-
Notifications
You must be signed in to change notification settings - Fork 0
/
fcyc.h
executable file
·63 lines (45 loc) · 1.62 KB
/
fcyc.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
/* Fcyc measures the speed of any "test function." Such a function
is passed a list of integer parameters, which it may interpret
in any way it chooses.
Time can be measured in seconds or clock cycles.
*/
typedef void (*test_funct)(void *);
/* Compute number of cycles used by function f on given set of parameters */
double fcyc(test_funct f, void* args);
/* Compute number of cycles used by function f on given set of parameters */
double fsec(test_funct f, void* args);
/***********************************************************/
/* Set the various parameters used by measurement routines */
/* Sets minimum number of timer ticks to resolve time. Default = 1000 */
void set_fcyc_min_ticks(int t);
/* Sets minimum number of repetitions of function. Default = 8 */
void set_fcyc_min_reps(int r);
/* When set, will run code to clear cache before each measurement
Default = 0
*/
void set_fcyc_clear_cache(int clear);
/* Set size of cache to use when clearing cache
Default = 1<<19 (512KB)
*/
void set_fcyc_cache_size(long int bytes);
/* Set size of cache block
Default = 32
*/
void set_fcyc_cache_block(long int bytes);
/* When set, will attempt to compensate for timer interrupt overhead
Default = 0
*/
void set_fcyc_compensate(long int compensate);
/* Value of K in K-best
Default = 3
*/
void set_fcyc_k(long int k);
/* Maximum number of samples attempting to find K-best within some tolerance.
When exceeded, just return best sample found.
Default = 20
*/
void set_fcyc_maxsamples(long int maxsamples);
/* Tolerance required for K-best
Default = 0.01
*/
void set_fcyc_epsilon(double epsilon);