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) uint64_t __bench_before = builder.get_estimated_num_finalized_gates();
16#define BENCH_GATE_COUNT_END(builder, op_name) \
17 uint64_t __bench_after = builder.get_estimated_num_finalized_gates(); \
18 std::cerr << "num gates with " << op_name << " = " << __bench_after - __bench_before << std::endl; \
19 benchmark_info(Builder::NAME_STRING, "Bigfield", op_name, "Gate Count", __bench_after - __bench_before);
21template <
typename... Args> std::string
format(Args... args)
23 std::ostringstream os;
31 std::stringstream current_argument;
32 current_argument << first;
33 std::string current_argument_string = current_argument.str();
34 std::replace(current_argument_string.begin(), current_argument_string.end(),
',',
';');
38template <
typename T,
typename... Args>
42 std::stringstream current_argument;
43 current_argument << first;
44 std::string current_argument_string = current_argument.str();
45 std::replace(current_argument_string.begin(), current_argument_string.end(),
',',
';');
52 std::ostringstream os;
61#define debug(...) debug_([&]() { return format(__VA_ARGS__); })
63#define debug(...) (void)0
67inline void debug_(std::function<std::string()> func)
74template <
typename... Args>
inline void info(Args... args)
79#define vinfo(...) vinfo_([&]() { return format(__VA_ARGS__); })
82inline void vinfo_(std::function<std::string()> func)
89template <
typename... Args>
inline void important(Args... args)
103template <
typename Arg1,
typename Arg2,
typename Arg3,
typename Arg4,
typename Arg5>
104inline void benchmark_info(Arg1 composer, Arg2 class_name, Arg3 operation, Arg4 metric, Arg5
value)
137 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)