aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSiCong Li <sicong.li@arm.com>2022-11-04 10:11:32 +0000
committerSiCong Li <sicong.li@arm.com>2022-11-04 13:47:35 +0000
commita2b131bf4680f83b10a7e3544b6183279d8c2691 (patch)
treea39f36d4e330ac5c0ff36feffc809224d159854f
parentd7c5d7d3635e43658123a0a5b2c1b77c81b9c26d (diff)
downloadComputeLibrary-a2b131bf4680f83b10a7e3544b6183279d8c2691.tar.gz
Fix compiler warnings in dynamic fusion
Resolves: COMPMID-5686 Change-Id: I608c359583c44f2f04f29faddd1c6b38a381de60 Signed-off-by: SiCong Li <sicong.li@arm.com> Reviewed-on: https://review.mlplatform.org/c/ml/ComputeLibrary/+/8562 Benchmark: Arm Jenkins <bsgcomp@arm.com> Reviewed-by: Jakub Sujak <jakub.sujak@arm.com> Reviewed-by: Gunes Bayir <gunes.bayir@arm.com> Comments-Addressed: Arm Jenkins <bsgcomp@arm.com> Tested-by: Arm Jenkins <bsgcomp@arm.com>
-rw-r--r--arm_compute/core/experimental/OperatorGraph.h17
-rw-r--r--examples/dynamic_fusion/cl_fused_conv2d_elementwise_add.cpp4
-rw-r--r--src/dynamic_fusion/runtime/gpu/cl/ClKernelRuntime.h3
-rw-r--r--src/dynamic_fusion/runtime/gpu/cl/ClWorkloadRuntime.cpp7
-rw-r--r--src/dynamic_fusion/sketch/gpu/operators/GpuConv2d.cpp3
-rw-r--r--tests/validation/dynamic_fusion/gpu/Integration.cpp1
6 files changed, 12 insertions, 23 deletions
diff --git a/arm_compute/core/experimental/OperatorGraph.h b/arm_compute/core/experimental/OperatorGraph.h
index cab83c7f8b..f2e352146f 100644
--- a/arm_compute/core/experimental/OperatorGraph.h
+++ b/arm_compute/core/experimental/OperatorGraph.h
@@ -128,21 +128,6 @@ private:
*/
bool operator<(const Operator &op0, const Operator &op1);
-/** Padding information for 2D operations like Conv2dDescriptor
- */
-struct Padding2D
-{
- Padding2D() = default;
- Padding2D(size_t left, size_t right, size_t top, size_t bottom)
- : left(left), right(right), top(top), bottom(bottom)
- {
- }
- size_t left = { 0 }; /**< Padding across the width dimension on the left, in elements. */
- size_t right = { 0 }; /**< Padding across the width dimension on the right, in elements. */
- size_t top = { 0 }; /**< Padding across the height dimension on the top, in elements. */
- size_t bottom = { 0 }; /**< Padding across the height dimension on the bottom, in elements. */
-};
-
/** Descriptor for Conv2dDescriptor operation
*/
struct Conv2dDescriptor
@@ -230,4 +215,4 @@ bool operator==(const FloorDescriptor &, const FloorDescriptor &);
} // namespace experimental
} // namespace arm_compute
#endif //ARM_COMPUTE_EXPERIMENTAL_DYNAMICFUSION_OPERATORGRAPH
-#endif /* ENABLE_EXPERIMENTAL_DYNAMIC_FUSION */ \ No newline at end of file
+#endif /* ENABLE_EXPERIMENTAL_DYNAMIC_FUSION */
diff --git a/examples/dynamic_fusion/cl_fused_conv2d_elementwise_add.cpp b/examples/dynamic_fusion/cl_fused_conv2d_elementwise_add.cpp
index 8aee67e8a4..afbc55777b 100644
--- a/examples/dynamic_fusion/cl_fused_conv2d_elementwise_add.cpp
+++ b/examples/dynamic_fusion/cl_fused_conv2d_elementwise_add.cpp
@@ -348,7 +348,7 @@ public:
void do_teardown() override
{
- for(auto m : measurements)
+ for(const auto &m : measurements)
{
std::cout << m.first << ": " << m.second.count() << "us" << std::endl;
}
@@ -389,4 +389,4 @@ int main(int argc, char **argv)
#undef TICK
#undef TOCK
#undef TOCK_AVG
-#endif /* ENABLE_EXPERIMENTAL_DYNAMIC_FUSION */ \ No newline at end of file
+#endif /* ENABLE_EXPERIMENTAL_DYNAMIC_FUSION */
diff --git a/src/dynamic_fusion/runtime/gpu/cl/ClKernelRuntime.h b/src/dynamic_fusion/runtime/gpu/cl/ClKernelRuntime.h
index acc2380031..4787acabcd 100644
--- a/src/dynamic_fusion/runtime/gpu/cl/ClKernelRuntime.h
+++ b/src/dynamic_fusion/runtime/gpu/cl/ClKernelRuntime.h
@@ -35,7 +35,8 @@ namespace experimental
{
namespace dynamic_fusion
{
-struct GpuKernelSourceCode;
+/** Forward declaration */
+class GpuKernelSourceCode;
/** OpenCL runtime to run a single kernel */
class ClKernelRuntime final : public opencl::IClKernel
diff --git a/src/dynamic_fusion/runtime/gpu/cl/ClWorkloadRuntime.cpp b/src/dynamic_fusion/runtime/gpu/cl/ClWorkloadRuntime.cpp
index 549c6d4abb..f14f66d1bd 100644
--- a/src/dynamic_fusion/runtime/gpu/cl/ClWorkloadRuntime.cpp
+++ b/src/dynamic_fusion/runtime/gpu/cl/ClWorkloadRuntime.cpp
@@ -287,15 +287,20 @@ Status ClWorkloadRuntime::configure(const GpuWorkloadSketch &sketch)
switch(stage)
{
case UnitWorkloadStage::Stage::Run:
+ {
_impl->_kernels.emplace(work.id(), std::move(k));
break;
+ }
case UnitWorkloadStage::Stage::Prepare:
+ {
_impl->_kernels_prep.emplace(work.id(), std::move(k));
break;
+ }
default:
+ {
ARM_COMPUTE_ERROR("Invalid unit workload stage");
+ }
}
- break;
}
// Create auxiliary tensor objects
create_aux_tensors(&_impl->_aux_tensors, _impl->_source_code);
diff --git a/src/dynamic_fusion/sketch/gpu/operators/GpuConv2d.cpp b/src/dynamic_fusion/sketch/gpu/operators/GpuConv2d.cpp
index 98c1cc3939..12aa4d1b9f 100644
--- a/src/dynamic_fusion/sketch/gpu/operators/GpuConv2d.cpp
+++ b/src/dynamic_fusion/sketch/gpu/operators/GpuConv2d.cpp
@@ -25,7 +25,6 @@
#include "arm_compute/core/CL/CLCompileContext.h"
#include "arm_compute/core/Validate.h"
-#include "arm_compute/core/Validate.h"
#include "arm_compute/core/experimental/Types.h"
#include "arm_compute/core/utils/misc/ShapeCalculator.h"
@@ -87,7 +86,7 @@ bool export_to_cl_image_support(const ITensorInfo *tensor, GPUTarget gpu_target,
return true;
}
-GpuOperatorType operator_type = GpuOperatorType::Complex;
+constexpr GpuOperatorType operator_type = GpuOperatorType::Complex;
} // namespace
Status GpuConv2d::validate_op(const GpuWorkloadSketch &sketch,
diff --git a/tests/validation/dynamic_fusion/gpu/Integration.cpp b/tests/validation/dynamic_fusion/gpu/Integration.cpp
index 87720a629d..6ee2e20d35 100644
--- a/tests/validation/dynamic_fusion/gpu/Integration.cpp
+++ b/tests/validation/dynamic_fusion/gpu/Integration.cpp
@@ -155,7 +155,6 @@ TEST_CASE(Multiple_Complex_Ops_0, framework::DatasetMode::ALL)
const auto data_layout = DataLayout::NHWC;
const auto t_input_shape = TensorShape(384, 12, 12);
const auto t_weight_shape = TensorShape(384, 1, 1, 16);
- const auto t_dst_shape = TensorShape(16, 12, 12);
auto t_input_info = TensorInfo(t_input_shape, 1, data_type, data_layout);
auto t_weight_info = TensorInfo(t_weight_shape, 1, data_type, data_layout);
auto t_dst_info = TensorInfo();