diff options
Diffstat (limited to 'arm_compute/core/GLES_COMPUTE/kernels')
25 files changed, 0 insertions, 2015 deletions
diff --git a/arm_compute/core/GLES_COMPUTE/kernels/GCAbsoluteDifferenceKernel.h b/arm_compute/core/GLES_COMPUTE/kernels/GCAbsoluteDifferenceKernel.h deleted file mode 100644 index ff8943b63a..0000000000 --- a/arm_compute/core/GLES_COMPUTE/kernels/GCAbsoluteDifferenceKernel.h +++ /dev/null @@ -1,71 +0,0 @@ -/* - * Copyright (c) 2017-2019 Arm Limited. - * - * SPDX-License-Identifier: MIT - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to - * deal in the Software without restriction, including without limitation the - * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or - * sell copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - * SOFTWARE. - */ -#ifndef ARM_COMPUTE_GCABSOLUTEDIFFERENCEKERNEL_H -#define ARM_COMPUTE_GCABSOLUTEDIFFERENCEKERNEL_H - -#include "arm_compute/core/GLES_COMPUTE/IGCKernel.h" - -namespace arm_compute -{ -class IGCTensor; - -/** Interface for the absolute difference kernel. - * - * Absolute difference is computed by: - * @f[ output(x,y) = | input1(x,y) - input2(x,y) | @f] - */ -class GCAbsoluteDifferenceKernel : public IGCKernel -{ -public: - /** Default constructor. */ - GCAbsoluteDifferenceKernel(); - /** Prevent instances of this class from being copied (As this class contains pointers) */ - GCAbsoluteDifferenceKernel(const GCAbsoluteDifferenceKernel &) = delete; - /** Prevent instances of this class from being copied (As this class contains pointers) */ - GCAbsoluteDifferenceKernel &operator=(const GCAbsoluteDifferenceKernel &) = delete; - /** Allow instances of this class to be moved */ - GCAbsoluteDifferenceKernel(GCAbsoluteDifferenceKernel &&) = default; - /** Allow instances of this class to be moved */ - GCAbsoluteDifferenceKernel &operator=(GCAbsoluteDifferenceKernel &&) = default; - /** Default destructor */ - ~GCAbsoluteDifferenceKernel() = default; - - /** Set the inputs and output images. - * - * @param[in] input1 Source tensor. Data types supported: U8 - * @param[in] input2 Source tensor. Data types supported: U8 - * @param[out] output Destination tensor. Data types supported: U8 - */ - void configure(const IGCTensor *input1, const IGCTensor *input2, IGCTensor *output); - - // Inherited methods overridden: - void run(const Window &window) override; - -private: - const IGCTensor *_input1; /**< Source tensor 1. */ - const IGCTensor *_input2; /**< Source tensor 2. */ - IGCTensor *_output; /**< Destination tensor. */ -}; -} -#endif /* ARM_COMPUTE_GCABSOLUTEDIFFERENCEKERNEL_H */ diff --git a/arm_compute/core/GLES_COMPUTE/kernels/GCActivationLayerKernel.h b/arm_compute/core/GLES_COMPUTE/kernels/GCActivationLayerKernel.h deleted file mode 100644 index 5d36768027..0000000000 --- a/arm_compute/core/GLES_COMPUTE/kernels/GCActivationLayerKernel.h +++ /dev/null @@ -1,74 +0,0 @@ -/* - * Copyright (c) 2017-2019 Arm Limited. - * - * SPDX-License-Identifier: MIT - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to - * deal in the Software without restriction, including without limitation the - * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or - * sell copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - * SOFTWARE. - */ -#ifndef ARM_COMPUTE_GCACTIVATIONLAYERKERNEL_H -#define ARM_COMPUTE_GCACTIVATIONLAYERKERNEL_H - -#include "arm_compute/core/GLES_COMPUTE/IGCKernel.h" - -namespace arm_compute -{ -// Forward declarations -class IGCTensor; -class GCCoreRuntimeContext; - -/** Interface for the activation layer kernel. */ -class GCActivationLayerKernel : public IGCKernel -{ -public: - /** Default constructor - * - * @param[in, out] ctx Core context to use - */ - explicit GCActivationLayerKernel(GCCoreRuntimeContext *ctx = nullptr); - /** Prevent instances of this class from being copied (As this class contains pointers) */ - GCActivationLayerKernel(const GCActivationLayerKernel &) = delete; - /** Prevent instances of this class from being copied (As this class contains pointers) */ - GCActivationLayerKernel &operator=(const GCActivationLayerKernel &) = delete; - /** Allow instances of this class to be moved */ - GCActivationLayerKernel(GCActivationLayerKernel &&) = default; - /** Allow instances of this class to be moved */ - GCActivationLayerKernel &operator=(GCActivationLayerKernel &&) = default; - /** Default destructor */ - ~GCActivationLayerKernel() = default; - /** Set the input and output tensor. - * - * @note If the output tensor is a nullptr, the activation function will be performed in-place - * - * @param[in, out] input Source tensor. In case of @p output tensor = nullptr, this tensor will store the result - * of the activation function. Data types supported: F16/F32. - * @param[out] output Destination tensor. Data type should match the input data type. - * @param[in] act_info Activation layer information. - */ - void configure(IGCTensor *input, IGCTensor *output, ActivationLayerInfo act_info); - - // Inherited methods overridden: - void run(const Window &window) override; - -private: - IGCTensor *_input; - IGCTensor *_output; - GCCoreRuntimeContext *_ctx; -}; -} // namespace arm_compute -#endif /*ARM_COMPUTE_GCACTIVATIONLAYERKERNEL_H */ diff --git a/arm_compute/core/GLES_COMPUTE/kernels/GCArithmeticAdditionKernel.h b/arm_compute/core/GLES_COMPUTE/kernels/GCArithmeticAdditionKernel.h deleted file mode 100644 index 4cd56b5a3d..0000000000 --- a/arm_compute/core/GLES_COMPUTE/kernels/GCArithmeticAdditionKernel.h +++ /dev/null @@ -1,82 +0,0 @@ -/* - * Copyright (c) 2016-2019 Arm Limited. - * - * SPDX-License-Identifier: MIT - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to - * deal in the Software without restriction, including without limitation the - * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or - * sell copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - * SOFTWARE. - */ -#ifndef ARM_COMPUTE_GCARITHMETICADDITIONKERNEL_H -#define ARM_COMPUTE_GCARITHMETICADDITIONKERNEL_H - -#include "arm_compute/core/GLES_COMPUTE/IGCKernel.h" -#include "arm_compute/core/Types.h" - -namespace arm_compute -{ -class IGCTensor; - -/** Interface for the arithmetic addition kernel - * - * Arithmetic addition is computed by: - * @f[ output(x,y) = input1(x,y) + input2(x,y) @f] - */ -class GCArithmeticAdditionKernel : public IGCKernel -{ -public: - /** Default constructor */ - GCArithmeticAdditionKernel(); - /** Prevent instances of this class from being copied (As this class contains pointers) */ - GCArithmeticAdditionKernel(const GCArithmeticAdditionKernel &) = delete; - /** Prevent instances of this class from being copied (As this class contains pointers) */ - GCArithmeticAdditionKernel &operator=(const GCArithmeticAdditionKernel &) = delete; - /** Allow instances of this class to be moved */ - GCArithmeticAdditionKernel(GCArithmeticAdditionKernel &&) = default; - /** Allow instances of this class to be moved */ - GCArithmeticAdditionKernel &operator=(GCArithmeticAdditionKernel &&) = default; - /** Default destructor */ - ~GCArithmeticAdditionKernel() = default; - /** Initialise the kernel's inputs, output and convertion policy. - * - * @param[in] input1 First tensor input. Data types supported: F16. - * @param[in] input2 Second tensor input. Data types supported: F16. - * @param[out] output Output tensor. Data types supported: F16. - * @param[in] policy Policy to use to handle overflow. - */ - void configure(const IGCTensor *input1, const IGCTensor *input2, IGCTensor *output, ConvertPolicy policy); - /** Static function to check if given info will lead to a valid configuration of @ref GCArithmeticAdditionKernel - * - * @param[in] input1 First tensor input info. Data types supported: F16. - * @param[in] input2 Second tensor input info. Data types supported: F16. - * @param[out] output Output tensor info. Data types supported: F16. - * @param[in] policy Policy to use to handle overflow. - * - * @return a status - */ - static Status validate(const ITensorInfo *input1, const ITensorInfo *input2, const ITensorInfo *output, ConvertPolicy policy); - - // Inherited methods overridden: - void run(const Window &window) override; - -private: - const IGCTensor *_input1; /**< Source tensor 1 */ - const IGCTensor *_input2; /**< Source tensor 2 */ - IGCTensor *_output; /**< Destination tensor */ -}; -} // namespace arm_compute -#endif /* ARM_COMPUTE_GCARITHMETICADDITIONKERNEL_H */ diff --git a/arm_compute/core/GLES_COMPUTE/kernels/GCBatchNormalizationLayerKernel.h b/arm_compute/core/GLES_COMPUTE/kernels/GCBatchNormalizationLayerKernel.h deleted file mode 100644 index 998042cd5c..0000000000 --- a/arm_compute/core/GLES_COMPUTE/kernels/GCBatchNormalizationLayerKernel.h +++ /dev/null @@ -1,98 +0,0 @@ -/* - * Copyright (c) 2017-2019 Arm Limited. - * - * SPDX-License-Identifier: MIT - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to - * deal in the Software without restriction, including without limitation the - * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or - * sell copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - * SOFTWARE. - */ -#ifndef ARM_COMPUTE_GCBATCHNORMALIZATIONLAYERKERNEL_H -#define ARM_COMPUTE_GCBATCHNORMALIZATIONLAYERKERNEL_H - -#include "arm_compute/core/GLES_COMPUTE/IGCKernel.h" - -namespace arm_compute -{ -class IGCTensor; - -/** Interface for the BatchNormalization layer kernel. - */ -class GCBatchNormalizationLayerKernel : public IGCKernel -{ -public: - /** Constructor */ - GCBatchNormalizationLayerKernel(); - /** Prevent instances of this class from being copied (As this class contains pointers) */ - GCBatchNormalizationLayerKernel(const GCBatchNormalizationLayerKernel &) = delete; - /** Prevent instances of this class from being copied (As this class contains pointers) */ - GCBatchNormalizationLayerKernel &operator=(const GCBatchNormalizationLayerKernel &) = delete; - /** Default Move Constructor. */ - GCBatchNormalizationLayerKernel(GCBatchNormalizationLayerKernel &&) = default; - /** Default move assignment operator */ - GCBatchNormalizationLayerKernel &operator=(GCBatchNormalizationLayerKernel &&) = default; - /** Default destructor */ - ~GCBatchNormalizationLayerKernel() = default; - - /** Set the input and output tensors. - * - * @param[in] input Source tensor. 3 lower dimensions represent a single input with dimensions [width, height, FM]. - * The rest are optional and used for representing batches. Data types supported: F16/F32. - * @param[out] output Destination tensor. Output will have the same number of dimensions as input. Data type supported: same as @p input - * @param[in] mean Mean values tensor. 1 dimension with size equal to the feature maps [FM]. Data types supported: Same as @p input - * @param[in] var Variance values tensor. 1 dimension with size equal to the feature maps [FM]. Data types supported: Same as @p input - * @param[in] beta (Optional) Beta values tensor info. 1 dimension with size equal to the feature maps [FM]. If not provided, default value for beta is 0. Data types supported: Same as @p input - * @param[in] gamma (Optional) Gamma values tensor info. 1 dimension with size equal to the feature maps [FM]. If not provided, default value for gamma is 1. Data types supported: Same as @p input - * @param[in] epsilon (optional) Small value to avoid division with zero. - * @param[in] act_info (Optional) Activation layer information in case of a fused activation. Only RELU, BOUNDED_RELU and LU_BOUNDED_RELU supported. - */ - void configure(const IGCTensor *input, IGCTensor *output, const IGCTensor *mean, const IGCTensor *var, const IGCTensor *beta = nullptr, const IGCTensor *gamma = nullptr, float epsilon = 0.001f, - ActivationLayerInfo act_info = ActivationLayerInfo()); - /** Static function to check if given info will lead to a valid configuration of @ref GCBatchNormalizationLayerKernel - * - * @param[in] input Source tensor info. In case of @p output tensor info = nullptr, this tensor will store the result. - * 3 lower dimensions represent a single input with dimensions [width, height, FM]. - * The rest are optional and used for representing batches. Data types supported: F16/F32. - * @param[in] output Destination tensor info. Output will have the same number of dimensions as input. Data type supported: same as @p input - * @param[in] mean Mean values tensor info. 1 dimension with size equal to the feature maps [FM]. Data types supported: Same as @p input - * @param[in] var Variance values tensor info. 1 dimension with size equal to the feature maps [FM]. Data types supported: Same as @p input - * @param[in] beta (Optional) Beta values tensor info. 1 dimension with size equal to the feature maps [FM]. If not provided, default value for beta is 0. Data types supported: Same as @p input - * @param[in] gamma (Optional) Gamma values tensor info. 1 dimension with size equal to the feature maps [FM]. If not provided, default value for gamma is 1. Data types supported: Same as @p input - * @param[in] epsilon (Optional) Small value to avoid division with zero. Default value is 0.001f. - * @param[in] act_info (Optional) Activation layer information in case of a fused activation. Only RELU, BOUNDED_RELU and LU_BOUNDED_RELU supported. - * - * @return a status - */ - static Status validate(const ITensorInfo *input, const ITensorInfo *output, - const ITensorInfo *mean, const ITensorInfo *var, - const ITensorInfo *beta = nullptr, const ITensorInfo *gamma = nullptr, - float epsilon = 0.001f, ActivationLayerInfo act_info = ActivationLayerInfo()); - - // Inherited methods overridden: - void run(const Window &window) override; - -private: - const IGCTensor *_input; - IGCTensor *_output; - const IGCTensor *_mean; - const IGCTensor *_var; - const IGCTensor *_beta; - const IGCTensor *_gamma; - float _epsilon; -}; -} -#endif /*ARM_COMPUTE_GCBATCHNORMALIZATIONLAYERKERNEL_H */ diff --git a/arm_compute/core/GLES_COMPUTE/kernels/GCCol2ImKernel.h b/arm_compute/core/GLES_COMPUTE/kernels/GCCol2ImKernel.h deleted file mode 100644 index 6ec9da9e88..0000000000 --- a/arm_compute/core/GLES_COMPUTE/kernels/GCCol2ImKernel.h +++ /dev/null @@ -1,92 +0,0 @@ -/* - * Copyright (c) 2017-2019 Arm Limited. - * - * SPDX-License-Identifier: MIT - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to - * deal in the Software without restriction, including without limitation the - * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or - * sell copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - * SOFTWARE. - */ - -#ifndef ARM_COMPUTE_GCCOL2IMKERNEL_H -#define ARM_COMPUTE_GCCOL2IMKERNEL_H - -#include "arm_compute/core/GLES_COMPUTE/IGCKernel.h" - -namespace arm_compute -{ -class IGCTensor; - -/** Interface for the col2im reshaping kernel. - * - * Rearranges each matrix column into image blocks. It's the inverse operation of @ref GCIm2ColKernel. - * - * For example, a vector of 9 elements can be reshaped to a block(image) of 3x3: - * - * @f[ - * \left( \begin{array}{ccccccccc} - * a0 & a1 & a2 & a3 & a4 & a5 & a6 & a7 & a8 \\ - * \end{array} \right) - * \rightarrow - * \left( \begin{array}{ccc} - * a0 & a1 & a2 \\ - * a3 & a4 & a5 \\ - * a6 & a7 & a8 \\ - * \end{array} \right) - * @f] - */ -class GCCol2ImKernel : public IGCKernel -{ -public: - /** Default constructor */ - GCCol2ImKernel(); - - /** Prevent instances of this class from being copied (As this class contains pointers) */ - GCCol2ImKernel(const GCCol2ImKernel &) = delete; - - /** Prevent instances of this class from being copied (As this class contains pointers) */ - GCCol2ImKernel &operator=(const GCCol2ImKernel &) = delete; - - /** Allow instances of this class to be moved */ - GCCol2ImKernel(GCCol2ImKernel &&) = default; - - /** Allow instances of this class to be moved */ - GCCol2ImKernel &operator=(GCCol2ImKernel &&) = default; - - /** Default destructor */ - ~GCCol2ImKernel() = default; - - /** Set the input and output of the kernel. - * - * @param[in] input The input tensor to convert. Data types supported: F16/F32 - * @param[out] output The output tensor. 3 lower dimensions represent a single output [width, height, OFM], - * while the rest represent batch of outputs. Data types supported: Same as @p input - * @param[in] convolved_dims Output convolved dimensions. - */ - void configure(const IGCTensor *input, IGCTensor *output, std::pair<unsigned int, unsigned int> convolved_dims); - - // Inherited methods overridden: - void run(const Window &window) override; - -private: - const IGCTensor *_input; - IGCTensor *_output; - std::pair<unsigned int, unsigned int> _convolved_dims; -}; -} - -#endif /*ARM_COMPUTE_GCCOL2IMKERNEL_H */ diff --git a/arm_compute/core/GLES_COMPUTE/kernels/GCDepthConcatenateLayerKernel.h b/arm_compute/core/GLES_COMPUTE/kernels/GCDepthConcatenateLayerKernel.h deleted file mode 100644 index 52e8d72151..0000000000 --- a/arm_compute/core/GLES_COMPUTE/kernels/GCDepthConcatenateLayerKernel.h +++ /dev/null @@ -1,74 +0,0 @@ -/* - * Copyright (c) 2017-2019 Arm Limited. - * - * SPDX-License-Identifier: MIT - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to - * deal in the Software without restriction, including without limitation the - * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or - * sell copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - * SOFTWARE. - */ - -#ifndef ARM_COMPUTE_GCDEPTHCONCATENATEKERNEL_H -#define ARM_COMPUTE_GCDEPTHCONCATENATEKERNEL_H - -#include "arm_compute/core/GLES_COMPUTE/IGCKernel.h" -#include "arm_compute/core/Types.h" - -namespace arm_compute -{ -class IGCTensor; - -/** Interface for the depth concatenate kernel. - * The input tensor will be concatenated into the output tensor. - */ -class GCDepthConcatenateLayerKernel : public IGCKernel -{ -public: - /** Default constructor */ - GCDepthConcatenateLayerKernel(); - /** Prevent instances of this class from being copied (As this class contains pointers) */ - GCDepthConcatenateLayerKernel(const GCDepthConcatenateLayerKernel &) = delete; - /** Prevent instances of this class from being copied (As this class contains pointers) */ - GCDepthConcatenateLayerKernel &operator=(const GCDepthConcatenateLayerKernel &) = delete; - /** Allow instances of this class to be moved */ - GCDepthConcatenateLayerKernel(GCDepthConcatenateLayerKernel &&) = default; - /** Allow instances of this class to be moved */ - GCDepthConcatenateLayerKernel &operator=(GCDepthConcatenateLayerKernel &&) = default; - /** Default destructor */ - ~GCDepthConcatenateLayerKernel() = default; - /** Initialise the kernel's inputs and output - * - * @param[in] input Input tensor. Data types supported: F16/F32. - * @param[in] depth_offset The offset on the Z axis. - * @param[in,out] output Output tensor. Data types supported: Same as @p input. - * - * @note: The output tensor's low two dimensions can't be smaller than the input one's. - * @note: The gaps between the two lowest dimensions of input and output need to be divisible by 2. - * - */ - void configure(const IGCTensor *input, unsigned int depth_offset, IGCTensor *output); - - // Inherited methods overridden: - void run(const Window &window) override; - -private: - const IGCTensor *_input; - IGCTensor *_output; - int _depth_offset; -}; -} -#endif /* ARM_COMPUTE_GCDEPTHCONCATENATEKERNEL_H */ diff --git a/arm_compute/core/GLES_COMPUTE/kernels/GCDepthwiseConvolutionLayer3x3Kernel.h b/arm_compute/core/GLES_COMPUTE/kernels/GCDepthwiseConvolutionLayer3x3Kernel.h deleted file mode 100644 index 95708d43b1..0000000000 --- a/arm_compute/core/GLES_COMPUTE/kernels/GCDepthwiseConvolutionLayer3x3Kernel.h +++ /dev/null @@ -1,77 +0,0 @@ -/* - * Copyright (c) 2017-2019 Arm Limited. - * - * SPDX-License-Identifier: MIT - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to - * deal in the Software without restriction, including without limitation the - * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or - * sell copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - * SOFTWARE. - */ -#ifndef ARM_COMPUTE_GCDEPTHWISECONVOLUTIONKERNEL3x3_H -#define ARM_COMPUTE_GCDEPTHWISECONVOLUTIONKERNEL3x3_H - -#include "arm_compute/core/GLES_COMPUTE/IGCKernel.h" - -namespace arm_compute -{ -class IGCTensor; - -/** Interface for the kernel to run a 3x3 depthwise convolution on a tensor. - */ -class GCDepthwiseConvolutionLayer3x3Kernel : public IGCKernel -{ -public: - /** Default constructor */ - GCDepthwiseConvolutionLayer3x3Kernel(); - /** Prevent instances of this class from being copied (As this class contains pointers) */ - GCDepthwiseConvolutionLayer3x3Kernel(const GCDepthwiseConvolutionLayer3x3Kernel &) = delete; - /** Prevent instances of this class from being copied (As this class contains pointers) */ - GCDepthwiseConvolutionLayer3x3Kernel &operator=(const GCDepthwiseConvolutionLayer3x3Kernel &) = delete; - /** Default Move Constructor. */ - GCDepthwiseConvolutionLayer3x3Kernel(GCDepthwiseConvolutionLayer3x3Kernel &&) = default; - /** Default move assignment operator */ - GCDepthwiseConvolutionLayer3x3Kernel &operator=(GCDepthwiseConvolutionLayer3x3Kernel &&) = default; - /** Initialize the function's source, destination, conv and border_size. - * - * @param[in] input Source tensor. DataType supported: F16. - * @param[in] weights Weights tensor. A 3D tensor with dimensions [3, 3, IFM]. Data type supported: Same as @p input. - * @param[in] biases (Optional) Biases tensor. A 1D tensor with dimensions [IFM]. Must be nullptr if not needed. - * Data type supported: Same as @p input. - * @param[out] output Destination tensor. Data type supported: Same as @p input. - * @param[in] conv_info Padding and stride information to use for the convolution. - * @param[in] depth_multiplier (Optional) Multiplier to apply to the input's depth in order to retrieve the output's depth. Defaults to 1. - */ - void configure(const IGCTensor *input, const IGCTensor *weights, const IGCTensor *biases, IGCTensor *output, const PadStrideInfo &conv_info, unsigned int depth_multiplier = 1); - - // Inherited methods overridden: - void run(const Window &window) override; - BorderSize border_size() const override; - -private: - BorderSize _border_size; - const IGCTensor *_input; - IGCTensor *_output; - const IGCTensor *_weights; - const IGCTensor *_biases; - unsigned int _conv_stride_x; - unsigned int _conv_stride_y; - unsigned int _conv_pad_left; - unsigned int _conv_pad_top; - gles::NDRange _lws; -}; -} // namespace arm_compute -#endif /*ARM_COMPUTE_GCDEPTHWISECONVOLUTIONKERNEL3x3_H */ diff --git a/arm_compute/core/GLES_COMPUTE/kernels/GCDirectConvolutionLayerKernel.h b/arm_compute/core/GLES_COMPUTE/kernels/GCDirectConvolutionLayerKernel.h deleted file mode 100644 index 64a51afa45..0000000000 --- a/arm_compute/core/GLES_COMPUTE/kernels/GCDirectConvolutionLayerKernel.h +++ /dev/null @@ -1,92 +0,0 @@ -/* - * Copyright (c) 2017-2019 Arm Limited. - * - * SPDX-License-Identifier: MIT - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to - * deal in the Software without restriction, including without limitation the - * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or - * sell copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - * SOFTWARE. - */ -#ifndef ARM_COMPUTE_GCDIRECTCONVOLUTIONLAYERKERNEL_H -#define ARM_COMPUTE_GCDIRECTCONVOLUTIONLAYERKERNEL_H - -#include "arm_compute/core/GLES_COMPUTE/IGCKernel.h" -#include "arm_compute/core/GLES_COMPUTE/OpenGLES.h" - -namespace arm_compute -{ -class IGCTensor; - -/** Interface for the direct convolution kernel. - */ -template <unsigned int kernel_size> -class GCDirectConvolutionLayerKernel : public IGCKernel -{ -public: - /** Default constructor */ - GCDirectConvolutionLayerKernel(); - /** Prevent instances of this class from being copied (As this class contains pointers) */ - GCDirectConvolutionLayerKernel(const GCDirectConvolutionLayerKernel &) = delete; - /** Prevent instances of this class from being copied (As this class contains pointers) */ - GCDirectConvolutionLayerKernel &operator=(const GCDirectConvolutionLayerKernel &) = delete; - /** Allow instances of this class to be moved */ - GCDirectConvolutionLayerKernel(GCDirectConvolutionLayerKernel &&) = default; - /** Allow instances of this class to be moved */ - GCDirectConvolutionLayerKernel &operator=(GCDirectConvolutionLayerKernel &&) = default; - /** Default destructor */ - ~GCDirectConvolutionLayerKernel() = default; - /** Set the input and output of the kernel. - * - * @param[in] input The input tensor to convert. 3 lower dimensions represent a single input [width, height, IFM], - * while every optional dimension from 4 and above represent a batch of inputs. Data types supported: F16/F32 - * @param[in] weights Weights tensor. Weights are 4D tensor with dimensions [kernel_x, kernel_y, IFM, OFM]. Data type supported:Same as @p input. - * @param[in] bias Biases tensor. Shared bias supported. Biases are 1D tensor with dimensions [OFM]. Data type supported:Same as @p input. - * @param[out] output The output tensor. First 2 lower dimensions represent a transform of each 3D input, - * while every dimension above represents a batch. Data types supported: Same as @p input - * @param[in] conv_info Contains padding and stride information described in @ref PadStrideInfo. - * @param[in] act_info (Optional) Activation layer information in case of a fused activation. - */ - void configure(const IGCTensor *input, const IGCTensor *weights, const IGCTensor *bias, IGCTensor *output, - const PadStrideInfo &conv_info, const ActivationLayerInfo &act_info = ActivationLayerInfo()); - - // Inherited methods overridden: - BorderSize border_size() const override; - - // Inherited methods overridden: - void run(const Window &window) override; - -private: - const IGCTensor *_input; - const IGCTensor *_bias; - const IGCTensor *_weights; - IGCTensor *_output; - BorderSize _border_size; - int _conv_stride_x; - int _conv_stride_y; - int _conv_pad_x; - int _conv_pad_y; - gles::NDRange _lws; -}; - -/** Interface for the 1x1 direct convolution kernel */ -using GCDirectConvolutionLayer1x1Kernel = GCDirectConvolutionLayerKernel<1>; -/** Interface for the 3x3 direct convolution kernel */ -using GCDirectConvolutionLayer3x3Kernel = GCDirectConvolutionLayerKernel<3>; -/** Interface for the 5x5 direct convolution kernel */ -using GCDirectConvolutionLayer5x5Kernel = GCDirectConvolutionLayerKernel<5>; -} -#endif /*ARM_COMPUTE_GCDIRECTCONVOLUTIONLAYERKERNEL_H */ diff --git a/arm_compute/core/GLES_COMPUTE/kernels/GCDropoutLayerKernel.h b/arm_compute/core/GLES_COMPUTE/kernels/GCDropoutLayerKernel.h deleted file mode 100644 index b1338b89f6..0000000000 --- a/arm_compute/core/GLES_COMPUTE/kernels/GCDropoutLayerKernel.h +++ /dev/null @@ -1,79 +0,0 @@ -/* - * Copyright (c) 2017-2019 Arm Limited. - * - * SPDX-License-Identifier: MIT - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to - * deal in the Software without restriction, including without limitation the - * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or - * sell copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - * SOFTWARE. - */ - -#ifndef ARM_COMPUTE_GCDROPOUTLAYERKERNEL_H -#define ARM_COMPUTE_GCDROPOUTLAYERKERNEL_H - -#include "arm_compute/core/GLES_COMPUTE/IGCKernel.h" - -namespace arm_compute -{ -class IGCTensor; - -/** Interface for the dropout layer kernel. - * - * Dropout is used to improve over-fit on neural networks. - * - */ -class GCDropoutLayerKernel : public IGCKernel -{ -public: - /** Default constructor */ - GCDropoutLayerKernel(); - - /** Prevent instances of this class from being copied (As this class contains pointers) */ - GCDropoutLayerKernel(const GCDropoutLayerKernel &) = delete; - - /** Prevent instances of this class from being copied (As this class contains pointers) */ - GCDropoutLayerKernel &operator=(const GCDropoutLayerKernel &) = delete; - - /** Allow instances of this class to be moved */ - GCDropoutLayerKernel(GCDropoutLayerKernel &&) = default; - - /** Allow instances of this class to be moved */ - GCDropoutLayerKernel &operator=(GCDropoutLayerKernel &&) = default; - - /** Set the input and output of the kernel. - * - * @param[in] input The input tensor for this op. Data types supported: F16/F32 - * @param[out] mask The mask tensor. Data types supported: Same as @p input - * @param[out] output The output tensor. Data types supported: Same as @p input - * @param[in] ratio Dropout ratio - * @param[in] forward Forward or backward propagation - * - */ - void configure(const IGCTensor *input, IGCTensor *mask, IGCTensor *output, float ratio, bool forward); - - // Inherited methods overridden: - void run(const Window &window) override; - -private: - const IGCTensor *_input; - IGCTensor *_mask; - IGCTensor *_output; - unsigned int _num_elems_processed_per_iteration; -}; -} - -#endif /*ARM_COMPUTE_GCDROPOUTLAYERKERNEL_H */ diff --git a/arm_compute/core/GLES_COMPUTE/kernels/GCFillBorderKernel.h b/arm_compute/core/GLES_COMPUTE/kernels/GCFillBorderKernel.h deleted file mode 100644 index 6852f90b02..0000000000 --- a/arm_compute/core/GLES_COMPUTE/kernels/GCFillBorderKernel.h +++ /dev/null @@ -1,77 +0,0 @@ -/* - * Copyright (c) 2017-2019 Arm Limited. - * - * SPDX-License-Identifier: MIT - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to - * deal in the Software without restriction, including without limitation the - * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or - * sell copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - * SOFTWARE. - */ -#ifndef ARM_COMPUTE_GCFILLBORDERKERNEL_H -#define ARM_COMPUTE_GCFILLBORDERKERNEL_H - -#include "arm_compute/core/GLES_COMPUTE/IGCKernel.h" -#include "arm_compute/core/PixelValue.h" -#include "arm_compute/core/Types.h" - -namespace arm_compute -{ -class IGCTensor; - -/** Interface for filling the border of a kernel */ -class GCFillBorderKernel : public IGCKernel -{ -public: - /** Default constructor */ - GCFillBorderKernel(); - /** Prevent instances of this class from being copied (As this class contains pointers) */ - GCFillBorderKernel(const GCFillBorderKernel &) = delete; - /** Prevent instances of this class from being copied (As this class contains pointers) */ - GCFillBorderKernel &operator=(const GCFillBorderKernel &) = delete; - /** Allow instances of this class to be moved */ - GCFillBorderKernel(GCFillBorderKernel &&) = default; - /** Allow instances of this class to be moved */ - GCFillBorderKernel &operator=(GCFillBorderKernel &&) = default; - /** Default destructor */ - ~GCFillBorderKernel() = default; - - /** Initialise the kernel's input, output and border mode. - * - * @param[in,out] tensor Tensor to process Data types supported: F16/F32. - * @param[in] border_size Size of the border to fill in elements. - * @param[in] border_mode Border mode to use for the convolution. - * @param[in] constant_border_value (Optional) Constant value to use for borders if border_mode is set to CONSTANT. - */ - void configure(const IGCTensor *tensor, BorderSize border_size, BorderMode border_mode, const PixelValue &constant_border_value = PixelValue()); - - /** Function to set the constant value on fill border kernel depending on type. - * - * @param[in] idx Index of the kernel argument to set. - * @param[in] constant_border_value Constant value to use for borders if border_mode is set to CONSTANT. - */ - template <class T> - void set_constant_border(unsigned int idx, const PixelValue &constant_border_value); - - // Inherited methods overridden: - void run(const Window &window) override; - bool is_parallelisable() const override; - -private: - const IGCTensor *_tensor; -}; -} -#endif /*ARM_COMPUTE_GCFILLBORDERKERNEL_H */ diff --git a/arm_compute/core/GLES_COMPUTE/kernels/GCGEMMInterleave4x4Kernel.h b/arm_compute/core/GLES_COMPUTE/kernels/GCGEMMInterleave4x4Kernel.h deleted file mode 100644 index c7d5181d9d..0000000000 --- a/arm_compute/core/GLES_COMPUTE/kernels/GCGEMMInterleave4x4Kernel.h +++ /dev/null @@ -1,80 +0,0 @@ -/* - * Copyright (c) 2017-2019 Arm Limited. - * - * SPDX-License-Identifier: MIT - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to - * deal in the Software without restriction, including without limitation the - * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or - * sell copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - * SOFTWARE. - */ -#ifndef ARM_COMPUTE_GCGEMMINTERLEAVE4X4KERNEL_H -#define ARM_COMPUTE_GCGEMMINTERLEAVE4X4KERNEL_H - -#include "arm_compute/core/GLES_COMPUTE/IGCKernel.h" - -namespace arm_compute -{ -class IGCTensor; - -/** OpenGL ES kernel which interleaves the elements of a matrix A in chunk of 4x4 - * - * This function puts the values in a 4x4 block of Matrix A on the same row (Interleaved values) - * - * @f[ - * \left( \begin{array}{cccc} - * a00 & a01 & a02 & a03 \\ - * a10 & a11 & a12 & a13 \\ - * a20 & a21 & a22 & a23 \\ - * a30 & a31 & a32 & a33 \\ - * \end{array} \right) - * \rightarrow - * \left( \begin{array}{ccccccccccccccccc} - * a00 & a10 & a20 & a30 & a01 & a11 & a21 & a31 & a02 & a12 & a22 & a32 & a03 & a13 & a23 & a33 \\ - * \end{array} \right) - * @f] - * - * After this operation, the output matrix will have the following shape: [ height * 4, ceil(width / 4.0f) ] - */ -class GCGEMMInterleave4x4Kernel : public IGCKernel -{ -public: - /** Default constructor */ - GCGEMMInterleave4x4Kernel(); - /** Prevent instances of this class from being copied (As this class contains pointers) */ - GCGEMMInterleave4x4Kernel(const GCGEMMInterleave4x4Kernel &) = delete; - /** Prevent instances of this class from being copied (As this class contains pointers) */ - GCGEMMInterleave4x4Kernel &operator=(const GCGEMMInterleave4x4Kernel &) = delete; - /** Allow instances of this class to be moved */ - GCGEMMInterleave4x4Kernel(GCGEMMInterleave4x4Kernel &&) = default; - /** Allow instances of this class to be moved */ - GCGEMMInterleave4x4Kernel &operator=(GCGEMMInterleave4x4Kernel &&) = default; - /** Initialise the kernel's input and output. - * - * @param[in] input Input tensor. Data types supported: F16, F32 - * @param[out] output Output tensor. Data type supported: same as @p input - */ - void configure(const IGCTensor *input, IGCTensor *output); - - // Inherited methods overridden - void run(const Window &window) override; - -private: - const IGCTensor *_input; - IGCTensor *_output; -}; -} -#endif /* ARM_COMPUTE_GCGEMMINTERLEAVE4X4KERNEL_H */ diff --git a/arm_compute/core/GLES_COMPUTE/kernels/GCGEMMMatrixAccumulateBiasesKernel.h b/arm_compute/core/GLES_COMPUTE/kernels/GCGEMMMatrixAccumulateBiasesKernel.h deleted file mode 100644 index e7de8a3fe2..0000000000 --- a/arm_compute/core/GLES_COMPUTE/kernels/GCGEMMMatrixAccumulateBiasesKernel.h +++ /dev/null @@ -1,64 +0,0 @@ -/* - * Copyright (c) 2017-2019 Arm Limited. - * - * SPDX-License-Identifier: MIT - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to - * deal in the Software without restriction, including without limitation the - * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or - * sell copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - * SOFTWARE. - */ -#ifndef ARM_COMPUTE_GCGEMMMATRIXACCUMULATEBIASESKERNEL_H -#define ARM_COMPUTE_GCGEMMMATRIXACCUMULATEBIASESKERNEL_H - -#include "arm_compute/core/GLES_COMPUTE/IGCKernel.h" - -namespace arm_compute -{ -/** Interface to add a bias to each row of the input tensor - * - */ -class GCGEMMMatrixAccumulateBiasesKernel : public IGCKernel -{ -public: - /** Default constructor */ - GCGEMMMatrixAccumulateBiasesKernel(); - /** Prevent instances of this class from being copied (As this class contains pointers) */ - GCGEMMMatrixAccumulateBiasesKernel(const GCGEMMMatrixAccumulateBiasesKernel &) = delete; - /** Prevent instances of this class from being copied (As this class contains pointers) */ - GCGEMMMatrixAccumulateBiasesKernel &operator=(const GCGEMMMatrixAccumulateBiasesKernel &) = delete; - /** Allow instances of this class to be moved */ - GCGEMMMatrixAccumulateBiasesKernel(GCGEMMMatrixAccumulateBiasesKernel &&) = default; - /** Allow instances of this class to be moved */ - GCGEMMMatrixAccumulateBiasesKernel &operator=(GCGEMMMatrixAccumulateBiasesKernel &&) = default; - /** Set the accumulate buffer and the biases of the kernel. - * - * @param[in, out] accum The accumulate tensor to convert. Data types supported: F16/F32 - * @param[in] biases The shared biases tensor to append. It must be 1D tensor. Data types supported: Same as @p input - */ - void configure(IGCTensor *accum, const IGCTensor *biases); - - // Inherited methods overridden: - void run(const Window &window) override; - -private: - IGCTensor *_accum; - const IGCTensor *_biases; - gles::NDRange _lws; -}; -} - -#endif /*ARM_COMPUTE_GCGEMMMATRIXACCUMULATEBIASESKERNEL_H */ diff --git a/arm_compute/core/GLES_COMPUTE/kernels/GCGEMMMatrixAdditionKernel.h b/arm_compute/core/GLES_COMPUTE/kernels/GCGEMMMatrixAdditionKernel.h deleted file mode 100644 index 8b78e0c103..0000000000 --- a/arm_compute/core/GLES_COMPUTE/kernels/GCGEMMMatrixAdditionKernel.h +++ /dev/null @@ -1,70 +0,0 @@ -/* - * Copyright (c) 2017-2019 Arm Limited. - * - * SPDX-License-Identifier: MIT - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to - * deal in the Software without restriction, including without limitation the - * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or - * sell copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - * SOFTWARE. - */ -#ifndef ARM_COMPUTE_GCGEMMMATRIXADDITIONKERNEL_H -#define ARM_COMPUTE_GCGEMMMATRIXADDITIONKERNEL_H - -#include "arm_compute/core/GLES_COMPUTE/IGCKernel.h" - -namespace arm_compute -{ -class IGCTensor; - -/** OpenGL ES kernel to perform the in-place matrix addition between 2 matrices, taking into account that the second matrix might be weighted by a scalar value beta. - * The matrices must have the same dimensions - * - * @note This kernel is computed if and only if beta != 0.0. - */ -class GCGEMMMatrixAdditionKernel : public IGCKernel -{ -public: - /** Default constructor */ - GCGEMMMatrixAdditionKernel(); - /** Prevent instances of this class from being copied (As this class contains pointers) */ - GCGEMMMatrixAdditionKernel(const GCGEMMMatrixAdditionKernel &) = delete; - /** Prevent instances of this class from being copied (As this class contains pointers) */ - GCGEMMMatrixAdditionKernel &operator=(const GCGEMMMatrixAdditionKernel &) = delete; - /** Allow instances of this class to be moved */ - GCGEMMMatrixAdditionKernel(GCGEMMMatrixAdditionKernel &&) = default; - /** Allow instances of this class to be moved */ - GCGEMMMatrixAdditionKernel &operator=(GCGEMMMatrixAdditionKernel &&) = default; - /** Initialise the kernel's input, output and beta value - * - * @note The input and output tensors must have the same dimensions - * - * @param[in] input Input tensor (Matrix C). Data types supported: F32 - * @param[in, out] output Output tensor. If this kernel is used to finalize the GEMM result (alpha * AB + beta * C), output must contain the result obtained by @ref GCGEMMMatrixMultiplyKernel. Data type supported: same as @p input - * @param[in] beta Weight of matrix C - */ - void configure(const IGCTensor *input, IGCTensor *output, float beta); - - // Inherited methods overridden: - void run(const Window &window) override; - -private: - const IGCTensor *_input; - IGCTensor *_output; -}; -} - -#endif /* ARM_COMPUTE_GCGEMMMATRIXADDITIONKERNEL_H */ diff --git a/arm_compute/core/GLES_COMPUTE/kernels/GCGEMMMatrixMultiplyKernel.h b/arm_compute/core/GLES_COMPUTE/kernels/GCGEMMMatrixMultiplyKernel.h deleted file mode 100644 index 4b6e08fb3a..0000000000 --- a/arm_compute/core/GLES_COMPUTE/kernels/GCGEMMMatrixMultiplyKernel.h +++ /dev/null @@ -1,92 +0,0 @@ -/* - * Copyright (c) 2017-2019 Arm Limited. - * - * SPDX-License-Identifier: MIT - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to - * deal in the Software without restriction, including without limitation the - * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or - * sell copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - * SOFTWARE. - */ -#ifndef ARM_COMPUTE_GCGEMMMATRIXMULTIPLYKERNEL_H -#define ARM_COMPUTE_GCGEMMMATRIXMULTIPLYKERNEL_H - -#include "arm_compute/core/GLES_COMPUTE/IGCKernel.h" -#include "arm_compute/core/GPUTarget.h" - -namespace arm_compute -{ -class IGCTensor; - -/** GLES Compute kernel to multiply two input matrices "A" and "B" or to multiply a vector "A" by a matrix "B". All elements of the output matrix/vector will be multiplied by alpha - * - * @attention The second input tensor must have at least 2 dimensions (matrix) - * - */ -class GCGEMMMatrixMultiplyKernel : public IGCKernel -{ -public: - /** Default constructor */ - GCGEMMMatrixMultiplyKernel(); - - /** Prevent instances of this class from being copied (As this class contains pointers) */ - GCGEMMMatrixMultiplyKernel(const GCGEMMMatrixMultiplyKernel &) = delete; - - /** Prevent instances of this class from being copied (As this class contains pointers) */ - GCGEMMMatrixMultiplyKernel &operator=(const GCGEMMMatrixMultiplyKernel &) = delete; - - /** Allow instances of this class to be moved */ - GCGEMMMatrixMultiplyKernel(GCGEMMMatrixMultiplyKernel &&) = default; - - /** Allow instances of this class to be moved */ - GCGEMMMatrixMultiplyKernel &operator=(GCGEMMMatrixMultiplyKernel &&) = default; - - /** Initialise the kernel's input, output and alpha - * - * @param[in] input0 Input tensor containing the interleaved Matrix A or the vector A. Data types supported: F16/F32 - * @param[in] input1 Input tensor containing the transposed Matrix B if the first input tensor A is not a vector. - * If the output tensor is a vector, input1 must contain the matrix B not reshaped. Data type supported: same as @p input0 - * @param[out] output Output tensor to store the result of matrix multiplication. Data type supported: same as @p input0 - * @param[in] alpha Weight of the matrix product - * @param[in] is_interleaved_transposed (Optional) True if input0 and input1 have been reshaped respectively using @ref GCGEMMInterleave4x4Kernel and @ref GCGEMMTranspose1xWKernel - * @param[in] reshape_info (Optional) GEMM reshape info. If is_interleaved_transposed = true, this object must contain the information to understand how the matrix A and matrix B have been reshaped - */ - void configure(const IGCTensor *input0, const IGCTensor *input1, IGCTensor *output, float alpha, bool is_interleaved_transposed = true, const GEMMReshapeInfo &reshape_info = GEMMReshapeInfo()); - /** Static function to check if given info will lead to a valid configuration of @ref GCGEMMMatrixMultiplyKernel - * - * @param[in] input0 Input tensor containing the Matrix A. Data types supported: F16/F32 - * @param[in] input1 Input tensor containing the Matrix B. Data type supported: same as @p input0 - * @param[in] output Output tensor to store the result of matrix multiplication. Data type supported: same as @p input0 - * @param[in] alpha Weight of the matrix product - * @param[in] is_interleaved_transposed True if input0 and input1 have been reshaped respectively using @ref GCGEMMInterleave4x4Kernel and @ref GCGEMMTranspose1xWKernel - * @param[in] reshape_info GEMM reshape info. If is_interleaved_transposed = true, this object must contain the information to understand how the matrix A and matrix B have been reshaped - * @param[in] gpu_target GPU Target - * - * @return a status - */ - static Status validate(const ITensorInfo *input0, const ITensorInfo *input1, const ITensorInfo *output, float alpha, bool is_interleaved_transposed, const GEMMReshapeInfo &reshape_info, - GPUTarget gpu_target); - - // Inherited methods overridden: - void run(const Window &window) override; - -private: - const IGCTensor *_input0; - const IGCTensor *_input1; - IGCTensor *_output; -}; -} -#endif /* ARM_COMPUTE_GCGEMMMATRIXMULTIPLYKERNEL_H */ diff --git a/arm_compute/core/GLES_COMPUTE/kernels/GCGEMMTranspose1xWKernel.h b/arm_compute/core/GLES_COMPUTE/kernels/GCGEMMTranspose1xWKernel.h deleted file mode 100644 index b091159a0c..0000000000 --- a/arm_compute/core/GLES_COMPUTE/kernels/GCGEMMTranspose1xWKernel.h +++ /dev/null @@ -1,67 +0,0 @@ -/* - * Copyright (c) 2017-2019 Arm Limited. - * - * SPDX-License-Identifier: MIT - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to - * deal in the Software without restriction, including without limitation the - * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or - * sell copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - * SOFTWARE. - */ -#ifndef ARM_COMPUTE_GCGEMMTRANSPOSE1XWKERNEL_H -#define ARM_COMPUTE_GCGEMMTRANSPOSE1XWKERNEL_H - -#include "arm_compute/core/GLES_COMPUTE/IGCSimple2DKernel.h" - -namespace arm_compute -{ -class IGCTensor; - -/** OpenGLES kernel which transposes the elements of a matrix in chunks of 1xW, where W is equal to (16 / element size of the tensor) - * - * Following an example of how the transposition1xW works when the input data type is F32 - * - * @f[ - * \left( \begin{array}{cccc} - * a00 & a01 & a02 & a03 \\ - * a10 & a11 & a12 & a13 \\ - * a20 & a21 & a22 & a23 \\ - * a30 & a31 & a32 & a33 \\ - * \end{array} \right) - * \rightarrow - * \left( \begin{array}{ccccccccccccccccc} - * a00 & a01 & a02 & a03 & a10 & a11 & a12 & a13 & a20 & a21 & a22 & a23 & a30 & a31 & a32 & a33 \\ - * \end{array} \right) - * @f] - * - * @note The output matrix will have the following shape: [ height * W, ceil(width / W) ], where W = (16 / element size of the tensor) - * - */ -class GCGEMMTranspose1xWKernel : public IGCSimple2DKernel -{ -public: - /** Initialise the kernel's input and output. - * - * @param[in] input Input tensor. Data types supported: F16, F32 - * @param[out] output Output tensor. Data type supported: same as @p input - */ - void configure(const IGCTensor *input, IGCTensor *output); - - // Inherited methods overridden: - void run(const Window &window) override; -}; -} -#endif /* ARM_COMPUTE_GCGEMMTRANSPOSE1XWKERNEL_H */ diff --git a/arm_compute/core/GLES_COMPUTE/kernels/GCIm2ColKernel.h b/arm_compute/core/GLES_COMPUTE/kernels/GCIm2ColKernel.h deleted file mode 100644 index 38c924dfd8..0000000000 --- a/arm_compute/core/GLES_COMPUTE/kernels/GCIm2ColKernel.h +++ /dev/null @@ -1,128 +0,0 @@ -/* - * Copyright (c) 2017-2019 Arm Limited. - * - * SPDX-License-Identifier: MIT - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to - * deal in the Software without restriction, including without limitation the - * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or - * sell copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - * SOFTWARE. - */ - -#ifndef ARM_COMPUTE_GCIM2COLKERNEL_H -#define ARM_COMPUTE_GCIM2COLKERNEL_H - -#include "arm_compute/core/GLES_COMPUTE/IGCKernel.h" - -namespace arm_compute -{ -class IGCTensor; -class Size2D; - -/** Interface for the im2col reshape kernel. - * - * Rearranges image blocks into columns. It is used to strip out each convolution block to a single column. - * It is used to transform a convolution to a plain matrix multiplication. - * - * For example taking into account the image below and assuming 3x3 image blocks with stride of 1 we have: - * @f[ - * \left( \begin{array}{cccc} - * a00 & a01 & a02 & a03 \\ - * a10 & a11 & a12 & a13 \\ - * a20 & a21 & a22 & a23 \\ - * a30 & a31 & a32 & a33 \\ - * \end{array} \right) - * = - * \left( \begin{array}{ccccccccc} - * a00 & a01 & a02 & a10 & a11 & a12 & a20 & a21 & a22 \\ - * a01 & a02 & a03 & a11 & a12 & a13 & a21 & a22 & a23 \\ - * a10 & a11 & a12 & a20 & a21 & a22 & a30 & a31 & a32 \\ - * a11 & a12 & a13 & a21 & a22 & a23 & a31 & a32 & a33 \\ - * \end{array} \right) - * @f] - */ -class GCIm2ColKernel : public IGCKernel -{ -public: - /** Default constructor */ - GCIm2ColKernel(); - /** Prevent instances of this class from being copied (As this class contains pointers) */ - GCIm2ColKernel(const GCIm2ColKernel &) = delete; - /** Prevent instances of this class from being copied (As this class contains pointers) */ - GCIm2ColKernel &operator=(const GCIm2ColKernel &) = delete; - /** Allow instances of this class to be moved */ - GCIm2ColKernel(GCIm2ColKernel &&) = default; - /** Allow instances of this class to be moved */ - GCIm2ColKernel &operator=(GCIm2ColKernel &&) = default; - /** Set the input and output of the kernel. - * - * @param[in] input The input tensor to convert. 3 lower dimensions represent a single input [width, height, IFM], - * while every optional dimension from 4 and above represent a batch of inputs. Data types supported: F16/F32 - * @param[out] output The output tensor. First 2 lower dimensions represent a transform of each 3D input, - * while every dimension above represents a batch. Data types supported: Same as @p input - * @param[in] kernel_dims The kernel dimensions (width and height). - * @param[in] conv_info Contains padding and stride information described in @ref PadStrideInfo. - * @param[in] has_bias In case biases are provided expands the matrix with 1. - * @param[in] dilation (Optional) Dilation, in elements, across x and y. Defaults to (1, 1). - */ - void configure(const IGCTensor *input, IGCTensor *output, const Size2D &kernel_dims, const PadStrideInfo &conv_info, bool has_bias, const Size2D &dilation = Size2D(1U, 1U)); - - // Inherited methods overridden: - void run(const Window &window) override; - - /** Static function to check if given info will lead to a valid configuration of @ref CLIm2ColKernel - * - * @param[in] input The input tensor to convert. 3 lower dimensions represent a single input [width, height, IFM], - * while every optional dimension from 4 and above represent a batch of inputs. Data types supported: F16/F32 - * @param[in] output The output tensor. First 2 lower dimensions represent a transform of each 3D input, - * while every dimension above represents a batch. Data types supported: Same as @p input - * @param[in] kernel_dims The kernel dimensions (width and height). - * @param[in] conv_info Contains padding and stride information described in @ref PadStrideInfo. - * @param[in] has_bias In case biases are provided expands the matrix with 1. - * @param[in] dilation (Optional) Dilation, in elements, across x and y. Defaults to (1, 1). - * - * @return a status - */ - static Status validate(const ITensorInfo *input, const ITensorInfo *output, const Size2D &kernel_dims, const PadStrideInfo &conv_info, bool has_bias, const Size2D &dilation = Size2D(1U, 1U)); - -private: - /** Run the reshape kernel optimised for the special case (stride is 1, padding is 0 and kernel's low 3 dimensions are same as input) - * - * @param[in] window Region on which to execute the kernel. (Must be a valid region of the window returned by window()). - * @param[in,out] queue Command queue on which to enqueue the kernel. - */ - void run_reduced(const Window &window); - /** run the generic convolution layer input reshape kernel - * - * @param[in] window Region on which to execute the kernel. (Must be a valid region of the window returned by window()). - * @param[in,out] queue Command queue on which to enqueue the kernel. - */ - void run_generic(const Window &window); - - /** Common signature for the kernel to run */ - using Im2ColFunction = void (GCIm2ColKernel::*)(const Window &); - -private: - const IGCTensor *_input; - IGCTensor *_output; - std::pair<unsigned int, unsigned int> _convolved_dims; - std::pair<unsigned int, unsigned int> _kernel_dims; - unsigned int _num_elems_processed_per_iteration; - Im2ColFunction _run_func; -}; -} - -#endif /*ARM_COMPUTE_GCIM2COLKERNEL_H */ diff --git a/arm_compute/core/GLES_COMPUTE/kernels/GCNormalizationLayerKernel.h b/arm_compute/core/GLES_COMPUTE/kernels/GCNormalizationLayerKernel.h deleted file mode 100644 index a942975b49..0000000000 --- a/arm_compute/core/GLES_COMPUTE/kernels/GCNormalizationLayerKernel.h +++ /dev/null @@ -1,72 +0,0 @@ -/* - * Copyright (c) 2017-2019 Arm Limited. - * - * SPDX-License-Identifier: MIT - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to - * deal in the Software without restriction, including without limitation the - * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or - * sell copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - * SOFTWARE. - */ -#ifndef ARM_COMPUTE_GCNORMALIZATIONLAYERKERNEL_H -#define ARM_COMPUTE_GCNORMALIZATIONLAYERKERNEL_H - -#include "arm_compute/core/GLES_COMPUTE/IGCKernel.h" - -namespace arm_compute -{ -class IGCTensor; - -/** Interface for the normalization layer kernel. - */ -class GCNormalizationLayerKernel : public IGCKernel -{ -public: - /** Constructor */ - GCNormalizationLayerKernel(); - /** Prevent instances of this class from being copied (As this class contains pointers) */ - GCNormalizationLayerKernel(const GCNormalizationLayerKernel &) = delete; - /** Prevent instances of this class from being copied (As this class contains pointers) */ - GCNormalizationLayerKernel &operator=(const GCNormalizationLayerKernel &) = delete; - /** Default Move Constructor. */ - GCNormalizationLayerKernel(GCNormalizationLayerKernel &&) = default; - /** Default move assignment operator */ - GCNormalizationLayerKernel &operator=(GCNormalizationLayerKernel &&) = default; - /** Default destrutor */ - ~GCNormalizationLayerKernel() = default; - /** Set the input and output tensors. - * - * @param[in] input Source tensor. 3 lower dims represent a single input with dimensions [width, height, IFM], - * and an optional 4th dimension for batch of inputs. Data types supported: F32. - * @param[in] squared_input Source with each element has been squared. 3 lower dims represent a single input with dimensions [width, height, IFM], - * Data types should match the input type. - * @param[out] output Destination tensor. Output will have the same number of dimensions as input. Data types should match the input type. - * @param[in] norm_info Normalization layer information like the normalization type, normalization size and other parameters. - */ - void configure(const IGCTensor *input, const IGCTensor *squared_input, IGCTensor *output, NormalizationLayerInfo norm_info); - - // Inherited methods overridden: - void run(const Window &window) override; - BorderSize border_size() const override; - -private: - const IGCTensor *_input; - const IGCTensor *_squared_input; - IGCTensor *_output; - BorderSize _border_size; -}; -} -#endif /*ARM_COMPUTE_GCNORMALIZATIONLAYERKERNEL_H */ diff --git a/arm_compute/core/GLES_COMPUTE/kernels/GCNormalizePlanarYUVLayerKernel.h b/arm_compute/core/GLES_COMPUTE/kernels/GCNormalizePlanarYUVLayerKernel.h deleted file mode 100644 index b8bd22659f..0000000000 --- a/arm_compute/core/GLES_COMPUTE/kernels/GCNormalizePlanarYUVLayerKernel.h +++ /dev/null @@ -1,84 +0,0 @@ -/* - * Copyright (c) 2017-2019 Arm Limited. - * - * SPDX-License-Identifier: MIT - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to - * deal in the Software without restriction, including without limitation the - * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or - * sell copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - * SOFTWARE. - */ -#ifndef ARM_COMPUTEH -#define ARM_COMPUTE_GCNORMALIZEPLANARYUVLAYERKERNEL_H - -#include "arm_compute/core/GLES_COMPUTE/IGCKernel.h" - -namespace arm_compute -{ -class IGCTensor; - -/** Interface for the NormalizePlanarYUV layer kernel. - */ -class GCNormalizePlanarYUVLayerKernel : public IGCKernel -{ -public: - /** Constructor */ - GCNormalizePlanarYUVLayerKernel(); - /** Prevent instances of this class from being copied (As this class contains pointers) */ - GCNormalizePlanarYUVLayerKernel(const GCNormalizePlanarYUVLayerKernel &) = delete; - /** Prevent instances of this class from being copied (As this class contains pointers) */ - GCNormalizePlanarYUVLayerKernel &operator=(const GCNormalizePlanarYUVLayerKernel &) = delete; - /** Default Move Constructor. */ - GCNormalizePlanarYUVLayerKernel(GCNormalizePlanarYUVLayerKernel &&) = default; - /** Default move assignment operator */ - GCNormalizePlanarYUVLayerKernel &operator=(GCNormalizePlanarYUVLayerKernel &&) = default; - /** Default destructor */ - ~GCNormalizePlanarYUVLayerKernel() = default; - - /** Set the input and output tensors. - * - * @param[in] input Source tensor. 3 lower dimensions represent a single input with dimensions [width, height, channels]. - * Data types supported: F16. - * @param[out] output Destination tensor. Data type supported: same as @p input - * @param[in] mean Mean values tensor. 1 dimension with size equal to the number of input channels. Data types supported: same as @p input - * @param[in] std Standard deviation values tensor. 1 dimension with size equal to the feature maps [FM]. - * Data types supported: same as @p input - */ - void configure(const IGCTensor *input, IGCTensor *output, const IGCTensor *mean, const IGCTensor *std); - /** Static function to check if given info will lead to a valid configuration of @ref GCNormalizePlanarYUVLayerKernel - * - * @param[in] input Source tensor info. 3 lower dimensions represent a single input with dimensions [width, height, channels]. - * Data types supported: F16. - * @param[out] output Destination tensor info. Data type supported: same as @p input - * @param[in] mean Mean values tensor info. 1 dimension with size equal to the number of input channels. Data types supported: same as @p input - * @param[in] std Standard deviation values tensor info. 1 dimension with size equal to the number of input channels. - * Data types supported: same as @p input - * - * @return a status - */ - static Status validate(const ITensorInfo *input, const ITensorInfo *output, const ITensorInfo *mean, const ITensorInfo *std); - - // Inherited methods overridden: - void run(const Window &window) override; - -private: - const IGCTensor *_input; - IGCTensor *_output; - const IGCTensor *_mean; - const IGCTensor *_std; -}; -} -#endif /*ARM_COMPUTE_GCNORMALIZEPLANARYUVLAYERKERNEL_H */ diff --git a/arm_compute/core/GLES_COMPUTE/kernels/GCPixelWiseMultiplicationKernel.h b/arm_compute/core/GLES_COMPUTE/kernels/GCPixelWiseMultiplicationKernel.h deleted file mode 100644 index f9d84b8963..0000000000 --- a/arm_compute/core/GLES_COMPUTE/kernels/GCPixelWiseMultiplicationKernel.h +++ /dev/null @@ -1,70 +0,0 @@ -/* - * Copyright (c) 2017-2019 Arm Limited. - * - * SPDX-License-Identifier: MIT - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to - * deal in the Software without restriction, including without limitation the - * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or - * sell copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - * SOFTWARE. - */ -#ifndef ARM_COMPUTE_GCPIXELWISEMULTIPLICATIONKERNEL_H -#define ARM_COMPUTE_GCPIXELWISEMULTIPLICATIONKERNEL_H - -#include "arm_compute/core/GLES_COMPUTE/IGCKernel.h" -#include "arm_compute/core/Types.h" - -namespace arm_compute -{ -class IGCTensor; - -/** Interface for the pixelwise multiplication kernel. - * - */ -class GCPixelWiseMultiplicationKernel : public IGCKernel -{ -public: - /** Default constructor.*/ - GCPixelWiseMultiplicationKernel(); - /** Prevent instances of this class from being copied (As this class contains pointers) */ - GCPixelWiseMultiplicationKernel(const GCPixelWiseMultiplicationKernel &) = delete; - /** Prevent instances of this class from being copied (As this class contains pointers) */ - GCPixelWiseMultiplicationKernel &operator=(const GCPixelWiseMultiplicationKernel &) = delete; - /** Allow instances of this class to be moved */ - GCPixelWiseMultiplicationKernel(GCPixelWiseMultiplicationKernel &&) = default; - /** Allow instances of this class to be moved */ - GCPixelWiseMultiplicationKernel &operator=(GCPixelWiseMultiplicationKernel &&) = default; - /** Initialise the kernel's input, output and border mode. - * - * @param[in] input1 An input tensor. Data types supported: F32. - * @param[in] input2 An input tensor. Data types supported: same as @p input1. - * @param[out] output The output tensor, Data types supported: same as @p input1. - * @param[in] scale Scale to apply after multiplication. - * Scale must be positive and its value must be either 1/255 or 1/2^n where n is between 0 and 15. - */ - void configure(const IGCTensor *input1, const IGCTensor *input2, IGCTensor *output, float scale); - - // Inherited methods overridden: - void run(const Window &window) override; - -private: - const IGCTensor *_input1; - const IGCTensor *_input2; - IGCTensor *_output; -}; -} - -#endif /*ARM_COMPUTE_GCPIXELWISEMULTIPLICATIONKERNEL_H */ diff --git a/arm_compute/core/GLES_COMPUTE/kernels/GCPoolingLayerKernel.h b/arm_compute/core/GLES_COMPUTE/kernels/GCPoolingLayerKernel.h deleted file mode 100644 index a2190774be..0000000000 --- a/arm_compute/core/GLES_COMPUTE/kernels/GCPoolingLayerKernel.h +++ /dev/null @@ -1,85 +0,0 @@ -/* - * Copyright (c) 2017-2020 Arm Limited. - * - * SPDX-License-Identifier: MIT - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to - * deal in the Software without restriction, including without limitation the - * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or - * sell copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - * SOFTWARE. - */ -#ifndef ARM_COMPUTE_GCPOOLINGLAYERKERNEL_H -#define ARM_COMPUTE_GCPOOLINGLAYERKERNEL_H - -#include "arm_compute/core/GLES_COMPUTE/IGCKernel.h" - -#include "arm_compute/core/Error.h" - -namespace arm_compute -{ -class IGCTensor; - -/** Interface for the pooling layer kernel */ -class GCPoolingLayerKernel : public IGCKernel -{ -public: - /** Default constructor */ - GCPoolingLayerKernel(); - /** Prevent instances of this class from being copied (As this class contains pointers) */ - GCPoolingLayerKernel(const GCPoolingLayerKernel &) = delete; - /** Prevent instances of this class from being copied (As this class contains pointers) */ - GCPoolingLayerKernel &operator=(const GCPoolingLayerKernel &) = delete; - /** Allow instances of this class to be moved */ - GCPoolingLayerKernel(GCPoolingLayerKernel &&) = default; - /** Allow instances of this class to be moved */ - GCPoolingLayerKernel &operator=(GCPoolingLayerKernel &&) = default; - /** Default destructor */ - ~GCPoolingLayerKernel() = default; - - /** Set the input and output tensors. - * - * @param[in] input Source tensor. Data types supported: F16/F32. - * @param[out] output Destination tensor. Data types supported: Same as @p input. - * @param[in] pool_info Contains pooling operation information described in @ref PoolingLayerInfo. - * @param[out] indices (optional) The indices of the maximal values. Data type supported: U32. - */ - void configure(const IGCTensor *input, IGCTensor *output, const PoolingLayerInfo &pool_info, IGCTensor *indices = nullptr); - - /** Static function to check if given info will lead to a valid configuration of @ref GCPoolingLayerKernel - * - * @param[in] input Source tensor info. Data types supported: F16/F32. - * @param[in] output Destination tensor info. Data types supported: Same as @p input. - * @param[in] pool_info Contains pooling operation information described in @ref PoolingLayerInfo. - * @param[in] indices (optional) The indices of the maximal values. Data type supported: U32. - * - * @return a status - */ - static Status validate(const ITensorInfo *input, const ITensorInfo *output, const PoolingLayerInfo &pool_info, const ITensorInfo *indices = nullptr); - - // Inherited methods overridden: - void run(const Window &window) override; - BorderSize border_size() const override; - -private: - const IGCTensor *_input; - IGCTensor *_output; - IGCTensor *_indices; - PoolingLayerInfo _pool_info; - BorderSize _border_size; - unsigned int _num_elems_processed_per_iteration; -}; -} // namespace arm_compute -#endif /*ARM_COMPUTE_GCPOOLINGLAYERKERNEL_H */ diff --git a/arm_compute/core/GLES_COMPUTE/kernels/GCScaleKernel.h b/arm_compute/core/GLES_COMPUTE/kernels/GCScaleKernel.h deleted file mode 100644 index 7a2e40a5ec..0000000000 --- a/arm_compute/core/GLES_COMPUTE/kernels/GCScaleKernel.h +++ /dev/null @@ -1,52 +0,0 @@ -/* - * Copyright (c) 2016-2020 Arm Limited. - * - * SPDX-License-Identifier: MIT - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to - * deal in the Software without restriction, including without limitation the - * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or - * sell copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - * SOFTWARE. - */ -#ifndef ARM_COMPUTE_GCSCALEKERNEL_H -#define ARM_COMPUTE_GCSCALEKERNEL_H - -#include "arm_compute/core/GLES_COMPUTE/IGCSimple3DKernel.h" -#include "arm_compute/core/KernelDescriptors.h" - -namespace arm_compute -{ -class IGCTensor; - -/** Interface for the scale kernel */ -class GCScaleKernel : public IGCSimple3DKernel -{ -public: - /** Initialise the kernel's inputs, output and interpolation policy - * - * @param[in] input Source tensor. Data types supported: F16 - * @param[out] output Destination tensor. Data types supported: Same as @p input - * All but the lowest two dimensions must be the same size as in the input tensor, i.e. scaling is only performed within the XY-plane. - * @param[in] info @ref ScaleKernelInfo descriptor to be used to configure - */ - void configure(const IGCTensor *input, IGCTensor *output, const ScaleKernelInfo &info); - - // Inherited methods overridden: - void run(const Window &window) override; - BorderSize border_size() const override; -}; -} // namespace arm_compute -#endif /*ARM_COMPUTE_GCSCALEKERNEL_H */ diff --git a/arm_compute/core/GLES_COMPUTE/kernels/GCSoftmaxLayerKernel.h b/arm_compute/core/GLES_COMPUTE/kernels/GCSoftmaxLayerKernel.h deleted file mode 100644 index 1b0d450b86..0000000000 --- a/arm_compute/core/GLES_COMPUTE/kernels/GCSoftmaxLayerKernel.h +++ /dev/null @@ -1,109 +0,0 @@ -/* - * Copyright (c) 2017-2019 Arm Limited. - * - * SPDX-License-Identifier: MIT - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to - * deal in the Software without restriction, including without limitation the - * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or - * sell copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - * SOFTWARE. - */ -#ifndef ARM_COMPUTE_GCSOFTMAXLAYERKERNEL_H -#define ARM_COMPUTE_GCSOFTMAXLAYERKERNEL_H - -#include "arm_compute/core/GLES_COMPUTE/IGCSimple3DKernel.h" - -namespace arm_compute -{ -class IGCTensor; - -/** Interface for the identifying the max value of 1D Logits */ -class GCLogits1DMaxKernel : public IGCSimple3DKernel -{ -public: - /** Set the input and output tensors. - * - * @param[in] input Source tensor. Data types supported: F16/F32 - * @param[out] output Destination tensor. Data types supported: same as @p input - */ - void configure(const IGCTensor *input, IGCTensor *output); -}; - -/** Interface for shifting the logits values around the max value and exponentiating the result */ -class GCLogits1DShiftExpSumKernel : public IGCKernel -{ -public: - /** Default constructor */ - GCLogits1DShiftExpSumKernel(); - /** Prevent instances of this class from being copied (As this class contains pointers) */ - GCLogits1DShiftExpSumKernel(const GCLogits1DShiftExpSumKernel &) = delete; - /** Prevent instances of this class from being copied (As this class contains pointers) */ - GCLogits1DShiftExpSumKernel &operator=(const GCLogits1DShiftExpSumKernel &) = delete; - /** Allow instances of this class to be moved */ - GCLogits1DShiftExpSumKernel(GCLogits1DShiftExpSumKernel &&) = default; - /** Allow instances of this class to be moved */ - GCLogits1DShiftExpSumKernel &operator=(GCLogits1DShiftExpSumKernel &&) = default; - /** Set the input and output tensors. - * - * @param[in] input Source tensor. Data types supported: F16/F32 - * @param[in] max Max values tensor. Data types supported: same as @p input - * @param[out] output Destination tensor. Data types supported: same as @p input - * @param[out] sum Sum of 1D logits tensor. Data types supported: same as @p input - */ - void configure(const IGCTensor *input, const IGCTensor *max, IGCTensor *output, IGCTensor *sum); - - // Inherited methods overridden: - void run(const Window &window) override; - -private: - const IGCTensor *_input; - const IGCTensor *_max; - IGCTensor *_output; - IGCTensor *_sum; -}; - -/** Interface for calculating the final step of the Softmax Layer where each logit value is multiplied by the inverse of the sum of the logits. */ -class GCLogits1DNormKernel : public IGCKernel -{ -public: - /** Default constructor */ - GCLogits1DNormKernel(); - /** Prevent instances of this class from being copied (As this class contains pointers) */ - GCLogits1DNormKernel(const GCLogits1DNormKernel &) = delete; - /** Prevent instances of this class from being copied (As this class contains pointers) */ - GCLogits1DNormKernel &operator=(const GCLogits1DNormKernel &) = delete; - /** Allow instances of this class to be moved */ - GCLogits1DNormKernel(GCLogits1DNormKernel &&) = default; - /** Allow instances of this class to be moved */ - GCLogits1DNormKernel &operator=(GCLogits1DNormKernel &&) = default; - /** Set the input and output tensors. - * - * @param[in] input Source tensor. Data types supported: F16/F32 - * @param[in] sum Sum tensor. Dimensions should be dim(input)-1. Data types supported: same as @p input - * @param[out] output Destination tensor. Data types supported: same as @p input - */ - void configure(const IGCTensor *input, const IGCTensor *sum, IGCTensor *output); - - // Inherited methods overridden: - void run(const Window &window) override; - -private: - const IGCTensor *_input; - const IGCTensor *_sum; - IGCTensor *_output; -}; -} // namespace arm_compute -#endif /*ARM_COMPUTE_GCSOFTMAXLAYERKERNEL_H */ diff --git a/arm_compute/core/GLES_COMPUTE/kernels/GCTensorShiftKernel.h b/arm_compute/core/GLES_COMPUTE/kernels/GCTensorShiftKernel.h deleted file mode 100644 index 72c3839c55..0000000000 --- a/arm_compute/core/GLES_COMPUTE/kernels/GCTensorShiftKernel.h +++ /dev/null @@ -1,84 +0,0 @@ -/* - * Copyright (c) 2017-2019 Arm Limited. - * - * SPDX-License-Identifier: MIT - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to - * deal in the Software without restriction, including without limitation the - * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or - * sell copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - * SOFTWARE. - */ -#ifndef ARM_COMPUTE_GCTENSORSHIFTKERNEL_H -#define ARM_COMPUTE_GCTENSORSHIFTKERNEL_H - -#include "arm_compute/core/GLES_COMPUTE/IGCKernel.h" -#include "arm_compute/core/GLES_COMPUTE/OpenGLES.h" - -namespace arm_compute -{ -class IGCTensor; -/** Interface for the kernel to shift valid data on a tensor. - * - * For example shifting 3x3 valid data with padding of 1 to right: - * @f[ - * \left( \begin{array}{ccccc} - * 0 & 0 & 0 & 0 & 0 \\ - * a00 & a01 & a02 & 0 & 0 \\ - * a10 & a11 & a12 & 0 & 0 \\ - * a20 & a21 & a22 & 0 & 0 \\ - * 0 & 0 & 0 & 0 & 0 \\ - * \end{array} \right) - * = - * \left( \begin{array}{ccccc} - * 0 & 0 & 0 & 0 & 0 \\ - * 0 & a00 & a01 & a02 & 0 \\ - * 0 & a10 & a11 & a12 & 0 \\ - * 0 & a20 & a21 & a22 & 0 \\ - * 0 & 0 & 0 & 0 & 0 \\ - * \end{array} \right) - * @f] - */ -class GCTensorShiftKernel : public IGCKernel -{ -public: - /** Default constructor */ - GCTensorShiftKernel(); - /** Prevent instances of this class from being copied (As this class contains pointers) */ - GCTensorShiftKernel(const GCTensorShiftKernel &) = delete; - /** Prevent instances of this class from being copied (As this class contains pointers) */ - GCTensorShiftKernel &operator=(const GCTensorShiftKernel &) = delete; - /** Allow instances of this class to be moved */ - GCTensorShiftKernel(GCTensorShiftKernel &&) = default; - /** Allow instances of this class to be moved */ - GCTensorShiftKernel &operator=(GCTensorShiftKernel &&) = default; - /** Default destructor */ - ~GCTensorShiftKernel() = default; - /** Set the input of the kernel. - * - * @param[in,out] input Source tensor. Data types supported: F16/F32 - */ - void configure(IGCTensor *input); - - // Inherited methods overridden: - void run(const Window &window) override; - -private: - IGCTensor *_input; - gles::NDRange _lws; - int _left_padding; -}; -} -#endif /*ARM_COMPUTE_GCTENSORSHIFTKERNEL_H */ diff --git a/arm_compute/core/GLES_COMPUTE/kernels/GCTransposeKernel.h b/arm_compute/core/GLES_COMPUTE/kernels/GCTransposeKernel.h deleted file mode 100644 index 03f741b3d4..0000000000 --- a/arm_compute/core/GLES_COMPUTE/kernels/GCTransposeKernel.h +++ /dev/null @@ -1,52 +0,0 @@ -/* - * Copyright (c) 2017-2019 Arm Limited. - * - * SPDX-License-Identifier: MIT - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to - * deal in the Software without restriction, including without limitation the - * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or - * sell copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - * SOFTWARE. - */ -#ifndef ARM_COMPUTE_GCTRANSPOSEKERNEL_H -#define ARM_COMPUTE_GCTRANSPOSEKERNEL_H - -#include "arm_compute/core/GLES_COMPUTE/IGCSimple2DKernel.h" - -namespace arm_compute -{ -class IGCTensor; - -/** OpenGL ES kernel which transposes the elements of a matrix. - * - * [width, height, batch] -> [height, width, batch] - * - */ -class GCTransposeKernel : public IGCSimple2DKernel -{ -public: - /** Initialise the kernel's input and output. - * - * @param[in] input Input tensor. Data types supported: F16/F32 - * @param[out] output Output tensor. Data type supported: Same as @p input - */ - void configure(const IGCTensor *input, IGCTensor *output); - - // Inherited methods overridden: - void run(const Window &window) override; -}; -} -#endif /* ARM_COMPUTE_GCTRANSPOSEKERNEL_H */ diff --git a/arm_compute/core/GLES_COMPUTE/kernels/GCWeightsReshapeKernel.h b/arm_compute/core/GLES_COMPUTE/kernels/GCWeightsReshapeKernel.h deleted file mode 100644 index 3b238bf5f4..0000000000 --- a/arm_compute/core/GLES_COMPUTE/kernels/GCWeightsReshapeKernel.h +++ /dev/null @@ -1,90 +0,0 @@ -/* - * Copyright (c) 2017-2019 Arm Limited. - * - * SPDX-License-Identifier: MIT - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to - * deal in the Software without restriction, including without limitation the - * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or - * sell copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - * SOFTWARE. - */ -#ifndef ARM_COMPUTE_GCWEIGHTSRESHAPEKERNEL_H -#define ARM_COMPUTE_GCWEIGHTSRESHAPEKERNEL_H - -#include "arm_compute/core/GLES_COMPUTE/IGCKernel.h" - -namespace arm_compute -{ -/** GLES Compute kernel to perform reshaping on the weights used by convolution and locally connected layer - * - * Rearranges each 3-dimensional kernel to a single row leading to a matrix with linearized kernels. - * In combination with the @ref GCIm2ColKernel can transform a convolution to a matrix multiplication. - * - * For example assuming a 3D weight kernel of 3x3 dimensions and depth of 2 we have: - * @f[ - * \left( \begin{array}{ccc} - * a000 & a001 & a002 \\ - * a010 & a011 & a012 \\ - * a020 & a021 & a022 \\ - * \end{array} \right) - * \left( \begin{array}{ccc} - * a100 & a101 & a102 \\ - * a110 & a111 & a112 \\ - * a120 & a121 & a122 \\ - * \end{array} \right) - * \rightarrow - * \left( \begin{array}{ccccccccc} - * a000 & a001 & a002 & a010 & a011 & a012 & a020 & a021 & a022 & a100 & a101 & a102 & a110 & a111 & a112 & a120 & a121 & a122 \\ - * \end{array} \right) - * @f] - */ -class GCWeightsReshapeKernel : public IGCKernel -{ -public: - /** Constructor.*/ - GCWeightsReshapeKernel(); - /** Prevent instances of this class from being copied (As this class contains pointers) */ - GCWeightsReshapeKernel(const GCWeightsReshapeKernel &) = delete; - /** Prevent instances of this class from being copied (As this class contains pointers) */ - GCWeightsReshapeKernel &operator=(const GCWeightsReshapeKernel &) = delete; - /** Allow instances of this class to be moved */ - GCWeightsReshapeKernel(GCWeightsReshapeKernel &&) = default; - /** Allow instances of this class to be moved */ - GCWeightsReshapeKernel &operator=(GCWeightsReshapeKernel &&) = default; - /** Default destructor */ - ~GCWeightsReshapeKernel() = default; - - /** Set the input and output of the kernel. - * - * @param[in] input The input tensor to convert. Weights are 4D tensor with dimensions [kernel_x, kernel_y, IFM, OFM] if shared, - * and 5D tensor with dimensions [kernel_x, kernel_y, IFM, OFM, batches] if unshared. Data types supported: F16, F32 - * @param[in] biases The shared biases tensor to append. Bias is 1D tensor with dimensions [OFM] if shared and 2D tensor with - * dimensions [OFM, batches] if unshared. Data types supported: Same as @p input - * @warning Appending biases to weights reshaped matrix is not supported for quantized asymmetric types. - * @param[out] output The output tensor. Should be a 2D Tensor. Data types supported: Same as @p input - */ - void configure(const IGCTensor *input, const IGCTensor *biases, IGCTensor *output); - - // Inherited methods overridden: - void run(const Window &window) override; - -private: - const IGCTensor *_input; - const IGCTensor *_biases; - IGCTensor *_output; -}; -} // namespace arm_compute -#endif /*ARM_COMPUTE_GCWEIGHTSRESHAPEKERNEL_H */
\ No newline at end of file |