提交 3fe87645 编写于 作者: L liuqi

Fix build example error for host.

上级 3d7c8ecd
...@@ -123,7 +123,7 @@ DEFINE_int32(gpu_priority_hint, 3, "0:DEFAULT/1:LOW/2:NORMAL/3:HIGH"); ...@@ -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(omp_num_threads, -1, "num of openmp threads");
DEFINE_int32(cpu_affinity_policy, 1, DEFINE_int32(cpu_affinity_policy, 1,
"0:AFFINITY_NONE/1:AFFINITY_BIG_ONLY/2:AFFINITY_LITTLE_ONLY"); "0:AFFINITY_NONE/1:AFFINITY_BIG_ONLY/2:AFFINITY_LITTLE_ONLY");
#ifndef CODE_TYPE
namespace { namespace {
bool ReadBinaryFile(std::vector<unsigned char> *data, bool ReadBinaryFile(std::vector<unsigned char> *data,
const std::string &filename) { const std::string &filename) {
...@@ -146,6 +146,7 @@ bool ReadBinaryFile(std::vector<unsigned char> *data, ...@@ -146,6 +146,7 @@ bool ReadBinaryFile(std::vector<unsigned char> *data,
return true; return true;
} }
} // namespace } // namespace
#endif
bool RunModel(const std::vector<std::string> &input_names, bool RunModel(const std::vector<std::string> &input_names,
const std::vector<std::vector<int64_t>> &input_shapes, const std::vector<std::vector<int64_t>> &input_shapes,
...@@ -162,10 +163,7 @@ bool RunModel(const std::vector<std::string> &input_names, ...@@ -162,10 +163,7 @@ bool RunModel(const std::vector<std::string> &input_names,
mace::SetGPUHints( mace::SetGPUHints(
static_cast<GPUPerfHint>(FLAGS_gpu_perf_hint), static_cast<GPUPerfHint>(FLAGS_gpu_perf_hint),
static_cast<GPUPriorityHint>(FLAGS_gpu_priority_hint)); static_cast<GPUPriorityHint>(FLAGS_gpu_priority_hint));
}
#endif // MACE_ENABLE_OPENCL
if (device_type == DeviceType::GPU) {
// Just call once. (Not thread-safe) // Just call once. (Not thread-safe)
// Set paths of Generated OpenCL Compiled Kernel Binary file // Set paths of Generated OpenCL Compiled Kernel Binary file
// if you build gpu library of specific soc. // if you build gpu library of specific soc.
...@@ -175,6 +173,8 @@ bool RunModel(const std::vector<std::string> &input_names, ...@@ -175,6 +173,8 @@ bool RunModel(const std::vector<std::string> &input_names,
std::vector<std::string> opencl_binary_paths = {FLAGS_opencl_binary_file}; std::vector<std::string> opencl_binary_paths = {FLAGS_opencl_binary_file};
mace::SetOpenCLBinaryPaths(opencl_binary_paths); mace::SetOpenCLBinaryPaths(opencl_binary_paths);
} }
#endif // MACE_ENABLE_OPENCL
// DO NOT USE tmp directory. // DO NOT USE tmp directory.
// Please use APP's own directory and make sure the directory exists. // Please use APP's own directory and make sure the directory exists.
// Just call once // Just call once
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册