diff --git a/mace/kernels/opencl/concat.cc b/mace/kernels/opencl/concat.cc index 4ccb42a167715f4a20c94095da5ca256fccf1bdc..65540e486c606cfc53c3d92e3f05236c931cb139 100644 --- a/mace/kernels/opencl/concat.cc +++ b/mace/kernels/opencl/concat.cc @@ -214,7 +214,7 @@ static MaceStatus ConcatN(cl::Kernel *kernel, MACE_CHECK(*kerror_code == 0) << "Kernel error code: " << *kerror_code; (*kernel_error)->UnMap(); } - if (runtime->is_profiling_enabled()) { + if (future != nullptr && runtime->is_profiling_enabled()) { event.wait(); CallStats tmp_stats; runtime->GetCallStats(event, &tmp_stats); diff --git a/mace/kernels/opencl/slice.cc b/mace/kernels/opencl/slice.cc index f865091fd75f0175fb2245965ca0731f2f93bf22..160ad003df465891c0b23a3659635dfb699c5be4 100644 --- a/mace/kernels/opencl/slice.cc +++ b/mace/kernels/opencl/slice.cc @@ -114,7 +114,7 @@ MaceStatus SliceFunctor::operator()( MACE_CHECK(*kerror_code == 0) << "Kernel error code: " << *kerror_code; kernel_error_->UnMap(); } - if (runtime->is_profiling_enabled()) { + if (future != nullptr && runtime->is_profiling_enabled()) { event.wait(); CallStats tmp_stats; runtime->GetCallStats(event, &tmp_stats); diff --git a/tools/converter.py b/tools/converter.py index ea212ec99e63f2066aa200a05a323673c438c95f..3a8d0276598f4e1a378e7044bd1c27239327e181 100644 --- a/tools/converter.py +++ b/tools/converter.py @@ -808,6 +808,7 @@ def build_specific_lib(target_abi, target_soc, serial_num, sh_commands.build_benchmark_model(target_abi, build_tmp_binary_dir, hexagon_mode, + enable_openmp, linkshared) # generate library diff --git a/tools/sh_commands.py b/tools/sh_commands.py index 3e231ca823db732bf4a9ff88395fb17e002c1749..df23c488d1d59f7fa8f68e7ae4828a633273981d 100644 --- a/tools/sh_commands.py +++ b/tools/sh_commands.py @@ -1051,16 +1051,17 @@ def packaging_lib(libmace_output_dir, project_name): def build_benchmark_model(abi, model_output_dir, hexagon_mode, + enable_openmp, linkshared=False): - if linkshared == 0: + if not linkshared: target_name = "benchmark_model_static" else: target_name = "benchmark_model_shared" - benchmark_target = "//mace/benchmark:benchmark_model_shared" benchmark_target = "//mace/benchmark:%s" % target_name bazel_build(benchmark_target, abi=abi, + enable_openmp=enable_openmp, hexagon_mode=hexagon_mode) benchmark_binary_file = "%s/%s" % (model_output_dir, target_name)