Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions app/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -216,17 +216,22 @@ int run_route(int argc, char** argv) {
if (!cur.empty()) devices.push_back(cur);
if (devices.empty()) throw std::runtime_error("--devices is empty");

const auto t0 = std::chrono::steady_clock::now();
onebit::laya::Scorer scorer;
if (!scorer.load(laya_model)) {
std::fprintf(stderr, "1bit route: %s\n", scorer.error().c_str());
return 1;
}
const auto t1 = std::chrono::steady_clock::now();
const std::string device = onebit::laya::route_device(scorer, state, devices);
if (device.empty()) {
std::fprintf(stderr, "1bit route: %s\n", scorer.error().c_str());
return 1;
}
const auto t2 = std::chrono::steady_clock::now();
std::printf("%s\n", device.c_str());
auto ms = [](auto a, auto b) { return std::chrono::duration<double, std::milli>(b - a).count(); };
std::fprintf(stderr, "1bit route: scorer loaded in %.0f ms, decision in %.0f ms\n", ms(t0, t1), ms(t1, t2));
return 0;
}
#endif
Expand Down
Loading