Barretenberg
The ZK-SNARK library at the core of Aztec
Loading...
Searching...
No Matches
log.hpp File Reference
#include "barretenberg/env/logstr.hpp"
#include "barretenberg/stdlib/primitives/circuit_builders/circuit_builders_fwd.hpp"
#include <algorithm>
#include <sstream>
#include <string>
#include <vector>

Go to the source code of this file.

Classes

class  BenchmarkInfoCollator
 A class for saving benchmarks and printing them all at once in the end of the function. More...
 

Macros

#define BENCHMARK_INFO_PREFIX   "##BENCHMARK_INFO_PREFIX##"
 
#define BENCHMARK_INFO_SEPARATOR   "#"
 
#define BENCHMARK_INFO_SUFFIX   "##BENCHMARK_INFO_SUFFIX##"
 
#define BENCH_GATE_COUNT_START(builder, op_name)   uint64_t __bench_before = builder.get_estimated_num_finalized_gates();
 
#define BENCH_GATE_COUNT_END(builder, op_name)
 

Functions

template<typename... Args>
std::string format (Args... args)
 
template<typename T >
void benchmark_format_chain (std::ostream &os, T const &first)
 
template<typename T , typename... Args>
void benchmark_format_chain (std::ostream &os, T const &first, Args const &... args)
 
template<typename... Args>
std::string benchmark_format (Args... args)
 
template<typename... Args>
void debug (Args... args)
 
template<typename... Args>
void info (Args... args)
 
template<typename... Args>
void vinfo (Args... args)
 
template<typename... Args>
void important (Args... args)
 
template<typename... Args>
void benchmark_info (Args...)
 Info used to store circuit statistics during CI/CD with concrete structure. Writes straight to log.
 

Variables

bool debug_logging
 
bool verbose_logging
 

Macro Definition Documentation

◆ BENCH_GATE_COUNT_END

#define BENCH_GATE_COUNT_END (   builder,
  op_name 
)
Value:
uint64_t __bench_after = builder.get_estimated_num_finalized_gates(); \
std::cerr << "num gates with " << op_name << " = " << __bench_after - __bench_before << std::endl; \
benchmark_info(Builder::NAME_STRING, "Bigfield", op_name, "Gate Count", __bench_after - __bench_before);
AluTraceBuilder builder
Definition alu.test.cpp:123
constexpr decltype(auto) get(::tuplet::tuple< T... > &&t) noexcept
Definition tuple.hpp:13

Definition at line 15 of file log.hpp.

◆ BENCH_GATE_COUNT_START

#define BENCH_GATE_COUNT_START (   builder,
  op_name 
)    uint64_t __bench_before = builder.get_estimated_num_finalized_gates();

Definition at line 13 of file log.hpp.

◆ BENCHMARK_INFO_PREFIX

#define BENCHMARK_INFO_PREFIX   "##BENCHMARK_INFO_PREFIX##"

Definition at line 9 of file log.hpp.

◆ BENCHMARK_INFO_SEPARATOR

#define BENCHMARK_INFO_SEPARATOR   "#"

Definition at line 10 of file log.hpp.

◆ BENCHMARK_INFO_SUFFIX

#define BENCHMARK_INFO_SUFFIX   "##BENCHMARK_INFO_SUFFIX##"

Definition at line 11 of file log.hpp.

Function Documentation

◆ benchmark_format()

template<typename... Args>
std::string benchmark_format ( Args...  args)

Definition at line 49 of file log.hpp.

◆ benchmark_format_chain() [1/2]

template<typename T >
void benchmark_format_chain ( std::ostream &  os,
T const &  first 
)

Definition at line 27 of file log.hpp.

◆ benchmark_format_chain() [2/2]

template<typename T , typename... Args>
void benchmark_format_chain ( std::ostream &  os,
T const &  first,
Args const &...  args 
)

Definition at line 38 of file log.hpp.

◆ benchmark_info()

template<typename... Args>
void benchmark_info ( Args...  )
inline

Info used to store circuit statistics during CI/CD with concrete structure. Writes straight to log.

Automatically appends the necessary prefix and suffix, as well as separators.

Template Parameters
Args
Parameters
args

Definition at line 103 of file log.hpp.

◆ debug()

template<typename... Args>
void debug ( Args...  args)
inline

Definition at line 59 of file log.hpp.

◆ format()

template<typename... Args>
std::string format ( Args...  args)

Definition at line 20 of file log.hpp.

◆ important()

template<typename... Args>
void important ( Args...  args)
inline

Definition at line 83 of file log.hpp.

◆ info()

template<typename... Args>
void info ( Args...  args)
inline

Definition at line 70 of file log.hpp.

◆ vinfo()

template<typename... Args>
void vinfo ( Args...  args)
inline

Definition at line 76 of file log.hpp.

Variable Documentation

◆ debug_logging

bool debug_logging
extern

Definition at line 12 of file log.cpp.

◆ verbose_logging

bool verbose_logging
extern

Definition at line 6 of file log.cpp.