本文整理汇总了C++中Benchmark::benchmarkAll方法的典型用法代码示例。如果您正苦于以下问题:C++ Benchmark::benchmarkAll方法的具体用法?C++ Benchmark::benchmarkAll怎么用?C++ Benchmark::benchmarkAll使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Benchmark
的用法示例。
在下文中一共展示了Benchmark::benchmarkAll方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: main
int main(int argc, char *argv[])
{
globalStructuresInit();
options.parse(argc, (const char **) (argv));
//options.printAll();
if (options.help()){
cout << options.helpToString();
exit(1);
}
if (options.fnCfg() != ""){
cfg.loadFromFile(options.fnCfg());
}else{
cfg.loadFromFile(string(DEFAULT_CFG));
}
if (! cfg.checkConfiguration()){
logWarning("Incomplete configuration.");
//exit(1);
}
//getMove protocol
if (options.getMoveMode()){
Board board;
Engine* engine = new Engine();
//last three arguments should be : position game_record gamestate file
string gr = argv[argc - 2];
if (options.fnRecord() != "") {
logDebug("Loading from record %s.\n", options.fnRecord().c_str());
if (! board.initFromRecord(options.fnRecord().c_str(), true)){
logError("Couldn't read record from file %s.\n", options.fnRecord().c_str());
return 1;
}
}
else if (options.fnPosition() != "" ){
logDebug("Loading from position %s.\n", options.fnPosition().c_str());
if (! board.initFromPosition(options.fnPosition().c_str())){
//logError("Couldn't read position from file %s.\n", options.fnPosition().c_str());
}
logDebug("Loading from record %s.\n", options.fnRecord().c_str());
//try to read as if it's a record
if (! board.initFromRecord(options.fnPosition().c_str(), true)){
logError("Couldn't read position or record from file %s.\n", options.fnPosition().c_str());
return 1;
}
}
//cerr << "=====" << endl;
//cerr << board.toString();
engine->doSearch(&board);
cout << engine->getBestMove() << endl;
//cerr << engine->getStats();
//cerr << engine->getAdditionalInfo();
return 0;
}
//aei protocol;
Aei* aei;
if (options.localMode()){
//use extended aei command set
aei = new Aei(AC_EXT);
} else
{
aei = new Aei();
}
if (options.benchmarkMode()){
Benchmark benchmark;
benchmark.benchmarkAll();
return 0;
}
if (options.fnAeiInit() != "")
aei->initFromFile(options.fnAeiInit());
aei->runLoop();
return 0;
}