fcyc.h 1.68 KB
Newer Older
Adam Blank's avatar
Adam Blank committed
1
2
3
/*
 * fcyc.h - prototypes for the routines in fcyc.c that estimate the
 *     time in CPU cycles used by a test function f
Caleb C. Sander's avatar
Fix #5    
Caleb C. Sander committed
4
 *
Adam Blank's avatar
Adam Blank committed
5
6
7
8
9
10
11
12
13
14
15
16
 * Copyright (c) 2002, R. Bryant and D. O'Hallaron, All rights reserved.
 * May not be used, modified, or copied without permission.
 *
 */

/* The test function takes a generic pointer as input */
typedef void (*test_funct)(void *);

/* Compute number of cycles used by test function f */
double fcyc(test_funct f, void* argp);

/*********************************************************
Caleb C. Sander's avatar
Fix #5    
Caleb C. Sander committed
17
 * Set the various parameters used by measurement routines
Adam Blank's avatar
Adam Blank committed
18
19
 *********************************************************/

Caleb C. Sander's avatar
Fix #5    
Caleb C. Sander committed
20
21
22
/*
 * set_fcyc_clear_cache - When set, will run code to clear cache
 *     before each measurement.
Adam Blank's avatar
Adam Blank committed
23
24
25
26
 *     Default = 0
 */
void set_fcyc_clear_cache(int clear);

Caleb C. Sander's avatar
Fix #5    
Caleb C. Sander committed
27
28
/*
 * set_fcyc_cache_size - Set size of cache to use when clearing cache
Adam Blank's avatar
Adam Blank committed
29
30
31
32
 *     Default = 1<<19 (512KB)
 */
void set_fcyc_cache_size(int bytes);

Caleb C. Sander's avatar
Fix #5    
Caleb C. Sander committed
33
34
/*
 * set_fcyc_cache_block - Set size of cache block
Adam Blank's avatar
Adam Blank committed
35
36
37
38
 *     Default = 32
 */
void set_fcyc_cache_block(int bytes);

Caleb C. Sander's avatar
Fix #5    
Caleb C. Sander committed
39
40
41
/*
 * set_fcyc_compensate- When set, will attempt to compensate for
 *     timer interrupt overhead
Adam Blank's avatar
Adam Blank committed
42
43
44
45
 *     Default = 0
 */
void set_fcyc_compensate(int compensate_arg);

Caleb C. Sander's avatar
Fix #5    
Caleb C. Sander committed
46
/*
Adam Blank's avatar
Adam Blank committed
47
48
49
50
51
 * set_fcyc_k - Value of K in K-best measurement scheme
 *     Default = 3
 */
void set_fcyc_k(int k);

Caleb C. Sander's avatar
Fix #5    
Caleb C. Sander committed
52
53
/*
 * set_fcyc_maxsamples - Maximum number of samples attempting to find
Adam Blank's avatar
Adam Blank committed
54
55
56
57
58
59
 *     K-best within some tolerance.
 *     When exceeded, just return best sample found.
 *     Default = 20
 */
void set_fcyc_maxsamples(int maxsamples_arg);

Caleb C. Sander's avatar
Fix #5    
Caleb C. Sander committed
60
/*
Adam Blank's avatar
Adam Blank committed
61
62
63
64
65
 * set_fcyc_epsilon - Tolerance required for K-best
 *     Default = 0.01
 */
void set_fcyc_epsilon(double epsilon_arg);

Caleb C. Sander's avatar
Fix #5    
Caleb C. Sander committed
66
void deinit_fcyc(void);
Adam Blank's avatar
Adam Blank committed
67
68