Update CpuGemmConv2d and CpuFlatten to use CpuReshape operator
- Following CpuReshapeKernel Optimizations, update the CpuGemmConv2D and CpuFlatten
to use CpuReshape operator instead of CpuReshapeKernel
- Minor changes to comment in NEReorgLayerKernel.h
Resolves COMPMID-6504
Signed-off-by: Anitha Raj <anitha.raj@arm.com>
Change-Id: Ib6ee1fdc313d91249f9fe41c81e73324031c1ff4
Reviewed-on: https://review.mlplatform.org/c/ml/ComputeLibrary/+/10186
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>
Benchmark: Arm Jenkins <bsgcomp@arm.com>
diff --git a/src/cpu/operators/CpuFlatten.h b/src/cpu/operators/CpuFlatten.h
index 0e9fcbd..911760d 100644
--- a/src/cpu/operators/CpuFlatten.h
+++ b/src/cpu/operators/CpuFlatten.h
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2021 Arm Limited.
+ * Copyright (c) 2021, 2023 Arm Limited.
*
* SPDX-License-Identifier: MIT
*
@@ -21,8 +21,8 @@
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/
-#ifndef ARM_COMPUTE_CPU_FLATTEN_H
-#define ARM_COMPUTE_CPU_FLATTEN_H
+#ifndef ACL_SRC_CPU_OPERATORS_CPUFLATTEN_H
+#define ACL_SRC_CPU_OPERATORS_CPUFLATTEN_H
#include "src/cpu/ICpuOperator.h"
@@ -30,10 +30,15 @@
{
namespace cpu
{
+class CpuReshape;
/** Basic function to flatten a given input */
class CpuFlatten : public ICpuOperator
{
public:
+ /** Constructor */
+ CpuFlatten();
+ /** Destructor */
+ ~CpuFlatten();
/** Configure operator for a given list of arguments
*
* Valid data layouts:
@@ -58,7 +63,13 @@
* @return a status
*/
static Status validate(const ITensorInfo *src, const ITensorInfo *dst);
+
+ // Inherited methods overridden:
+ void run(ITensorPack &tensors) override;
+
+private:
+ std::unique_ptr<CpuReshape> _reshape;
};
} // namespace cpu
} // namespace arm_compute
-#endif /* ARM_COMPUTE_CPU_FLATTEN_H */
+#endif // ACL_SRC_CPU_OPERATORS_CPUFLATTEN_H