10#define BENCHMARK_INFO_PREFIX "##BENCHMARK_INFO_PREFIX##"
11#define BENCHMARK_INFO_SEPARATOR "#"
12#define BENCHMARK_INFO_SUFFIX "##BENCHMARK_INFO_SUFFIX##"
14#define BENCH_GATE_COUNT_START(builder, op_name) \
15 uint64_t __bench_before = builder.get_num_finalized_gates_inefficient();
17#define BENCH_GATE_COUNT_END(builder, op_name) \
18 uint64_t __bench_after = builder.get_num_finalized_gates_inefficient(); \
19 std::cerr << "num gates with " << op_name << " = " << __bench_after - __bench_before << std::endl; \
20 benchmark_info(Builder::NAME_STRING, "Bigfield", op_name, "Gate Count", __bench_after - __bench_before);
22template <
typename... Args> std::string
format(Args... args)
24 std::ostringstream os;
32 std::stringstream current_argument;
33 current_argument << first;
34 std::string current_argument_string = current_argument.str();
35 std::replace(current_argument_string.begin(), current_argument_string.end(),
',',
';');
39template <
typename T,
typename... Args>
43 std::stringstream current_argument;
44 current_argument << first;
45 std::string current_argument_string = current_argument.str();
46 std::replace(current_argument_string.begin(), current_argument_string.end(),
',',
';');
53 std::ostringstream os;
62#define debug(...) debug_([&]() { return format(__VA_ARGS__); })
64#define debug(...) (void)0
68inline void debug_(std::function<std::string()> func)
75template <
typename... Args>
inline void info(Args... args)
80#define vinfo(...) vinfo_([&]() { return format(__VA_ARGS__); })
83inline void vinfo_(std::function<std::string()> func)
90template <
typename... Args>
inline void important(Args... args)
104template <
typename Arg1,
typename Arg2,
typename Arg3,
typename Arg4,
typename Arg5>
105inline void benchmark_info(Arg1 composer, Arg2 class_name, Arg3 operation, Arg4 metric, Arg5
value)
138 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 debug_(std::function< std::string()> func)
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 vinfo_(std::function< std::string()> func)
void logstr(char const *msg)