- bitboards_init();
- Position::init();
- kpk_bitbase_init();
- Search::init();
- Threads.init();
-
- if (argc < 2)
- {
- cout << engine_name() << " by " << engine_authors() << endl;
- uci_loop();
- }
- else if (string(argv[1]) == "bench")
- benchmark(argc, argv);
-
- else
- cout << "Usage: stockfish bench [hash size = 128] [threads = 1] "
- << "[limit = 12] [fen positions file = default] "
- << "[limited by depth, time, nodes or perft = depth]" << endl;
-
- Threads.exit();
- return 0;
+ std::cout << engine_info() << std::endl;
+
+ CommandLine::init(argc, argv);
+ UCI::init(Options);
+ Tune::init();
+ Bitboards::init();
+ Position::init();
+ Threads.set(size_t(Options["Threads"]));
+ Search::clear(); // After threads are up
+ Eval::NNUE::init();
+
+ UCI::loop(argc, argv);
+
+ Threads.set(0);
+ return 0;