From 452885b0893dd81dd756fcc520def3702cfaf9c0 Mon Sep 17 00:00:00 2001 From: DefTruth <31974251+DefTruth@users.noreply.github.com> Date: Thu, 30 Mar 2023 21:08:38 +0800 Subject: [PATCH] [benchmark] fixed runtime benchmark bin macros bug (#1748) * [Benchmark] Add pure runtime benchmark bin * [Benchmark] add cpu/gpu memory collect -> benchmark bin * [Backend] update trt max_batch_size policy * [backend] Update trt backend max_batch_size policy * [Benchmark] Add more model format support -> benchmark bin * [benchmark] fixed runtime benchmark bin marcos bug --- benchmark/cpp/benchmark.cc | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/benchmark/cpp/benchmark.cc b/benchmark/cpp/benchmark.cc index 242179621..4629ad458 100755 --- a/benchmark/cpp/benchmark.cc +++ b/benchmark/cpp/benchmark.cc @@ -40,6 +40,7 @@ DEFINE_string(params_file, "", "Optional, set specific params file," DEFINE_string(model_format, "PADDLE", "Optional, set specific model format," "eg, PADDLE/ONNX/RKNN/TORCHSCRIPT/SOPHGO"); +#if defined(ENABLE_BENCHMARK) static std::vector GetInt64Shape(const std::vector& shape) { std::vector new_shape; new_shape.resize(shape.size()); @@ -276,10 +277,11 @@ static void showInputInfos(int argc, char* argv[]) { std::cout << input_infos[i] << std::endl; } } +#endif int main(int argc, char* argv[]) { - google::ParseCommandLineFlags(&argc, &argv, true); #if defined(ENABLE_BENCHMARK) + google::ParseCommandLineFlags(&argc, &argv, true); if (FLAGS_diff) { CheckTensorDiff(argc, argv); return 0;