|
15 | 15 | * |
16 | 16 | * This module contains some utility functions for measuring the time that |
17 | 17 | * various methods take to execute. To use it, we insert the macro |
18 | | - * FHE_TIMER_START at the beginning of the method(s) that we want to time and |
19 | | - * FHE_TIMER_STOP at the end, then the main program needs to call the function |
| 18 | + * HELIB_TIMER_START at the beginning of the method(s) that we want to time and |
| 19 | + * HELIB_TIMER_STOP at the end, then the main program needs to call the function |
20 | 20 | * setTimersOn() to activate the timers and setTimersOff() to pause them. |
21 | 21 | * To obtain the value of a given timer (in seconds), the application can |
22 | 22 | * use the function getTime4func(const char *fncName), and the function |
@@ -48,8 +48,8 @@ class FHEtimer |
48 | 48 | const char* loc; |
49 | 49 |
|
50 | 50 | // THREADS: these need to be atomic |
51 | | - FHE_atomic_ulong counter; |
52 | | - FHE_atomic_long numCalls; |
| 51 | + HELIB_atomic_ulong counter; |
| 52 | + HELIB_atomic_long numCalls; |
53 | 53 |
|
54 | 54 | FHEtimer(const char* _name, const char* _loc) : |
55 | 55 | name(_name), loc(_loc), counter(0), numCalls(0) |
@@ -108,24 +108,24 @@ class auto_timer |
108 | 108 | // NOTE: the STOP functions below are not really needed, |
109 | 109 | // but are provided for backward compatibility |
110 | 110 |
|
111 | | -#define FHE_STRINGIFY(x) #x |
112 | | -#define FHE_TOSTRING(x) FHE_STRINGIFY(x) |
113 | | -#define FHE_AT __FILE__ ":" FHE_TOSTRING(__LINE__) |
| 111 | +#define HELIB_STRINGIFY(x) #x |
| 112 | +#define HELIB_TOSTRING(x) HELIB_STRINGIFY(x) |
| 113 | +#define HELIB_AT __FILE__ ":" HELIB_TOSTRING(__LINE__) |
114 | 114 |
|
115 | | -#define FHE_stringify_aux(s) #s |
116 | | -#define FHE_stringify(s) FHE_stringify_aux(s) |
| 115 | +#define HELIB_stringify_aux(s) #s |
| 116 | +#define HELIB_stringify(s) HELIB_stringify_aux(s) |
117 | 117 |
|
118 | | -#define FHE_TIMER_START \ |
119 | | - static helib::FHEtimer _local_timer(__func__, FHE_AT); \ |
| 118 | +#define HELIB_TIMER_START \ |
| 119 | + static helib::FHEtimer _local_timer(__func__, HELIB_AT); \ |
120 | 120 | helib::auto_timer _local_auto_timer(&_local_timer) |
121 | 121 |
|
122 | | -#define FHE_TIMER_STOP _local_auto_timer.stop() |
| 122 | +#define HELIB_TIMER_STOP _local_auto_timer.stop() |
123 | 123 |
|
124 | | -#define FHE_NTIMER_START(n) \ |
125 | | - static helib::FHEtimer _named_local_timer##n(#n, FHE_AT); \ |
| 124 | +#define HELIB_NTIMER_START(n) \ |
| 125 | + static helib::FHEtimer _named_local_timer##n(#n, HELIB_AT); \ |
126 | 126 | helib::auto_timer _named_local_auto_timer##n(&_named_local_timer##n) |
127 | 127 |
|
128 | | -#define FHE_NTIMER_STOP(n) _named_local_auto_timer##n.stop(); |
| 128 | +#define HELIB_NTIMER_STOP(n) _named_local_auto_timer##n.stop(); |
129 | 129 |
|
130 | 130 | } // namespace helib |
131 | 131 |
|
|
0 commit comments