本文整理汇总了C++中Benchmark::GetBaseType方法的典型用法代码示例。如果您正苦于以下问题:C++ Benchmark::GetBaseType方法的具体用法?C++ Benchmark::GetBaseType怎么用?C++ Benchmark::GetBaseType使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Benchmark
的用法示例。
在下文中一共展示了Benchmark::GetBaseType方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: Shootout
//.........这里部分代码省略.........
{
output(pRes, "**** ERROR **** Excessive number of evaluation failures! [%d]\n\n",
failure_count);
++excessive_failure_cnt;
}
results.clear();
}
output(pRes, "\n\nBenchmark settings:\n");
output(pRes, " - Expressions File is \"%s\"\n" , sCaption.c_str());
output(pRes, " - Reference parser is %s\n" , pRefBench->GetShortName().c_str());
output(pRes, " - Iterations per expression: %d\n", iCount);
output(pRes, " - Number of expressions: %d\n" , vExpr.size());
if (excessive_failure_cnt)
output(pRes, " - Number of excessive failures: %d\n", excessive_failure_cnt);
#if defined(_DEBUG)
output(pRes, " - Debug build\n");
#else
output(pRes, " - Release build\n");
#endif
#if defined (__GNUC__)
output(pRes, " - Compiled with GCC Version %d.%d.%d\n", __GNUC__, __GNUC_MINOR__, __GNUC_PATCHLEVEL__);
#elif defined(_MSC_VER)
output(pRes, " - Compiled with MSVC Version %d\n", _MSC_VER);
#endif
output(pRes, " - IEEE 754 (IEC 559) is %s\n", (std::numeric_limits<double>::is_iec559) ? "Available" : " NOT AVAILABLE");
output(pRes, " - %d-bit build\n", sizeof(void*)*8);
dump_cpuid(pRes);
output(pRes, "\n\nScores:\n");
// Dump scores
std::deque<std::pair<int,Benchmark*> > order_list;
for (std::size_t i = 0; i < vBenchmarks.size(); ++i)
{
order_list.push_back(std::make_pair(vBenchmarks[i]->GetPoints(),vBenchmarks[i]));
}
std::sort(order_list.begin(),order_list.end());
std::reverse(order_list.begin(),order_list.end());
bool bHasFailures = false;
output(pRes, " # Parser Type Points Score Failures\n");
output(pRes, " -----------------------------------------------------------------------\n");
for (std::size_t i = 0; i < order_list.size(); ++i)
{
Benchmark* pBench = order_list[i].second;
bHasFailures |= (pBench->GetFails().size() > 0);
output(pRes, " %02d\t%-20s\t%-10s\t%6d\t%6d\t%4d\n",
i,
pBench->GetShortName().c_str(),
pBench->GetBaseType().c_str(),
pBench->GetPoints(),
(int)((pBench->GetScore() / (double)vExpr.size()) * 100.0),
pBench->GetFails().size());
}
// Dump failures
if (bHasFailures)
{
output(pRes, "\n\nFailures:\n");
for (std::size_t i = 0; i < vBenchmarks.size(); ++i)
{
Benchmark *pBench = vBenchmarks[i];
const std::map<std::string, std::string> &allFailures = pBench->GetFails();
if (!allFailures.empty())
{
output(pRes, " %-15s (%3d):\n",
pBench->GetShortName().c_str(),
allFailures.size());
for (auto it = allFailures.begin(); it != allFailures.end(); ++it)
{
output(pRes, " \"%s\" - \"%s\"\n",
it->first.c_str(),
it->second.c_str());
}
}
}
}
if (writeResultTable)
{
WriteResultTable(pRes,vBenchmarks,vExpr);
}
fclose(pRes);
}