Skip to content

Commit

Permalink
Ignore --batchsize in CPU only compiles.
Browse files Browse the repository at this point in the history
AutoGTP will always send --batchsize, but CPU only
compiles don't support the option. Ignore the option
in those builds.

The same problem exists with --tune-only, but quitting
immediately happens to be sane behavior so we don't need
to fix that.

Pull request leela-zero#2313.
  • Loading branch information
gcp authored Apr 3, 2019
1 parent 2474f73 commit da9ed9d
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/Leela.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -208,6 +208,11 @@ static void parse_commandline(int argc, char *argv[]) {
#endif
// These won't be shown, we use them to catch incorrect usage of the
// command line.
po::options_description ignore("Ignored options");
#ifndef USE_OPENCL
ignore.add_options()
("batchsize", po::value<unsigned int>()->default_value(1), "Max batch size.");
#endif
po::options_description h_desc("Hidden options");
h_desc.add_options()
("arguments", po::value<std::vector<std::string>>());
Expand All @@ -224,7 +229,7 @@ static void parse_commandline(int argc, char *argv[]) {
#endif
// Parse both the above, we will check if any of the latter are present.
po::options_description all;
all.add(visible).add(h_desc);
all.add(visible).add(ignore).add(h_desc);
po::positional_options_description p_desc;
p_desc.add("arguments", -1);
po::variables_map vm;
Expand Down

0 comments on commit da9ed9d

Please sign in to comment.