From 3fe876455dfd153e2019a44696aff9f52f4cac51 Mon Sep 17 00:00:00 2001 From: liuqi Date: Wed, 4 Jul 2018 09:37:37 +0800 Subject: [PATCH] Fix build example error for host. --- mace/examples/cli/example.cc | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/mace/examples/cli/example.cc b/mace/examples/cli/example.cc index dbccc36f..32373058 100644 --- a/mace/examples/cli/example.cc +++ b/mace/examples/cli/example.cc @@ -123,7 +123,7 @@ DEFINE_int32(gpu_priority_hint, 3, "0:DEFAULT/1:LOW/2:NORMAL/3:HIGH"); DEFINE_int32(omp_num_threads, -1, "num of openmp threads"); DEFINE_int32(cpu_affinity_policy, 1, "0:AFFINITY_NONE/1:AFFINITY_BIG_ONLY/2:AFFINITY_LITTLE_ONLY"); - +#ifndef CODE_TYPE namespace { bool ReadBinaryFile(std::vector *data, const std::string &filename) { @@ -146,6 +146,7 @@ bool ReadBinaryFile(std::vector *data, return true; } } // namespace +#endif bool RunModel(const std::vector &input_names, const std::vector> &input_shapes, @@ -162,10 +163,7 @@ bool RunModel(const std::vector &input_names, mace::SetGPUHints( static_cast(FLAGS_gpu_perf_hint), static_cast(FLAGS_gpu_priority_hint)); - } -#endif // MACE_ENABLE_OPENCL - if (device_type == DeviceType::GPU) { // Just call once. (Not thread-safe) // Set paths of Generated OpenCL Compiled Kernel Binary file // if you build gpu library of specific soc. @@ -175,6 +173,8 @@ bool RunModel(const std::vector &input_names, std::vector opencl_binary_paths = {FLAGS_opencl_binary_file}; mace::SetOpenCLBinaryPaths(opencl_binary_paths); } +#endif // MACE_ENABLE_OPENCL + // DO NOT USE tmp directory. // Please use APP's own directory and make sure the directory exists. // Just call once -- GitLab