2 *****************************************************************************
4 Declaration of functions for profiling code blocks.
6 Reports time, operation counts, memory usage, and others.
8 *****************************************************************************
9 * @author This file is part of libsnark, developed by SCIPR Lab
10 * and contributors (see AUTHORS).
11 * @copyright MIT license (see LICENSE file)
12 *****************************************************************************/
14 #ifndef PROFILING_HPP_
15 #define PROFILING_HPP_
24 void start_profiling();
25 long long get_nsec_time();
26 void print_time(const char* msg);
27 void print_header(const char* msg);
31 extern bool inhibit_profiling_info;
32 extern bool inhibit_profiling_counters;
33 extern std::map<std::string, size_t> invocation_counts;
34 extern std::map<std::string, long long> last_times;
35 extern std::map<std::string, long long> cumulative_times;
37 void clear_profiling_counters();
39 void print_cumulative_time_entry(const std::string &key, const long long factor=1);
40 void print_cumulative_times(const long long factor=1);
41 void print_cumulative_op_counts(const bool only_fq=false);
43 void enter_block(const std::string &msg, const bool indent=true);
44 void leave_block(const std::string &msg, const bool indent=true);
46 void print_mem(const std::string &s = "");
47 void print_compilation_info();
51 #endif // PROFILING_HPP_