From ceaa0bfe219631b5a4e638613f90f9fa47a3defe Mon Sep 17 00:00:00 2001 From: Manuel Bottini Date: Tue, 16 Feb 2021 15:15:19 +0000 Subject: Remove OpenGL ES support Remove the following: - Relevant backend kernels - Relevant backend functions - Relevant backend validation tests - Relevant backend specific examples - Remove backend support from Graph API - Remove backend support from build system Update documentation Resolves: COMPMID-4149 Change-Id: Id0621d6ee35169754de458103907aaba4ef770c0 Signed-off-by: Manuel Bottini Reviewed-on: https://review.mlplatform.org/c/ml/ComputeLibrary/+/5097 Tested-by: Arm Jenkins Reviewed-by: Michele Di Giorgio Reviewed-by: Georgios Pinitas --- .../core/GLES_COMPUTE/GCCoreRuntimeContext.h | 63 ----- arm_compute/core/GLES_COMPUTE/GCHelpers.h | 58 ----- arm_compute/core/GLES_COMPUTE/GCKernelLibrary.h | 271 --------------------- arm_compute/core/GLES_COMPUTE/GCKernels.h | 54 ---- arm_compute/core/GLES_COMPUTE/IGCKernel.h | 165 ------------- arm_compute/core/GLES_COMPUTE/IGCSimple2DKernel.h | 41 ---- arm_compute/core/GLES_COMPUTE/IGCSimple3DKernel.h | 43 ---- arm_compute/core/GLES_COMPUTE/IGCSimpleKernel.h | 66 ----- arm_compute/core/GLES_COMPUTE/IGCTensor.h | 113 --------- arm_compute/core/GLES_COMPUTE/OpenGLES.h | 165 ------------- .../kernels/GCAbsoluteDifferenceKernel.h | 71 ------ .../GLES_COMPUTE/kernels/GCActivationLayerKernel.h | 74 ------ .../kernels/GCArithmeticAdditionKernel.h | 82 ------- .../kernels/GCBatchNormalizationLayerKernel.h | 98 -------- .../core/GLES_COMPUTE/kernels/GCCol2ImKernel.h | 92 ------- .../kernels/GCDepthConcatenateLayerKernel.h | 74 ------ .../kernels/GCDepthwiseConvolutionLayer3x3Kernel.h | 77 ------ .../kernels/GCDirectConvolutionLayerKernel.h | 92 ------- .../GLES_COMPUTE/kernels/GCDropoutLayerKernel.h | 79 ------ .../core/GLES_COMPUTE/kernels/GCFillBorderKernel.h | 77 ------ .../kernels/GCGEMMInterleave4x4Kernel.h | 80 ------ .../kernels/GCGEMMMatrixAccumulateBiasesKernel.h | 64 ----- .../kernels/GCGEMMMatrixAdditionKernel.h | 70 ------ .../kernels/GCGEMMMatrixMultiplyKernel.h | 92 ------- .../kernels/GCGEMMTranspose1xWKernel.h | 67 ----- .../core/GLES_COMPUTE/kernels/GCIm2ColKernel.h | 128 ---------- .../kernels/GCNormalizationLayerKernel.h | 72 ------ .../kernels/GCNormalizePlanarYUVLayerKernel.h | 84 ------- .../kernels/GCPixelWiseMultiplicationKernel.h | 70 ------ .../GLES_COMPUTE/kernels/GCPoolingLayerKernel.h | 85 ------- .../core/GLES_COMPUTE/kernels/GCScaleKernel.h | 52 ---- .../GLES_COMPUTE/kernels/GCSoftmaxLayerKernel.h | 109 --------- .../GLES_COMPUTE/kernels/GCTensorShiftKernel.h | 84 ------- .../core/GLES_COMPUTE/kernels/GCTransposeKernel.h | 52 ---- .../GLES_COMPUTE/kernels/GCWeightsReshapeKernel.h | 90 ------- arm_compute/core/Types.h | 6 +- arm_compute/graph/backends/GLES/GCDeviceBackend.h | 64 ----- .../graph/backends/GLES/GCFunctionFactory.h | 57 ----- arm_compute/graph/backends/GLES/GCNodeValidator.h | 52 ---- arm_compute/graph/backends/GLES/GCTensorHandle.h | 72 ------ .../runtime/GLES_COMPUTE/GCBufferAllocator.h | 49 ---- arm_compute/runtime/GLES_COMPUTE/GCFunctions.h | 51 ---- arm_compute/runtime/GLES_COMPUTE/GCHelpers.h | 39 --- arm_compute/runtime/GLES_COMPUTE/GCMemory.h | 85 ------- arm_compute/runtime/GLES_COMPUTE/GCMemoryRegion.h | 108 -------- .../runtime/GLES_COMPUTE/GCRuntimeContext.h | 63 ----- arm_compute/runtime/GLES_COMPUTE/GCScheduler.h | 107 -------- arm_compute/runtime/GLES_COMPUTE/GCTensor.h | 106 -------- .../runtime/GLES_COMPUTE/GCTensorAllocator.h | 128 ---------- .../runtime/GLES_COMPUTE/IGCSimpleFunction.h | 63 ----- .../GLES_COMPUTE/functions/GCAbsoluteDifference.h | 55 ----- .../GLES_COMPUTE/functions/GCActivationLayer.h | 70 ------ .../GLES_COMPUTE/functions/GCArithmeticAddition.h | 67 ----- .../functions/GCBatchNormalizationLayer.h | 71 ------ .../GLES_COMPUTE/functions/GCConcatenateLayer.h | 71 ------ .../GLES_COMPUTE/functions/GCConvolutionLayer.h | 161 ------------ .../functions/GCDepthwiseConvolutionLayer.h | 78 ------ .../functions/GCDirectConvolutionLayer.h | 83 ------- .../GLES_COMPUTE/functions/GCDropoutLayer.h | 66 ----- .../runtime/GLES_COMPUTE/functions/GCFillBorder.h | 56 ----- .../GLES_COMPUTE/functions/GCFullyConnectedLayer.h | 116 --------- .../runtime/GLES_COMPUTE/functions/GCGEMM.h | 116 --------- .../GLES_COMPUTE/functions/GCGEMMInterleave4x4.h | 52 ---- .../GLES_COMPUTE/functions/GCGEMMTranspose1xW.h | 49 ---- .../GLES_COMPUTE/functions/GCNormalizationLayer.h | 76 ------ .../functions/GCNormalizePlanarYUVLayer.h | 78 ------ .../functions/GCPixelWiseMultiplication.h | 53 ---- .../GLES_COMPUTE/functions/GCPoolingLayer.h | 79 ------ .../runtime/GLES_COMPUTE/functions/GCScale.h | 54 ---- .../GLES_COMPUTE/functions/GCSoftmaxLayer.h | 79 ------ .../runtime/GLES_COMPUTE/functions/GCTensorShift.h | 54 ---- .../runtime/GLES_COMPUTE/functions/GCTranspose.h | 52 ---- 72 files changed, 3 insertions(+), 5737 deletions(-) delete mode 100644 arm_compute/core/GLES_COMPUTE/GCCoreRuntimeContext.h delete mode 100644 arm_compute/core/GLES_COMPUTE/GCHelpers.h delete mode 100644 arm_compute/core/GLES_COMPUTE/GCKernelLibrary.h delete mode 100644 arm_compute/core/GLES_COMPUTE/GCKernels.h delete mode 100644 arm_compute/core/GLES_COMPUTE/IGCKernel.h delete mode 100644 arm_compute/core/GLES_COMPUTE/IGCSimple2DKernel.h delete mode 100644 arm_compute/core/GLES_COMPUTE/IGCSimple3DKernel.h delete mode 100644 arm_compute/core/GLES_COMPUTE/IGCSimpleKernel.h delete mode 100644 arm_compute/core/GLES_COMPUTE/IGCTensor.h delete mode 100644 arm_compute/core/GLES_COMPUTE/OpenGLES.h delete mode 100644 arm_compute/core/GLES_COMPUTE/kernels/GCAbsoluteDifferenceKernel.h delete mode 100644 arm_compute/core/GLES_COMPUTE/kernels/GCActivationLayerKernel.h delete mode 100644 arm_compute/core/GLES_COMPUTE/kernels/GCArithmeticAdditionKernel.h delete mode 100644 arm_compute/core/GLES_COMPUTE/kernels/GCBatchNormalizationLayerKernel.h delete mode 100644 arm_compute/core/GLES_COMPUTE/kernels/GCCol2ImKernel.h delete mode 100644 arm_compute/core/GLES_COMPUTE/kernels/GCDepthConcatenateLayerKernel.h delete mode 100644 arm_compute/core/GLES_COMPUTE/kernels/GCDepthwiseConvolutionLayer3x3Kernel.h delete mode 100644 arm_compute/core/GLES_COMPUTE/kernels/GCDirectConvolutionLayerKernel.h delete mode 100644 arm_compute/core/GLES_COMPUTE/kernels/GCDropoutLayerKernel.h delete mode 100644 arm_compute/core/GLES_COMPUTE/kernels/GCFillBorderKernel.h delete mode 100644 arm_compute/core/GLES_COMPUTE/kernels/GCGEMMInterleave4x4Kernel.h delete mode 100644 arm_compute/core/GLES_COMPUTE/kernels/GCGEMMMatrixAccumulateBiasesKernel.h delete mode 100644 arm_compute/core/GLES_COMPUTE/kernels/GCGEMMMatrixAdditionKernel.h delete mode 100644 arm_compute/core/GLES_COMPUTE/kernels/GCGEMMMatrixMultiplyKernel.h delete mode 100644 arm_compute/core/GLES_COMPUTE/kernels/GCGEMMTranspose1xWKernel.h delete mode 100644 arm_compute/core/GLES_COMPUTE/kernels/GCIm2ColKernel.h delete mode 100644 arm_compute/core/GLES_COMPUTE/kernels/GCNormalizationLayerKernel.h delete mode 100644 arm_compute/core/GLES_COMPUTE/kernels/GCNormalizePlanarYUVLayerKernel.h delete mode 100644 arm_compute/core/GLES_COMPUTE/kernels/GCPixelWiseMultiplicationKernel.h delete mode 100644 arm_compute/core/GLES_COMPUTE/kernels/GCPoolingLayerKernel.h delete mode 100644 arm_compute/core/GLES_COMPUTE/kernels/GCScaleKernel.h delete mode 100644 arm_compute/core/GLES_COMPUTE/kernels/GCSoftmaxLayerKernel.h delete mode 100644 arm_compute/core/GLES_COMPUTE/kernels/GCTensorShiftKernel.h delete mode 100644 arm_compute/core/GLES_COMPUTE/kernels/GCTransposeKernel.h delete mode 100644 arm_compute/core/GLES_COMPUTE/kernels/GCWeightsReshapeKernel.h delete mode 100644 arm_compute/graph/backends/GLES/GCDeviceBackend.h delete mode 100644 arm_compute/graph/backends/GLES/GCFunctionFactory.h delete mode 100644 arm_compute/graph/backends/GLES/GCNodeValidator.h delete mode 100644 arm_compute/graph/backends/GLES/GCTensorHandle.h delete mode 100644 arm_compute/runtime/GLES_COMPUTE/GCBufferAllocator.h delete mode 100644 arm_compute/runtime/GLES_COMPUTE/GCFunctions.h delete mode 100644 arm_compute/runtime/GLES_COMPUTE/GCHelpers.h delete mode 100644 arm_compute/runtime/GLES_COMPUTE/GCMemory.h delete mode 100644 arm_compute/runtime/GLES_COMPUTE/GCMemoryRegion.h delete mode 100644 arm_compute/runtime/GLES_COMPUTE/GCRuntimeContext.h delete mode 100644 arm_compute/runtime/GLES_COMPUTE/GCScheduler.h delete mode 100644 arm_compute/runtime/GLES_COMPUTE/GCTensor.h delete mode 100644 arm_compute/runtime/GLES_COMPUTE/GCTensorAllocator.h delete mode 100644 arm_compute/runtime/GLES_COMPUTE/IGCSimpleFunction.h delete mode 100644 arm_compute/runtime/GLES_COMPUTE/functions/GCAbsoluteDifference.h delete mode 100644 arm_compute/runtime/GLES_COMPUTE/functions/GCActivationLayer.h delete mode 100644 arm_compute/runtime/GLES_COMPUTE/functions/GCArithmeticAddition.h delete mode 100644 arm_compute/runtime/GLES_COMPUTE/functions/GCBatchNormalizationLayer.h delete mode 100644 arm_compute/runtime/GLES_COMPUTE/functions/GCConcatenateLayer.h delete mode 100644 arm_compute/runtime/GLES_COMPUTE/functions/GCConvolutionLayer.h delete mode 100644 arm_compute/runtime/GLES_COMPUTE/functions/GCDepthwiseConvolutionLayer.h delete mode 100644 arm_compute/runtime/GLES_COMPUTE/functions/GCDirectConvolutionLayer.h delete mode 100644 arm_compute/runtime/GLES_COMPUTE/functions/GCDropoutLayer.h delete mode 100644 arm_compute/runtime/GLES_COMPUTE/functions/GCFillBorder.h delete mode 100644 arm_compute/runtime/GLES_COMPUTE/functions/GCFullyConnectedLayer.h delete mode 100644 arm_compute/runtime/GLES_COMPUTE/functions/GCGEMM.h delete mode 100644 arm_compute/runtime/GLES_COMPUTE/functions/GCGEMMInterleave4x4.h delete mode 100644 arm_compute/runtime/GLES_COMPUTE/functions/GCGEMMTranspose1xW.h delete mode 100644 arm_compute/runtime/GLES_COMPUTE/functions/GCNormalizationLayer.h delete mode 100644 arm_compute/runtime/GLES_COMPUTE/functions/GCNormalizePlanarYUVLayer.h delete mode 100644 arm_compute/runtime/GLES_COMPUTE/functions/GCPixelWiseMultiplication.h delete mode 100644 arm_compute/runtime/GLES_COMPUTE/functions/GCPoolingLayer.h delete mode 100644 arm_compute/runtime/GLES_COMPUTE/functions/GCScale.h delete mode 100644 arm_compute/runtime/GLES_COMPUTE/functions/GCSoftmaxLayer.h delete mode 100644 arm_compute/runtime/GLES_COMPUTE/functions/GCTensorShift.h delete mode 100644 arm_compute/runtime/GLES_COMPUTE/functions/GCTranspose.h (limited to 'arm_compute') diff --git a/arm_compute/core/GLES_COMPUTE/GCCoreRuntimeContext.h b/arm_compute/core/GLES_COMPUTE/GCCoreRuntimeContext.h deleted file mode 100644 index 5c8f5d0132..0000000000 --- a/arm_compute/core/GLES_COMPUTE/GCCoreRuntimeContext.h +++ /dev/null @@ -1,63 +0,0 @@ -/* - * Copyright (c) 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_GCCORERUNTIME_CONTEXT_H -#define ARM_COMPUTE_GCCORERUNTIME_CONTEXT_H - -#include "arm_compute/core/GLES_COMPUTE/OpenGLES.h" - -namespace arm_compute -{ -// Forward declarations -class GCKernelLibrary; - -/** Core runtime context for OpenGL ES */ -class GCCoreRuntimeContext final -{ -public: - /** Legacy constructor */ - GCCoreRuntimeContext(); - - /** Constructor */ - GCCoreRuntimeContext(GCKernelLibrary *kernel_lib); - /** Destructor */ - ~GCCoreRuntimeContext() = default; - /** Default copy constructor */ - GCCoreRuntimeContext(const GCCoreRuntimeContext &) = default; - /** Default move constructor */ - GCCoreRuntimeContext(GCCoreRuntimeContext &&) = default; - /** Default copy assignment */ - GCCoreRuntimeContext &operator=(const GCCoreRuntimeContext &) = default; - /** Default move assignment operator */ - GCCoreRuntimeContext &operator=(GCCoreRuntimeContext &&) = default; - /** Kernel Library accessor - * - * @return The kernel library instance used by the core context - */ - GCKernelLibrary *kernel_library() const; - -private: - GCKernelLibrary *_kernel_lib{ nullptr }; -}; -} // namespace arm_compute -#endif /*ARM_COMPUTE_GCCORERUNTIME_CONTEXT_H */ diff --git a/arm_compute/core/GLES_COMPUTE/GCHelpers.h b/arm_compute/core/GLES_COMPUTE/GCHelpers.h deleted file mode 100644 index 194d49d38d..0000000000 --- a/arm_compute/core/GLES_COMPUTE/GCHelpers.h +++ /dev/null @@ -1,58 +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_GCHELPERS_H -#define ARM_COMPUTE_GCHELPERS_H - -#include "arm_compute/core/GLES_COMPUTE/IGCKernel.h" -#include "arm_compute/core/GLES_COMPUTE/OpenGLES.h" -#include "arm_compute/core/GPUTarget.h" -#include "arm_compute/core/Helpers.h" - -#include -#include - -namespace arm_compute -{ -// Forward declarations -class GCCoreRuntimeContext; - -/** Max vector width of an GLES vector */ -static constexpr unsigned int max_gc_vector_width = 16; - -/** Helper function to get the GPU target from GLES using GL_RENDERER enum - * - * @return the GPU target - */ -GPUTarget get_target_from_device(); -/** Creates an GLES kernel - * - * @param[in] ctx A context to be used to create the GLES kernel. - * @param[in] kernel_name The kernel name. - * @param[in] build_opts The build options to be used for the GLES kernel compilation. - * - * @return A GLES kernel - */ -GCKernel create_opengl_kernel(GCCoreRuntimeContext *ctx, const std::string &kernel_name, const std::set &build_opts); -} // namespace arm_compute -#endif /* ARM_COMPUTE_GCHELPERS_H */ diff --git a/arm_compute/core/GLES_COMPUTE/GCKernelLibrary.h b/arm_compute/core/GLES_COMPUTE/GCKernelLibrary.h deleted file mode 100644 index 8ecdd194bf..0000000000 --- a/arm_compute/core/GLES_COMPUTE/GCKernelLibrary.h +++ /dev/null @@ -1,271 +0,0 @@ -/* - * Copyright (c) 2017-2021 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_GCKERNELLIBRARY_H -#define ARM_COMPUTE_GCKERNELLIBRARY_H - -#include "arm_compute/core/GLES_COMPUTE/OpenGLES.h" -#include "arm_compute/core/Utils.h" - -#include -#include -#include -#include -#include - -namespace arm_compute -{ -/** GCProgram class */ -class GCProgram final -{ -public: - /** Default constructor. */ - GCProgram(); - /** Construct program from source file. - * - * @param[in] name Program name. - * @param[in] source Program source. - */ - GCProgram(std::string name, std::string source); - /** Default Copy Constructor. */ - GCProgram(const GCProgram &) = default; - /** Default Move Constructor. */ - GCProgram(GCProgram &&) = default; - /** Default copy assignment operator */ - GCProgram &operator=(const GCProgram &) = default; - /** Default move assignment operator */ - GCProgram &operator=(GCProgram &&) = default; - /** Returns program name. - * - * @return Program's name. - */ - std::string name() const - { - return _name; - } - /** Link program. - * - * @param[in] shader Shader used to link program. - * - * @return linked program id . - */ - GLuint link_program(GLuint shader); - /** Compile shader. - * - * @param[in] build_options Shader build options. - * - * @return GLES shader object. - */ - GLuint compile_shader(const std::string &build_options); - -private: - std::string _name; /**< Program name. */ - std::string _source; /**< Source code for the program. */ -}; - -/** GCKernel class */ -class GCKernel final -{ -public: - /** Default Constructor. */ - GCKernel(); - /** Default Copy Constructor. */ - GCKernel(const GCKernel &) = default; - /** Default Move Constructor. */ - GCKernel(GCKernel &&) = default; - /** Default copy assignment operator */ - GCKernel &operator=(const GCKernel &) = default; - /** Default move assignment operator */ - GCKernel &operator=(GCKernel &&) = default; - /** Constructor. - * - * @param[in] name Kernel name. - * @param[in] program Built program. - */ - GCKernel(std::string name, GLuint program); - /** Destructor. - */ - ~GCKernel(); - /** Returns kernel name. - * - * @return Kernel's name. - */ - std::string name() const - { - return _name; - } - /** Get program id. - * - * @return program id. - */ - GLuint get_program() const - { - return _program; - } - /** Use current program. - * - * @return program id. - */ - void use(); - /** Unuse current program. - * - * @return program id. - */ - void unuse(); - /** Set argument value at index of shader params. - * - * @param[in] idx Index in shader params. - * @param[in] value Argument value to be set. - */ - template - void set_argument(unsigned int idx, T value) - { - if(idx >= _shader_arguments.size()) - { - _shader_arguments.resize(idx + 1, 0); - } - - unsigned int *p = reinterpret_cast(&value); - _shader_arguments[idx] = *p; - } - /** Clear shader arguments. - * - */ - void clear_arguments() - { - _shader_arguments.clear(); - } - /** Set shader params binding point. - * - * @param[in] binding Shader params binding point. - */ - void set_shader_params_binding_point(unsigned int binding) - { - _shader_params_binding_point = binding; - } - /** Update shader params. - * - */ - void update_shader_params(); - /** Clean up program and ubo. - * - */ - void cleanup(); - -private: - std::string _name; /**< Kernel name */ - GLuint _program; /**< Linked program id */ - std::vector _shader_arguments; /**< Store all the values of the shader arguments */ - GLuint _shader_params_ubo_name; /**< Uniform buffer object name for shader parameters */ - GLuint _shader_params_binding_point; /**< The binding point of the uniform block for shader parameters */ - GLuint _shader_params_index; /**< The index of the uniform block */ - GLint _shader_params_size; /**< The uniform block data size in the shader */ - static constexpr const char *_shader_params_name = "shader_params"; /**< The uniform block name in the shader */ -}; - -/** GCKernelLibrary class */ -class GCKernelLibrary final -{ - using StringSet = std::set; - -public: - /** Default Constructor. */ - GCKernelLibrary(); - /** Default Destructor */ - ~GCKernelLibrary(); - /** Prevent instances of this class from being copied */ - GCKernelLibrary(const GCKernelLibrary &) = delete; - /** Prevent instances of this class from being copied */ - const GCKernelLibrary &operator=(const GCKernelLibrary &) = delete; - /** Get the static instance of @ref GCKernelLibrary. - * This method has been deprecated and will be removed in future releases. - * @return The static instance of GCKernelLibrary. - */ - static GCKernelLibrary &get(); - /** Initialises the kernel library. - * - * @param[in] shader_path (Optional) Path of the directory from which shader sources are loaded. - * @param[in] dpy (Optional) EGLdisplay set by external application. - * @param[in] ctx (Optional) EGLContext set by external application. - */ - void init(std::string shader_path = "./", EGLDisplay dpy = EGL_NO_DISPLAY, EGLContext ctx = EGL_NO_CONTEXT); - /** Sets the path that the shaders reside in. - * - * @param[in] shader_path Path of the shader. - */ - void set_shader_path(const std::string &shader_path); - /** Sets display and context to create kernel. - * - * @param[in] dpy EGLdisplay set by external application. - * @param[in] ctx EGLContext set by external application. - */ - void set_context(EGLDisplay dpy, EGLContext ctx); - /** Creates a kernel from the kernel library. - * - * @param[in] shader_name Shader name. - * @param[in] build_options_set Shader build options as a set. - * - * @return The created kernel. - */ - GCKernel create_kernel(const std::string &shader_name, const StringSet &build_options_set = {}) const; - /** Serializes and saves programs to a binary. */ - void save_binary(); - /** Load serialized binary with all the programs. */ - void load_binary(); - /** Setup a dummy fbo to workaround an issue on Galaxy S8. */ - void setup_dummy_fbo(); - -private: - /** Preprocess GLES shader - * - * @param[in] shader_source Source code of the shader to preprocess. - * - * @return Preprocessed GLES shader object. - */ - std::string preprocess_shader(const std::string &shader_source) const; - /** Load program and its dependencies. - * - * @param[in] program_name Name of the program to load. - */ - const GCProgram &load_program(const std::string &program_name) const; - /** Concatenates contents of a set into a single string. - * - * @param[in] s Input set to concatenate. - * - * @return Concatenated string. - */ - std::string stringify_set(const StringSet &s) const; - - EGLDisplay _display; /**< Underlying EGL Display. */ - EGLContext _context; /**< Underlying EGL Context. */ - GLuint _frame_buffer; /**< Dummy fbo */ - GLuint _tex_rt; /**< Dummy texture for render target */ - std::string _shader_path; /**< Path to the shaders folder. */ - mutable std::map _programs_map; /**< Map with all already loaded program data. */ - mutable std::map _built_programs_map; /**< Map with all already built program data. */ - static const std::map _shader_program_map; /**< Map that associates kernel names with programs. */ - static const std::map _program_source_map; /**< Contains sources for all programs. - Used for compile-time shader inclusion. */ -}; -} // namespace arm_compute -#endif /* ARM_COMPUTE_GCKERNELLIBRARY_H */ diff --git a/arm_compute/core/GLES_COMPUTE/GCKernels.h b/arm_compute/core/GLES_COMPUTE/GCKernels.h deleted file mode 100644 index 1b94ae3dda..0000000000 --- a/arm_compute/core/GLES_COMPUTE/GCKernels.h +++ /dev/null @@ -1,54 +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_GCKERNELS_H -#define ARM_COMPUTE_GCKERNELS_H - -/* Header regrouping all the GLES compute kernels */ -#include "arm_compute/core/GLES_COMPUTE/kernels/GCAbsoluteDifferenceKernel.h" -#include "arm_compute/core/GLES_COMPUTE/kernels/GCActivationLayerKernel.h" -#include "arm_compute/core/GLES_COMPUTE/kernels/GCArithmeticAdditionKernel.h" -#include "arm_compute/core/GLES_COMPUTE/kernels/GCBatchNormalizationLayerKernel.h" -#include "arm_compute/core/GLES_COMPUTE/kernels/GCCol2ImKernel.h" -#include "arm_compute/core/GLES_COMPUTE/kernels/GCDepthConcatenateLayerKernel.h" -#include "arm_compute/core/GLES_COMPUTE/kernels/GCDepthwiseConvolutionLayer3x3Kernel.h" -#include "arm_compute/core/GLES_COMPUTE/kernels/GCDirectConvolutionLayerKernel.h" -#include "arm_compute/core/GLES_COMPUTE/kernels/GCDropoutLayerKernel.h" -#include "arm_compute/core/GLES_COMPUTE/kernels/GCFillBorderKernel.h" -#include "arm_compute/core/GLES_COMPUTE/kernels/GCGEMMInterleave4x4Kernel.h" -#include "arm_compute/core/GLES_COMPUTE/kernels/GCGEMMMatrixAccumulateBiasesKernel.h" -#include "arm_compute/core/GLES_COMPUTE/kernels/GCGEMMMatrixAdditionKernel.h" -#include "arm_compute/core/GLES_COMPUTE/kernels/GCGEMMMatrixMultiplyKernel.h" -#include "arm_compute/core/GLES_COMPUTE/kernels/GCGEMMTranspose1xWKernel.h" -#include "arm_compute/core/GLES_COMPUTE/kernels/GCIm2ColKernel.h" -#include "arm_compute/core/GLES_COMPUTE/kernels/GCNormalizationLayerKernel.h" -#include "arm_compute/core/GLES_COMPUTE/kernels/GCNormalizePlanarYUVLayerKernel.h" -#include "arm_compute/core/GLES_COMPUTE/kernels/GCPixelWiseMultiplicationKernel.h" -#include "arm_compute/core/GLES_COMPUTE/kernels/GCPoolingLayerKernel.h" -#include "arm_compute/core/GLES_COMPUTE/kernels/GCScaleKernel.h" -#include "arm_compute/core/GLES_COMPUTE/kernels/GCSoftmaxLayerKernel.h" -#include "arm_compute/core/GLES_COMPUTE/kernels/GCTensorShiftKernel.h" -#include "arm_compute/core/GLES_COMPUTE/kernels/GCTransposeKernel.h" -#include "arm_compute/core/GLES_COMPUTE/kernels/GCWeightsReshapeKernel.h" - -#endif /* ARM_COMPUTE_GCKERNELS_H */ diff --git a/arm_compute/core/GLES_COMPUTE/IGCKernel.h b/arm_compute/core/GLES_COMPUTE/IGCKernel.h deleted file mode 100644 index 7891b98aea..0000000000 --- a/arm_compute/core/GLES_COMPUTE/IGCKernel.h +++ /dev/null @@ -1,165 +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_IGCKERNEL_H -#define ARM_COMPUTE_IGCKERNEL_H - -#include "arm_compute/core/GLES_COMPUTE/GCKernelLibrary.h" -#include "arm_compute/core/GLES_COMPUTE/OpenGLES.h" -#include "arm_compute/core/GPUTarget.h" - -#include "arm_compute/core/IKernel.h" - -namespace arm_compute -{ -class IGCTensor; -class Window; - -/** Common interface for all the GLES kernels */ -class IGCKernel : public IKernel -{ -public: - /** Constructor */ - IGCKernel(); - /** Returns a reference to the GLES kernel of this object. - * - * @return A reference to the GLES kernel of this object. - */ - GCKernel &kernel(); - - /** Add the passed 1D tensor's parameters to the object's kernel's arguments starting from the index idx. - * - * @param[in] idx Index at which to start adding the tensor's arguments.Input and output tensor will have sperated index, multiple indices start from 1, single index have to be set to 0. - * @param[in] tensor Tensor to set as an argument of the object's kernel. - * @param[in] binding_point Tensor's binding point in this kernel. - * @param[in] window Window the kernel will be executed on. - */ - void add_1D_tensor_argument(unsigned int &idx, const IGCTensor *tensor, const unsigned int binding_point, const Window &window); - - /** Add the passed 2D tensor's parameters to the object's kernel's arguments starting from the index idx. - * - * @param[in] idx Index at which to start adding the tensor's arguments.Input and output tensor will have sperated index, multiple indices start from 1, single index have to be set to 0. - * @param[in] tensor Tensor to set as an argument of the object's kernel. - * @param[in] binding_point Tensor's binding point in this kernel. - * @param[in] window Window the kernel will be executed on. - */ - void add_2D_tensor_argument(unsigned int &idx, const IGCTensor *tensor, const unsigned int binding_point, const Window &window); - - /** Add the passed 3D tensor's parameters to the object's kernel's arguments starting from the index idx. - * - * @param[in] idx Index at which to start adding the tensor's arguments.Input and output tensor will have sperated index, multiple indices start from 1, single index have to be set to 0. - * @param[in] tensor Tensor to set as an argument of the object's kernel. - * @param[in] binding_point Tensor's binding point in this kernel. - * @param[in] window Window the kernel will be executed on. - */ - void add_3D_tensor_argument(unsigned int &idx, const IGCTensor *tensor, const unsigned int binding_point, const Window &window); - - /** Returns the number of arguments enqueued per 1D tensor object. - * - * @return The number of arguments enqueues per 1D tensor object. - */ - unsigned int num_arguments_per_1D_tensor() const; - /** Returns the number of arguments enqueued per 2D tensor object. - * - * @return The number of arguments enqueues per 2D tensor object. - */ - unsigned int num_arguments_per_2D_tensor() const; - /** Returns the number of arguments enqueued per 3D tensor object. - * - * @return The number of arguments enqueues per 3D tensor object. - */ - unsigned int num_arguments_per_3D_tensor() const; - /** Enqueue the OpenGL ES shader to process the given window - * - * @param[in] window Region on which to execute the kernel. (Must be a valid region of the window returned by window()). - */ - virtual void run(const Window &window) = 0; - - /** Set the Local-Workgroup-Size hint - * - * @note This method should be called after the configuration of the kernel - * - * @param[in] lws_hint Local-Workgroup-Size to use - */ - void set_lws_hint(gles::NDRange &lws_hint) - { - _lws_hint = lws_hint; - } - - /** Set the targeted GPU architecture - * - * @param[in] target The targeted GPU architecture - */ - void set_target(GPUTarget target) - { - _target = target; - } - - /** Get the targeted GPU architecture - * - * @return The targeted GPU architecture. - */ - GPUTarget get_target() const - { - return _target; - } - -private: - /** Add the passed tensor's parameters to the object's kernel's arguments starting from the index idx. - * - * @param[in] idx Index at which to start adding the tensor's arguments.Input and output tensor will have sperated index, multiple indices start from 1, single index have to be set to 0. - * @param[in] tensor Tensor to set as an argument of the object's kernel. - * @param[in] binding_point Tensor's binding point in this kernel. - * @param[in] window Window the kernel will be executed on. - */ - template - void add_tensor_argument(unsigned int &idx, const IGCTensor *tensor, const unsigned int binding_point, const Window &window); - - /** Returns the number of arguments enqueued per tensor object. - * - * @return The number of arguments enqueued per tensor object. - */ - template - unsigned int num_arguments_per_tensor() const; - -protected: - GCKernel _kernel; /**< GLES kernel to run */ - gles::NDRange _lws_hint; /**< Local workgroup size hint for the GLES kernel */ - GPUTarget _target; /**< The targeted GPU */ -}; - -/** Add the kernel to the command queue with the given window. - * - * @note Depending on the size of the window, this might translate into several jobs being enqueued. - * - * @note If kernel->kernel() is empty then the function will return without adding anything to the queue. - * - * @param[in] kernel Kernel to enqueue - * @param[in] window Window the kernel has to process. - * @param[in] lws Local workgroup size requested, by default (1, 1, 1) - * - * @note If any dimension of the lws is greater than the global workgroup size then no lws will be passed. - */ -void enqueue(IGCKernel &kernel, const Window &window, const gles::NDRange &lws = gles::NDRange(1U, 1U, 1U)); -} -#endif /*ARM_COMPUTE_IGCKERNEL_H */ diff --git a/arm_compute/core/GLES_COMPUTE/IGCSimple2DKernel.h b/arm_compute/core/GLES_COMPUTE/IGCSimple2DKernel.h deleted file mode 100644 index 3b2cfa19dd..0000000000 --- a/arm_compute/core/GLES_COMPUTE/IGCSimple2DKernel.h +++ /dev/null @@ -1,41 +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_IGCSIMPLE2DKERNEL_H -#define ARM_COMPUTE_IGCSIMPLE2DKERNEL_H - -#include "arm_compute/core/GLES_COMPUTE/IGCSimpleKernel.h" - -namespace arm_compute -{ -class IGCTensor; - -/** Interface for simple OpenGL ES kernels having 1 tensor input and 1 tensor output. This interface can be used when the work-item processes a 2D tile */ -class IGCSimple2DKernel : public IGCSimpleKernel -{ -public: - // Inherited methods overridden: - void run(const Window &window) override; -}; -} -#endif /*ARM_COMPUTE_IGCSIMPLE2DKERNEL_H */ diff --git a/arm_compute/core/GLES_COMPUTE/IGCSimple3DKernel.h b/arm_compute/core/GLES_COMPUTE/IGCSimple3DKernel.h deleted file mode 100644 index 9ccd135023..0000000000 --- a/arm_compute/core/GLES_COMPUTE/IGCSimple3DKernel.h +++ /dev/null @@ -1,43 +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_IGCSIMPLE3DKERNEL_H -#define ARM_COMPUTE_IGCSIMPLE3DKERNEL_H - -#include "arm_compute/core/GLES_COMPUTE/IGCSimple2DKernel.h" - -namespace arm_compute -{ -class IGCTensor; - -/** Interface for simple GLES kernels having 1 tensor input and 1 tensor output. - * Both input tensor and output tensor must have at least 3 dimensions. - */ -class IGCSimple3DKernel : public IGCSimple2DKernel -{ -public: - // Inherited methods overridden: - void run(const Window &window) override; -}; -} -#endif /*ARM_COMPUTE_IGCSIMPLE3DKERNEL_H */ diff --git a/arm_compute/core/GLES_COMPUTE/IGCSimpleKernel.h b/arm_compute/core/GLES_COMPUTE/IGCSimpleKernel.h deleted file mode 100644 index e49941db04..0000000000 --- a/arm_compute/core/GLES_COMPUTE/IGCSimpleKernel.h +++ /dev/null @@ -1,66 +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_IGCSIMPLEKERNEL_H -#define ARM_COMPUTE_IGCSIMPLEKERNEL_H - -#include "arm_compute/core/GLES_COMPUTE/IGCKernel.h" -#include "arm_compute/core/GLES_COMPUTE/IGCTensor.h" -#include "arm_compute/core/Helpers.h" - -namespace arm_compute -{ -/** Interface for simple OpenGL ES kernels having 1 tensor input and 1 tensor output */ -class IGCSimpleKernel : public IGCKernel -{ -public: - /** Constructor. */ - IGCSimpleKernel(); - /** Prevent instances of this class from being copied (As this class contains pointers) */ - IGCSimpleKernel(const IGCSimpleKernel &) = delete; - /** Prevent instances of this class from being copied (As this class contains pointers) */ - IGCSimpleKernel &operator=(const IGCSimpleKernel &) = delete; - /** Allow instances of this class to be moved */ - IGCSimpleKernel(IGCSimpleKernel &&) = default; - /** Allow instances of this class to be moved */ - IGCSimpleKernel &operator=(IGCSimpleKernel &&) = default; - /** Default destructor */ - ~IGCSimpleKernel() = default; - - /** Configure the kernel - * - * @param[in] input Source tensor. - * @param[out] output Destination tensor. - * @param[in] num_elems_processed_per_iteration Number of processed elements per iteration. - * @param[in] border_undefined (Optional) True if the border mode is undefined. False if it's replicate or constant. - * @param[in] border_size (Optional) Size of the border. - */ - void configure(const IGCTensor *input, IGCTensor *output, unsigned int num_elems_processed_per_iteration, bool border_undefined = false, const BorderSize &border_size = BorderSize()); - -protected: - const IGCTensor *_input; - IGCTensor *_output; -}; -} - -#endif /*ARM_COMPUTE_IGCSIMPLEKERNEL_H */ diff --git a/arm_compute/core/GLES_COMPUTE/IGCTensor.h b/arm_compute/core/GLES_COMPUTE/IGCTensor.h deleted file mode 100644 index 080947d9e5..0000000000 --- a/arm_compute/core/GLES_COMPUTE/IGCTensor.h +++ /dev/null @@ -1,113 +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_IGCTENSOR_H -#define ARM_COMPUTE_IGCTENSOR_H - -#include "arm_compute/core/GLES_COMPUTE/OpenGLES.h" -#include "arm_compute/core/ITensor.h" - -#include - -namespace arm_compute -{ -/** Interface for GLES Compute tensor */ -class IGCTensor : public ITensor -{ -public: - /** Default constructor. */ - IGCTensor(); - - /** Prevent instances of this class from being copied (As this class contains pointers) */ - IGCTensor(const IGCTensor &) = delete; - - /** Prevent instances of this class from being copy assigned (As this class contains pointers) */ - IGCTensor &operator=(const IGCTensor &) = delete; - - /** Allow instances of this class to be moved */ - IGCTensor(IGCTensor &&) = default; - - /** Allow instances of this class to be moved */ - IGCTensor &operator=(IGCTensor &&) = default; - - /** Virtual destructor */ - virtual ~IGCTensor() = default; - - /** Map on an allocated buffer. - * - * @param[in] blocking (Optional) If true, then the mapping will be ready to use by the time - * this method returns, else it is the caller's responsibility - * to flush the queue and wait for the mapping operation to have completed before using the returned mapping pointer. - */ - void map(bool blocking = true); - /** Unmap an allocated and mapped buffer. - */ - void unmap(); - /** Clear the contents of the tensor synchronously. - */ - void clear(); - - // Inherited methods overridden: - uint8_t *buffer() const override; - /** Interface to be implemented by the child class to return the tensor's gles compute buffer id. - * - * @return A SSBO buffer id. - */ - virtual GLuint gc_buffer() const = 0; - - /** Flag indicating whether the tensor has been left aligned by a kernel and therefore needs shifting. - * - * @return True if the tensor is left aligned. - */ - bool needs_shifting() const; - /** Set the flag indicating whether or not a tensor needs shifting. - * - * @param[in] needs_shifting Indicates if the tensor is left aligned or not. - * - */ - void set_needs_shifting(bool needs_shifting); - -protected: - /** Method to be implemented by the child class to map the SSBO. - * - * @param[in] blocking If true, then the mapping will be ready to use by the time - * this method returns, else it is the caller's responsibility - * to flush the queue and wait for the mapping operation to have completed before using the returned mapping pointer. - */ - virtual uint8_t *do_map(bool blocking) = 0; - /** Method to be implemented by the child class to unmap the SSBO. - * - * @note This method simply enqueues the unmap operation, it is the caller's responsibility to flush the queue and make sure the unmap is finished before - * the memory is accessed by the device. - */ - virtual void do_unmap() = 0; - -private: - uint8_t *_mapping; - bool _needs_shifting; -}; - -/** Interface for GLES Compute image */ -using IGCImage = IGCTensor; -} -#endif /*ARM_COMPUTE_IGCTENSOR_H */ diff --git a/arm_compute/core/GLES_COMPUTE/OpenGLES.h b/arm_compute/core/GLES_COMPUTE/OpenGLES.h deleted file mode 100644 index 0bd7bed27a..0000000000 --- a/arm_compute/core/GLES_COMPUTE/OpenGLES.h +++ /dev/null @@ -1,165 +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_OPENGLES_H -#define ARM_COMPUTE_OPENGLES_H - -#include "arm_compute/core/Log.h" - -#include -#include -#include -#include -#include -#include - -#ifdef ARM_COMPUTE_DEBUG_ENABLED -#define ARM_COMPUTE_GL_CHECK(x) \ - x; \ - { \ - GLenum error = glGetError(); \ - if(error != GL_NO_ERROR) \ - ARM_COMPUTE_LOG_INFO_MSG_WITH_FORMAT_CORE("glGetError() = %i (0x%.8x)\n", error, error); \ - } -#else /* ARM_COMPUTE_DEBUG_ENABLED */ -#define ARM_COMPUTE_GL_CHECK(x) x -#endif /* ARM_COMPUTE_DEBUG_ENABLED */ - -namespace arm_compute -{ -namespace gles -{ -/** Class interface for specifying NDRange values. */ -class NDRange -{ -private: - size_t _sizes[3]; - size_t _dimensions; - -public: - /** Default constructor - resulting range has zero dimensions. */ - NDRange() - : _dimensions(0) - { - _sizes[0] = 0; - _sizes[1] = 0; - _sizes[2] = 0; - } - - /** Constructs one-dimensional range. - * - * @param[in] size0 Size of the first dimension. - */ - NDRange(size_t size0) - : _dimensions(1) - { - _sizes[0] = size0; - _sizes[1] = 1; - _sizes[2] = 1; - } - - /** Constructs two-dimensional range. - * - * @param[in] size0 Size of the first dimension. - * @param[in] size1 Size of the second dimension. - */ - NDRange(size_t size0, size_t size1) - : _dimensions(2) - { - _sizes[0] = size0; - _sizes[1] = size1; - _sizes[2] = 1; - } - - /** Constructs three-dimensional range. - * - * @param[in] size0 Size of the first dimension. - * @param[in] size1 Size of the second dimension. - * @param[in] size2 Size of the third dimension. - */ - NDRange(size_t size0, size_t size1, size_t size2) - : _dimensions(3) - { - _sizes[0] = size0; - _sizes[1] = size1; - _sizes[2] = size2; - } - - /** Conversion operator to const size_t *. - * - * @returns A pointer to the size of the first dimension. - */ - operator const size_t *() const - { - return _sizes; - } - - /** Queries the number of dimensions in the range. - * - * @returns The number of dimensions. - */ - size_t dimensions() const - { - return _dimensions; - } - - /** Returns the size of the object in bytes based on the runtime number of dimensions - * - * @returns The size of the object in bytes. - */ - size_t size() const - { - return _dimensions * sizeof(size_t); - } - - /** Returns the sizes array for each dimensions. - * - * @returns The sizes array - */ - size_t *get() - { - return _sizes; - } - - /** Returns the sizes array for each dimensions. - * - * @returns The sizes array - */ - const size_t *get() const - { - return _sizes; - } -}; - -static const NDRange NullRange; -static const NDRange Range_128_1 = NDRange(128, 1); -} // namespace gles - -/** Check if the OpenGL ES 3.1 API is available at runtime. - * - * @returns true if the OpenGL ES 3.1 API is available. - */ -bool opengles31_is_available(); -} // namespace arm_compute - -#endif /* ARM_COMPUTE_OPENGLES_H */ 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 convolved_dims); - - // Inherited methods overridden: - void run(const Window &window) override; - -private: - const IGCTensor *_input; - IGCTensor *_output; - std::pair _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 -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 - 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 _convolved_dims; - std::pair _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 diff --git a/arm_compute/core/Types.h b/arm_compute/core/Types.h index 59ba5aabb4..5c897b9110 100644 --- a/arm_compute/core/Types.h +++ b/arm_compute/core/Types.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2016-2020 Arm Limited. + * Copyright (c) 2016-2021 Arm Limited. * * SPDX-License-Identifier: MIT * @@ -1821,10 +1821,10 @@ private: /** GEMM reshape information class. This class stores the necessary information about matrix A and matrix B reshape. * - * The matrix A can only be reshaped through @ref CLGEMMReshapeLHSMatrixKernel or @ref NEGEMMInterleave4x4Kernel or @ref GCGEMMInterleave4x4Kernel + * The matrix A can only be reshaped through @ref CLGEMMReshapeLHSMatrixKernel or @ref NEGEMMInterleave4x4Kernel * Note: Optionally just for @ref CLGEMMReshapeLHSMatrixKernel is it possible to set mult_interleave4x4_height, the multiplication factor for the height of the 4x4 interleaved block * - * The matrix B can only be reshaped through @ref CLGEMMReshapeRHSMatrixKernel or @ref NEGEMMTranspose1xWKernel or @ref GCGEMMTranspose1xWKernel + * The matrix B can only be reshaped through @ref CLGEMMReshapeRHSMatrixKernel or @ref NEGEMMTranspose1xWKernel * Note: Optionally just for @ref CLGEMMReshapeRHSMatrixKernel is it possible to set mult_transpose1xW_width, the multiplication factor for the width of the 1xW transposed block * */ diff --git a/arm_compute/graph/backends/GLES/GCDeviceBackend.h b/arm_compute/graph/backends/GLES/GCDeviceBackend.h deleted file mode 100644 index 41805cdbfa..0000000000 --- a/arm_compute/graph/backends/GLES/GCDeviceBackend.h +++ /dev/null @@ -1,64 +0,0 @@ -/* - * Copyright (c) 2018-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_GRAPH_GCDEVICEBACKEND_H -#define ARM_COMPUTE_GRAPH_GCDEVICEBACKEND_H - -#include "arm_compute/graph/IDeviceBackend.h" - -#include "arm_compute/runtime/GLES_COMPUTE/GCBufferAllocator.h" - -namespace arm_compute -{ -namespace graph -{ -namespace backends -{ -/** GLES Compute device backend */ -class GCDeviceBackend final : public IDeviceBackend -{ -public: - /** Default Constructor */ - GCDeviceBackend(); - - // Inherited overridden methods - void initialize_backend() override; - void setup_backend_context(GraphContext &ctx) override; - void release_backend_context(GraphContext &ctx) override; - bool is_backend_supported() override; - IAllocator *backend_allocator() override; - std::unique_ptr create_tensor(const Tensor &tensor) override; - std::unique_ptr create_subtensor(ITensorHandle *parent, TensorShape shape, Coordinates coords, bool extend_parent) override; - std::unique_ptr configure_node(INode &node, GraphContext &ctx) override; - Status validate_node(INode &node) override; - std::shared_ptr create_memory_manager(MemoryManagerAffinity affinity) override; - std::shared_ptr create_weights_manager() override; - -private: - bool _initialized; /**< Flag that specifies if the backend has been default initialized */ - GCBufferAllocator _allocator; /**< GLES buffer affinity allocator */ -}; -} // namespace backends -} // namespace graph -} // namespace arm_compute -#endif //ARM_COMPUTE_GRAPH_GCDEVICEBACKEND_H diff --git a/arm_compute/graph/backends/GLES/GCFunctionFactory.h b/arm_compute/graph/backends/GLES/GCFunctionFactory.h deleted file mode 100644 index e5c00e5b29..0000000000 --- a/arm_compute/graph/backends/GLES/GCFunctionFactory.h +++ /dev/null @@ -1,57 +0,0 @@ -/* - * Copyright (c) 2018-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_GRAPH_GCFUNCTIONFACTORY_H -#define ARM_COMPUTE_GRAPH_GCFUNCTIONFACTORY_H - -#include "arm_compute/runtime/IFunction.h" - -#include - -namespace arm_compute -{ -namespace graph -{ -// Forward declarations -class INode; -class GraphContext; - -namespace backends -{ -/** Factory for generating GLES compute backend functions **/ -class GCFunctionFactory final -{ -public: - /** Create a backend execution function depending on the node type - * - * @param[in] node Node to create the backend function for - * @param[in] ctx Context to use - * - * @return Backend function - */ - static std::unique_ptr create(INode *node, GraphContext &ctx); -}; -} // namespace backends -} // namespace graph -} // namespace arm_compute -#endif //ARM_COMPUTE_GRAPH_GCFUNCTIONFACTORY_H diff --git a/arm_compute/graph/backends/GLES/GCNodeValidator.h b/arm_compute/graph/backends/GLES/GCNodeValidator.h deleted file mode 100644 index ab3864acf7..0000000000 --- a/arm_compute/graph/backends/GLES/GCNodeValidator.h +++ /dev/null @@ -1,52 +0,0 @@ -/* - * Copyright (c) 2018-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_GRAPH_GCNODEVALIDATOR_H -#define ARM_COMPUTE_GRAPH_GCNODEVALIDATOR_H - -#include "arm_compute/core/Error.h" - -namespace arm_compute -{ -namespace graph -{ -// Forward declarations -class INode; - -namespace backends -{ -class GCNodeValidator final -{ -public: - /** Validate a node - * - * @param[in] node Node to validate - * - * @return An error status - */ - static Status validate(INode *node); -}; -} // namespace backends -} // namespace graph -} // namespace arm_compute -#endif //ARM_COMPUTE_GRAPH_GCNODEVALIDATOR_H diff --git a/arm_compute/graph/backends/GLES/GCTensorHandle.h b/arm_compute/graph/backends/GLES/GCTensorHandle.h deleted file mode 100644 index bf4897a3b9..0000000000 --- a/arm_compute/graph/backends/GLES/GCTensorHandle.h +++ /dev/null @@ -1,72 +0,0 @@ -/* - * Copyright (c) 2018-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_GRAPH_GCTENSORHANDLE_H -#define ARM_COMPUTE_GRAPH_GCTENSORHANDLE_H - -#include "arm_compute/graph/ITensorHandle.h" - -#include "arm_compute/runtime/GLES_COMPUTE/GCTensor.h" - -namespace arm_compute -{ -namespace graph -{ -namespace backends -{ -/** GLES compute tensor handle interface object **/ -class GCTensorHandle final : public ITensorHandle -{ -public: - /** Default Constructor - * - * @param[in] info Tensor metadata - */ - GCTensorHandle(const ITensorInfo &info); - /** Destructor: free the tensor's memory */ - ~GCTensorHandle() = default; - /** Allow instances of this class to be move constructed */ - GCTensorHandle(GCTensorHandle &&) = default; - /** Allow instances of this class to be moved */ - GCTensorHandle &operator=(GCTensorHandle &&) = default; - - // Inherited overridden methods - void allocate() override; - void free() override; - void manage(IMemoryGroup *mg) override; - void map(bool blocking) override; - void unmap() override; - void release_if_unused() override; - arm_compute::ITensor &tensor() override; - const arm_compute::ITensor &tensor() const override; - ITensorHandle *parent_handle() override; - bool is_subtensor() const override; - Target target() const override; - -private: - arm_compute::GCTensor _tensor; /**< Backend Tensor */ -}; -} // namespace backends -} // namespace graph -} // namespace arm_compute -#endif /* ARM_COMPUTE_GRAPH_GCTENSORHANDLE_H */ diff --git a/arm_compute/runtime/GLES_COMPUTE/GCBufferAllocator.h b/arm_compute/runtime/GLES_COMPUTE/GCBufferAllocator.h deleted file mode 100644 index ceb89edb76..0000000000 --- a/arm_compute/runtime/GLES_COMPUTE/GCBufferAllocator.h +++ /dev/null @@ -1,49 +0,0 @@ -/* - * Copyright (c) 2018-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_GCBUFFERALLOCATOR_H -#define ARM_COMPUTE_GCBUFFERALLOCATOR_H - -#include "arm_compute/runtime/IAllocator.h" - -#include "arm_compute/core/GLES_COMPUTE/OpenGLES.h" -#include "arm_compute/runtime/GLES_COMPUTE/GCScheduler.h" - -#include - -namespace arm_compute -{ -/** Default GLES buffer allocator implementation */ -class GCBufferAllocator final : public IAllocator -{ -public: - /** Default constructor */ - GCBufferAllocator() = default; - - // Inherited methods overridden: - void *allocate(size_t size, size_t alignment) override; - void free(void *ptr) override; - std::unique_ptr make_region(size_t size, size_t alignment) override; -}; -} // namespace arm_compute -#endif /*ARM_COMPUTE_GCBUFFERALLOCATOR_H */ diff --git a/arm_compute/runtime/GLES_COMPUTE/GCFunctions.h b/arm_compute/runtime/GLES_COMPUTE/GCFunctions.h deleted file mode 100644 index c8026621ab..0000000000 --- a/arm_compute/runtime/GLES_COMPUTE/GCFunctions.h +++ /dev/null @@ -1,51 +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_GCFUNCTIONS_H -#define ARM_COMPUTE_GCFUNCTIONS_H - -/* Header regrouping all the GLES compute functions */ -#include "arm_compute/runtime/GLES_COMPUTE/functions/GCAbsoluteDifference.h" -#include "arm_compute/runtime/GLES_COMPUTE/functions/GCActivationLayer.h" -#include "arm_compute/runtime/GLES_COMPUTE/functions/GCArithmeticAddition.h" -#include "arm_compute/runtime/GLES_COMPUTE/functions/GCBatchNormalizationLayer.h" -#include "arm_compute/runtime/GLES_COMPUTE/functions/GCConcatenateLayer.h" -#include "arm_compute/runtime/GLES_COMPUTE/functions/GCConvolutionLayer.h" -#include "arm_compute/runtime/GLES_COMPUTE/functions/GCDepthwiseConvolutionLayer.h" -#include "arm_compute/runtime/GLES_COMPUTE/functions/GCDirectConvolutionLayer.h" -#include "arm_compute/runtime/GLES_COMPUTE/functions/GCDropoutLayer.h" -#include "arm_compute/runtime/GLES_COMPUTE/functions/GCFillBorder.h" -#include "arm_compute/runtime/GLES_COMPUTE/functions/GCFullyConnectedLayer.h" -#include "arm_compute/runtime/GLES_COMPUTE/functions/GCGEMM.h" -#include "arm_compute/runtime/GLES_COMPUTE/functions/GCGEMMInterleave4x4.h" -#include "arm_compute/runtime/GLES_COMPUTE/functions/GCGEMMTranspose1xW.h" -#include "arm_compute/runtime/GLES_COMPUTE/functions/GCNormalizationLayer.h" -#include "arm_compute/runtime/GLES_COMPUTE/functions/GCNormalizePlanarYUVLayer.h" -#include "arm_compute/runtime/GLES_COMPUTE/functions/GCPixelWiseMultiplication.h" -#include "arm_compute/runtime/GLES_COMPUTE/functions/GCPoolingLayer.h" -#include "arm_compute/runtime/GLES_COMPUTE/functions/GCScale.h" -#include "arm_compute/runtime/GLES_COMPUTE/functions/GCSoftmaxLayer.h" -#include "arm_compute/runtime/GLES_COMPUTE/functions/GCTensorShift.h" -#include "arm_compute/runtime/GLES_COMPUTE/functions/GCTranspose.h" - -#endif /* ARM_COMPUTE_GCFUNCTIONS_H */ diff --git a/arm_compute/runtime/GLES_COMPUTE/GCHelpers.h b/arm_compute/runtime/GLES_COMPUTE/GCHelpers.h deleted file mode 100644 index 99e27686e1..0000000000 --- a/arm_compute/runtime/GLES_COMPUTE/GCHelpers.h +++ /dev/null @@ -1,39 +0,0 @@ -/* - * Copyright (c) 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_GC_HELPERS_H -#define ARM_COMPUTE_GC_HELPERS_H - -#include "arm_compute/core/GLES_COMPUTE/OpenGLES.h" - -namespace arm_compute -{ -/** This function creates an OpenGL-ES context and a display. - * - * @return A std::tuple where the first element is the opengl display, the second element is the opengl context - * and the third one an error code. The error code will be EGL_TRUE upon successful creation, otherwise - * a value telling why the function failed. - */ -std::tuple create_opengl_display_and_context(); -} // namespace arm_compute -#endif /* ARM_COMPUTE_GC_HELPERS_H */ diff --git a/arm_compute/runtime/GLES_COMPUTE/GCMemory.h b/arm_compute/runtime/GLES_COMPUTE/GCMemory.h deleted file mode 100644 index 12a8bce912..0000000000 --- a/arm_compute/runtime/GLES_COMPUTE/GCMemory.h +++ /dev/null @@ -1,85 +0,0 @@ -/* - * Copyright (c) 2018-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_RUNTIME_GLES_COMPUTE_GCMEMORY_H -#define ARM_COMPUTE_RUNTIME_GLES_COMPUTE_GCMEMORY_H - -#include "arm_compute/runtime/IMemory.h" - -#include "arm_compute/runtime/GLES_COMPUTE/GCMemoryRegion.h" - -#include -#include - -namespace arm_compute -{ -/** GLES implementation of memory object */ -class GCMemory : public IMemory -{ -public: - /** Default Constructor */ - GCMemory(); - /** Default Constructor - * - * @param[in] memory Memory to be imported - */ - GCMemory(const std::shared_ptr &memory); - /** Default Constructor - * - * @note Ownership of the memory is not transferred to this object. - * Thus management (allocate/free) should be done by the client. - * - * @param[in] memory Memory to be imported - */ - GCMemory(IGCMemoryRegion *memory); - /** Allow instances of this class to be copied */ - GCMemory(const GCMemory &) = default; - /** Allow instances of this class to be copy assigned */ - GCMemory &operator=(const GCMemory &) = default; - /** Allow instances of this class to be moved */ - GCMemory(GCMemory &&) noexcept = default; - /** Allow instances of this class to be move assigned */ - GCMemory &operator=(GCMemory &&) noexcept = default; - /** GLES Region accessor - * - * @return Memory region - */ - IGCMemoryRegion *gc_region(); - /** GLES Region accessor - * - * @return Memory region - */ - IGCMemoryRegion *gc_region() const; - - // Inherited methods overridden: - IMemoryRegion *region() final; - IMemoryRegion *region() const final; - void set_region(IMemoryRegion *region) final; - void set_owned_region(std::unique_ptr region) final; - -private: - IGCMemoryRegion *_region; - std::shared_ptr _region_owned; -}; -} // namespace arm_compute -#endif /* ARM_COMPUTE_RUNTIME_GLES_COMPUTE_GCMEMORY_H */ diff --git a/arm_compute/runtime/GLES_COMPUTE/GCMemoryRegion.h b/arm_compute/runtime/GLES_COMPUTE/GCMemoryRegion.h deleted file mode 100644 index 90fd4c6d86..0000000000 --- a/arm_compute/runtime/GLES_COMPUTE/GCMemoryRegion.h +++ /dev/null @@ -1,108 +0,0 @@ -/* - * Copyright (c) 2018-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_RUNTIME_GLES_COMPUTE_GC_MEMORY_REGION_H -#define ARM_COMPUTE_RUNTIME_GLES_COMPUTE_GC_MEMORY_REGION_H - -#include "arm_compute/core/GLES_COMPUTE/OpenGLES.h" -#include "arm_compute/runtime/IMemoryRegion.h" - -#include - -namespace arm_compute -{ -/** GLES memory region interface */ -class IGCMemoryRegion : public IMemoryRegion -{ -public: - /** Constructor - * - * @param[in] size Region size - */ - IGCMemoryRegion(size_t size); - /** Default Destructor */ - virtual ~IGCMemoryRegion() = default; - /** Prevent instances of this class from being copied (As this class contains pointers) */ - IGCMemoryRegion(const IGCMemoryRegion &) = delete; - /** Default move constructor */ - IGCMemoryRegion(IGCMemoryRegion &&) = default; - /** Prevent instances of this class from being copied (As this class contains pointers) */ - IGCMemoryRegion &operator=(const IGCMemoryRegion &) = delete; - /** Default move assignment operator */ - IGCMemoryRegion &operator=(IGCMemoryRegion &&) = default; - /** Returns the underlying CL buffer - * - * @return CL memory buffer object - */ - const GLuint &gc_ssbo_name() const; - /** Host/SVM pointer accessor - * - * @return Host/SVM pointer base - */ - virtual void *ptr() = 0; - /** Enqueue a map operation of the allocated buffer on the given queue. - * - * @param[in] blocking If true, then the mapping will be ready to use by the time - * this method returns, else it is the caller's responsibility - * to flush the queue and wait for the mapping operation to have completed before using the returned mapping pointer. - * - * @return The mapping address. - */ - virtual void *map(bool blocking) = 0; - /** Enqueue an unmap operation of the allocated buffer on the given queue. - * - * @note This method simply enqueue the unmap operation, it is the caller's responsibility to flush the queue and make sure the unmap is finished before - * the memory is accessed by the device. - * - */ - virtual void unmap() = 0; - - // Inherited methods overridden : - void *buffer() override; - const void *buffer() const override; - -protected: - void *_mapping; - GLuint _ssbo_name; -}; - -/** GLES buffer memory region implementation */ -class GCBufferMemoryRegion final : public IGCMemoryRegion -{ -public: - /** Constructor - * - * @param[in] size Region size - */ - GCBufferMemoryRegion(size_t size); - /** Destructor */ - ~GCBufferMemoryRegion(); - - // Inherited methods overridden : - void *ptr() final; - void *map(bool blocking) final; - void unmap() final; - std::unique_ptr extract_subregion(size_t offset, size_t size) final; -}; -} // namespace arm_compute -#endif /* ARM_COMPUTE_RUNTIME_GLES_COMPUTE_GC_MEMORY_REGION_H */ diff --git a/arm_compute/runtime/GLES_COMPUTE/GCRuntimeContext.h b/arm_compute/runtime/GLES_COMPUTE/GCRuntimeContext.h deleted file mode 100644 index d6e754003f..0000000000 --- a/arm_compute/runtime/GLES_COMPUTE/GCRuntimeContext.h +++ /dev/null @@ -1,63 +0,0 @@ -/* - * Copyright (c) 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_GCRUNTIME_CONTEXT_H -#define ARM_COMPUTE_GCRUNTIME_CONTEXT_H - -#include "arm_compute/core/GLES_COMPUTE/GCCoreRuntimeContext.h" -#include "arm_compute/core/GLES_COMPUTE/GCKernelLibrary.h" -#include "arm_compute/core/GLES_COMPUTE/OpenGLES.h" -#include "arm_compute/runtime/GLES_COMPUTE/GCScheduler.h" -#include "arm_compute/runtime/IScheduler.h" -#include "arm_compute/runtime/RuntimeContext.h" - -namespace arm_compute -{ -/** Runtime context */ -class GCRuntimeContext : public RuntimeContext -{ -public: - /** Default Constructor */ - GCRuntimeContext(); - /** Destructor */ - ~GCRuntimeContext() = default; - /** Prevent instances of this class from being copied (As this class contains pointers) */ - GCRuntimeContext(const GCRuntimeContext &) = delete; - /** Prevent instances of this class from being copied (As this class contains pointers) */ - GCRuntimeContext &operator=(const GCRuntimeContext &) = delete; - /** CPU Scheduler setter */ - void set_gpu_scheduler(GCScheduler *scheduler); - - // Inherited overridden methods - GCScheduler *gpu_scheduler(); - GCKernelLibrary &kernel_library(); - GCCoreRuntimeContext *core_runtime_context(); - -private: - std::unique_ptr _gpu_owned_scheduler{ nullptr }; - GCScheduler *_gpu_scheduler{ nullptr }; - GCKernelLibrary _kernel_lib{}; - GCCoreRuntimeContext _core_context{}; -}; -} // namespace arm_compute -#endif /*ARM_COMPUTE_GCRUNTIME_CONTEXT_H */ diff --git a/arm_compute/runtime/GLES_COMPUTE/GCScheduler.h b/arm_compute/runtime/GLES_COMPUTE/GCScheduler.h deleted file mode 100644 index eed4d3b58e..0000000000 --- a/arm_compute/runtime/GLES_COMPUTE/GCScheduler.h +++ /dev/null @@ -1,107 +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_GCSCHEDULER_H -#define ARM_COMPUTE_GCSCHEDULER_H - -#include "arm_compute/core/GLES_COMPUTE/IGCKernel.h" -#include "arm_compute/core/Types.h" - -namespace arm_compute -{ -// Forward declarations -class IGCKernel; - -/** Provides global access to a OpenGL ES context and command queue. */ -class GCScheduler final -{ -public: - /** Constructor */ - GCScheduler(); - /** Destructor */ - ~GCScheduler(); - /** Prevent instances of this class from being copied */ - GCScheduler(const GCScheduler &) = delete; - /** Prevent instances of this class from being copied */ - GCScheduler &operator=(const GCScheduler &) = delete; - /** Access the scheduler singleton. - * - * @return The scheduler - */ - static GCScheduler &get(); - /** Initialises the context and command queue used by the scheduler to default values - * and sets a default device and kernel path for the @ref GCKernelLibrary. - */ - void default_init(); - /** Initializes the context and display used by the Scheduler. - * - * @param[in] display Display to use - * @param[in] ctx Context to use - */ - void default_init_with_context(EGLDisplay display, EGLContext ctx); - /** Schedule the execution of the passed kernel if possible. - * - * @param[in] kernel Kernel to execute. - * @param[in] flush (Optional) Specifies if the command queue will be flushed after running the kernel. - */ - void dispatch(IGCKernel &kernel, bool flush = true); - /** Initialises the display and context to be used by the scheduler. - * - * @param[in] dpy The EGL display connection - * @param[in] ctx The EGL rendering context - */ - void init(EGLDisplay dpy, EGLContext ctx); - /** Defines a barrier ordering memory transactions. */ - void memory_barrier(); - /** Get the target GPU. - * - * @return The target GPU. - */ - GPUTarget get_target() const - { - return _target; - } - /** Accessor to set target GPU to be used by the scheduler. - * - * @param[in] target The target GPU. - */ - void set_target(GPUTarget target) - { - _target = target; - } - -private: - /** Set up EGL context */ - void setup_context(); - - /** Flag to ensure symbols initialisation is happening before Scheduler creation */ - static std::once_flag _initialize_symbols; - - EGLDisplay _display; /**< Underlying EGL Display. */ - EGLContext _context; /**< Underlying EGL Context. */ - - GPUTarget _target; -}; -} -#endif /* ARM_COMPUTE_GCSCHEDULER_H */ diff --git a/arm_compute/runtime/GLES_COMPUTE/GCTensor.h b/arm_compute/runtime/GLES_COMPUTE/GCTensor.h deleted file mode 100644 index aa31df78d6..0000000000 --- a/arm_compute/runtime/GLES_COMPUTE/GCTensor.h +++ /dev/null @@ -1,106 +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_GCTENSOR_H -#define ARM_COMPUTE_GCTENSOR_H - -#include "arm_compute/core/GLES_COMPUTE/IGCTensor.h" -#include "arm_compute/runtime/GLES_COMPUTE/GCTensorAllocator.h" - -namespace arm_compute -{ -class ITensorAllocator; -class ITensorInfo; -class IRuntimeContext; - -/** Interface for OpenGL ES tensor */ -class GCTensor : public IGCTensor, public IMemoryManageable -{ -public: - /** Default constructor - * - * @param[in] ctx (Optional) Pointer to the runtime context. - * - */ - GCTensor(IRuntimeContext *ctx = nullptr); - - /** Prevent instances of this class from being copied (As this class contains pointers) */ - GCTensor(const GCTensor &) = delete; - - /** Prevent instances of this class from being copy assigned (As this class contains pointers) */ - GCTensor &operator=(const GCTensor &) = delete; - - /** Allow instances of this class to be moved */ - GCTensor(GCTensor &&) = default; - - /** Allow instances of this class to be moved */ - GCTensor &operator=(GCTensor &&) = default; - - /** Virtual destructor */ - virtual ~GCTensor() = default; - - /** Return a pointer to the tensor's allocator - * - * @return A pointer to the tensor's allocator - */ - ITensorAllocator *allocator(); - - /** Enqueue a map operation of the allocated buffer on the given queue. - * - * @param[in] blocking (Optional) If true, then the mapping will be ready to use by the time - * this method returns, else it is the caller's responsibility - * to flush the queue and wait for the mapping operation to have completed before using the returned mapping pointer. - * - * @return The mapping address. - */ - void map(bool blocking = true); - - /** Enqueue an unmap operation of the allocated and mapped buffer on the given queue. - * - * @note This method simply enqueues the unmap operation, it is the caller's responsibility to flush the queue and make sure the unmap is finished before - * the memory is accessed by the device. - * - */ - void unmap(); - - // Inherited methods overridden: - TensorInfo *info() const override; - TensorInfo *info() override; - uint8_t *buffer() const override; - GLuint gc_buffer() const override; - void associate_memory_group(IMemoryGroup *memory_group) override; - -protected: - // Inherited methods overridden: - uint8_t *do_map(bool blocking) override; - void do_unmap() override; - -private: - mutable GCTensorAllocator _allocator; /**< Instance of the OpenGL ES tensor allocator */ -}; - -/** OpenGL ES Image */ -using GCImage = GCTensor; -} // namespace arm_compute -#endif /*ARM_COMPUTE_GCTENSOR_H */ diff --git a/arm_compute/runtime/GLES_COMPUTE/GCTensorAllocator.h b/arm_compute/runtime/GLES_COMPUTE/GCTensorAllocator.h deleted file mode 100644 index ff1e9b0766..0000000000 --- a/arm_compute/runtime/GLES_COMPUTE/GCTensorAllocator.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_GCTENSORALLOCATOR_H -#define ARM_COMPUTE_GCTENSORALLOCATOR_H - -#include "arm_compute/core/GLES_COMPUTE/OpenGLES.h" -#include "arm_compute/runtime/GLES_COMPUTE/GCMemory.h" -#include "arm_compute/runtime/ITensorAllocator.h" -#include "arm_compute/runtime/MemoryGroup.h" - -#include - -namespace arm_compute -{ -class GCTensor; - -/** Basic implementation of a GLES memory tensor allocator. */ -class GCTensorAllocator : public ITensorAllocator -{ -public: - /** Default constructor. */ - GCTensorAllocator(IMemoryManageable *owner = nullptr); - - /** Prevent instances of this class from being copied (As this class contains pointers) */ - GCTensorAllocator(const GCTensorAllocator &) = delete; - - /** Prevent instances of this class from being copy assigned (As this class contains pointers) */ - GCTensorAllocator &operator=(const GCTensorAllocator &) = delete; - - /** Allow instances of this class to be moved */ - GCTensorAllocator(GCTensorAllocator &&) = default; - - /** Allow instances of this class to be moved */ - GCTensorAllocator &operator=(GCTensorAllocator &&) = default; - - /** Default destructor */ - ~GCTensorAllocator() = default; - - /** Interface to be implemented by the child class to return the pointer to the mapped data. - * - * @return a pointer to the data. - */ - uint8_t *data(); - - /** Get the OpenGL ES buffer object name - * - * @return The buffer object name - */ - GLuint get_gl_ssbo_name() const; - - /** Enqueue a map operation of the allocated buffer on the given queue. - * - * @param[in] blocking If true, then the mapping will be ready to use by the time - * this method returns, else it is the caller's responsibility - * to flush the queue and wait for the mapping operation to have completed before using the returned mapping pointer. - * - * @return The mapping address. - */ - uint8_t *map(bool blocking); - - /** Enqueue an unmap operation of the allocated buffer on the given queue. - * - * @note This method simply enqueue the unmap operation, it is the caller's responsibility to flush the queue and make sure the unmap is finished before - * the memory is accessed by the device. - * - */ - void unmap(); - - /** Allocate size specified by TensorInfo of GLES memory. - * - * @note: The tensor must not already be allocated when calling this function. - * - */ - void allocate() override; - - /** Free allocated GLES memory. - * - * @note The tensor must have been allocated when calling this function. - * - */ - void free() override; - - /** Associates the tensor with a memory group - * - * @param[in] associated_memory_group Memory group to associate the tensor with - */ - void set_associated_memory_group(IMemoryGroup *associated_memory_group); - -protected: - /** Call map() on the SSBO. - * - * @return A pointer to the beginning of the tensor's allocation. - */ - uint8_t *lock() override; - - /** Call unmap() on the SSBO. */ - void unlock() override; - -private: - IMemoryManageable *_owner; /**< Owner of the allocator */ - IMemoryGroup *_associated_memory_group; /**< Registered memory group */ - GCMemory _memory; /**< OpenGL ES memory */ - uint8_t *_mapping; /**< Pointer to the CPU mapping of the OpenGL ES buffer. */ -}; -} // namespace arm_compute -#endif /* ARM_COMPUTE_GCTENSORALLOCATOR_H */ diff --git a/arm_compute/runtime/GLES_COMPUTE/IGCSimpleFunction.h b/arm_compute/runtime/GLES_COMPUTE/IGCSimpleFunction.h deleted file mode 100644 index f3f7a3a9ff..0000000000 --- a/arm_compute/runtime/GLES_COMPUTE/IGCSimpleFunction.h +++ /dev/null @@ -1,63 +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_IGCSIMPLEFUNCTION_H -#define ARM_COMPUTE_IGCSIMPLEFUNCTION_H - -#include "arm_compute/core/GLES_COMPUTE/IGCKernel.h" -#include "arm_compute/core/GLES_COMPUTE/kernels/GCFillBorderKernel.h" -#include "arm_compute/runtime/GLES_COMPUTE/GCRuntimeContext.h" -#include "arm_compute/runtime/IFunction.h" - -#include - -namespace arm_compute -{ -/** Basic interface for functions which have a single OpenGL ES kernel */ -class IGCSimpleFunction : public IFunction -{ -public: - /** Default Constructor - * - * @param[in] ctx Runtime context to be used by the function - */ - IGCSimpleFunction(GCRuntimeContext *ctx = nullptr); - /** Prevent instances of this class from being copied (As this class contains pointers) */ - IGCSimpleFunction(const IGCSimpleFunction &) = delete; - /** Default move constructor */ - IGCSimpleFunction(IGCSimpleFunction &&) = default; - /** Prevent instances of this class from being copied (As this class contains pointers) */ - IGCSimpleFunction &operator=(const IGCSimpleFunction &) = delete; - /** Default move assignment operator */ - IGCSimpleFunction &operator=(IGCSimpleFunction &&) = default; - - // Inherited methods overridden: - void run() override final; - -protected: - std::unique_ptr _kernel; /**< Kernel to run */ - GCFillBorderKernel _border_handler; /**< Kernel to handle borders */ - GCRuntimeContext *_ctx; /**< Context to use */ -}; -} // namespace arm_compute -#endif /*ARM_COMPUTE_IGCSIMPLEFUNCTION_H */ diff --git a/arm_compute/runtime/GLES_COMPUTE/functions/GCAbsoluteDifference.h b/arm_compute/runtime/GLES_COMPUTE/functions/GCAbsoluteDifference.h deleted file mode 100644 index bbba8acd7e..0000000000 --- a/arm_compute/runtime/GLES_COMPUTE/functions/GCAbsoluteDifference.h +++ /dev/null @@ -1,55 +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_GCABSOLUTEDIFFERENCE_H -#define ARM_COMPUTE_GCABSOLUTEDIFFERENCE_H - -#include "arm_compute/runtime/GLES_COMPUTE/IGCSimpleFunction.h" - -namespace arm_compute -{ -class ITensor; - -/** Basic function to run @ref GCAbsoluteDifferenceKernel - * - * @note The tensor data types for the inputs must be U8. - * @note The function calculates the absolute difference also when the 2 inputs have different tensor data types. - * - * @deprecated This function is deprecated and is intended to be removed in 21.05 release - * - */ -class GCAbsoluteDifference : public IGCSimpleFunction -{ -public: - /** Initialize the function - * - * @param[in] input1 First input tensor. Data types supported: U8 - * @param[in] input2 Second input tensor. Data types supported: U8 - * @param[out] output Output tensor. Data types supported: U8 - */ - void configure(const IGCTensor *input1, const IGCTensor *input2, IGCTensor *output); -}; -} - -#endif /* ARM_COMPUTE_GCABSOLUTEDIFFERENCE_H */ diff --git a/arm_compute/runtime/GLES_COMPUTE/functions/GCActivationLayer.h b/arm_compute/runtime/GLES_COMPUTE/functions/GCActivationLayer.h deleted file mode 100644 index b09afbb81d..0000000000 --- a/arm_compute/runtime/GLES_COMPUTE/functions/GCActivationLayer.h +++ /dev/null @@ -1,70 +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_GCACTIVATIONLAYER_H -#define ARM_COMPUTE_GCACTIVATIONLAYER_H - -#include "arm_compute/core/Types.h" -#include "arm_compute/runtime/GLES_COMPUTE/IGCSimpleFunction.h" - -namespace arm_compute -{ -// Forward declarations -class IGCTensor; - -/** Basic function to run @ref GCActivationLayerKernel - * - * @note The function simulates an activation layer with the specified activation function. - * - * @deprecated This function is deprecated and is intended to be removed in 21.05 release - * - */ -class GCActivationLayer : public IGCSimpleFunction -{ -public: - /** Constructor - * - * @param[in, out] ctx Runtime context to be used by the function - */ - explicit GCActivationLayer(GCRuntimeContext *ctx = nullptr); - /** Prevent instances of this class from being copied (As this class contains pointers) */ - GCActivationLayer(const GCActivationLayer &) = delete; - /** Default move constructor */ - GCActivationLayer(GCActivationLayer &&) = default; - /** Prevent instances of this class from being copied (As this class contains pointers) */ - GCActivationLayer &operator=(const GCActivationLayer &) = delete; - /** Default move assignment operator */ - GCActivationLayer &operator=(GCActivationLayer &&) = 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 supported: same as @p input - * @param[in] act_info Activation layer parameters. - */ - void configure(IGCTensor *input, IGCTensor *output, ActivationLayerInfo act_info); -}; -} // namespace arm_compute -#endif /* ARM_COMPUTE_GCACTIVATIONLAYER_H */ diff --git a/arm_compute/runtime/GLES_COMPUTE/functions/GCArithmeticAddition.h b/arm_compute/runtime/GLES_COMPUTE/functions/GCArithmeticAddition.h deleted file mode 100644 index 9a7527dcd5..0000000000 --- a/arm_compute/runtime/GLES_COMPUTE/functions/GCArithmeticAddition.h +++ /dev/null @@ -1,67 +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_GCARITHMETICADDITION_H -#define ARM_COMPUTE_GCARITHMETICADDITION_H - -#include "arm_compute/core/Types.h" -#include "arm_compute/runtime/GLES_COMPUTE/IGCSimpleFunction.h" - -namespace arm_compute -{ -class IGCTensor; - -/** Basic function to run @ref GCArithmeticAdditionKernel - * - * @note The tensor data type for the inputs must be F16. - * @note The function performs an arithmetic addition between two tensors. - * - * @deprecated This function is deprecated and is intended to be removed in 21.05 release - * - */ -class GCArithmeticAddition : public IGCSimpleFunction -{ -public: - /** 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. - * @param[in] act_info (Optional) Activation layer information in case of a fused activation. Currently not supported. - */ - void configure(const IGCTensor *input1, const IGCTensor *input2, IGCTensor *output, ConvertPolicy policy, const ActivationLayerInfo &act_info = ActivationLayerInfo()); - /** Static function to check if given info will lead to a valid configuration of @ref GCArithmeticAddition - * - * @param[in] input1 First tensor input info. Data types supported: F16. - * @param[in] input2 Second tensor input info. Data types supported: F16. - * @param[in] output Output tensor info. Data types supported: F16. - * @param[in] policy Policy to use to handle overflow. - * @param[in] act_info (Optional) Activation layer information in case of a fused activation. Currently not supported. - * - * @return a status - */ - static Status validate(const ITensorInfo *input1, const ITensorInfo *input2, const ITensorInfo *output, ConvertPolicy policy, const ActivationLayerInfo &act_info = ActivationLayerInfo()); -}; -} -#endif /* ARM_COMPUTE_GCARITHMETICADDITION_H */ diff --git a/arm_compute/runtime/GLES_COMPUTE/functions/GCBatchNormalizationLayer.h b/arm_compute/runtime/GLES_COMPUTE/functions/GCBatchNormalizationLayer.h deleted file mode 100644 index 75b4cdc628..0000000000 --- a/arm_compute/runtime/GLES_COMPUTE/functions/GCBatchNormalizationLayer.h +++ /dev/null @@ -1,71 +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_GCBATCHNORMALIZATIONLAYER_H -#define ARM_COMPUTE_GCBATCHNORMALIZATIONLAYER_H - -#include "arm_compute/runtime/IFunction.h" - -#include "arm_compute/core/GLES_COMPUTE/kernels/GCBatchNormalizationLayerKernel.h" -#include "arm_compute/core/Types.h" - -namespace arm_compute -{ -class IGCTensor; - -/** Basic function to run @ref GCBatchNormalizationLayerKernel and simulate a batch normalization layer. - * - * Batch normalization is calculated by: - * @f[ out_i = \gamma * (\frac{in_i - \mu_{B}}{\sqrt{\sigma^2_{B} + \epsilon}}) + \beta \equiv BN_{\gamma,\beta}(in_i) @f] - * - * @deprecated This function is deprecated and is intended to be removed in 21.05 release - * - */ -class GCBatchNormalizationLayer : public IFunction -{ -public: - /** Default constructor */ - GCBatchNormalizationLayer(); - /** 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 Beta values tensor. 1 dimension with size equal to the feature maps [FM]. Data types supported: Same as @p input - * @param[in] gamma Gamma values tensor. 1 dimension with size equal to the feature maps [FM]. Data types supported: Same as @p input - * @param[in] epsilon 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, const IGCTensor *gamma, float epsilon, - ActivationLayerInfo act_info = ActivationLayerInfo()); - - // Inherited methods overridden: - void run() override; - -private: - GCBatchNormalizationLayerKernel _norm_kernel; /**< BatchNormalization layer kernel to run */ -}; -} -#endif /* ARM_COMPUTE_GCBATCHNORMALIZATIONLAYER_H */ diff --git a/arm_compute/runtime/GLES_COMPUTE/functions/GCConcatenateLayer.h b/arm_compute/runtime/GLES_COMPUTE/functions/GCConcatenateLayer.h deleted file mode 100644 index fe24c07f63..0000000000 --- a/arm_compute/runtime/GLES_COMPUTE/functions/GCConcatenateLayer.h +++ /dev/null @@ -1,71 +0,0 @@ -/* - * Copyright (c) 2019-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_GCDEPTHCONCATENATELAYER_H -#define ARM_COMPUTE_GCDEPTHCONCATENATELAYER_H - -#include "arm_compute/core/GLES_COMPUTE/OpenGLES.h" -#include "arm_compute/core/GLES_COMPUTE/kernels/GCDepthConcatenateLayerKernel.h" -#include "arm_compute/core/Types.h" -#include "arm_compute/runtime/IFunction.h" - -#include -#include - -namespace arm_compute -{ -class IGCTensor; - -/** Basic function to execute concatenate tensors along a given axis. This function calls the following kernels: - * - * @note only axis z is supported - * -# @ref GCDepthConcatenateLayerKernel - * - * @deprecated This function is deprecated and is intended to be removed in 21.05 release - * - */ -class GCConcatenateLayer : public IFunction -{ -public: - /** Default constructor */ - GCConcatenateLayer(); - /** Initialise the kernel's inputs vector and output. - * - * @note Input and output tensor dimensions preconditions defer depending on the concatenation axis. - * - * @param[in,out] inputs_vector The vectors containing all the tensors to concatenate. Data types supported: F16/F32. - * @param[out] output Output tensor. Data types supported: Same as @p input. - * @param[in] axis Concatenation axis. Supported underlying concatenation axis is 2. - */ - void configure(std::vector inputs_vector, IGCTensor *output, size_t axis); - - // Inherited methods overridden: - void run() override; - -private: - std::vector> _concat_kernels; - unsigned int _num_inputs; - unsigned int _axis; -}; -} // namespace arm_compute -#endif /* ARM_COMPUTE_GCDEPTHCONCATENATELAYER_H */ diff --git a/arm_compute/runtime/GLES_COMPUTE/functions/GCConvolutionLayer.h b/arm_compute/runtime/GLES_COMPUTE/functions/GCConvolutionLayer.h deleted file mode 100644 index 3cff9688eb..0000000000 --- a/arm_compute/runtime/GLES_COMPUTE/functions/GCConvolutionLayer.h +++ /dev/null @@ -1,161 +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_GCCONVOLUTIONLAYER_H -#define ARM_COMPUTE_GCCONVOLUTIONLAYER_H - -#include "arm_compute/core/GLES_COMPUTE/kernels/GCCol2ImKernel.h" -#include "arm_compute/core/GLES_COMPUTE/kernels/GCFillBorderKernel.h" -#include "arm_compute/core/GLES_COMPUTE/kernels/GCIm2ColKernel.h" -#include "arm_compute/core/GLES_COMPUTE/kernels/GCWeightsReshapeKernel.h" -#include "arm_compute/core/Types.h" -#include "arm_compute/runtime/GLES_COMPUTE/GCTensor.h" -#include "arm_compute/runtime/GLES_COMPUTE/functions/GCActivationLayer.h" -#include "arm_compute/runtime/GLES_COMPUTE/functions/GCGEMM.h" -#include "arm_compute/runtime/IFunction.h" -#include "arm_compute/runtime/MemoryGroup.h" - -#include - -namespace arm_compute -{ -class IGCTensor; - -/** Function to reshape and transpose the weights. This function calls the following kernels: - * -# @ref GCWeightsReshapeKernel - * - * @deprecated This function is deprecated and is intended to be removed in 21.05 release - * - */ -class GCConvolutionLayerReshapeWeights : public IFunction -{ -public: - /** Constructor */ - GCConvolutionLayerReshapeWeights(); - /** Set the input and output tensors. - * - * @param[in] weights Weights tensor. Weights are 4D tensor with dimensions [kernel_x, kernel_y, IFM, OFM]. - * Data type supported: F16/F32. - * @param[in] biases Biases tensor. Shared biases supported. Biases are 1D tensor with dimensions [OFM]. Data type supported: Same as @p weights. - * @param[out] output Destination tensor. Data types supported: Same as @p weights. - */ - void configure(const IGCTensor *weights, const IGCTensor *biases, IGCTensor *output); - // Inherited methods overridden: - void run() override; - -private: - GCWeightsReshapeKernel _weights_reshape_kernel; -}; - -/** Basic function to compute the convolution layer. This function calls the following GLES kernels: - * - * -# @ref GCWeightsReshapeKernel (executed only once for each configuration) - * -# @ref GCGEMMTranspose1xWKernel (executed only once for each configuration) - * -# @ref GCIm2ColKernel - * -# @ref GCGEMMInterleave4x4Kernel - * -# @ref GCCol2ImKernel - * - * @deprecated This function is deprecated and is intended to be removed in 21.05 release - * - */ -class GCConvolutionLayer : public IFunction -{ -public: - /** Default constructor */ - GCConvolutionLayer(std::shared_ptr memory_manager = nullptr); - /** Prevent instances of this class from being copied (As this class contains pointers) */ - GCConvolutionLayer(const GCConvolutionLayer &) = delete; - /** Default move constructor */ - GCConvolutionLayer(GCConvolutionLayer &&) = default; - /** Prevent instances of this class from being copied (As this class contains pointers) */ - GCConvolutionLayer &operator=(const GCConvolutionLayer &) = delete; - /** Default move assignment operator */ - GCConvolutionLayer &operator=(GCConvolutionLayer &&) = default; - /** Set the input and output tensors. - * - * @param[in] input Source tensor. 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] biases Biases tensor. Shared biases supported. Biases are 1D tensor with dimensions [OFM]. - * Data type supported: Should match @p input data type, except for input of QASYMM8 type where biases should be of S32 type. - * @param[out] output Destination 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] conv_info Contains padding and stride information described in @ref PadStrideInfo. - * @param[in] weights_info Specifies if the weights tensor has been reshaped with GCWeightsReshapeKernel. If this is not part of the fully connected layer the weights - * tensor has also been transposed with GCGEMMTranspose1xWKernel. Data type supported: Same as @p input. - * @param[in] dilation (Optional) Dilation, in elements, across x and y. Defaults to (1, 1). - * @param[in] act_info (Optional) Activation layer information in case of a fused activation. - * @param[in] num_groups (Optional) Number of groups when performing a grouped convolution. num_groups != 1 is not supported - */ - void configure(const IGCTensor *input, const IGCTensor *weights, const IGCTensor *biases, IGCTensor *output, const PadStrideInfo &conv_info, - const WeightsInfo &weights_info = WeightsInfo(), const Size2D &dilation = Size2D(1U, 1U), const ActivationLayerInfo &act_info = ActivationLayerInfo(), unsigned int num_groups = 1); - - // Inherited methods overridden: - void run() override; - void prepare() override; - -private: - /** Configures the appropriate matrix multiply routine - * - * @param input Input tensor. Data types supported: F16/F32. - * @param weights Weights tensor. Data type supported: Same as @p input. - * @param output Output tensor. Data types supported: Same as @p input, - */ - void configure_mm(const IGCTensor *input, const IGCTensor *weights, IGCTensor *output); - /** Static function to check if given info will lead to a valid configuration of @ref GCGEMMConvolutionLayer matrix multiply routines - * - * @param[in] input Input tensor. Data types supported: QASYMM8/F16/F32. - * @param[in] weights Weights tensor. Data type supported: Same as @p input. - * @param[in] output Output tensor. Data types supported: Same as @p input, - * except for input of QASYMM8 type where output should be of S32 type. - * - * @return a status - */ - static Status validate_mm(const ITensorInfo *input, const ITensorInfo *weights, const ITensorInfo *output); - -private: - MemoryGroup _memory_group; - GCConvolutionLayerReshapeWeights _reshape_weights; - GCIm2ColKernel _input_im2col_kernel; - GCGEMM _mm_gemm; - GCCol2ImKernel _output_col2im_kernel; - GCFillBorderKernel _fill_border; - GCActivationLayer _activationlayer_function; - - const IGCTensor *_original_weights; - - GCTensor _input_im2col_reshaped; - GCTensor _input_interleaved_reshaped; - GCTensor _weights_reshaped; - GCTensor _weights_transposed; - GCTensor _gemm_output; - GCTensor _tmp_output; - - bool _is_activationlayer_enabled; - bool _is_prepared; -}; -} - -#endif /* ARM_COMPUTE_GCCONVOLUTIONLAYER_H */ diff --git a/arm_compute/runtime/GLES_COMPUTE/functions/GCDepthwiseConvolutionLayer.h b/arm_compute/runtime/GLES_COMPUTE/functions/GCDepthwiseConvolutionLayer.h deleted file mode 100644 index 82fe368d7d..0000000000 --- a/arm_compute/runtime/GLES_COMPUTE/functions/GCDepthwiseConvolutionLayer.h +++ /dev/null @@ -1,78 +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_GCDEPTHWISECONVOLUTION_H -#define ARM_COMPUTE_GCDEPTHWISECONVOLUTION_H - -#include "arm_compute/core/GLES_COMPUTE/kernels/GCDepthwiseConvolutionLayer3x3Kernel.h" -#include "arm_compute/core/GLES_COMPUTE/kernels/GCFillBorderKernel.h" -#include "arm_compute/core/GLES_COMPUTE/kernels/GCTensorShiftKernel.h" -#include "arm_compute/core/Types.h" -#include "arm_compute/runtime/GLES_COMPUTE/functions/GCActivationLayer.h" -#include "arm_compute/runtime/IFunction.h" - -namespace arm_compute -{ -class IGCTensor; - -/** Basic function to execute a depthwise convolution for kernel size 3x3xC. This function calls the following OpenGLES kernels: - * - * -# @ref GCDepthwiseConvolutionLayer3x3Kernel - * -# @ref GCFillBorderKernel (if pad_x or pad_y > 0) - * - * @deprecated This function is deprecated and is intended to be removed in 21.05 release - * - */ -class GCDepthwiseConvolutionLayer3x3 : public IFunction -{ -public: - /** Default constructor */ - GCDepthwiseConvolutionLayer3x3(); - /** Initialize the function's source, destination, conv and border_size. - * - * @param[in, out] input Source tensor. Data type supported: F16. (Written to only for border filling). - * @param[in] weights Weights tensor. A 3D tensor with shape [3, 3, IFM]. Data type supported: Same as @p input. - * @param[in] biases Biases tensor. A 1D tensor with shape [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. - * @param[in] act_info (Optional) Activation layer information in case of a fused activation. - * @param[in] dilation (Optional) Dilation, in elements, across x and y. Defaults to (1, 1). Currently supports (1,1) only. - */ - void configure(IGCTensor *input, const IGCTensor *weights, const IGCTensor *biases, IGCTensor *output, const PadStrideInfo &conv_info, - unsigned int depth_multiplier = 1, const ActivationLayerInfo &act_info = ActivationLayerInfo(), const Size2D &dilation = Size2D(1U, 1U)); - - // Inherited methods overridden: - void run() override final; - -private: - std::unique_ptr _kernel; - GCFillBorderKernel _border_handler; - GCTensorShiftKernel _shift_handler; - GCActivationLayer _activationlayer_function; - - bool _is_activationlayer_enabled; -}; -} -#endif /*ARM_COMPUTE_GCDEPTHWISECONVOLUTION_H */ diff --git a/arm_compute/runtime/GLES_COMPUTE/functions/GCDirectConvolutionLayer.h b/arm_compute/runtime/GLES_COMPUTE/functions/GCDirectConvolutionLayer.h deleted file mode 100644 index f834802db6..0000000000 --- a/arm_compute/runtime/GLES_COMPUTE/functions/GCDirectConvolutionLayer.h +++ /dev/null @@ -1,83 +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_GCDIRECTCONVOLUTIONLAYER_H -#define ARM_COMPUTE_GCDIRECTCONVOLUTIONLAYER_H - -#include "arm_compute/core/GLES_COMPUTE/IGCKernel.h" -#include "arm_compute/core/GLES_COMPUTE/kernels/GCDirectConvolutionLayerKernel.h" -#include "arm_compute/core/GLES_COMPUTE/kernels/GCFillBorderKernel.h" -#include "arm_compute/core/GLES_COMPUTE/kernels/GCTensorShiftKernel.h" -#include "arm_compute/core/Types.h" -#include "arm_compute/runtime/GLES_COMPUTE/functions/GCActivationLayer.h" -#include "arm_compute/runtime/IFunction.h" - -#include - -namespace arm_compute -{ -class IGCTensor; - -/** Basic function to execute direct convolution function. This function calls the following kernels: - * - * -# @ref GCDirectConvolutionLayerKernel - * -# @ref GCFillBorderKernel - * -# @ref GCTensorShiftKernel - * - * @note Supported kernel size: 1x1, 3x3, and 5x5 - * @note This OpenGL ES implementation works with stride_x = 1 and 2 - * - * @deprecated This function is deprecated and is intended to be removed in 21.05 release - * - */ -class GCDirectConvolutionLayer : public IFunction -{ -public: - /** Default constructor */ - GCDirectConvolutionLayer(); - /** Set the input and output tensors. - * - * @param[in,out] input Source tensor. 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. - * input will be written to only if it is currently left aligned. - * @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] biases Biases tensor. Shared biases supported. Biases are 1D tensor with dimensions [OFM]. Data type supported:Same as @p input. - * @param[out] output Destination 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] 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(IGCTensor *input, const IGCTensor *weights, const IGCTensor *biases, IGCTensor *output, const PadStrideInfo &conv_info, - const ActivationLayerInfo &act_info = ActivationLayerInfo()); - - // Inherited methods overridden: - void run() override final; - -private: - std::unique_ptr _kernel; - GCFillBorderKernel _border_handler; - GCTensorShiftKernel _shift_handler; -}; -} -#endif /* ARM_COMPUTE_GCDIRECTCONVOLUTIONLAYER_H */ diff --git a/arm_compute/runtime/GLES_COMPUTE/functions/GCDropoutLayer.h b/arm_compute/runtime/GLES_COMPUTE/functions/GCDropoutLayer.h deleted file mode 100644 index 4d551f2692..0000000000 --- a/arm_compute/runtime/GLES_COMPUTE/functions/GCDropoutLayer.h +++ /dev/null @@ -1,66 +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_GCDROPOUTLAYER_H -#define ARM_COMPUTE_GCDROPOUTLAYER_H - -#include "arm_compute/core/GLES_COMPUTE/kernels/GCDropoutLayerKernel.h" -#include "arm_compute/runtime/IFunction.h" - -namespace arm_compute -{ -class IGCTensor; -/** Basic function to do dropout op. This function calls the following kernels: - * - * -# @ref GCDropoutLayerKernel - * - * @deprecated This function is deprecated and is intended to be removed in 21.05 release - * - */ -class GCDropoutLayer : public IFunction -{ -public: - /** Constructor */ - GCDropoutLayer(); - - /** Set the input and output tensors. - * - * @param[in] input Source tensor. Data type supported: F16/F32. - * @param[out] mask Destination tensor. Data type supported: Same as @p input. - * @param[out] output Destination tensor. Data type 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 override - void run() override; - -private: - GCDropoutLayerKernel _dropout_kernel; -}; -} - -#endif /* ARM_COMPUTE_GCDROPOUTLAYER_H */ diff --git a/arm_compute/runtime/GLES_COMPUTE/functions/GCFillBorder.h b/arm_compute/runtime/GLES_COMPUTE/functions/GCFillBorder.h deleted file mode 100644 index 1635db51e7..0000000000 --- a/arm_compute/runtime/GLES_COMPUTE/functions/GCFillBorder.h +++ /dev/null @@ -1,56 +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_GCFILLBORDER_H -#define ARM_COMPUTE_GCFILLBORDER_H - -#include "arm_compute/core/PixelValue.h" -#include "arm_compute/core/Types.h" -#include "arm_compute/runtime/GLES_COMPUTE/IGCSimpleFunction.h" - -namespace arm_compute -{ -class ITensor; - -/** Basic function to run @ref GCFillBorderKernel - * - * @deprecated This function is deprecated and is intended to be removed in 21.05 release - * - */ -class GCFillBorder : public IGCSimpleFunction -{ -public: - /** Initialize the function - * - * @param[in,out] tensor Source tensor. Data types supported: F16/F32 - * @param[in] border_width The border width - * @param[in] border_mode Strategy to use for borders. - * @param[in] constant_border_value (Optional) Constant value to use for borders if border_mode is set to CONSTANT. - */ - void configure(IGCTensor *tensor, unsigned int border_width, BorderMode border_mode, - const PixelValue &constant_border_value = PixelValue()); -}; -} - -#endif /*ARM_COMPUTE_FILLBORDER_H */ diff --git a/arm_compute/runtime/GLES_COMPUTE/functions/GCFullyConnectedLayer.h b/arm_compute/runtime/GLES_COMPUTE/functions/GCFullyConnectedLayer.h deleted file mode 100644 index f839a7db39..0000000000 --- a/arm_compute/runtime/GLES_COMPUTE/functions/GCFullyConnectedLayer.h +++ /dev/null @@ -1,116 +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_GCFULLYCONNECTEDLAYER_H -#define ARM_COMPUTE_GCFULLYCONNECTEDLAYER_H - -#include "arm_compute/core/GLES_COMPUTE/kernels/GCGEMMMatrixAccumulateBiasesKernel.h" -#include "arm_compute/core/GLES_COMPUTE/kernels/GCGEMMMatrixMultiplyKernel.h" -#include "arm_compute/core/GLES_COMPUTE/kernels/GCIm2ColKernel.h" -#include "arm_compute/core/GLES_COMPUTE/kernels/GCTransposeKernel.h" -#include "arm_compute/runtime/GLES_COMPUTE/GCTensor.h" -#include "arm_compute/runtime/GLES_COMPUTE/IGCSimpleFunction.h" -#include "arm_compute/runtime/IWeightsManager.h" -#include "arm_compute/runtime/MemoryGroup.h" - -namespace arm_compute -{ -/** Basic function to reshape the weights of Fully Connected layer with OpenGL ES. This function calls the following kernels: - * - * -# @ref GCTransposeKernel - * - * @note The fully connected layer accepts "weights" tensors only with 2 dimensions. - * - * @deprecated This function is deprecated and is intended to be removed in 21.05 release - * - */ -class GCFullyConnectedLayerReshapeWeights : public IGCSimpleFunction -{ -public: - /** Set the input and output tensors. - * - * @param[in] input Weights tensor. The weights must be 2 dimensional. Data types supported: F16/F32. - * @param[out] output Destination tensor which stores the transposed input tensor. Data type supported: Same as @p input. - */ - void configure(const IGCTensor *input, IGCTensor *output); -}; - -/** Basic function to compute a Fully Connected layer on OpenGL ES. This function calls the following OpenGL ES kernels: - * - * -# @ref GCIm2ColKernel (called when the input comes from a convolutional layer) - * -# @ref GCFullyConnectedLayerReshapeWeights (if @p are_weights_reshaped is set to false and transpose_weights is set to true ) (called once) - * -# @ref GCGEMMMatrixMultiplyKernel - * -# @ref GCGEMMMatrixAccumulateBiasesKernel (if @p biases is not equal to nullptr) - * - * @note The fully connected layer accepts "weights" tensors only with 2 dimensions. - * - * @deprecated This function is deprecated and is intended to be removed in 21.05 release - * - */ -class GCFullyConnectedLayer : public IFunction -{ -public: - /** Constructor */ - GCFullyConnectedLayer(std::shared_ptr memory_manager = nullptr, IWeightsManager *weights_manager = nullptr); - /** Prevent instances of this class from being copied (As this class contains pointers) */ - GCFullyConnectedLayer(const GCFullyConnectedLayer &) = delete; - /** Default move constructor */ - GCFullyConnectedLayer(GCFullyConnectedLayer &&) = default; - /** Prevent instances of this class from being copied (As this class contains pointers) */ - GCFullyConnectedLayer &operator=(const GCFullyConnectedLayer &) = delete; - /** Default move assignment operator */ - GCFullyConnectedLayer &operator=(GCFullyConnectedLayer &&) = default; - /** Set the input and output tensors. - * - * @param[in] input Source tensor. Data type supported: F16/F32. - * @param[in] weights Weights tensor. The weights must be 2 dimensional. Data type supported: Same as @p input - * @param[in] biases Bias tensor. It can be nullptr. Data type supported:Same as @p input. - * @param[out] output Destination tensor. Data type supported: Same as @p input. - * @param[in] fc_info (Optional) Fully connected layer additional info - */ - void configure(const IGCTensor *input, const IGCTensor *weights, const IGCTensor *biases, IGCTensor *output, - FullyConnectedLayerInfo fc_info = FullyConnectedLayerInfo()); - - //Inherited methods override - void run() override; - void prepare() override; - -private: - void configure_fc_fc(const IGCTensor *input, const IGCTensor *weights, IGCTensor *output); - void configure_conv_fc(const IGCTensor *input, const IGCTensor *weights, IGCTensor *output); - - MemoryGroup _memory_group; - IWeightsManager *_weights_manager; - GCIm2ColKernel _im2col_kernel; - GCFullyConnectedLayerReshapeWeights _reshape_weights_kernel; - GCGEMMMatrixMultiplyKernel _mm_kernel; - GCGEMMMatrixAccumulateBiasesKernel _accumulate_biases_kernel; - GCTensor _im2col_output; - GCTensor _reshape_weights_output; - const IGCTensor *_original_weights; - bool _are_weights_reshaped; - bool _is_fc_after_conv; - bool _accumulate_biases; -}; -} -#endif /* ARM_COMPUTE_GCFULLYCONNECTEDLAYER_H */ diff --git a/arm_compute/runtime/GLES_COMPUTE/functions/GCGEMM.h b/arm_compute/runtime/GLES_COMPUTE/functions/GCGEMM.h deleted file mode 100644 index 653da4b981..0000000000 --- a/arm_compute/runtime/GLES_COMPUTE/functions/GCGEMM.h +++ /dev/null @@ -1,116 +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_GCGEMM_H -#define ARM_COMPUTE_GCGEMM_H - -#include "arm_compute/core/GLES_COMPUTE/kernels/GCGEMMInterleave4x4Kernel.h" -#include "arm_compute/core/GLES_COMPUTE/kernels/GCGEMMMatrixAdditionKernel.h" -#include "arm_compute/core/GLES_COMPUTE/kernels/GCGEMMMatrixMultiplyKernel.h" -#include "arm_compute/core/GLES_COMPUTE/kernels/GCGEMMTranspose1xWKernel.h" -#include "arm_compute/runtime/GLES_COMPUTE/GCTensor.h" -#include "arm_compute/runtime/IFunction.h" -#include "arm_compute/runtime/MemoryGroup.h" - -namespace arm_compute -{ -class IGCTensor; - -/** Basic function to execute GEMM on OpenGLES Compute. This function calls the following kernels: - * - * -# @ref GCGEMMInterleave4x4Kernel (if the output tensor is a matrix) - * -# @ref GCGEMMTranspose1xWKernel (if the output tensor is a matrix) - * -# @ref GCGEMMMatrixMultiplyKernel - * -# @ref GCGEMMMatrixAdditionKernel (if c != nullptr and beta != 0.0) - * - * @deprecated This function is deprecated and is intended to be removed in 21.05 release - * - */ -class GCGEMM : public IFunction -{ -public: - /** Default constructor. */ - GCGEMM(std::shared_ptr memory_manager = nullptr); - /** Prevent instances of this class from being copied (As this class contains pointers) */ - GCGEMM(const GCGEMM &) = delete; - /** Default move constructor */ - GCGEMM(GCGEMM &&) = default; - /** Prevent instances of this class from being copied (As this class contains pointers) */ - GCGEMM &operator=(const GCGEMM &) = delete; - /** Default move assignment operator */ - GCGEMM &operator=(GCGEMM &&) = default; - /** Initialise the kernel's inputs and output - * - * @note GEMM: General Matrix Multiply - [alpha * A * B + beta * C]. - * - * @note All tensors must have the same data type. - * - * @note Whilst the first input tensor can be a vector, the second input tensor must be at least a matrix - * - * @param[in] a First input tensor (Matrix or Vector A). Data types supported: F32 - * @param[in] b Second input tensor (Matrix B). Data type supported: same as @p a. - * @param[in] c Third input tensor (Matrix C). It can be a nullptr if just the multiplication between @p a and @p b is needed. Data type supported: same as @p a. - * @param[out] output Output tensor. Data type supported: same as @p a - * @param[in] alpha Weight of the matrix product - * @param[in] beta Weight of matrix C - * @param[in] gemm_info (Optional) Specifies if the matrix A and/or matrix B have been reshaped and - * if the reshape of matrix B should happen only for the first run - */ - void configure(const IGCTensor *a, const IGCTensor *b, const IGCTensor *c, IGCTensor *output, float alpha, float beta, const GEMMInfo &gemm_info = GEMMInfo()); - /** Static function to check if given info will lead to a valid configuration of @ref GCGEMM. - * - * @param[in] a First input tensor (Matrix or Vector A). Data types supported: F16/F32 - * @param[in] b Second input tensor (Matrix B). Data type supported: same as @p a. - * @param[in] c Third input tensor (Matrix C). It can be a nullptr if just the multiplication between @p a and @p b is needed. Data type supported: same as @p a. - * @param[out] output Output tensor. Data type supported: same as @p a - * @param[in] alpha Weight of the matrix product - * @param[in] beta Weight of matrix C - * @param[in] gemm_info (Optional) Specifies if the matrix A and/or matrix B have been reshaped and - * if the reshape of matrix B should happen only for the first run - * - * @return a status - */ - static Status validate(const ITensorInfo *a, const ITensorInfo *b, const IGCTensor *c, const ITensorInfo *output, const float alpha, const float beta, const GEMMInfo &gemm_info = GEMMInfo()); - - // Inherited methods overridden: - void run() override; - void prepare() override; - -private: - MemoryGroup _memory_group; - GCGEMMInterleave4x4Kernel _interleave_kernel; - GCGEMMTranspose1xWKernel _transpose_kernel; - GCGEMMMatrixMultiplyKernel _mm_kernel; - GCGEMMMatrixAdditionKernel _ma_kernel; - GCTensor _tmp_a; - GCTensor _tmp_b; - const IGCTensor *_original_b; - bool _is_interleaved_transposed; - bool _run_addition; - bool _reshape_b_only_on_first_run; - bool _is_prepared; -}; -} - -#endif /* ARM_COMPUTE_GCGEMM_H */ diff --git a/arm_compute/runtime/GLES_COMPUTE/functions/GCGEMMInterleave4x4.h b/arm_compute/runtime/GLES_COMPUTE/functions/GCGEMMInterleave4x4.h deleted file mode 100644 index 964c368316..0000000000 --- a/arm_compute/runtime/GLES_COMPUTE/functions/GCGEMMInterleave4x4.h +++ /dev/null @@ -1,52 +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_GCGEMMINTERLEAVE4X4_H -#define ARM_COMPUTE_GCGEMMINTERLEAVE4X4_H - -#include "arm_compute/runtime/GLES_COMPUTE/IGCSimpleFunction.h" - -namespace arm_compute -{ -class ITensor; - -/** Basic function to execute GCGEMMInterleave4x4Kernel. This function calls the following OpenGL ES kernel: - * - * -# @ref GCGEMMInterleave4x4Kernel - * - * @deprecated This function is deprecated and is intended to be removed in 21.05 release - * - */ -class GCGEMMInterleave4x4 : public IGCSimpleFunction -{ -public: - /** Initialise the kernel's inputs, output - * - * @param[in] input First input tensor. Data types supported: F32, F16 - * @param[out] output Output tensor. Data type supported: same as @p input - */ - void configure(const IGCTensor *input, IGCTensor *output); -}; -} - -#endif /* ARM_COMPUTE_GCGEMMINTERLEAVE4X4_H */ diff --git a/arm_compute/runtime/GLES_COMPUTE/functions/GCGEMMTranspose1xW.h b/arm_compute/runtime/GLES_COMPUTE/functions/GCGEMMTranspose1xW.h deleted file mode 100644 index 107590cf76..0000000000 --- a/arm_compute/runtime/GLES_COMPUTE/functions/GCGEMMTranspose1xW.h +++ /dev/null @@ -1,49 +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_GCGEMMTRANSPOSE1XW_H -#define ARM_COMPUTE_GCGEMMTRANSPOSE1XW_H - -#include "arm_compute/runtime/GLES_COMPUTE/IGCSimpleFunction.h" - -namespace arm_compute -{ -/** Basic function to execute GCGEMMTranspose1xWKernel. This function calls the following OpenGLES kernels: - * - * -# @ref GCGEMMTranspose1xWKernel - * - * @deprecated This function is deprecated and is intended to be removed in 21.05 release - * - */ -class GCGEMMTranspose1xW : public IGCSimpleFunction -{ -public: - /** Initialise the kernel's inputs, output - * - * @param[in] input First input tensor. Data type supported: F32 - * @param[out] output Output tensor. Data type supported: same as @p input - */ - void configure(const IGCTensor *input, IGCTensor *output); -}; -} -#endif /*ARM_COMPUTE_GCGEMMTRANSPOSE1XW_H */ diff --git a/arm_compute/runtime/GLES_COMPUTE/functions/GCNormalizationLayer.h b/arm_compute/runtime/GLES_COMPUTE/functions/GCNormalizationLayer.h deleted file mode 100644 index f8ee39c362..0000000000 --- a/arm_compute/runtime/GLES_COMPUTE/functions/GCNormalizationLayer.h +++ /dev/null @@ -1,76 +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_GCNORMALIZATIONLAYER_H -#define ARM_COMPUTE_GCNORMALIZATIONLAYER_H - -#include "arm_compute/runtime/IFunction.h" - -#include "arm_compute/core/GLES_COMPUTE/kernels/GCFillBorderKernel.h" -#include "arm_compute/core/GLES_COMPUTE/kernels/GCNormalizationLayerKernel.h" -#include "arm_compute/core/GLES_COMPUTE/kernels/GCPixelWiseMultiplicationKernel.h" -#include "arm_compute/runtime/GLES_COMPUTE/GCTensor.h" -#include "arm_compute/runtime/MemoryGroup.h" - -#include "arm_compute/core/Types.h" - -namespace arm_compute -{ -// Forward declarations -class IGCTensor; - -/** Basic function to compute a normalization layer. This function calls the following OpenGL ES kernels: - * - * -# @ref GCPixelWiseMultiplicationKernel - * -# @ref GCFillBorderKernel - * -# @ref GCNormalizationLayerKernel - * - * @deprecated This function is deprecated and is intended to be removed in 21.05 release - * - */ -class GCNormalizationLayer : public IFunction -{ -public: - /** Default constructor */ - GCNormalizationLayer(std::shared_ptr memory_manager = nullptr); - /** 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. Number of channels must be 1. - * @param[out] output Destination tensor. Dimensions, data type and number of channels must match the input ones. - * @param[in] norm_info Normalization layer information like the normalization type, normalization size and other parameters. - */ - void configure(const IGCTensor *input, IGCTensor *output, const NormalizationLayerInfo &norm_info); - - // Inherited methods overridden: - void run() override; - -private: - MemoryGroup _memory_group; - GCTensor _squared_input; /**< The intermediate buffer which stores results of squaring input*/ - GCNormalizationLayerKernel _norm_kernel; /**< Normalization layer kernel to run */ - GCPixelWiseMultiplicationKernel _multiply_kernel; /**< Pixel multiplication kernel to run */ - GCFillBorderKernel _border_handler; /**< Kernel to handle borders */ -}; -} // namespace arm_compute -#endif /* ARM_COMPUTE_GCNORMALIZATIONLAYER_H */ diff --git a/arm_compute/runtime/GLES_COMPUTE/functions/GCNormalizePlanarYUVLayer.h b/arm_compute/runtime/GLES_COMPUTE/functions/GCNormalizePlanarYUVLayer.h deleted file mode 100644 index e097cb9291..0000000000 --- a/arm_compute/runtime/GLES_COMPUTE/functions/GCNormalizePlanarYUVLayer.h +++ /dev/null @@ -1,78 +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_GCNORMALIZEPLANARYUVLAYER_H -#define ARM_COMPUTE_GCNORMALIZEPLANARYUVLAYER_H - -#include "arm_compute/runtime/IFunction.h" - -#include "arm_compute/core/GLES_COMPUTE/kernels/GCNormalizePlanarYUVLayerKernel.h" -#include "arm_compute/core/Types.h" - -namespace arm_compute -{ -class IGCTensor; - -/** Basic function to run @ref GCNormalizePlanarYUVLayerKernel - * - * @note The function simulates a NormalizePlanarYUV layer. - * - * @deprecated This function is deprecated and is intended to be removed in 21.05 release - * - */ -class GCNormalizePlanarYUVLayer : public IFunction -{ -public: - /** Default constructor */ - GCNormalizePlanarYUVLayer(); - /** 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 number of input channels. - * 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 CLNormalizePlanarYUVLayer - * - * @param[in] input Source tensor info. 3 lower dimensions represent a single input with dimensions [width, height, channels]. - * Data types supported: F16/F32. - * @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() override; - -private: - GCNormalizePlanarYUVLayerKernel _norm_kernel; /**< NormalizePlanarYUV layer kernel to run */ -}; -} -#endif /* ARM_COMPUTE_GCNORMALIZEPLANARYUVLAYER_H */ diff --git a/arm_compute/runtime/GLES_COMPUTE/functions/GCPixelWiseMultiplication.h b/arm_compute/runtime/GLES_COMPUTE/functions/GCPixelWiseMultiplication.h deleted file mode 100644 index e09ce374ff..0000000000 --- a/arm_compute/runtime/GLES_COMPUTE/functions/GCPixelWiseMultiplication.h +++ /dev/null @@ -1,53 +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_GCPIXELWISEMULTIPLICATION_H -#define ARM_COMPUTE_GCPIXELWISEMULTIPLICATION_H - -#include "arm_compute/core/Types.h" -#include "arm_compute/runtime/GLES_COMPUTE/IGCSimpleFunction.h" - -namespace arm_compute -{ -class IGCTensor; - -/** Basic function to run @ref GCPixelWiseMultiplicationKernel. - * - * @deprecated This function is deprecated and is intended to be removed in 21.05 release - * - */ -class GCPixelWiseMultiplication : public IGCSimpleFunction -{ -public: - /** Initialise the kernel's inputs, output and convertion policy. - * - * @param[in] input1 First tensor input. Data types supported: F32. - * @param[in] input2 Second tensor input. Data types supported: Same as @p input1. - * @param[out] output Output tensor. Data types supported: Same as @p input1. - * @param[in] scale Scale to apply after multiplication. Must be a positive value. - * @param[in] act_info (Optional) Activation layer information in case of a fused activation. Currently not supported. - */ - void configure(const IGCTensor *input1, const IGCTensor *input2, IGCTensor *output, float scale, const ActivationLayerInfo &act_info = ActivationLayerInfo()); -}; -} -#endif /*ARM_COMPUTE_GCPIXELWISEMULTIPLICATION_H */ diff --git a/arm_compute/runtime/GLES_COMPUTE/functions/GCPoolingLayer.h b/arm_compute/runtime/GLES_COMPUTE/functions/GCPoolingLayer.h deleted file mode 100644 index dcb7e81b9b..0000000000 --- a/arm_compute/runtime/GLES_COMPUTE/functions/GCPoolingLayer.h +++ /dev/null @@ -1,79 +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_GCPOOLINGLAYER_H -#define ARM_COMPUTE_GCPOOLINGLAYER_H - -#include "arm_compute/core/GLES_COMPUTE/IGCKernel.h" -#include "arm_compute/core/GLES_COMPUTE/kernels/GCFillBorderKernel.h" -#include "arm_compute/core/GLES_COMPUTE/kernels/GCPoolingLayerKernel.h" -#include "arm_compute/core/GLES_COMPUTE/kernels/GCTensorShiftKernel.h" -#include "arm_compute/runtime/IFunction.h" - -#include "arm_compute/core/Error.h" -#include "arm_compute/core/Types.h" - -namespace arm_compute -{ -class IGCTensor; - -/** Basic function to simulate a pooling layer with the specified pooling operation. This function calls the following OpenGL ES kernels: - * - * -# @ref GCFillBorderKernel (executed if padding size is different from zero) - * -# @ref GCPoolingLayerKernel - * - * @deprecated This function is deprecated and is intended to be removed in 21.05 release - * - */ -class GCPoolingLayer : public IFunction -{ -public: - GCPoolingLayer(); - /** Set the input and output tensors. - * - * @param[in,out] input Source tensor. (Written to only when padding != 0) 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(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 GCPoolingLayer - * - * @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); - - void run() override final; - -private: - std::unique_ptr _kernel; - GCFillBorderKernel _border_handler; - GCTensorShiftKernel _shift_handler; -}; -} // namespace arm_compute -#endif /* ARM_COMPUTE_GCPOOLINGLAYER_H */ diff --git a/arm_compute/runtime/GLES_COMPUTE/functions/GCScale.h b/arm_compute/runtime/GLES_COMPUTE/functions/GCScale.h deleted file mode 100644 index 8e44d3bc70..0000000000 --- a/arm_compute/runtime/GLES_COMPUTE/functions/GCScale.h +++ /dev/null @@ -1,54 +0,0 @@ -/* - * Copyright (c) 2016-2021 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_GCSCALE_H -#define ARM_COMPUTE_GCSCALE_H - -#include "arm_compute/core/KernelDescriptors.h" -#include "arm_compute/runtime/GLES_COMPUTE/IGCSimpleFunction.h" - -#include - -namespace arm_compute -{ -class IGCTensor; - -/** Basic function to run @ref GCScaleKernel - * - * @deprecated This function is deprecated and is intended to be removed in 21.05 release - * - */ -class GCScale : public IGCSimpleFunction -{ -public: - /** Initialize the function's source, destination, interpolation type and border_mode. - * - * @param[in,out] input Source tensor. Data types supported: F16. (Written to only for @p border_mode != UNDEFINED) - * @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(IGCTensor *input, IGCTensor *output, const ScaleKernelInfo &info); -}; -} -#endif /*ARM_COMPUTE_GCSCALE_H */ diff --git a/arm_compute/runtime/GLES_COMPUTE/functions/GCSoftmaxLayer.h b/arm_compute/runtime/GLES_COMPUTE/functions/GCSoftmaxLayer.h deleted file mode 100644 index 083b07c57c..0000000000 --- a/arm_compute/runtime/GLES_COMPUTE/functions/GCSoftmaxLayer.h +++ /dev/null @@ -1,79 +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_GCSOFTMAXLAYER_H -#define ARM_COMPUTE_GCSOFTMAXLAYER_H - -#include "arm_compute/core/GLES_COMPUTE/kernels/GCSoftmaxLayerKernel.h" -#include "arm_compute/runtime/GLES_COMPUTE/GCTensor.h" -#include "arm_compute/runtime/IFunction.h" -#include "arm_compute/runtime/MemoryGroup.h" - -namespace arm_compute -{ -class IGCTensor; - -/** Basic function to compute a SoftmaxLayer. - * - * Softmax is calculated by : - * @f[ out = exp(x - max(x)) / sum(exp(x - max(x))) @f] - * - * This function runs the following kernels: - * -# @ref GCLogits1DMaxKernel - * -# @ref GCLogits1DShiftExpSumKernel - * -# @ref GCLogits1DNormKernel - * - * @deprecated This function is deprecated and is intended to be removed in 21.05 release - * - */ -class GCSoftmaxLayer : public IFunction -{ -public: - /** Constructor */ - GCSoftmaxLayer(std::shared_ptr memory_manager = nullptr); - /** 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] beta (Optional) A scaling factor for the exponent. Only beta = 1 is supported - * @param[in] axis (Optional) The dimension in which to apply the function. E.g. for input of shape 4x5x6 and - * axis=1, softmax will be applied to 4x6=24 vectors of size 5. Defaults to 0 - * - * @note The value of @p axis must be always 0 for GLES - */ - void configure(const IGCTensor *input, IGCTensor *output, float beta = 1.0f, int32_t axis = 0); - - // Inherited methods overridden: - void run() override; - -private: - MemoryGroup _memory_group; - GCLogits1DMaxKernel _max_kernel; - GCLogits1DShiftExpSumKernel _shift_exp_sum_kernel; - GCLogits1DNormKernel _norm_kernel; - GCTensor _max; - GCTensor _sum; - GCTensor _tmp; -}; -} // namespace arm_compute -#endif /* ARM_COMPUTE_GCSOFTMAXLAYER_H */ diff --git a/arm_compute/runtime/GLES_COMPUTE/functions/GCTensorShift.h b/arm_compute/runtime/GLES_COMPUTE/functions/GCTensorShift.h deleted file mode 100644 index d25a322f4f..0000000000 --- a/arm_compute/runtime/GLES_COMPUTE/functions/GCTensorShift.h +++ /dev/null @@ -1,54 +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_GCTENSORSHIFT_H -#define ARM_COMPUTE_GCTENSORSHIFT_H - -#include "arm_compute/core/GLES_COMPUTE/kernels/GCTensorShiftKernel.h" -#include "arm_compute/core/Types.h" -#include "arm_compute/runtime/GLES_COMPUTE/IGCSimpleFunction.h" - -#include - -namespace arm_compute -{ -class IGCTensor; - -/** Basic function to execute shift function for tensor. This function applies to fix alignment issue on OpenGL ES: - * - * @note This alignment issue is introduced by limits of compute shader which requires 32/64/128bit alignment for data access on OpenGL ES - * - * @deprecated This function is deprecated and is intended to be removed in 21.05 release - * - */ -class GCTensorShift : public IGCSimpleFunction -{ -public: - /** Initialise the kernel's input, output. - * - * @param[in,out] input Source tensor. Data types supported: F16/F32. - */ - void configure(IGCTensor *input); -}; -} -#endif /* ARM_COMPUTE_GCTENSORSHIFT_H */ diff --git a/arm_compute/runtime/GLES_COMPUTE/functions/GCTranspose.h b/arm_compute/runtime/GLES_COMPUTE/functions/GCTranspose.h deleted file mode 100644 index 84e303aa25..0000000000 --- a/arm_compute/runtime/GLES_COMPUTE/functions/GCTranspose.h +++ /dev/null @@ -1,52 +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_GCTRANSPOSE_H -#define ARM_COMPUTE_GCTRANSPOSE_H - -#include "arm_compute/runtime/GLES_COMPUTE/IGCSimpleFunction.h" - -namespace arm_compute -{ -class IGCTensor; - -/** Basic function to transpose a matrix on OpenGL ES. This function calls the following OpenGL ES kernel: - * - * -# @ref GCTransposeKernel - * - * @deprecated This function is deprecated and is intended to be removed in 21.05 release - * - */ -class GCTranspose : public IGCSimpleFunction -{ -public: - /** Initialise the kernel's inputs 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); -}; -} - -#endif /* ARM_COMPUTE_GCTRANSPOSE_H */ -- cgit v1.2.1