Go to the documentation of this file.
54 #include <mach/mach_time.h>
55 static mach_timebase_info_data_t g_time_info;
57 mach_timebase_info(&g_time_info);
62 #if defined(__APPLE__)
64 return t * g_time_info.numer / g_time_info.denom;
67 t.tv_sec =
t.tv_nsec = 0;
68 clock_gettime(CLOCK_MONOTONIC, &
t);
69 return static_cast<int64_t>(
t.tv_sec) * 1000000000LL +
t.tv_nsec;
80 const int kRangeMultiplier = 8;
88 lo *= kRangeMultiplier;
104 for (
int i = 1;
i < argc;
i++) {
106 if (
regcomp(&re, argv[
i], 0) != 0) {
107 fprintf(
stderr,
"couldn't compile \"%s\" as a regular expression!\n", argv[
i]);
136 for (
size_t i = 0;
i <
args_.size(); ++
i) {
159 int last = iterations;
166 iterations =
Round(iterations);
169 char throughput[100];
170 throughput[0] =
'\0';
174 snprintf(throughput,
sizeof(throughput),
" %8.2f MFlops/s", mflops_processed/seconds);
178 if (
arg >= (1<<20)) {
179 snprintf(full_name,
sizeof(full_name),
"%s/%dM",
name_,
arg/(1<<20));
180 }
else if (
arg >= (1<<10)) {
181 snprintf(full_name,
sizeof(full_name),
"%s/%dK",
name_,
arg/(1<<10));
183 snprintf(full_name,
sizeof(full_name),
"%s/%d",
name_,
arg);
186 snprintf(full_name,
sizeof(full_name),
"%s",
name_);
207 int main(
int argc,
char* argv[]) {
209 fprintf(
stderr,
"No benchmarks registered!\n");
213 int name_width =
static_cast<int>(strlen(it->second->Name()));
216 bool need_header =
true;
219 if (
b->ShouldRun(argc, argv)) {
229 fprintf(
stderr,
"No matching benchmarks!\n");
230 fprintf(
stderr,
"Available benchmarks:\n");
232 fprintf(
stderr,
" %s\n", it->second->Name());
Annotation for function names.
Annotation indicating that a class derives from another given type.
void(* fn_range_)(int, int)
bool ShouldRun(int argc, char *argv[])
static int g_name_column_width
void Register(const char *name, void(*fn)(int), void(*fn_range)(int, int))
set noclip points set clip one set noclip two set bar set border lt lw set xdata set ydata set zdata set x2data set y2data set boxwidth set dummy x
svint32_t PacketXi __attribute__((arm_sve_vector_bits(EIGEN_ARM64_SVE_VL)))
std::map< std::string, ::testing::Benchmark * > BenchmarkMap
static int64_t NanoTime()
static const symbolic::SymbolExpr< internal::symbolic_last_tag > last
BenchmarkMap & gBenchmarks()
void StartBenchmarkTiming()
bool match(const T &xpr, std::string ref, std::string str_xpr="")
static int64_t g_benchmark_start_time_ns
static int64_t g_benchmark_total_time_ns
int regexec(const regex_t *__restrict __preg, const char *__restrict __string, size_t __nmatch, regmatch_t __pmatch[__restrict_arr], int __eflags)
void SetBenchmarkFlopsProcessed(int64_t x)
static int64_t g_flops_processed
int regcomp(regex_t *__restrict __preg, const char *__restrict __pattern, int __cflags)
void RunRepeatedlyWithArg(int iterations, int arg)
BenchmarkMap::iterator BenchmarkMapIt
Benchmark * Range(int lo, int hi)
unsigned __int64 uint64_t
int main(int argc, char *argv[])
void StopBenchmarkTiming()
void regfree(regex_t *__preg)
gtsam
Author(s):
autogenerated on Sat Nov 16 2024 04:01:54