aboutsummaryrefslogtreecommitdiff
path: root/examples/dynamic_fusion/cl_fused_conv2d_elementwise_add.cpp
diff options
context:
space:
mode:
authorSiCong Li <sicong.li@arm.com>2022-05-24 14:37:31 +0100
committerSiCong Li <sicong.li@arm.com>2022-06-01 14:07:40 +0000
commit0e7053da06b4d73058abbc3782611259b00066b5 (patch)
tree4f3327401fee66d85934a4ff79b8bc5730cc07c1 /examples/dynamic_fusion/cl_fused_conv2d_elementwise_add.cpp
parent82169b3cf131318b55e80fe980895b3c16d5aca5 (diff)
downloadComputeLibrary-0e7053da06b4d73058abbc3782611259b00066b5.tar.gz
Fix reference example for fusion of conv2d and adddition
* Make sure the reference is running the same computation as the fused example * Add finer breakdown of start-up time Related to COMPMID-5365 Signed-off-by: SiCong Li <sicong.li@arm.com> Change-Id: Ia5c73d4af318cafda1335438f88d0d4f74a5355c Reviewed-on: https://review.mlplatform.org/c/ml/ComputeLibrary/+/7643 Tested-by: Arm Jenkins <bsgcomp@arm.com> Reviewed-by: Michalis Spyrou <michalis.spyrou@arm.com> Comments-Addressed: Arm Jenkins <bsgcomp@arm.com>
Diffstat (limited to 'examples/dynamic_fusion/cl_fused_conv2d_elementwise_add.cpp')
-rw-r--r--examples/dynamic_fusion/cl_fused_conv2d_elementwise_add.cpp7
1 files changed, 7 insertions, 0 deletions
diff --git a/examples/dynamic_fusion/cl_fused_conv2d_elementwise_add.cpp b/examples/dynamic_fusion/cl_fused_conv2d_elementwise_add.cpp
index af00efdfb9..285509b586 100644
--- a/examples/dynamic_fusion/cl_fused_conv2d_elementwise_add.cpp
+++ b/examples/dynamic_fusion/cl_fused_conv2d_elementwise_add.cpp
@@ -138,6 +138,7 @@ public:
CLScheduler::get().default_init(tuner_to_use);
TICK(startup_time);
+ TICK(configure);
/* Computation:
* out = add_desc(addend, conv2d1x1(direct_conv)(input, weights, bias))
*/
@@ -251,7 +252,9 @@ public:
const auto success = ClCompositeOperator::validate(workload); // Optional
op.configure(CLKernelLibrary::get().get_compile_context(), workload);
// [Validate and configure ClCompositeOperator]
+ TOCK(configure, measurements);
+ TICK(tensor_allocation);
/// @page example_dynamic_fusion_cl_conv2d_elementwise_add
/// @subsection run_clcompositeoperator Run ClCompositeOperator
/// Construct the runtime CLTensor s with backing memory
@@ -312,7 +315,9 @@ public:
tensor_data.tensor->allocator()->allocate();
}
// [Initialize and Allocate Auxiliary CLTensor objects]
+ TOCK(tensor_allocation, measurements);
+ TICK(dummy_run);
/// @page example_dynamic_fusion_cl_conv2d_elementwise_add
/// Run the ClCompositeOperator prepare job. This performs any jobs that are required for the first run, like
/// reshaping tensors for a more performant format.
@@ -327,6 +332,8 @@ public:
// [Run ClCompositeOperator]
op.run(run_pack_map);
// [Run ClCompositeOperator]
+ CLScheduler::get().sync();
+ TOCK(dummy_run, measurements);
TOCK(startup_time, measurements);
return true;
}