提交 1132af81 编写于 作者: L liuqi

Fix concat and slice benchmark bug.

上级 86bd23c9
...@@ -214,7 +214,7 @@ static MaceStatus ConcatN(cl::Kernel *kernel, ...@@ -214,7 +214,7 @@ static MaceStatus ConcatN(cl::Kernel *kernel,
MACE_CHECK(*kerror_code == 0) << "Kernel error code: " << *kerror_code; MACE_CHECK(*kerror_code == 0) << "Kernel error code: " << *kerror_code;
(*kernel_error)->UnMap(); (*kernel_error)->UnMap();
} }
if (runtime->is_profiling_enabled()) { if (future != nullptr && runtime->is_profiling_enabled()) {
event.wait(); event.wait();
CallStats tmp_stats; CallStats tmp_stats;
runtime->GetCallStats(event, &tmp_stats); runtime->GetCallStats(event, &tmp_stats);
......
...@@ -114,7 +114,7 @@ MaceStatus SliceFunctor<DeviceType::GPU, T>::operator()( ...@@ -114,7 +114,7 @@ MaceStatus SliceFunctor<DeviceType::GPU, T>::operator()(
MACE_CHECK(*kerror_code == 0) << "Kernel error code: " << *kerror_code; MACE_CHECK(*kerror_code == 0) << "Kernel error code: " << *kerror_code;
kernel_error_->UnMap(); kernel_error_->UnMap();
} }
if (runtime->is_profiling_enabled()) { if (future != nullptr && runtime->is_profiling_enabled()) {
event.wait(); event.wait();
CallStats tmp_stats; CallStats tmp_stats;
runtime->GetCallStats(event, &tmp_stats); runtime->GetCallStats(event, &tmp_stats);
......
...@@ -808,6 +808,7 @@ def build_specific_lib(target_abi, target_soc, serial_num, ...@@ -808,6 +808,7 @@ def build_specific_lib(target_abi, target_soc, serial_num,
sh_commands.build_benchmark_model(target_abi, sh_commands.build_benchmark_model(target_abi,
build_tmp_binary_dir, build_tmp_binary_dir,
hexagon_mode, hexagon_mode,
enable_openmp,
linkshared) linkshared)
# generate library # generate library
......
...@@ -1051,16 +1051,17 @@ def packaging_lib(libmace_output_dir, project_name): ...@@ -1051,16 +1051,17 @@ def packaging_lib(libmace_output_dir, project_name):
def build_benchmark_model(abi, def build_benchmark_model(abi,
model_output_dir, model_output_dir,
hexagon_mode, hexagon_mode,
enable_openmp,
linkshared=False): linkshared=False):
if linkshared == 0: if not linkshared:
target_name = "benchmark_model_static" target_name = "benchmark_model_static"
else: else:
target_name = "benchmark_model_shared" target_name = "benchmark_model_shared"
benchmark_target = "//mace/benchmark:benchmark_model_shared"
benchmark_target = "//mace/benchmark:%s" % target_name benchmark_target = "//mace/benchmark:%s" % target_name
bazel_build(benchmark_target, bazel_build(benchmark_target,
abi=abi, abi=abi,
enable_openmp=enable_openmp,
hexagon_mode=hexagon_mode) hexagon_mode=hexagon_mode)
benchmark_binary_file = "%s/%s" % (model_output_dir, target_name) benchmark_binary_file = "%s/%s" % (model_output_dir, target_name)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册