From 09cad7253cc75f67bf428ceef196cfbec7f8c357 Mon Sep 17 00:00:00 2001 From: Georgios Pinitas Date: Wed, 22 Jul 2020 12:11:20 +0100 Subject: COMPMID-3393: Minor tweaks on memory injection interface * Avoid the need to overload workspace() everytime * Remove the Layer suffix from the operators * Clean interface by removing default arguments when unsupported Signed-off-by: Georgios Pinitas Change-Id: I7710ecd485cae13e9c2d45216debbd8103bc5a0f Reviewed-on: https://review.mlplatform.org/c/ml/ComputeLibrary/+/3610 Tested-by: Arm Jenkins Reviewed-by: Michalis Spyrou Comments-Addressed: Arm Jenkins --- arm_compute/runtime/CL/ICLOperator.h | 3 +- .../runtime/CL/functions/CLActivationLayer.h | 5 +--- .../runtime/CL/functions/CLConcatenateLayer.h | 5 ++-- .../runtime/CL/functions/CLElementWiseUnaryLayer.h | 35 +++++----------------- arm_compute/runtime/CL/functions/CLReshapeLayer.h | 7 ++--- arm_compute/runtime/CL/functions/CLSlice.h | 3 -- arm_compute/runtime/CL/functions/CLStridedSlice.h | 3 -- 7 files changed, 14 insertions(+), 47 deletions(-) (limited to 'arm_compute/runtime/CL') diff --git a/arm_compute/runtime/CL/ICLOperator.h b/arm_compute/runtime/CL/ICLOperator.h index c9fdd864de..2d6c96e815 100644 --- a/arm_compute/runtime/CL/ICLOperator.h +++ b/arm_compute/runtime/CL/ICLOperator.h @@ -55,7 +55,8 @@ public: // Inherited methods overridden: void run(InputTensorMap inputs, OutputTensorMap outputs, OperatorTensorMap workspace) override; - void prepare(OperatorTensorMap constants) override final; + void prepare(OperatorTensorMap constants) override; + MemoryRequirements workspace() const override; protected: std::unique_ptr _kernel; diff --git a/arm_compute/runtime/CL/functions/CLActivationLayer.h b/arm_compute/runtime/CL/functions/CLActivationLayer.h index d7cc67a647..632487c78d 100644 --- a/arm_compute/runtime/CL/functions/CLActivationLayer.h +++ b/arm_compute/runtime/CL/functions/CLActivationLayer.h @@ -98,7 +98,7 @@ private: namespace experimental { /** Basic function to run @ref CLActivationLayerKernel */ -class CLActivationLayer : public ICLOperator +class CLActivation : public ICLOperator { public: /** Set the input and output tensor. @@ -120,9 +120,6 @@ public: * @return a status */ static Status validate(const ITensorInfo *input, const ITensorInfo *output, const ActivationLayerInfo &act_info); - - // Inherited methods overridden: - MemoryRequirements workspace() const override; }; } // namespace experimental } // namespace arm_compute diff --git a/arm_compute/runtime/CL/functions/CLConcatenateLayer.h b/arm_compute/runtime/CL/functions/CLConcatenateLayer.h index 4e8a95be43..99a2053a5a 100644 --- a/arm_compute/runtime/CL/functions/CLConcatenateLayer.h +++ b/arm_compute/runtime/CL/functions/CLConcatenateLayer.h @@ -113,11 +113,11 @@ namespace experimental * -# @ref CLDepthConcatenateLayerKernel (if underlying concatenation axis is 2). * -# @ref CLBatchConcatenateLayerKernel (if underlying concatenation axis is 3). */ -class CLConcatenateLayer : public ICLOperator +class CLConcatenation : public ICLOperator { public: /** Default constructor */ - CLConcatenateLayer(); + CLConcatenation(); /** Initialise the kernel's inputs vector and output. * * @note Input and output tensor dimensions preconditions defer depending on the concatenation axis. @@ -144,7 +144,6 @@ public: static Status validate(const std::vector &inputs_vector, const ITensorInfo *output, size_t axis); // Inherited methods overridden: - MemoryRequirements workspace() const override; void run(InputTensorMap inputs, OutputTensorMap outputs, OperatorTensorMap workspace) override; private: diff --git a/arm_compute/runtime/CL/functions/CLElementWiseUnaryLayer.h b/arm_compute/runtime/CL/functions/CLElementWiseUnaryLayer.h index e4268c1592..5208bfe404 100644 --- a/arm_compute/runtime/CL/functions/CLElementWiseUnaryLayer.h +++ b/arm_compute/runtime/CL/functions/CLElementWiseUnaryLayer.h @@ -356,7 +356,7 @@ private: namespace experimental { /** Basic function to perform inverse square root on an input tensor. */ -class CLRsqrtLayer : public ICLOperator +class CLRsqrt : public ICLOperator { public: /** Initialize the function @@ -380,13 +380,10 @@ public: * @return a status */ static Status validate(const ITensorInfo *input, const ITensorInfo *output); - - // Inherited methods overridden: - MemoryRequirements workspace() const override; }; /** Basic function to perform exponential on an input tensor. */ -class CLExpLayer : public ICLOperator +class CLExp : public ICLOperator { public: /** Initialize the function @@ -410,13 +407,10 @@ public: * @return a status */ static Status validate(const ITensorInfo *input, const ITensorInfo *output); - - // Inherited methods overridden: - MemoryRequirements workspace() const override; }; /** Basic function to negate an input tensor. */ -class CLNegLayer : public ICLOperator +class CLNeg : public ICLOperator { public: /** Initialize the function @@ -440,13 +434,10 @@ public: * @return a status */ static Status validate(const ITensorInfo *input, const ITensorInfo *output); - - // Inherited methods overridden: - MemoryRequirements workspace() const override; }; /** Basic function to calculate sine of an input tensor. */ -class CLSinLayer : public ICLOperator +class CLSin : public ICLOperator { public: /** Initialize the function @@ -470,13 +461,10 @@ public: * @return a status */ static Status validate(const ITensorInfo *input, const ITensorInfo *output); - - // Inherited methods overridden: - MemoryRequirements workspace() const override; }; /** Basic function to perform elementwise log on an input tensor. */ -class CLLogLayer : public ICLOperator +class CLLog : public ICLOperator { public: /** Initialize the function @@ -500,13 +488,10 @@ public: * @return a status */ static Status validate(const ITensorInfo *input, const ITensorInfo *output); - - // Inherited methods overridden: - MemoryRequirements workspace() const override; }; /** Basic function to get the absolute value of an input tensor. */ -class CLAbsLayer : public ICLOperator +class CLAbs : public ICLOperator { public: /** Initialize the function @@ -530,13 +515,10 @@ public: * @return a status */ static Status validate(const ITensorInfo *input, const ITensorInfo *output); - - // Inherited methods overridden: - MemoryRequirements workspace() const override; }; /** Basic function to get the round (to the nearest even) value of an input tensor. */ -class CLRoundLayer : public ICLOperator +class CLRound : public ICLOperator { public: /** Initialize the function @@ -560,9 +542,6 @@ public: * @return a status */ static Status validate(const ITensorInfo *input, const ITensorInfo *output); - - // Inherited methods overridden: - MemoryRequirements workspace() const override; }; } // namespace experimental } // namespace arm_compute diff --git a/arm_compute/runtime/CL/functions/CLReshapeLayer.h b/arm_compute/runtime/CL/functions/CLReshapeLayer.h index 175fbffd8d..7fc6c3b864 100644 --- a/arm_compute/runtime/CL/functions/CLReshapeLayer.h +++ b/arm_compute/runtime/CL/functions/CLReshapeLayer.h @@ -81,7 +81,7 @@ private: namespace experimental { /** Basic function to run @ref CLReshapeLayerKernel */ -class CLReshapeLayer : public ICLOperator +class CLReshape : public ICLOperator { public: /** Initialise the kernel's inputs and outputs @@ -100,10 +100,7 @@ public: * @return a status */ static Status validate(const ITensorInfo *input, const ITensorInfo *output); - - // Inherited methods overridden: - MemoryRequirements workspace() const override; }; } // namespace experimental -} +} // namespace arm_compute #endif /*ARM_COMPUTE_CLRESHAPELAYER_H */ diff --git a/arm_compute/runtime/CL/functions/CLSlice.h b/arm_compute/runtime/CL/functions/CLSlice.h index 6fe62acaf5..23c398cb41 100644 --- a/arm_compute/runtime/CL/functions/CLSlice.h +++ b/arm_compute/runtime/CL/functions/CLSlice.h @@ -68,9 +68,6 @@ public: * @return A status */ static Status validate(const ITensorInfo *input, const ITensorInfo *output, const Coordinates &starts, const Coordinates &ends); - - // Inherited methods overridden: - MemoryRequirements workspace() const override; }; } // namespace experimental diff --git a/arm_compute/runtime/CL/functions/CLStridedSlice.h b/arm_compute/runtime/CL/functions/CLStridedSlice.h index 394d8c4f59..fdbef81f7d 100644 --- a/arm_compute/runtime/CL/functions/CLStridedSlice.h +++ b/arm_compute/runtime/CL/functions/CLStridedSlice.h @@ -156,9 +156,6 @@ public: static Status validate(const ITensorInfo *input, const ITensorInfo *output, const Coordinates &starts, const Coordinates &ends, const BiStrides &strides, int32_t begin_mask = 0, int32_t end_mask = 0, int32_t shrink_axis_mask = 0); - - // Inherited methods overridden: - MemoryRequirements workspace() const override; }; } // namespace experimental } // namespace arm_compute -- cgit v1.2.1