9#define BENCHMARK_INFO_PREFIX "##BENCHMARK_INFO_PREFIX##"
10#define BENCHMARK_INFO_SEPARATOR "#"
11#define BENCHMARK_INFO_SUFFIX "##BENCHMARK_INFO_SUFFIX##"
13#define BENCH_GATE_COUNT_START(builder, op_name) uint64_t __bench_before = builder.get_estimated_num_finalized_gates();
15#define BENCH_GATE_COUNT_END(builder, op_name) \
16 uint64_t __bench_after = builder.get_estimated_num_finalized_gates(); \
17 std::cerr << "num gates with " << op_name << " = " << __bench_after - __bench_before << std::endl; \
18 benchmark_info(Builder::NAME_STRING, "Bigfield", op_name, "Gate Count", __bench_after - __bench_before);
20template <
typename... Args> std::string
format(Args... args)
22 std::ostringstream os;
30 std::stringstream current_argument;
31 current_argument << first;
32 std::string current_argument_string = current_argument.str();
33 std::replace(current_argument_string.begin(), current_argument_string.end(),
',',
';');
37template <
typename T,
typename... Args>
41 std::stringstream current_argument;
42 current_argument << first;
43 std::string current_argument_string = current_argument.str();
44 std::replace(current_argument_string.begin(), current_argument_string.end(),
',',
';');
51 std::ostringstream os;
59template <
typename... Args>
inline void debug(Args... args)
67template <
typename... Args>
inline void debug(Args... ) {}
70template <
typename... Args>
inline void info(Args... args)
76template <
typename... Args>
inline void vinfo(Args... args)
83template <
typename... Args>
inline void important(Args... args)
97template <
typename Arg1,
typename Arg2,
typename Arg3,
typename Arg4,
typename Arg5>
98inline void benchmark_info(Arg1 composer, Arg2 class_name, Arg3 operation, Arg4 metric, Arg5
value)
131 template <
typename Arg1,
typename Arg2,
typename Arg3,
typename Arg4,
typename Arg5>
A class for saving benchmarks and printing them all at once in the end of the function.
void benchmark_info_deferred(Args...)
BenchmarkInfoCollator(BenchmarkInfoCollator &&other)=default
BenchmarkInfoCollator(const BenchmarkInfoCollator &other)=default
BenchmarkInfoCollator & operator=(const BenchmarkInfoCollator &other)=default
std::vector< std::string > saved_benchmarks
BenchmarkInfoCollator()=default
BenchmarkInfoCollator & operator=(BenchmarkInfoCollator &&other)=default
BenchmarkInfoCollator(std::vector< std::string > saved_benchmarks)
Info used to store circuit statistics during CI/CD with concrete structure. Stores string in vector f...
#define BENCHMARK_INFO_SEPARATOR
std::string format(Args... args)
#define BENCHMARK_INFO_PREFIX
void benchmark_info(Args...)
Info used to store circuit statistics during CI/CD with concrete structure. Writes straight to log.
#define BENCHMARK_INFO_SUFFIX
void important(Args... args)
std::string benchmark_format(Args... args)
void benchmark_format_chain(std::ostream &os, T const &first)
void logstr(char const *msg)