diff options
Diffstat (limited to 'libs/ARMComputeEx/arm_compute')
54 files changed, 0 insertions, 4626 deletions
diff --git a/libs/ARMComputeEx/arm_compute/core/CL/CLKernelLibraryEx.h b/libs/ARMComputeEx/arm_compute/core/CL/CLKernelLibraryEx.h deleted file mode 100644 index e4e752ef9..000000000 --- a/libs/ARMComputeEx/arm_compute/core/CL/CLKernelLibraryEx.h +++ /dev/null @@ -1,245 +0,0 @@ -/* - * Copyright (c) 2018 Samsung Electronics Co., Ltd. All Rights Reserved - * Copyright (c) 2016-2018 ARM Limited. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -/** - * @file CLKernelLibraryEx.h - * @ingroup COM_AI_RUNTIME - * @brief This file is a cloned version of CLKernelLibrary.h in ACL. This file defines - * an interface for CLKernelLibrary.cpp which adds more OpenCL kernels on top of ACL. - */ - -#ifndef __ARM_COMPUTE_CLKERNELLIBRARY_EX_H__ -#define __ARM_COMPUTE_CLKERNELLIBRARY_EX_H__ - -#include "arm_compute/core/CL/OpenCL.h" - -#include <map> -#include <set> -#include <string> -#include <utility> - -namespace arm_compute -{ - -/** - * @brief Class to build OpenCL kernels added from nnfw - * */ -class CLKernelLibraryEx -{ - using StringSet = std::set<std::string>; - -private: - /** - * @brief Construct a new CLKernelLibraryEx object - */ - CLKernelLibraryEx(); - -public: - /** - * @brief Prevent instances of this class from being copied. - */ - CLKernelLibraryEx(const CLKernelLibraryEx &) = delete; - - /** - * @brief Prevent instances of this class from being copied. - */ - const CLKernelLibraryEx &operator=(const CLKernelLibraryEx &) = delete; - - /** - * @brief Get the KernelLibrary singleton. - * @return The KernelLibrary instance - */ - static CLKernelLibraryEx &get(); - - /** - * @brief Initialise the kernel library. - * @param[in] kernel_path Path of the directory from which kernel sources are loaded. - * @param[in] context CL context used to create programs. - * @param[in] device CL device for which the programs are created. - * @return N/A - */ - void init(std::string kernel_path, cl::Context context, cl::Device device) - { - _kernel_path = std::move(kernel_path); - _context = std::move(context); - _device = std::move(device); - } - - /** - * @brief Set the path that the kernels reside in. - * @param[in] kernel_path Path of the directory from which kernel sources are loaded. - * @return N/A - */ - void set_kernel_path(const std::string &kernel_path) { _kernel_path = kernel_path; }; - - /** - * @brief Get the path that the kernels reside in. - * @return the path of kernel files - */ - std::string get_kernel_path() { return _kernel_path; }; - - /** - * @brief Get the source of the selected program. - * @param[in] program_name Program name. - * @return Source of the selected program. - */ - std::string get_program_source(const std::string &program_name); - - /** - * @brief Set the CL context used to create programs. - * @note Setting the context also resets the device to the - * first one available in the new context. - * @param[in] context A CL context. - * @return N/A - */ - void set_context(cl::Context context) - { - _context = std::move(context); - if (_context.get() == nullptr) - { - _device = cl::Device(); - } - else - { - const auto cl_devices = _context.getInfo<CL_CONTEXT_DEVICES>(); - - if (cl_devices.empty()) - { - _device = cl::Device(); - } - else - { - _device = cl_devices[0]; - } - } - } - - /** - * @brief Return associated CL context. - * @return A CL context. - */ - cl::Context &context() { return _context; } - - /** - * @brief Set the CL device for which the programs are created. - * @param[in] device A CL device. - * @return N/A - */ - void set_device(cl::Device device) { _device = std::move(device); } - - /** - * @brief Gets the CL device for which the programs are created. - * @return A CL device. - */ - cl::Device &get_device() { return _device; } - - /** - * @brief Return the device version - * @return The content of CL_DEVICE_VERSION - */ - std::string get_device_version(); - - /** - * @brief Create a kernel from the kernel library. - * @param[in] kernel_name Kernel name. - * @param[in] build_options_set Kernel build options as a set. - * @return The created kernel. - */ - Kernel create_kernel(const std::string &kernel_name, - const StringSet &build_options_set = {}) const; - - /** - * @brief Find the maximum number of local work items in a workgroup can be supported for the - * kernel. - * @param[in] kernel kernel object - */ - - size_t max_local_workgroup_size(const cl::Kernel &kernel) const; - /** - * @brief Return the default NDRange for the device. - * @return default NDRangeof the device - */ - cl::NDRange default_ndrange() const; - - /** - * @brief Clear the library's cache of binary programs - * @return N/A - */ - void clear_programs_cache() - { - _programs_map.clear(); - _built_programs_map.clear(); - } - - /** - * @brief Access the cache of built OpenCL programs - * @return program map data structure of which key is name of kernel and value is - * kerel source name. (*.cl) - */ - const std::map<std::string, cl::Program> &get_built_programs() const - { - return _built_programs_map; - } - - /** - * @brief Add a new built program to the cache - * @param[in] built_program_name Name of the program - * @param[in] program Built program to add to the cache - * @return N/A - */ - void add_built_program(const std::string &built_program_name, cl::Program program); - - /** - * @brief Returns true if FP16 is supported by the CL device - * @return true if the CL device supports FP16 - */ - bool fp16_supported() const; - - /** - * @brief Returns true if int64_base_atomics extension is supported by the CL device - * @return true if the CL device supports int64_base_atomics extension - */ - bool int64_base_atomics_supported() const; - -private: - /** - * @brief Load program and its dependencies. - * @param[in] program_name Name of the program to load. - */ - const Program &load_program(const std::string &program_name) const; - /** - * @brief 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; - - cl::Context _context; /**< Underlying CL context. */ - cl::Device _device; /**< Underlying CL device. */ - std::string _kernel_path; /**< Path to the kernels folder. */ - mutable std::map<std::string, const Program> - _programs_map; /**< Map with all already loaded program data. */ - mutable std::map<std::string, cl::Program> - _built_programs_map; /**< Map with all already built program data. */ - static const std::map<std::string, std::string> - _kernel_program_map; /**< Map that associates kernel names with programs. */ - static const std::map<std::string, std::string> - _program_source_map; /**< Contains sources for all programs. - Used for compile-time kernel inclusion. >*/ -}; -} -#endif /* __ARM_COMPUTE_CLKERNELLIBRARY_EX_H__ */ diff --git a/libs/ARMComputeEx/arm_compute/core/CL/OpenCLEx.h b/libs/ARMComputeEx/arm_compute/core/CL/OpenCLEx.h deleted file mode 100644 index dbda354d6..000000000 --- a/libs/ARMComputeEx/arm_compute/core/CL/OpenCLEx.h +++ /dev/null @@ -1,79 +0,0 @@ -/* - * Copyright (c) 2018 Samsung Electronics Co., Ltd. All Rights Reserved - * Copyright (c) 2016-2018 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_OPENCLEX_H__ -#define __ARM_COMPUTE_OPENCLEX_H__ - -#include <string> -#include <utility> - -/* Configure the Khronos C++ wrapper to target OpenCL 1.2: */ -#ifndef ARM_COMPUTE_NO_EXCEPTIONS -#define CL_HPP_ENABLE_EXCEPTIONS -#endif // ARM_COMPUTE_NO_EXCEPTIONS -#define CL_HPP_CL_1_2_DEFAULT_BUILD -#define CL_HPP_TARGET_OPENCL_VERSION 110 -#define CL_HPP_MINIMUM_OPENCL_VERSION 110 -#include <CL/cl2.hpp> - -namespace arm_compute -{ -/** Class for loading OpenCL symbols. */ -class CLSymbolsEx final -{ -private: - CLSymbolsEx() = default; - void load_symbols(void *handle); - -public: - /** Get the static instance of CLSymbols. - * - * @return The static instance of CLSymbols. - */ - static CLSymbolsEx &get(); - /** Load symbols from the given OpenCL library path. - * - * @param[in] library Path to the OpenCL library. - * - * @return True if loading the library is successful. - */ - bool load(const std::string &library); - /** Load symbols from any of the default OpenCL library names. - * - * @return True if loading any library is successful. - */ - bool load_default(); - -#define DECLARE_FUNCTION_PTR(func_name) std::function<decltype(func_name)> func_name##_ptr = nullptr - - DECLARE_FUNCTION_PTR(clGetEventInfo); - DECLARE_FUNCTION_PTR(clSetEventCallback); - -#undef DECLARE_FUNCTION_PTR - -private: - std::pair<bool, bool> _loaded{false, false}; -}; -} // namespace arm_compute -#endif /* __ARM_COMPUTE_OPENCLEX_H__ */ diff --git a/libs/ARMComputeEx/arm_compute/core/CL/kernels/CLActivationLayerExKernel.h b/libs/ARMComputeEx/arm_compute/core/CL/kernels/CLActivationLayerExKernel.h deleted file mode 100644 index 080cc47ef..000000000 --- a/libs/ARMComputeEx/arm_compute/core/CL/kernels/CLActivationLayerExKernel.h +++ /dev/null @@ -1,78 +0,0 @@ -/* - * Copyright (c) 2018 Samsung Electronics Co., Ltd. All Rights Reserved - * Copyright (c) 2016-2018 ARM Limited. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -#ifndef __ARM_COMPUTE_CLACTIVATIONLAYEREXKERNEL_H__ -#define __ARM_COMPUTE_CLACTIVATIONLAYEREXKERNEL_H__ - -#include "arm_compute/core/CL/ICLKernel.h" -#include "arm_compute/core/TypesEx.h" - -namespace arm_compute -{ -class ICLTensor; - -/** Interface for the activation layer kernel. */ -class CLActivationLayerExKernel : public ICLKernel -{ -public: - /** Default constructor */ - CLActivationLayerExKernel(); - /** Prevent instances of this class from being copied (As this class contains pointers) */ - CLActivationLayerExKernel(const CLActivationLayerExKernel &) = delete; - /** Prevent instances of this class from being copied (As this class contains pointers) */ - CLActivationLayerExKernel &operator=(const CLActivationLayerExKernel &) = delete; - /** Allow instances of this class to be moved */ - CLActivationLayerExKernel(CLActivationLayerExKernel &&) = default; - /** Allow instances of this class to be moved */ - CLActivationLayerExKernel &operator=(CLActivationLayerExKernel &&) = default; - /** Default destructor */ - ~CLActivationLayerExKernel() = 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: - * QASYMM8/F16/F32. - * @param[out] output Destination tensor. Data type supported: same as @p input - * @param[in] act_info Activation layer information. - */ - void configure(ICLTensor *input, ICLTensor *output, ActivationLayerInfoEx act_info); - /** Static function to check if given info will lead to a valid configuration of @ref - * CLActivationLayerKernel - * - * @param[in] input Source tensor info. In case of @p output tensor info = nullptr, this tensor - * will store the result - * of the activation function. Data types supported: QASYMM8/F16/F32. - * @param[in] output Destination tensor info. Data type supported: same as @p input - * @param[in] act_info Activation layer information. - * - * @return a status - */ - static Status validate(const ITensorInfo *input, const ITensorInfo *output, - const ActivationLayerInfoEx &act_info); - - // Inherited methods overridden: - void run(const Window &window, cl::CommandQueue &queue) override; - -private: - ICLTensor *_input; - ICLTensor *_output; - bool _run_in_place; -}; -} // namespace arm_compute -#endif /*__ARM_COMPUTE_CLACTIVATIONLAYEREXKERNEL_H__ */ diff --git a/libs/ARMComputeEx/arm_compute/core/CL/kernels/CLArgMinMaxKernel.h b/libs/ARMComputeEx/arm_compute/core/CL/kernels/CLArgMinMaxKernel.h deleted file mode 100644 index b91a26159..000000000 --- a/libs/ARMComputeEx/arm_compute/core/CL/kernels/CLArgMinMaxKernel.h +++ /dev/null @@ -1,106 +0,0 @@ -/* - * Copyright (c) 2018 Samsung Electronics Co., Ltd. All Rights Reserved - * Copyright (c) 2016-2018 ARM Limited. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -/** - * @file CLArgMinMaxKernel.h - * @brief This file defines CLArgMinMaxKernel - * @ingroup COM_AI_RUNTIME - */ - -#ifndef __ARM_COMPUTE_CLARG_MIN_MAX_KERNEL_H__ -#define __ARM_COMPUTE_CLARG_MIN_MAX_KERNEL_H__ - -#include "arm_compute/core/CL/ICLKernel.h" -#include "arm_compute/core/TypesEx.h" - -namespace arm_compute -{ -class ICLTensor; - -/** - * @brief Class to define interface for the argminmax max kernel. - */ -class CLArgMinMaxKernel : public ICLKernel -{ -public: - /** - * @brief Default constructor. - */ - CLArgMinMaxKernel(); - /** - * @brief Prevent instances of this class from being copied (As this class contains pointers). - * @param [in] copiedInstance Const reference of CLArgMinMaxKernel to be copied - */ - CLArgMinMaxKernel(const CLArgMinMaxKernel &) = delete; - /** - * @brief Prevent instances of this class from being copied (As this class contains pointers). - * @param [in] copiedInstance Const reference of CLArgMinMaxKernel to be copied - * @return Reference of this instance - */ - CLArgMinMaxKernel &operator=(const CLArgMinMaxKernel &) = delete; - /** - * @brief Allow instances of this class to be moved - * @param [in] movedInstance Rvalue reference of CLArgMinMaxKernel to be moved - */ - CLArgMinMaxKernel(CLArgMinMaxKernel &&) = default; - /** - * @brief Allow instances of this class to be moved - * @param [in] movedInstance Rvalue reference of CLArgMinMaxKernel to be moved - * @return Reference of this instance - */ - CLArgMinMaxKernel &operator=(CLArgMinMaxKernel &&) = default; - /** - * @brief Initialise the kernel's input, output and border mode. - * @param[in] input An input tensor. Data types supported: U8/QASYMM8/S32/F32. - * @param[out] output The output tensor, Data types supported: same as @p input. - * @param[in] argminmax_axis Axis to argminmax - * return N/A - */ - void configure(const ICLTensor *input, ICLTensor *output, const uint32_t argminmax_axis, - ArgOperation op); - /** - * @brief Static function to check if given info will lead to a valid configuration of @ref - * CLArgMinMaxKernel - * @param[in] input An input tensor info. Data types supported: U8/QASYMM8/S32/F32. - * @param[in] output The output tensor info, Data types supported: same as @p input1. - * @param[in] argminmax_axis Axis to argminmax - * @return a status - */ - static Status validate(const ITensorInfo *input, const ITensorInfo *output, - const uint32_t argminmax_axis, ArgOperation op); - - /* - * @brief Run CLArgMinMaxKernel op - * @param[in] window Window to be used for in_slice - * @param[in] queue cl::CommandQueue - * @return N/A - */ - void run(const Window &window, cl::CommandQueue &queue) override; - /* - * @brief Run CLArgMinMaxKernel op on CPU - * @param[in] queue cl::CommandQueue - * @return N/A - */ - void run_on_cpu(cl::CommandQueue &queue); - -private: - const ICLTensor *_input; - ICLTensor *_output; - uint32_t _argminmax_axis; -}; -} // namespace arm_compute -#endif /*__ARM_COMPUTE_CLargminmaxMAXKERNEL_H__ */ diff --git a/libs/ARMComputeEx/arm_compute/core/CL/kernels/CLArithmeticSubtractionExKernel.h b/libs/ARMComputeEx/arm_compute/core/CL/kernels/CLArithmeticSubtractionExKernel.h deleted file mode 100644 index 9a765f310..000000000 --- a/libs/ARMComputeEx/arm_compute/core/CL/kernels/CLArithmeticSubtractionExKernel.h +++ /dev/null @@ -1,81 +0,0 @@ -/* - * Copyright (c) 2018 Samsung Electronics Co., Ltd. All Rights Reserved - * Copyright (c) 2016-2018 ARM Limited. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -#ifndef __ARM_COMPUTE_CLARITHMETICSUBTRACTIONEXKERNEL_H__ -#define __ARM_COMPUTE_CLARITHMETICSUBTRACTIONEXKERNEL_H__ - -#include "arm_compute/core/CL/ICLKernel.h" - -namespace arm_compute -{ -class ICLTensor; - -/** Interface for the arithmetic subtraction kernel (support broadcasting) - * - * Arithmetic subtraction is computed by: - * @f[ output(x,y) = input1(x,y) - input2(x,y) @f] - */ -class CLArithmeticSubtractionExKernel : public ICLKernel -{ -public: - /** Default constructor */ - CLArithmeticSubtractionExKernel(); - /** Prevent instances of this class from being copied (As this class contains pointers) */ - CLArithmeticSubtractionExKernel(const CLArithmeticSubtractionExKernel &) = delete; - /** Prevent instances of this class from being copied (As this class contains pointers) */ - CLArithmeticSubtractionExKernel &operator=(const CLArithmeticSubtractionExKernel &) = delete; - /** Allow instances of this class to be moved */ - CLArithmeticSubtractionExKernel(CLArithmeticSubtractionExKernel &&) = default; - /** Allow instances of this class to be moved */ - CLArithmeticSubtractionExKernel &operator=(CLArithmeticSubtractionExKernel &&) = default; - /** Default destructor */ - ~CLArithmeticSubtractionExKernel() = default; - - /** Initialise the kernel's inputs, output and convertion policy. - * - * @param[in] input1 First tensor input. Data types supported: U8/S16/F16/F32. - * @param[in] input2 Second tensor input. Data types supported: U8/S16/F16/F32. - * @param[out] output Output tensor. Data types supported: U8 (Only if both inputs are U8), - * S16/F16/F32. - * @param[in] policy Policy to use to handle overflow. - */ - void configure(const ICLTensor *input1, const ICLTensor *input2, ICLTensor *output, - ConvertPolicy policy); - /** Static function to check if given info will lead to a valid configuration of @ref - * CLArithmeticSubtractionExKernel - * - * @param[in] input1 First tensor input info. Data types supported: U8/S16/F16/F32. - * @param[in] input2 Second tensor input info. Data types supported: U8/S16/F16/F32. - * @param[in] output Output tensor info. Data types supported: U8 (Only if both inputs are U8), - * S16/F16/F32. - * @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, cl::CommandQueue &queue) override; - BorderSize border_size() const override; - -private: - const ICLTensor *_input1; /**< Source tensor 1 */ - const ICLTensor *_input2; /**< Source tensor 2 */ - ICLTensor *_output; /**< Destination tensor */ -}; -} // namespace arm_compute -#endif /* __ARM_COMPUTE_CLARITHMETICSUBTRACTIONEXKERNEL_H__ */ diff --git a/libs/ARMComputeEx/arm_compute/core/CL/kernels/CLBatchToSpaceNDKernel.h b/libs/ARMComputeEx/arm_compute/core/CL/kernels/CLBatchToSpaceNDKernel.h deleted file mode 100644 index 1387897c9..000000000 --- a/libs/ARMComputeEx/arm_compute/core/CL/kernels/CLBatchToSpaceNDKernel.h +++ /dev/null @@ -1,58 +0,0 @@ -/* - * Copyright (c) 2018 Samsung Electronics Co., Ltd. All Rights Reserved - * Copyright (c) 2016-2018 ARM Limited. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -#ifndef __ARM_COMPUTE_CLBATCH_TO_SPACE_ND_KERNEL_H__ -#define __ARM_COMPUTE_CLBATCH_TO_SPACE_ND_KERNEL_H__ - -#include "arm_compute/core/CL/ICLKernel.h" - -namespace arm_compute -{ -class ICLTensor; - -/** OpenCL kernel to perform BATCH_TO_SPACE_ND operation */ -class CLBatchToSpaceNDKernel : public ICLKernel -{ -public: - /** Default constructor */ - CLBatchToSpaceNDKernel(); - /** Prevent instances of this class from being copied (As this class contains pointers) */ - CLBatchToSpaceNDKernel(const CLBatchToSpaceNDKernel &) = delete; - /** Prevent instances of this class from being copied (As this class contains pointers) */ - CLBatchToSpaceNDKernel &operator=(const CLBatchToSpaceNDKernel &) = delete; - /** Allow instances of this class to be moved */ - CLBatchToSpaceNDKernel(CLBatchToSpaceNDKernel &&) = default; - /** Allow instances of this class to be moved */ - CLBatchToSpaceNDKernel &operator=(CLBatchToSpaceNDKernel &&) = default; - /** Default destructor */ - ~CLBatchToSpaceNDKernel() = default; - /** Initialise the kernel's input and output. - * - * @param[in] input Input tensor. Data types supported: U8/QASYMM8/S16/S32/F16/F32. - * @param[in] output Output tensor. Data types supported: U8/QASYMM8/S16/S32/F16/F32. - */ - void configure(const ICLTensor *input, ICLTensor *output, const int32_t *block_size); - - // Inherited methods overridden: - void run(const Window &window, cl::CommandQueue &queue) override; - -private: - const ICLTensor *_input; /**< Source tensor */ - ICLTensor *_output; /**< Destination tensor */ -}; - -} // namespace arm_compute -#endif /* __ARM_COMPUTE_CLSPACE_TO_BATCH_ND_KERNEL_H__ */ diff --git a/libs/ARMComputeEx/arm_compute/core/CL/kernels/CLBinaryLogicalOpKernel.h b/libs/ARMComputeEx/arm_compute/core/CL/kernels/CLBinaryLogicalOpKernel.h deleted file mode 100644 index ab33d9d3a..000000000 --- a/libs/ARMComputeEx/arm_compute/core/CL/kernels/CLBinaryLogicalOpKernel.h +++ /dev/null @@ -1,62 +0,0 @@ -/* - * Copyright (c) 2018 Samsung Electronics Co., Ltd. All Rights Reserved - * Copyright (c) 2016-2018 ARM Limited. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -#ifndef __ARM_COMPUTE_CLBINARYLOGICALOPKERNEL_H__ -#define __ARM_COMPUTE_CLBINARYLOGICALOPKERNEL_H__ - -#include "arm_compute/core/CL/ICLKernel.h" -#include "arm_compute/core/TypesEx.h" - -namespace arm_compute -{ -class ICLTensor; - -/** OpenCL kernel to return truth values of two input tensors for Binary Logical Op*/ -class CLBinaryLogicalOpKernel : public ICLKernel -{ -public: - /** Default constructor */ - CLBinaryLogicalOpKernel(); - /** Prevent instances of this class from being copied (As this class contains pointers). */ - CLBinaryLogicalOpKernel(const CLBinaryLogicalOpKernel &) = delete; - /** Prevent instances of this class from being copied (As this class contains pointers). */ - CLBinaryLogicalOpKernel &operator=(const CLBinaryLogicalOpKernel &) = delete; - /** Allow instances of this class to be moved */ - CLBinaryLogicalOpKernel(CLBinaryLogicalOpKernel &&) = default; - /** Allow instances of this class to be moved */ - CLBinaryLogicalOpKernel &operator=(CLBinaryLogicalOpKernel &&) = default; - /** Initialize the kernel's input, output. - * - * @param[in] input1 Source tensor1. - * @param[in] input2 Source tensor2. - * @param[out] output Output tensor. - */ - void configure(const ICLTensor *input1, const ICLTensor *input2, ICLTensor *output, - BinaryLogicalOperation op); - - // Inherited methods overridden: - void run(const Window &window, cl::CommandQueue &queue) override; - - BorderSize border_size() const override; - -private: - const ICLTensor *_input1; - const ICLTensor *_input2; - ICLTensor *_output; -}; - -} // namespace arm_compute -#endif /*__ARM_COMPUTE_CLBINARYLOGICALOPKERNEL_H__ */ diff --git a/libs/ARMComputeEx/arm_compute/core/CL/kernels/CLCastKernel.h b/libs/ARMComputeEx/arm_compute/core/CL/kernels/CLCastKernel.h deleted file mode 100644 index 4c2feb903..000000000 --- a/libs/ARMComputeEx/arm_compute/core/CL/kernels/CLCastKernel.h +++ /dev/null @@ -1,96 +0,0 @@ -/* - * Copyright (c) 2018 Samsung Electronics Co., Ltd. All Rights Reserved - * Copyright (c) 2016-2018 ARM Limited. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -/** - * @file CLCastKernel.h - * @ingroup COM_AI_RUNTIME - * @brief This file defines CLCastKernel class - */ - -#ifndef __ARM_COMPUTE_CLCASTKERNEL_H__ -#define __ARM_COMPUTE_CLCASTKERNEL_H__ - -#include "arm_compute/core/CL/ICLKernel.h" - -namespace arm_compute -{ -class ICLTensor; - -/** - * @brief Class to define OpenCL kernel for cast operation - */ -class CLCastKernel : public ICLKernel -{ -public: - /** - * @brief Construct CLCastKernel object - */ - CLCastKernel(); - - /** - * @brief Prevent instances of this class from being copied (As this class contains pointers) - */ - CLCastKernel(const CLCastKernel &) = delete; - - /** - * @brief Prevent instances of this class from being copied (As this class contains pointers) - */ - CLCastKernel &operator=(const CLCastKernel &) = delete; - - /** - * @brief Construct CLCastKernel object using default move constructor - * @param[in] CLCastKernel object to move - */ - CLCastKernel(CLCastKernel &&) = default; - - /** - * @brief Allow instances of this class to be moved - * @param[in] CLCastKernel object to move - */ - CLCastKernel &operator=(CLCastKernel &&) = default; - - /** - * @brief Destruct this CLCastKernel object - */ - ~CLCastKernel() = default; - - /** - * @brief Initialise the kernel's input and output. - * @param[in] input Input tensor. Data types supported: U8/QASYMM8/S16/S32/F16/F32. - * @param[in] output Output tensor. Data types supported: U8/QASYMM8/S16/S32/F16/F32. - * @return N/A - */ - void configure(const ICLTensor *input, ICLTensor *output); - - /** - * @brief Enqueue the OpenCL kernel to process the given window on the passed OpenCL command - * queue. - * @note The queue is *not* flushed by this method, and therefore the kernel will not have - * been executed by the time this method returns. - * @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.@return N/A - * @return N/A - */ - void run(const Window &window, cl::CommandQueue &queue) override; - -private: - const ICLTensor *_input; /**< Source tensor */ - ICLTensor *_output; /**< Destination tensor */ -}; -} // namespace arm_compute -#endif /* __ARM_COMPUTE_CLCASTKERNEL_H__ */ diff --git a/libs/ARMComputeEx/arm_compute/core/CL/kernels/CLComparisonOpKernel.h b/libs/ARMComputeEx/arm_compute/core/CL/kernels/CLComparisonOpKernel.h deleted file mode 100644 index f5f455993..000000000 --- a/libs/ARMComputeEx/arm_compute/core/CL/kernels/CLComparisonOpKernel.h +++ /dev/null @@ -1,61 +0,0 @@ -/* - * Copyright (c) 2018 Samsung Electronics Co., Ltd. All Rights Reserved - * Copyright (c) 2016-2018 ARM Limited. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -#ifndef __ARM_COMPUTE_CLCOMPARISON_OP_KERNEL_H__ -#define __ARM_COMPUTE_CLCOMPARISON_OP_KERNEL_H__ - -#include "arm_compute/core/CL/ICLKernel.h" -#include "arm_compute/core/TypesEx.h" - -namespace arm_compute -{ -class ICLTensor; - -/** OpenCL kernel to check if values in both tensors are equal*/ -class CLComparisonOpKernel : public ICLKernel -{ -public: - /** Default constructor */ - CLComparisonOpKernel(); - /** Prevent instances of this class from being copied (As this class contains pointers). */ - CLComparisonOpKernel(const CLComparisonOpKernel &) = delete; - /** Prevent instances of this class from being copied (As this class contains pointers). */ - CLComparisonOpKernel &operator=(const CLComparisonOpKernel &) = delete; - /** Allow instances of this class to be moved */ - CLComparisonOpKernel(CLComparisonOpKernel &&) = default; - /** Allow instances of this class to be moved */ - CLComparisonOpKernel &operator=(CLComparisonOpKernel &&) = default; - /** Initialize the kernel's input, output. - * - * @param[in] input1 Source tensor1. - * @param[in] input2 Source tensor2. - * @param[out] output Output tensor. - */ - void configure(const ICLTensor *input1, const ICLTensor *input2, ICLTensor *output, - const ComparisonOperation &op); - - // Inherited methods overridden: - void run(const Window &window, cl::CommandQueue &queue) override; - - BorderSize border_size() const override; - -private: - const ICLTensor *_input1; - const ICLTensor *_input2; - ICLTensor *_output; -}; -} // namespace arm_compute -#endif /*__ARM_COMPUTE_CLCOMPARISON_OP_KERNEL_H__ */ diff --git a/libs/ARMComputeEx/arm_compute/core/CL/kernels/CLDepthToSpaceKernel.h b/libs/ARMComputeEx/arm_compute/core/CL/kernels/CLDepthToSpaceKernel.h deleted file mode 100644 index 60ec7a82a..000000000 --- a/libs/ARMComputeEx/arm_compute/core/CL/kernels/CLDepthToSpaceKernel.h +++ /dev/null @@ -1,58 +0,0 @@ -/* - * Copyright (c) 2018 Samsung Electronics Co., Ltd. All Rights Reserved - * Copyright (c) 2016-2018 ARM Limited. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -#ifndef __ARM_COMPUTE_CLDEPTHTOSPACEKERNEL_H__ -#define __ARM_COMPUTE_CLDEPTHTOSPACEKERNEL_H__ - -#include "arm_compute/core/CL/ICLKernel.h" - -namespace arm_compute -{ -class ICLTensor; - -/** OpenCL kernel to perform depthTospace operation */ -class CLDepthToSpaceKernel : public ICLKernel -{ -public: - /** Default constructor */ - CLDepthToSpaceKernel(); - /** Prevent instances of this class from being copied (As this class contains pointers) */ - CLDepthToSpaceKernel(const CLDepthToSpaceKernel &) = delete; - /** Prevent instances of this class from being copied (As this class contains pointers) */ - CLDepthToSpaceKernel &operator=(const CLDepthToSpaceKernel &) = delete; - /** Allow instances of this class to be moved */ - CLDepthToSpaceKernel(CLDepthToSpaceKernel &&) = default; - /** Allow instances of this class to be moved */ - CLDepthToSpaceKernel &operator=(CLDepthToSpaceKernel &&) = default; - /** Default destructor */ - ~CLDepthToSpaceKernel() = default; - /** Initialise the kernel's input and output. - * - * @param[in] input Input tensor. Data types supported: U8/QASYMM8/S16/S32/F16/F32. - * @param[in] output Output tensor. Data types supported: U8/QASYMM8/S16/S32/F16/F32. - */ - void configure(const ICLTensor *input, ICLTensor *output, const int32_t block_size); - - // Inherited methods overridden: - void run(const Window &window, cl::CommandQueue &queue) override; - -private: - const ICLTensor *_input; /**< Source tensor */ - ICLTensor *_output; /**< Destination tensor */ -}; - -} // namespace arm_compute -#endif /* __ARM_COMPUTE_CLDEPTHTOSPACEKERNEL_H__ */ diff --git a/libs/ARMComputeEx/arm_compute/core/CL/kernels/CLEmbeddingLookupKernel.h b/libs/ARMComputeEx/arm_compute/core/CL/kernels/CLEmbeddingLookupKernel.h deleted file mode 100644 index da075db69..000000000 --- a/libs/ARMComputeEx/arm_compute/core/CL/kernels/CLEmbeddingLookupKernel.h +++ /dev/null @@ -1,113 +0,0 @@ -/* - * Copyright (c) 2018 Samsung Electronics Co., Ltd. All Rights Reserved - * Copyright (c) 2016-2018 ARM Limited. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -/** - * @file CLEmbeddingLookupKernel.h - * @ingroup COM_AI_RUNTIME - * @brief This file defines CLEmbeddingLookupKernel class - */ - -#ifndef __ARM_COMPUTE_CLEMBEDDINGLOOKUPKERNEL_H__ -#define __ARM_COMPUTE_CLEMBEDDINGLOOKUPKERNEL_H__ - -#include "arm_compute/core/CL/ICLKernel.h" - -namespace arm_compute -{ -class ICLTensor; - -/** -* @brief Class to perform EmbeddingLookup operation with opencl kernel -*/ -class CLEmbeddingLookupKernel : public ICLKernel -{ -public: - /** - * @brief Construct a CLEmbeddingLookupKernel object - * */ - CLEmbeddingLookupKernel(); - - /** - * @brief Prevent instances of this class from being copied (As this class contains pointers) - * */ - CLEmbeddingLookupKernel(const CLEmbeddingLookupKernel &) = delete; - - /** - * @brief Prevent instances of this class from being copied (As this class contains pointers) - * */ - CLEmbeddingLookupKernel &operator=(const CLEmbeddingLookupKernel &) = delete; - - /** - * @brief Construct a CLEmbeddingLookupKernel object by using default move constructor - * @param[in] CLEmbeddingLookupKernel object to move - * */ - CLEmbeddingLookupKernel(CLEmbeddingLookupKernel &&) = default; - - /** - * @brief Move assignment operator - * @param[in] CLEmbeddingLookupKernel object to move - * */ - CLEmbeddingLookupKernel &operator=(CLEmbeddingLookupKernel &&) = default; - - /** - * @brief Destruct this object - * */ - ~CLEmbeddingLookupKernel() = default; - - /** - * @brief Set the input and output of the kernel - * @param[in] input Source tensor. - * Data type supported: U8/S8/QASYMM8/U16/S16/U32/S32/F16/F32 - * @param[out] output Destination tensor. Data type supported: Same as @p input - * @param[in] lookups Lookups are 1D tensor that values are indices into the first - * dimension of input. - * Data types supported: S32. - * @return N/A - */ - void configure(const ICLTensor *input, ICLTensor *output, const ICLTensor *lookups); - - /** - * @brief Static function to check if given info will lead to a valid configuration of @ref - * CLEmbeddingLookupKernel - * @param[in] input The input tensor info. - * Data types supported: U8/S8/QASYMM8/U16/S16/U32/S32/F16/F32 - * @param[in] output The output tensor info, Data types supported: same as @p input1. - * @param[in] lookups Lookups info. Data types supported: S32. - * @return a status - */ - static Status validate(const ITensorInfo *input, const ITensorInfo *output, - const ITensorInfo *lookups); - - /** - * @brief Enqueue the OpenCL kernel to process the given window on the passed OpenCL command - * queue. - * @note The queue is *not* flushed by this method, and therefore the kernel will not have - * been executed by the time this method returns. - * @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.@return N/A - * @return N/A - */ - void run(const Window &window, cl::CommandQueue &queue) override; - -private: - const ICLTensor *_input; /** Source tensor */ - ICLTensor *_output; /** Destination tensor */ - const ICLTensor *_lookups; /** Lookups tensor */ -}; -} // namespace arm_compute -#endif /*__ARM_COMPUTE_CLEMBEDDINGLOOKUPKERNEL_H__ */ diff --git a/libs/ARMComputeEx/arm_compute/core/CL/kernels/CLExpKernel.h b/libs/ARMComputeEx/arm_compute/core/CL/kernels/CLExpKernel.h deleted file mode 100644 index a6ea539f8..000000000 --- a/libs/ARMComputeEx/arm_compute/core/CL/kernels/CLExpKernel.h +++ /dev/null @@ -1,57 +0,0 @@ -/* - * Copyright (c) 2018 Samsung Electronics Co., Ltd. All Rights Reserved - * Copyright (c) 2016-2018 ARM Limited. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -#ifndef __ARM_COMPUTE_CLEXPKERNEL_H__ -#define __ARM_COMPUTE_CLEXPKERNEL_H__ - -#include "arm_compute/core/CL/ICLKernel.h" - -namespace arm_compute -{ -class ICLTensor; - -/** OpenCL kernel to perform an exponential operation */ -class CLExpKernel : public ICLKernel -{ -public: - /** Default constructor */ - CLExpKernel(); - /** Prevent instances of this class from being copied (As this class contains pointers) */ - CLExpKernel(const CLExpKernel &) = delete; - /** Prevent instances of this class from being copied (As this class contains pointers) */ - CLExpKernel &operator=(const CLExpKernel &) = delete; - /** Allow instances of this class to be moved */ - CLExpKernel(CLExpKernel &&) = default; - /** Allow instances of this class to be moved */ - CLExpKernel &operator=(CLExpKernel &&) = default; - /** Default destructor */ - ~CLExpKernel() = default; - /** Set the source, destination of the kernel - * - * @param[in] input Source tensor. Data type supported: F32. - * @param[out] output Destination tensor. Data type supported: F32. - */ - void configure(const ICLTensor *input, ICLTensor *output); - - // Inherited methods overridden: - void run(const Window &window, cl::CommandQueue &queue) override; - -private: - const ICLTensor *_input; - ICLTensor *_output; -}; -} // namespace arm_compute -#endif /*__ARM_COMPUTE_CLEXPKERNEL_H__ */ diff --git a/libs/ARMComputeEx/arm_compute/core/CL/kernels/CLGatherKernel.h b/libs/ARMComputeEx/arm_compute/core/CL/kernels/CLGatherKernel.h deleted file mode 100644 index 7e35a80b0..000000000 --- a/libs/ARMComputeEx/arm_compute/core/CL/kernels/CLGatherKernel.h +++ /dev/null @@ -1,104 +0,0 @@ -/* - * Copyright (c) 2018 Samsung Electronics Co., Ltd. All Rights Reserved - * Copyright (c) 2016-2018 ARM Limited. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -/** - * @file CLGatherKernel.h - * @ingroup COM_AI_RUNTIME - * @brief This file defines CLGatherKernel class - */ - -#ifndef __ARM_COMPUTE_CLGATHERKERNEL_H__ -#define __ARM_COMPUTE_CLGATHERKERNEL_H__ - -#include "arm_compute/core/CL/ICLKernel.h" - -namespace arm_compute -{ -class ICLTensor; - -/** - * @brief Class to define an interface for the gather kernel. - */ -class CLGatherKernel : public ICLKernel -{ -public: - /** - * @brief Construct CLGatherKernel object - * */ - CLGatherKernel(); - - /** - * @brief Prevent instances of this class from being copied (As this class contains pointers). - */ - CLGatherKernel(const CLGatherKernel &) = delete; - - /** - * @brief Prevent instances of this class from being copied (As this class contains pointers). - */ - CLGatherKernel &operator=(const CLGatherKernel &) = delete; - - /** - * @brief Construct CLGatherKernel object by using default move constructor - * @param[in] CLGatherKernel object to move - */ - CLGatherKernel(CLGatherKernel &&) = default; - - /** - * @brief Move assignment operator - * @param[in] CLGatherKernel object to move - */ - CLGatherKernel &operator=(CLGatherKernel &&) = default; - - /** - * @brief Initialise the kernel's input, output and border mode. - * @param[in] input1 An input tensor. Data types supported: U8/S32/F32. - * @param[in] input2 An input tensor. Data types supported: S32. - * @param[out] output The output tensor, Data types supported: same as @p input1. - * @return N/A - */ - void configure(const ICLTensor *input1, const ICLTensor *input2, ICLTensor *output); - - /** - * @brief Static function to check if given info will lead to a valid configuration of @ref - * CLGatherKernel - * @param[in] input1 An input tensor. Data types supported: U8/S32/F32. - * @param[in] input2 An input tensor. Data types supported: S32. - * @param[out] output The output tensor, Data types supported: same as @p input1. - * @return a status - */ - static Status validate(const ITensorInfo *input1, const ITensorInfo *input2, - const ITensorInfo *output); - - /** - * @brief Enqueue the OpenCL kernel to process the given window on the passed OpenCL command - * queue. - * @note The queue is *not* flushed by this method, and therefore the kernel will not have - * been executed by the time this method returns. - * @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.@return N/A - * @return N/A - */ - void run(const Window &window, cl::CommandQueue &queue) override; - -private: - const ICLTensor *_input1; - const ICLTensor *_input2; - ICLTensor *_output; -}; -} // namespace arm_compute -#endif /*__ARM_COMPUTE_CLGATHERKERNEL_H__ */ diff --git a/libs/ARMComputeEx/arm_compute/core/CL/kernels/CLHashtableLookupKernel.h b/libs/ARMComputeEx/arm_compute/core/CL/kernels/CLHashtableLookupKernel.h deleted file mode 100644 index c3fc15637..000000000 --- a/libs/ARMComputeEx/arm_compute/core/CL/kernels/CLHashtableLookupKernel.h +++ /dev/null @@ -1,129 +0,0 @@ -/* - * Copyright (c) 2018 Samsung Electronics Co., Ltd. All Rights Reserved - * Copyright (c) 2016-2018 ARM Limited. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -/** - * @file CLHashtableLookupKernel.h - * @ingroup COM_AI_RUNTIME - * @brief This file defines CLHashtableLookupKernel class - */ - -#ifndef __ARM_COMPUTE_CLHASHTABLELOOKUPKERNEL_H__ -#define __ARM_COMPUTE_CLHASHTABLELOOKUPKERNEL_H__ - -#include "arm_compute/core/CL/ICLKernel.h" -#include "arm_compute/runtime/CL/CLTensor.h" - -namespace arm_compute -{ -class ICLTensor; - -/** -* @brief Class to perform HashtableLookup operation with opencl kernel -*/ -class CLHashtableLookupKernel : public ICLKernel -{ -public: - /** - * @brief Construct a CLHashtableLookupKernel object - * */ - CLHashtableLookupKernel(); - - /** - * @brief Prevent instances of this class from being copied (As this class contains pointers) - * */ - CLHashtableLookupKernel(const CLHashtableLookupKernel &) = delete; - - /** - * @brief Prevent instances of this class from being copied (As this class contains pointers) - * */ - CLHashtableLookupKernel &operator=(const CLHashtableLookupKernel &) = delete; - - /** - * @brief Construct a CLHashtableLookupKernel object by using default move constructor - * @param[in] CLHashtableLookupKernel object to move - * */ - CLHashtableLookupKernel(CLHashtableLookupKernel &&) = default; - - /** - * @brief Move assignment operator - * @param[in] CLHashtableLookupKernel object to move - * */ - CLHashtableLookupKernel &operator=(CLHashtableLookupKernel &&) = default; - - /** - * @brief Destruct this object - * */ - ~CLHashtableLookupKernel() = default; - - /** - * @brief Set the input and output of the kernel - * @param[in] lookups Lookups 1D tensor that values are indices into the first dimension of - * input. - * @param[in] keys Keys 1D tensor. keys and input pair represent a map. - * Data types supported: S32 - * @param[in] input Source tensor. - * Data types supported: U8/S8/QASYMM8/U16/S16/U32/S32/F16/F32 - * @param[out] output Destination tensor. Data types and data layouts supported: Same as @p - * input. - * @param[out] hits Hits 1D tensor. A boolean tensor that indicates whether the lookup hits - * (True) or not (False). Data types supported: U8/QASYMM8 - * @return N/A - */ - void configure(const ICLTensor *lookups, const ICLTensor *keys, const ICLTensor *input, - ICLTensor *output, ICLTensor *hits); - - /** - * @brief Static function to check if given info will lead to a valid configuration of @ref - * CLHashtableLookupKernel - * @param[in] lookups The lookups tensor info. Data types supported: S32. - * @param[in] keys The keys tensor info. keys and input pair represent a map. - * Data types supported: S32 - * @param[in] input The input tensor info. - * Data types supported: U8/S8/QASYMM8/U16/S16/U32/S32/F16/F32 - * @param[out] output The output tensor. Data types and data layouts supported: Same as @p - * input. - * @param[out] hits The hits tensor info. A boolean tensor that indicates whether the lookup - * hits - * (True) or not (False). Data types supported: U8/QASYMM8 - * @return a status - */ - static Status validate(const ITensorInfo *lookups, const ITensorInfo *keys, - const ITensorInfo *input, const ITensorInfo *output, - const ITensorInfo *hits); - - /** - * @brief Enqueue the OpenCL kernel to process the given window on the passed OpenCL command - * queue. - * @note The queue is *not* flushed by this method, and therefore the kernel will not have - * been executed by the time this method returns. - * @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.@return N/A - * @return N/A - */ - void run(const Window &window, cl::CommandQueue &queue) override; - -private: - const ICLTensor *_lookups; /** Lookups tensor */ - const ICLTensor *_keys; /** Keys tensor */ - const ICLTensor *_input; /** Source tensor */ - ICLTensor *_output; /** Destination tensor */ - ICLTensor *_hits; /** Hits tensor */ - std::unique_ptr<CLTensor> _lookup_indices{nullptr}; /** Lookup indices tensor */ -}; -} // namespace arm_compute -#endif /*__ARM_COMPUTE_CLHASHTABLELOOKUPKERNEL_H__ */ diff --git a/libs/ARMComputeEx/arm_compute/core/CL/kernels/CLNegKernel.h b/libs/ARMComputeEx/arm_compute/core/CL/kernels/CLNegKernel.h deleted file mode 100644 index ccbea147e..000000000 --- a/libs/ARMComputeEx/arm_compute/core/CL/kernels/CLNegKernel.h +++ /dev/null @@ -1,55 +0,0 @@ -/* - * Copyright (c) 2018 Samsung Electronics Co., Ltd. All Rights Reserved - * Copyright (c) 2016-2018 ARM Limited. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -#ifndef __ARM_COMPUTE_CLNEGKERNEL_H__ -#define __ARM_COMPUTE_CLNEGKERNEL_H__ - -#include "arm_compute/core/CL/ICLKernel.h" - -namespace arm_compute -{ -class ICLTensor; - -/** OpenCL kernel to perform a negation operation on tensor*/ -class CLNegKernel : public ICLKernel -{ -public: - /** Default constructor */ - CLNegKernel(); - /** Prevent instances of this class from being copied (As this class contains pointers). */ - CLNegKernel(const CLNegKernel &) = delete; - /** Prevent instances of this class from being copied (As this class contains pointers). */ - CLNegKernel &operator=(const CLNegKernel &) = delete; - /** Allow instances of this class to be moved */ - CLNegKernel(CLNegKernel &&) = default; - /** Allow instances of this class to be moved */ - CLNegKernel &operator=(CLNegKernel &&) = default; - /** Initialize the kernel's input, output. - * - * @param[in] input Source tensor. - * @param[out] output Destination tensor. - */ - void configure(const ICLTensor *input, ICLTensor *output); - - // Inherited methods overridden: - void run(const Window &window, cl::CommandQueue &queue) override; - -private: - const ICLTensor *_input; - ICLTensor *_output; -}; -} // namespace arm_compute -#endif /*__ARM_COMPUTE_CLNEGKERNEL_H__ */ diff --git a/libs/ARMComputeEx/arm_compute/core/CL/kernels/CLNormalizationLayerExKernel.h b/libs/ARMComputeEx/arm_compute/core/CL/kernels/CLNormalizationLayerExKernel.h deleted file mode 100644 index 181a6226a..000000000 --- a/libs/ARMComputeEx/arm_compute/core/CL/kernels/CLNormalizationLayerExKernel.h +++ /dev/null @@ -1,81 +0,0 @@ -/* - * Copyright (c) 2018 Samsung Electronics Co., Ltd. All Rights Reserved - * Copyright (c) 2016-2018 ARM Limited. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -#ifndef __ARM_COMPUTE_CLNORMALIZATIONLAYEREXKERNEL_H__ -#define __ARM_COMPUTE_CLNORMALIZATIONLAYEREXKERNEL_H__ - -#include "arm_compute/core/CL/ICLKernel.h" - -namespace arm_compute -{ -class ICLTensor; - -/** Interface for the normalization layer kernel. - */ -class CLNormalizationLayerExKernel : public ICLKernel -{ -public: - /** Constructor */ - CLNormalizationLayerExKernel(); - /** Prevent instances of this class from being copied (As this class contains pointers) */ - CLNormalizationLayerExKernel(const CLNormalizationLayerExKernel &) = delete; - /** Prevent instances of this class from being copied (As this class contains pointers) */ - CLNormalizationLayerExKernel &operator=(const CLNormalizationLayerExKernel &) = delete; - /** Default Move Constructor. */ - CLNormalizationLayerExKernel(CLNormalizationLayerExKernel &&) = default; - /** Default move assignment operator */ - CLNormalizationLayerExKernel &operator=(CLNormalizationLayerExKernel &&) = 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: - * F16/F32. - * @param[out] output Destination tensor. Output will have the same number of dimensions as - * input. Data types supported: same as @p input. - * @param[in] norm_info Normalization layer information like the normalization type, - * normalization size and other parameters. - */ - void configure(const ICLTensor *input, ICLTensor *output, NormalizationLayerInfo norm_info); - /** Static function to check if given info will lead to a valid configuration of @ref - * CLNormalizationLayerKernel - * - * @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: - * F16/F32. - * @param[in] output Destination tensor. Output will have the same number of dimensions as - * input. Data types supported: same as @p input. - * @param[in] norm_info Normalization layer information like the normalization type, normalization - * size and other parameters. - * - * @return a status - */ - static Status validate(const ITensorInfo *input, const ITensorInfo *output, - NormalizationLayerInfo norm_info); - - // Inherited methods overridden: - void run(const Window &window, cl::CommandQueue &queue) override; - BorderSize border_size() const override; - -private: - const ICLTensor *_input; - ICLTensor *_output; - BorderSize _border_size; - bool _is_in_map; -}; -} // namespace arm_compute -#endif /*__ARM_COMPUTE_CLNORMALIZATIONLAYEREXKERNEL_H__ */ diff --git a/libs/ARMComputeEx/arm_compute/core/CL/kernels/CLPReLUKernel.h b/libs/ARMComputeEx/arm_compute/core/CL/kernels/CLPReLUKernel.h deleted file mode 100644 index eff1b8bd5..000000000 --- a/libs/ARMComputeEx/arm_compute/core/CL/kernels/CLPReLUKernel.h +++ /dev/null @@ -1,59 +0,0 @@ -/* - * Copyright (c) 2018 Samsung Electronics Co., Ltd. All Rights Reserved - * Copyright (c) 2016-2018 ARM Limited. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -#ifndef __ARM_COMPUTE_CLPRELU_KERNEL_H__ -#define __ARM_COMPUTE_CLPRELU_KERNEL_H__ - -#include "arm_compute/core/CL/ICLKernel.h" - -namespace arm_compute -{ -class ICLTensor; - -/** OpenCL kernel to calculate PReLU*/ -class CLPReLUKernel : public ICLKernel -{ -public: - /** Default constructor */ - CLPReLUKernel(); - /** Prevent instances of this class from being copied (As this class contains pointers). */ - CLPReLUKernel(const CLPReLUKernel &) = delete; - /** Prevent instances of this class from being copied (As this class contains pointers). */ - CLPReLUKernel &operator=(const CLPReLUKernel &) = delete; - /** Allow instances of this class to be moved */ - CLPReLUKernel(CLPReLUKernel &&) = default; - /** Allow instances of this class to be moved */ - CLPReLUKernel &operator=(CLPReLUKernel &&) = default; - /** Initialize the kernel's input, output. - * - * @param[in] input Source tensor1. - * @param[in] alpha Source tensor2. - * @param[out] output Output tensor. - */ - void configure(const ICLTensor *input, const ICLTensor *alpha, ICLTensor *output); - - // Inherited methods overridden: - void run(const Window &window, cl::CommandQueue &queue) override; - - BorderSize border_size() const override; - -private: - const ICLTensor *_input; - const ICLTensor *_alpha; - ICLTensor *_output; -}; -} // namespace arm_compute -#endif /*__ARM_COMPUTE_CLPRELU_KERNEL_H__ */ diff --git a/libs/ARMComputeEx/arm_compute/core/CL/kernels/CLPadLayerKernel.h b/libs/ARMComputeEx/arm_compute/core/CL/kernels/CLPadLayerKernel.h deleted file mode 100644 index cbaa2adee..000000000 --- a/libs/ARMComputeEx/arm_compute/core/CL/kernels/CLPadLayerKernel.h +++ /dev/null @@ -1,60 +0,0 @@ -/* -* Copyright (c) 2018 Samsung Electronics Co., Ltd. All Rights Reserved -* Copyright (c) 2016-2018 ARM Limited. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ -#ifndef __ARM_COMPUTE_CLPADLAYERKERNEL_H__ -#define __ARM_COMPUTE_CLPADLAYERKERNEL_H__ - -#include "arm_compute/core/CL/ICLKernel.h" - -namespace arm_compute -{ -class ICLTensor; - -/** OpenCL kernel to perform PAD operation */ -class CLPadLayerKernel : public ICLKernel -{ -public: - /** Default constructor */ - CLPadLayerKernel(); - /** Prevent instances of this class from being copied (As this class contains pointers) */ - CLPadLayerKernel(const CLPadLayerKernel &) = delete; - /** Prevent instances of this class from being copied (As this class contains pointers) */ - CLPadLayerKernel &operator=(const CLPadLayerKernel &) = delete; - /** Allow instances of this class to be moved */ - CLPadLayerKernel(CLPadLayerKernel &&) = default; - /** Allow instances of this class to be moved */ - CLPadLayerKernel &operator=(CLPadLayerKernel &&) = default; - /** Default destructor */ - ~CLPadLayerKernel() = default; - /** Initialise the kernel's input and output. - * - * @param[in] input Input tensor. Data types supported: U8/QASYMM8/S16/S32/F16/F32. - * @param[in] output Output tensor. Data types supported: U8/QASYMM8/S16/S32/F16/F32. - * @param[in] pad_size Padding Size tensor. Data types supported : S32 - */ - void configure(const ICLTensor *input, ICLTensor *output, ICLTensor *pad_size); - - // Inherited methods overridden: - void run(const Window &window, cl::CommandQueue &queue) override; - -private: - const ICLTensor *_input; /**< Source tensor */ - ICLTensor *_output; /**< Destination tensor */ - ICLTensor *_pad_size; /**< Padding Size tensor */ -}; - -} // namespace arm_compute -#endif /* __ARM_COMPUTE_CLPADLAYERKERNEL_H__ */ diff --git a/libs/ARMComputeEx/arm_compute/core/CL/kernels/CLPermuteExKernel.h b/libs/ARMComputeEx/arm_compute/core/CL/kernels/CLPermuteExKernel.h deleted file mode 100644 index 3434deee8..000000000 --- a/libs/ARMComputeEx/arm_compute/core/CL/kernels/CLPermuteExKernel.h +++ /dev/null @@ -1,73 +0,0 @@ -/* - * Copyright (c) 2018 Samsung Electronics Co., Ltd. All Rights Reserved - * Copyright (c) 2016-2018 ARM Limited. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -#ifndef __ARM_COMPUTE_CLPERMUTEEXKERNEL_H__ -#define __ARM_COMPUTE_CLPERMUTEEXKERNEL_H__ - -#include "arm_compute/core/CL/ICLKernel.h" - -namespace arm_compute -{ -class ICLTensor; - -/** OpenCL kernel to perform tensor permutation. - * - * Permutes given a permutation vector - */ -class CLPermuteExKernel : public ICLKernel -{ -public: - /** Default constructor */ - CLPermuteExKernel(); - /** Prevent instances of this class from being copied (As this class contains pointers) */ - CLPermuteExKernel(const CLPermuteExKernel &) = delete; - /** Prevent instances of this class from being copied (As this class contains pointers) */ - CLPermuteExKernel &operator=(const CLPermuteExKernel &) = delete; - /** Allow instances of this class to be moved */ - CLPermuteExKernel(CLPermuteExKernel &&) = default; - /** Allow instances of this class to be moved */ - CLPermuteExKernel &operator=(CLPermuteExKernel &&) = default; - /** Set the input and output of the kernel. - * - * @param[in] input The input tensor to permute. Data types supported: - * U8/S8/QASYMM8/U16/S16/F16/U32/S32/F32 - * @param[in] output The output tensor. Data types supported: Same as @p input - * @param[in] perm Permutation vector - */ - void configure(const ICLTensor *input, ICLTensor *output, const PermutationVector &perm); - /** Static function to check if given info will lead to a valid configuration of @ref - * CLPermuteKernel - * - * @param[in] input First tensor input info. Data types supported: - * U8/S8/QASYMM8/U16/S16/F16/U32/S32/F32. - * @param[in] output Output tensor info. Data types supported: same as @p input. - * @param[in] perm Permutation vector - * - * @return a status - */ - static Status validate(const ITensorInfo *input, const ITensorInfo *output, - const PermutationVector &perm); - - // Inherited methods overridden: - void run(const Window &window, cl::CommandQueue &queue) override; - -private: - const ICLTensor *_input; - ICLTensor *_output; - PermutationVector _perm; -}; -} // arm_compute -#endif /*__ARM_COMPUTE_CLPERMUTEEXKERNEL_H__ */ diff --git a/libs/ARMComputeEx/arm_compute/core/CL/kernels/CLPixelWiseDivisionKernel.h b/libs/ARMComputeEx/arm_compute/core/CL/kernels/CLPixelWiseDivisionKernel.h deleted file mode 100644 index d579f5d8f..000000000 --- a/libs/ARMComputeEx/arm_compute/core/CL/kernels/CLPixelWiseDivisionKernel.h +++ /dev/null @@ -1,125 +0,0 @@ -/* - * Copyright (c) 2018 Samsung Electronics Co., Ltd. All Rights Reserved - * Copyright (c) 2016-2018 ARM Limited. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -/** - * @file CLPixelWiseDivisionKernel.h - * @ingroup COM_AI_RUNTIME - * @brief This file defines CLPixelWiseDivisionKernel class - */ - -#ifndef __ARM_COMPUTE_CLPIXELWISEDIVISIONKERNEL_H__ -#define __ARM_COMPUTE_CLPIXELWISEDIVISIONKERNEL_H__ - -#include "arm_compute/core/CL/ICLKernel.h" - -namespace arm_compute -{ -class ICLTensor; - -/** - * @brief Interface for the pixelwise division kernel. - */ -class CLPixelWiseDivisionKernel : public ICLKernel -{ -public: - /** - * @brief Construct a CLPixelWiseDivisionKernel object - */ - CLPixelWiseDivisionKernel(); - - /** - * @brief Prevent instances of this class from being copied (As this class contains pointers). - */ - CLPixelWiseDivisionKernel(const CLPixelWiseDivisionKernel &) = delete; - - /** - * @brief Prevent instances of this class from being copied (As this class contains pointers). - */ - CLPixelWiseDivisionKernel &operator=(const CLPixelWiseDivisionKernel &) = delete; - - /** - * @brief Construct a CLPixelWiseDivisionKernel object by using move constructor - * @param[in] CLPixelWiseDivisionKernel object to move - */ - CLPixelWiseDivisionKernel(CLPixelWiseDivisionKernel &&) = default; - - /** - * @brief Allow instances of this class to be moved - * @param[in] CLPixelWiseDivisionKernel object to move - */ - CLPixelWiseDivisionKernel &operator=(CLPixelWiseDivisionKernel &&) = default; - - /** - * @brief Initialise the kernel's input, output and border mode. - * @param[in] input1 An input tensor. Data types supported: U8/S16/F16/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. Note: - * U8 requires both inputs to be U8. - * @param[in] scale Scale to apply after division. - * Scale must be positive and its value must be either 1/255 or 1/2^n - * where n is between 0 and 15. - * @param[in] overflow_policy Overflow policy. Supported overflow policies: Wrap, Saturate - * @param[in] rounding_policy Rounding policy. Supported rounding modes: to zero, to nearest - * even. - * @return N/A - */ - void configure(const ICLTensor *input1, const ICLTensor *input2, ICLTensor *output, float scale, - ConvertPolicy overflow_policy, RoundingPolicy rounding_policy); - - /** - * @brief Static function to check if given info will lead to a valid configuration of @ref - * CLPixelWiseDivisionKernel - * @param[in] input1 An input tensor info. Data types supported: U8/S16/F16/F32. - * @param[in] input2 An input tensor info. Data types supported: same as @p input1. - * @param[in] output The output tensor info, Data types supported: same as @p input1. - * Note: U8 requires both inputs to be U8. - * @param[in] scale Scale to apply after division. - * Scale must be positive and its value must be either 1/255 or 1/2^n - * where n is between 0 and 15. - * @param[in] overflow_policy Overflow policy. Supported overflow policies: Wrap, Saturate - * @param[in] rounding_policy Rounding policy. Supported rounding modes: to zero, to nearest even. - * @return a status - */ - static Status validate(const ITensorInfo *input1, const ITensorInfo *input2, - const ITensorInfo *output, float scale, ConvertPolicy overflow_policy, - RoundingPolicy rounding_policy); - - /** - * @brief Enqueue the OpenCL kernel to process the given window on the passed OpenCL command - * queue. - * @note The queue is *not* flushed by this method, and therefore the kernel will not have - * been executed by the time this method returns. - * @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.@return N/A - * @return N/A - */ - void run(const Window &window, cl::CommandQueue &queue) override; - - /** - * @brief The size of the border for that kernel - * @return The width in number of elements of the border. - */ - BorderSize border_size() const override; - -private: - const ICLTensor *_input1; - const ICLTensor *_input2; - ICLTensor *_output; -}; -} // namespace arm_compute -#endif /*__ARM_COMPUTE_CLPIXELWISEDIVISIONKERNEL_H__ */ diff --git a/libs/ARMComputeEx/arm_compute/core/CL/kernels/CLReduceOperationKernel.h b/libs/ARMComputeEx/arm_compute/core/CL/kernels/CLReduceOperationKernel.h deleted file mode 100644 index a26a4a7fc..000000000 --- a/libs/ARMComputeEx/arm_compute/core/CL/kernels/CLReduceOperationKernel.h +++ /dev/null @@ -1,104 +0,0 @@ -/* - * Copyright (c) 2018 Samsung Electronics Co., Ltd. All Rights Reserved - * Copyright (c) 2016-2018 ARM Limited. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -/** - * @file CLReduceOperationKernel.h - * @brief This file defines CLReduceOperationKernel class - * @ingroup COM_AI_RUNTIME - */ - -#ifndef __ARM_COMPUTE_CLREDUCEOPERATIONKERNEL_H__ -#define __ARM_COMPUTE_CLREDUCEOPERATIONKERNEL_H__ - -#include "arm_compute/core/CL/ICLKernel.h" -#include "arm_compute/core/TypesEx.h" - -namespace arm_compute -{ -class ICLTensor; - -/** - * @brief Class to define interface for the reduce operation kernel - */ -class CLReduceOperationKernel : public ICLKernel -{ -public: - /** - * @brief Default constructor - */ - CLReduceOperationKernel(); - /** - * @brief Prevent instances of this class from being copied (As this class contains pointers) - */ - CLReduceOperationKernel(const CLReduceOperationKernel &) = delete; - /** - * @brief Prevent instances of this class from being copied (As this class contains pointers) - */ - CLReduceOperationKernel &operator=(const CLReduceOperationKernel &) = delete; - /** - * @brief Allow instances of this class to be moved - */ - CLReduceOperationKernel(CLReduceOperationKernel &&) = default; - /** - * @brief Allow instances of this class to be moved - */ - CLReduceOperationKernel &operator=(CLReduceOperationKernel &&) = default; - /** - * @brief Default destructor - */ - ~CLReduceOperationKernel() = default; - - /** - * @brief Set the input and output tensors. - * @param[in] input Source tensor. Data types supported: U8/S32/F32. - * @param[out] output Destination tensor. Data types supported: Same as @p input. - * Output will have the same number of dimensions as input. - * @param[in] axis Axis along which to reduce. - * @param[in] op Reduce operation to perform. - * @return N/A - */ - void configure(const ICLTensor *input, ICLTensor *output, const uint32_t axis, - ReduceOperation op); - - /** - * @brief Static function to check if given info will lead to a valid configuration of @ref - * CLReduceOperationKernel. - * @param[in] input Source tensor info. Data types supported: U8/S32/F32. - * @param[in] output Destination tensor info. Data types supported: Same as @p input. - * Output will have the same number of dimensions as input. - * @param[in] axis Axis along which to reduce. - * @param[in] op Reduce operation to perform. - * @return a status - */ - static Status validate(const ITensorInfo *input, const ITensorInfo *output, const uint32_t axis, - ReduceOperation op); - - /* - * @brief Run CLReduceOperationKernel op - * @param[in] window Window to be used for in_slice - * @param[in] queue CLQueue - * @return N/A - */ - void run(const Window &window, cl::CommandQueue &queue) override; - -private: - const ICLTensor *_input; - ICLTensor *_output; - uint32_t _axis; -}; -} // namespace arm_compute -#endif /*__ARM_COMPUTE_CLREDUCEOPERATIONKERNEL_H__ */ diff --git a/libs/ARMComputeEx/arm_compute/core/CL/kernels/CLSpaceToBatchNDKernel.h b/libs/ARMComputeEx/arm_compute/core/CL/kernels/CLSpaceToBatchNDKernel.h deleted file mode 100644 index 68534f1ab..000000000 --- a/libs/ARMComputeEx/arm_compute/core/CL/kernels/CLSpaceToBatchNDKernel.h +++ /dev/null @@ -1,69 +0,0 @@ -/* - * Copyright (c) 2018 Samsung Electronics Co., Ltd. All Rights Reserved - * Copyright (c) 2016-2018 ARM Limited. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -#ifndef __ARM_COMPUTE_CLSPACE_TO_BATCH_ND_KERNEL_H__ -#define __ARM_COMPUTE_CLSPACE_TO_BATCH_ND_KERNEL_H__ - -#include "arm_compute/core/CL/ICLKernel.h" - -namespace arm_compute -{ -class ICLTensor; - -/** OpenCL kernel to perform SPACE_TO_BATCH_ND operation */ -class CLSpaceToBatchNDKernel final : public ICLKernel -{ -public: - /** Default constructor */ - CLSpaceToBatchNDKernel(); - /** Prevent instances of this class from being copied (As this class contains pointers) */ - CLSpaceToBatchNDKernel(const CLSpaceToBatchNDKernel &) = delete; - /** Prevent instances of this class from being copied (As this class contains pointers) */ - CLSpaceToBatchNDKernel &operator=(const CLSpaceToBatchNDKernel &) = delete; - /** Allow instances of this class to be moved */ - CLSpaceToBatchNDKernel(CLSpaceToBatchNDKernel &&) = default; - /** Allow instances of this class to be moved */ - CLSpaceToBatchNDKernel &operator=(CLSpaceToBatchNDKernel &&) = default; - /** Default destructor */ - ~CLSpaceToBatchNDKernel() = default; - /** Initialise the kernel's input and output. - * - * @note The data layout of input and output must be the same. - * @note The number of dimensions of input and output must be 4, and `spatial` dimensions - * are height and width. - * @param[in] input Input tensor. Data types supported: U8/QASYMM8/S16/F16/S32/F32. - * Data layout supported: NCHW/NHWC - * @param[in] block_size Block size tensor. Data types supported: S32. - * @param[in] padding_size Padding size tensor. Data types supported: S32. - * @param[out] output Output tensor. Data types supported: U8/QASYMM8/S16/F16/S32/F32. - * Data layout supported: NCHW/NHWC - */ - void configure(const ICLTensor *input, const ICLTensor *block_size, const ICLTensor *padding_size, - ICLTensor *output); - - // Inherited methods overridden: - void run(const Window &window, cl::CommandQueue &queue) override; - -private: - const ICLTensor *_input; /**< Source tensor */ - const ICLTensor *_block_size; /**< Block size tensor */ - const ICLTensor *_padding_size; /**< Padding size tensor */ - ICLTensor *_output; /**< Destination tensor */ -}; - -} // namespace arm_compute - -#endif /* __ARM_COMPUTE_CLSPACE_TO_BATCH_ND_KERNEL_H__ */ diff --git a/libs/ARMComputeEx/arm_compute/core/CL/kernels/CLSpaceToDepthKernel.h b/libs/ARMComputeEx/arm_compute/core/CL/kernels/CLSpaceToDepthKernel.h deleted file mode 100644 index be845a549..000000000 --- a/libs/ARMComputeEx/arm_compute/core/CL/kernels/CLSpaceToDepthKernel.h +++ /dev/null @@ -1,58 +0,0 @@ -/* - * Copyright (c) 2018 Samsung Electronics Co., Ltd. All Rights Reserved - * Copyright (c) 2016-2018 ARM Limited. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -#ifndef __ARM_COMPUTE_CLSPACETODEPTHKERNEL_H__ -#define __ARM_COMPUTE_CLSPACETODEPTHKERNEL_H__ - -#include "arm_compute/core/CL/ICLKernel.h" - -namespace arm_compute -{ -class ICLTensor; - -/** OpenCL kernel to perform spaceTodepth operation */ -class CLSpaceToDepthKernel : public ICLKernel -{ -public: - /** Default constructor */ - CLSpaceToDepthKernel(); - /** Prevent instances of this class from being copied (As this class contains pointers) */ - CLSpaceToDepthKernel(const CLSpaceToDepthKernel &) = delete; - /** Prevent instances of this class from being copied (As this class contains pointers) */ - CLSpaceToDepthKernel &operator=(const CLSpaceToDepthKernel &) = delete; - /** Allow instances of this class to be moved */ - CLSpaceToDepthKernel(CLSpaceToDepthKernel &&) = default; - /** Allow instances of this class to be moved */ - CLSpaceToDepthKernel &operator=(CLSpaceToDepthKernel &&) = default; - /** Default destructor */ - ~CLSpaceToDepthKernel() = default; - /** Initialise the kernel's input and output. - * - * @param[in] input Input tensor. Data types supported: U8/QASYMM8/S16/S32/F16/F32. - * @param[in] output Output tensor. Data types supported: U8/QASYMM8/S16/S32/F16/F32. - */ - void configure(const ICLTensor *input, ICLTensor *output, const int32_t block_size); - - // Inherited methods overridden: - void run(const Window &window, cl::CommandQueue &queue) override; - -private: - const ICLTensor *_input; /**< Source tensor */ - ICLTensor *_output; /**< Destination tensor */ -}; - -} // namespace arm_compute -#endif /* __ARM_COMPUTE_CLSPACETODEPTHKERNEL_H__ */ diff --git a/libs/ARMComputeEx/arm_compute/core/CL/kernels/CLSquaredDifferenceKernel.h b/libs/ARMComputeEx/arm_compute/core/CL/kernels/CLSquaredDifferenceKernel.h deleted file mode 100644 index a4c44e35d..000000000 --- a/libs/ARMComputeEx/arm_compute/core/CL/kernels/CLSquaredDifferenceKernel.h +++ /dev/null @@ -1,59 +0,0 @@ -/* - * Copyright (c) 2018 Samsung Electronics Co., Ltd. All Rights Reserved - * Copyright (c) 2016-2018 ARM Limited. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -#ifndef __ARM_COMPUTE_CLSQUARED_DIFFERENCE_KERNEL_H__ -#define __ARM_COMPUTE_CLSQUARED_DIFFERENCE_KERNEL_H__ - -#include "arm_compute/core/CL/ICLKernel.h" - -namespace arm_compute -{ -class ICLTensor; - -/** OpenCL kernel to return squared difference value of two tensors (x-y)^2*/ -class CLSquaredDifferenceKernel : public ICLKernel -{ -public: - /** Default constructor */ - CLSquaredDifferenceKernel(); - /** Prevent instances of this class from being copied (As this class contains pointers). */ - CLSquaredDifferenceKernel(const CLSquaredDifferenceKernel &) = delete; - /** Prevent instances of this class from being copied (As this class contains pointers). */ - CLSquaredDifferenceKernel &operator=(const CLSquaredDifferenceKernel &) = delete; - /** Allow instances of this class to be moved */ - CLSquaredDifferenceKernel(CLSquaredDifferenceKernel &&) = default; - /** Allow instances of this class to be moved */ - CLSquaredDifferenceKernel &operator=(CLSquaredDifferenceKernel &&) = default; - /** Initialize the kernel's input, output. - * - * @param[in] input1 Source tensor1. - * @param[in] input2 Source tensor2. - * @param[out] output Output tensor. - */ - void configure(const ICLTensor *input1, const ICLTensor *input2, ICLTensor *output); - - // Inherited methods overridden: - void run(const Window &window, cl::CommandQueue &queue) override; - - BorderSize border_size() const override; - -private: - const ICLTensor *_input1; - const ICLTensor *_input2; - ICLTensor *_output; -}; -} // namespace arm_compute -#endif /*__ARM_COMPUTE_CLSQUARED_DIFFERENCE_KERNEL_H__ */ diff --git a/libs/ARMComputeEx/arm_compute/core/CL/kernels/CLStridedSliceExKernel.h b/libs/ARMComputeEx/arm_compute/core/CL/kernels/CLStridedSliceExKernel.h deleted file mode 100644 index 6368c380e..000000000 --- a/libs/ARMComputeEx/arm_compute/core/CL/kernels/CLStridedSliceExKernel.h +++ /dev/null @@ -1,142 +0,0 @@ -/* - * Copyright (c) 2018 Samsung Electronics Co., Ltd. All Rights Reserved - * Copyright (c) 2016-2018 ARM Limited. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -/** - * @file CLStridedSliceExKernel.h - * @ingroup COM_AI_RUNTIME - * @brief This file defines CLStridedSliceExKernel class - */ - -#ifndef __ARM_COMPUTE_CLSTRIDEDSLICEEXKERNEL_H__ -#define __ARM_COMPUTE_CLSTRIDEDSLICEEXKERNEL_H__ - -#include "arm_compute/core/CL/ICLKernel.h" - -namespace arm_compute -{ -class ICLTensor; - -/** -* @brief Class to define an interface for the kernel to extract a strided slice of a tensor -*/ -class CLStridedSliceExKernel : public ICLKernel -{ -public: - /** - * @brief Construct a CLStridedSliceExKernel object - * */ - CLStridedSliceExKernel(); - - /** - * @brief Prevent instances of this class from being copied (As this class contains pointers) - * */ - CLStridedSliceExKernel(const CLStridedSliceExKernel &) = delete; - - /** - * @brief Prevent instances of this class from being copied (As this class contains pointers) - * */ - CLStridedSliceExKernel &operator=(const CLStridedSliceExKernel &) = delete; - - /** - * @brief Construct a CLStridedSliceExKernel object by using default move constructor - * @param[in] CLStridedSliceExKernel object to move - * */ - CLStridedSliceExKernel(CLStridedSliceExKernel &&) = default; - - /** - * @brief Move assignment operator - * @param[in] CLStridedSliceExKernel object to move - * */ - CLStridedSliceExKernel &operator=(CLStridedSliceExKernel &&) = default; - - /** - * @brief Destruct this object - * */ - ~CLStridedSliceExKernel() = default; - - /** - * @brief Set the input and output of the kernel - * @param[in] input Source tensor. Data type supported: - * U8/S8/QASYMM8/U16/S16/U32/S32/F16/F32 - * @param[out] output Destination tensor. Data type supported: Same as @p input - * @param[in] beginData The begin tensor. Data types supported: S32. - * The number of dimensions must be 1. - * The length must be the same as the number of dimensions of input. - * @param[in] endData The end tensor. Data types supported: S32. - * The number of dimensions must be 1. - * The length must be the same as the number of dimensions of input. - * @param[in] strideData The stride tensor. Data types supported: S32. - * The number of dimensions must be 1. - * The length must be the same as the number of dimensions of input. - * @param[in] beginMask Mask for begin - * @param[in] endMask Mask for end - * @param[in] shrinkAxisMask Mask for shrink axis. - * @return N/A - */ - void configure(const ICLTensor *input, ICLTensor *output, ICLTensor *beginData, - ICLTensor *endData, ICLTensor *stridesData, int32_t beginMask, int32_t endMask, - int32_t shrinkAxisMask); - - /** - * @brief Static function to check if given info will lead to a valid configuration of @ref - * CLStridedSliceExKernel - * @param[in] input The input tensor info. Data types supported: - * U8/S8/QASYMM8/U16/S16/U32/S32/F16/F32 - * @param[in] output The output tensor info, Data types supported: same as @p input1. - * @param[in] begin The begin tensor info. Data types supported: S32. - * The number of dimensions must be 1. - * The length must be the same as the number of dimensions of input. - * @param[in] end The end tensor info. Data types supported: S32. - * The number of dimensions must be 1. - * The length must be the same as the number of dimensions of input. - * @param[in] stride The stride tensor info. Data types supported: S32. - * The number of dimensions must be 1. - * The length must be the same as the number of dimensions of input. - * @param[in] beginMask Mask for begin - * @param[in] endMask Mask for end - * @param[in] shrinkAxisMask Mask for shrink axis. - * @return a status - */ - static Status validate(const ITensorInfo *input, const ITensorInfo *output, - const ITensorInfo *begin, const ITensorInfo *end, - const ITensorInfo *stride, int32_t beginMask, int32_t endMask, - int32_t shrinkAxisMask); - - /** - * @brief Enqueue the OpenCL kernel to process the given window on the passed OpenCL command - * queue. - * @note The queue is *not* flushed by this method, and therefore the kernel will not have - * been executed by the time this method returns. - * @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.@return N/A - * @return N/A - */ - void run(const Window &window, cl::CommandQueue &queue) override; - -private: - const ICLTensor *_input; /** Source tensor */ - ICLTensor *_output; /** Destination tensor */ - ICLTensor *_beginData; /** Start indices of input tensor */ - ICLTensor *_endData; /** Stop indices of input tensor */ - ICLTensor *_stridesData; /** Strides tensor */ - int32_t _beginMask; /** Begin mask */ - int32_t _endMask; /** End mask */ - int32_t _shrinkAxisMask; /** Shrink axis mask */ -}; -} // namespace arm_compute -#endif /*__ARM_COMPUTE_CLSTRIDEDSLICEEXKERNEL_H__ */ diff --git a/libs/ARMComputeEx/arm_compute/core/CL/kernels/CLTopKV2Kernel.h b/libs/ARMComputeEx/arm_compute/core/CL/kernels/CLTopKV2Kernel.h deleted file mode 100644 index eb2bad254..000000000 --- a/libs/ARMComputeEx/arm_compute/core/CL/kernels/CLTopKV2Kernel.h +++ /dev/null @@ -1,653 +0,0 @@ -/* - * Copyright (c) 2018 Samsung Electronics Co., Ltd. All Rights Reserved - * Copyright (c) 2016-2018 ARM Limited. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -/** - * @file CLTopKV2Kernel.h - * @brief This file defines classes for TopKV2Kernel - * @ingroup COM_AI_RUNTIME - */ - -#ifndef __ARM_COMPUTE_CLTOPKV2KERNEL_H__ -#define __ARM_COMPUTE_CLTOPKV2KERNEL_H__ - -#include "arm_compute/core/CL/ICLKernel.h" - -// these parameters can be changed -#define _ITEMS 16 // number of items in a group -#define _GROUPS 4 // the number of virtual processors is _ITEMS * _GROUPS -#define _HISTOSPLIT (_ITEMS * _GROUPS / 2) // number of splits of the histogram -#define PERMUT // store the final permutation -//////////////////////////////////////////////////////// - -namespace arm_compute -{ -class ICLTensor; - -/** - * @brief Class to define CLTopKV2Single - */ -class CLTopKV2Single : public ICLKernel -{ -public: - /** - * @brief Constructor - */ - CLTopKV2Single(); - /** - * @brief Prevent instances of this class from being copied (As this class contains pointers). - * @param [in] copiedInstance Const reference of CLTopKV2Single to be copied - */ - CLTopKV2Single(const CLTopKV2Single &) = delete; - /** - * @brief Prevent instances of this class from being copied (As this class contains pointers). - * @param [in] copiedInstance Const reference of CLTopKV2Single to be copied - * @return Reference of this instance - */ - CLTopKV2Single &operator=(const CLTopKV2Single &) = delete; - /** - * @brief Allow instances of this class to be moved - * @param [in] movedInstance Rvalue reference of CLTopKV2Single to be moved - */ - CLTopKV2Single(CLTopKV2Single &&) = default; - /** - * @brief Allow instances of this class to be moved - * @param [in] movedInstance Rvalue reference of CLTopKV2Single to be moved - * @return Reference of this instance - */ - CLTopKV2Single &operator=(CLTopKV2Single &&) = default; - - /** - * @brief Initialise kernel with params - * @param[in] input An input tensor - * @param[in] topk_values Values of the top k predictions - * @param[in] topk_indices Indices of the top k predictions - * @param[in] indices Indices - * @param[in] temp_stack Temp stack - * @param[in] k K of the top k predictions - * @param[in] n Number times to quick-sort - * return N/A - */ - void configure(ICLTensor *input, ICLTensor *topk_values, ICLTensor *topk_indices, - cl::Buffer *indices, cl::Buffer *temp_stack, int k, int n); - - /* - * @brief Run CLTopKV2Single op - * @param[in] window Window to be used for in_slice - * @param[in] queue cl::CommandQueue - * @return N/A - */ - void run(const Window &window, cl::CommandQueue &queue) override; - -private: - ICLTensor *_input; - ICLTensor *_topk_values; - ICLTensor *_topk_indices; -}; - -/** - * @brief Class to define CLTopKV2Init - */ -class CLTopKV2Init : public ICLKernel -{ -public: - /** - * @brief Constructor - */ - CLTopKV2Init(); - /** - * @brief Prevent instances of this class from being copied (As this class contains pointers). - * @param [in] copiedInstance Const reference of CLTopKV2Init to be copied - */ - CLTopKV2Init(const CLTopKV2Init &) = delete; - /** - * @brief Prevent instances of this class from being copied (As this class contains pointers). - * @param [in] copiedInstance Const reference of CLTopKV2Init to be copied - * @return Reference of this instance - */ - CLTopKV2Init &operator=(const CLTopKV2Init &) = delete; - /** - * @brief Allow instances of this class to be moved - * @param [in] movedInstance Rvalue reference of CLTopKV2Init to be moved - */ - CLTopKV2Init(CLTopKV2Init &&) = default; - /** - * @brief Allow instances of this class to be moved - * @param [in] movedInstance Rvalue reference of CLTopKV2Init to be moved - * @return Reference of this instance - */ - CLTopKV2Init &operator=(CLTopKV2Init &&) = default; - - /** - * @brief Initialise kernel with params - * @param[in] input An input tensor - * @param[in] in_key_buf Buffer of input key - * @param[in] in_ind_buf Buffer of input index - * @param[in] n Number times to quick-sort - * return N/A - */ - void configure(ICLTensor *input, cl::Buffer *in_key_buf, cl::Buffer *in_ind_buf, int n); - - /* - * @brief Run CLTopKV2Init op - * @param[in] window Window to be used for in_slice - * @param[in] queue cl::CommandQueue - * @return N/A - */ - void run(const Window &window, cl::CommandQueue &queue) override; - -private: - ICLTensor *_input; -}; - -/** - * @brief Class to define CLRadixSortHistogram - */ -class CLRadixSortHistogram : public ICLKernel -{ -public: - /** - * @brief Constructor - */ - CLRadixSortHistogram(); - /** - * @brief Prevent instances of this class from being copied (As this class contains pointers). - * @param [in] copiedInstance Const reference of CLRadixSortHistogram to be copied - */ - CLRadixSortHistogram(const CLRadixSortHistogram &) = delete; - /** - * @brief Prevent instances of this class from being copied (As this class contains pointers). - * @param [in] copiedInstance Const reference of CLRadixSortHistogram to be copied - * @return Reference of this instance - */ - CLRadixSortHistogram &operator=(const CLRadixSortHistogram &) = delete; - /** - * @brief Allow instances of this class to be moved - * @param [in] movedInstance Rvalue reference of CLRadixSortHistogram to be moved - */ - CLRadixSortHistogram(CLRadixSortHistogram &&) = default; - /** - * @brief Allow instances of this class to be moved - * @param [in] movedInstance Rvalue reference of CLRadixSortHistogram to be moved - * @return Reference of this instance - */ - CLRadixSortHistogram &operator=(CLRadixSortHistogram &&) = default; - - /** - * @brief Initialise kernel with params - * @param[out] hist_buf Buffer of histogram - * @param[in] bits Number of bits to be used for radix sort - * @param[in] n Integer number size to sort - * return N/A - */ - void configure(cl::Buffer *hist_buf, int bits, int n); - - /** - * @brief Set pass - * @param[in] pass Passes made of in radix sort algorithm - * @param[in] in_key_buf Buffer of input key - * return N/A - */ - void setPass(int pass, cl::Buffer *in_key_buf) - { - _pass = pass; - _in_key_buf = in_key_buf; - } - - /* - * @brief Run CLRadixSortHistogram op - * @param[in] window Window to be used for in_slice - * @param[in] queue cl::CommandQueue - * @return N/A - */ - void run(const Window &window, cl::CommandQueue &queue) override; - -private: - int _pass; - cl::Buffer *_in_key_buf; -}; - -/** - * @brief Class to define CLRadixSortScanHistogram - */ -class CLRadixSortScanHistogram : public ICLKernel -{ -public: - /** - * @brief Constructor - */ - CLRadixSortScanHistogram(); - /** - * @brief Prevent instances of this class from being copied (As this class contains pointers). - * @param [in] copiedInstance Const reference of CLRadixSortScanHistogram to be copied - */ - CLRadixSortScanHistogram(const CLRadixSortScanHistogram &) = delete; - /** - * @brief Prevent instances of this class from being copied (As this class contains pointers). - * @param [in] copiedInstance Const reference of CLRadixSortScanHistogram to be copied - * @return Reference of this instance - */ - CLRadixSortScanHistogram &operator=(const CLRadixSortScanHistogram &) = delete; - /** - * @brief Allow instances of this class to be moved - * @param [in] movedInstance Rvalue reference of CLRadixSortScanHistogram to be moved - */ - CLRadixSortScanHistogram(CLRadixSortScanHistogram &&) = default; - /** - * @brief Allow instances of this class to be moved - * @param [in] movedInstance Rvalue reference of CLRadixSortScanHistogram to be moved - * @return Reference of this instance - */ - CLRadixSortScanHistogram &operator=(CLRadixSortScanHistogram &&) = default; - - /** - * @brief Initialise kernel with params - * @param[out] hist_buf Buffer of histogram - * @param[out] glob_sum_buf Buffer of global sum - * @param[in] bits Number of bits to be used for radix sort - * return N/A - */ - void configure(cl::Buffer *hist_buf, cl::Buffer *glob_sum_buf, int bits); - - /* - * @brief Run CLRadixSortScanHistogram op - * @param[in] window Window to be used for in_slice - * @param[in] queue cl::CommandQueue - * @return N/A - */ - void run(const Window &window, cl::CommandQueue &queue) override; -}; - -/** - * @brief Class to define CLRadixSortGlobalScanHistogram - */ -class CLRadixSortGlobalScanHistogram : public ICLKernel -{ -public: - /** - * @brief Constructor - */ - CLRadixSortGlobalScanHistogram(); - /** - * @brief Prevent instances of this class from being copied (As this class contains pointers). - * @param [in] copiedInstance Const reference of CLRadixSortGlobalScanHistogram to be copied - */ - CLRadixSortGlobalScanHistogram(const CLRadixSortGlobalScanHistogram &) = delete; - /** - * @brief Prevent instances of this class from being copied (As this class contains pointers). - * @param [in] copiedInstance Const reference of CLRadixSortGlobalScanHistogram to be copied - * @return Reference of this instance - */ - CLRadixSortGlobalScanHistogram &operator=(const CLRadixSortGlobalScanHistogram &) = delete; - /** - * @brief Allow instances of this class to be moved - * @param [in] movedInstance Rvalue reference of CLRadixSortGlobalScanHistogram to be moved - */ - CLRadixSortGlobalScanHistogram(CLRadixSortGlobalScanHistogram &&) = default; - /** - * @brief Allow instances of this class to be moved - * @param [in] movedInstance Rvalue reference of CLRadixSortGlobalScanHistogram to be moved - * @return Reference of this instance - */ - CLRadixSortGlobalScanHistogram &operator=(CLRadixSortGlobalScanHistogram &&) = default; - - /** - * @brief Initialise kernel with params - * @param[out] glob_sum_buf Buffer of global sum - * @param[out] temp_buf Temp buffer to be used while RadixSortGlobalScanHistogram - * @param[in] bits Number of bits to be used for radix sort - * return N/A - */ - void configure(cl::Buffer *glob_sum_buf, cl::Buffer *temp_buf, int bits); - - /* - * @brief Run CLRadixSortGlobalScanHistogram op - * @param[in] window Window to be used for in_slice - * @param[in] queue cl::CommandQueue - * @return N/A - */ - void run(const Window &window, cl::CommandQueue &queue) override; -}; - -/** - * @brief Class to define CLRadixSortPasteHistogram - */ -class CLRadixSortPasteHistogram : public ICLKernel -{ -public: - /** - * @brief Constructor - */ - CLRadixSortPasteHistogram(); - /** - * @brief Prevent instances of this class from being copied (As this class contains pointers). - * @param [in] copiedInstance Const reference of CLRadixSortPasteHistogram to be copied - */ - CLRadixSortPasteHistogram(const CLRadixSortPasteHistogram &) = delete; - /** - * @brief Prevent instances of this class from being copied (As this class contains pointers). - * @param [in] copiedInstance Const reference of CLRadixSortPasteHistogram to be copied - * @return Reference of this instance - */ - CLRadixSortPasteHistogram &operator=(const CLRadixSortPasteHistogram &) = delete; - /** - * @brief Allow instances of this class to be moved - * @param [in] movedInstance Rvalue reference of CLRadixSortPasteHistogram to be moved - */ - CLRadixSortPasteHistogram(CLRadixSortPasteHistogram &&) = default; - /** - * @brief Allow instances of this class to be moved - * @param [in] movedInstance Rvalue reference of CLRadixSortPasteHistogram to be moved - * @return Reference of this instance - */ - CLRadixSortPasteHistogram &operator=(CLRadixSortPasteHistogram &&) = default; - - /** - * @brief Initialise kernel with params - * @param[out] hist_buf Buffer of histogram - * @param[out] glob_sum_buf Buffer of global sum - * @param[in] bits Number of bits to be used for radix sort - * return N/A - */ - void configure(cl::Buffer *hist_buf, cl::Buffer *glob_sum_buf, int bits); - - /* - * @brief Run CLRadixSortPasteHistogram op - * @param[in] window Window to be used for in_slice - * @param[in] queue cl::CommandQueue - * @return N/A - */ - void run(const Window &window, cl::CommandQueue &queue) override; -}; - -/** - * @brief Class to define CLRadixSortReorder - */ -class CLRadixSortReorder : public ICLKernel -{ -public: - /** - * @brief Constructor - */ - CLRadixSortReorder(); - /** - * @brief Prevent instances of this class from being copied (As this class contains pointers). - * @param [in] copiedInstance Const reference of CLRadixSortReorder to be copied - */ - CLRadixSortReorder(const CLRadixSortReorder &) = delete; - /** - * @brief Prevent instances of this class from being copied (As this class contains pointers). - * @param [in] copiedInstance Const reference of CLRadixSortReorder to be copied - * @return Reference of this instance - */ - CLRadixSortReorder &operator=(const CLRadixSortReorder &) = delete; - /** - * @brief Allow instances of this class to be moved - * @param [in] movedInstance Rvalue reference of CLRadixSortReorder to be moved - */ - CLRadixSortReorder(CLRadixSortReorder &&) = default; - /** - * @brief Allow instances of this class to be moved - * @param [in] movedInstance Rvalue reference of CLRadixSortReorder to be moved - * @return Reference of this instance - */ - CLRadixSortReorder &operator=(CLRadixSortReorder &&) = default; - - /** - * @brief Initialise kernel with params - * @param[out] hist_buf Buffer of histogram - * @param[in] bits Number of bits to be used for radix sort - * @param[in] n Integer number size to sort - * return N/A - */ - void configure(cl::Buffer *hist_buf, int bits, int n); - - /** - * @brief Set pass - * @param[in] pass Passes made of in radix sort algorithm - * @param[in] in_key_buf Buffer of input key - * @param[out] out_key_buf Buffer of output key - * @param[in] in_ind_buf Buffer of input index - * @param[out] out_ind_buf Buffer of output index - * return N/A - */ - void setPass(int pass, cl::Buffer *in_key_buf, cl::Buffer *out_key_buf, cl::Buffer *in_ind_buf, - cl::Buffer *out_ind_buf) - { - _pass = pass; - _in_key_buf = in_key_buf; - _out_key_buf = out_key_buf; - _in_ind_buf = in_ind_buf; - _out_ind_buf = out_ind_buf; - } - /* - * @brief Run CLRadixSortReorder op - * @param[in] window Window to be used for in_slice - * @param[in] queue cl::CommandQueue - * @return N/A - */ - void run(const Window &window, cl::CommandQueue &queue) override; - -private: - int _pass; - cl::Buffer *_in_key_buf; - cl::Buffer *_out_key_buf; - cl::Buffer *_in_ind_buf; - cl::Buffer *_out_ind_buf; -}; - -/** - * @brief Class to define CLTopKV2FindFirstNegative - */ -class CLTopKV2FindFirstNegative : public ICLKernel -{ -public: - /** - * @brief Constructor - */ - CLTopKV2FindFirstNegative(); - /** - * @brief Prevent instances of this class from being copied (As this class contains pointers). - * @param [in] copiedInstance Const reference of CLTopKV2FindFirstNegative to be copied - */ - CLTopKV2FindFirstNegative(const CLTopKV2FindFirstNegative &) = delete; - /** - * @brief Prevent instances of this class from being copied (As this class contains pointers). - * @param [in] copiedInstance Const reference of CLTopKV2FindFirstNegative to be copied - * @return Reference of this instance - */ - CLTopKV2FindFirstNegative &operator=(const CLTopKV2FindFirstNegative &) = delete; - /** - * @brief Allow instances of this class to be moved - * @param [in] movedInstance Rvalue reference of CLTopKV2FindFirstNegative to be moved - */ - CLTopKV2FindFirstNegative(CLTopKV2FindFirstNegative &&) = default; - /** - * @brief Allow instances of this class to be moved - * @param [in] movedInstance Rvalue reference of CLTopKV2FindFirstNegative to be moved - * @return Reference of this instance - */ - CLTopKV2FindFirstNegative &operator=(CLTopKV2FindFirstNegative &&) = default; - - /** - * @brief Initialise kernel with params - * @param[out] first_negative_idx_buf Buffer of the first negative index - * @param[in] n Number times to find - * return N/A - */ - void configure(cl::Buffer *first_negative_idx_buf, int n); - - /** - * @brief Set output buffer - * @param[out] out_key_buf Buffer of output key - * return N/A - */ - void setOutputBuffer(cl::Buffer *out_key_buf) { _out_key_buf = out_key_buf; } - - /* - * @brief Run CLTopKV2FindFirstNegative op - * @param[in] window Window to be used for in_slice - * @param[in] queue cl::CommandQueue - * @return N/A - */ - void run(const Window &window, cl::CommandQueue &queue) override; - -private: - cl::Buffer *_out_key_buf; -}; - -/** - * @brief Class to define CLTopKV2ReorderNegatives - */ -class CLTopKV2ReorderNegatives : public ICLKernel -{ -public: - /** - * @brief Constructor - */ - CLTopKV2ReorderNegatives(); - /** - * @brief Prevent instances of this class from being copied (As this class contains pointers). - * @param [in] copiedInstance Const reference of CLTopKV2ReorderNegatives to be copied - */ - CLTopKV2ReorderNegatives(const CLTopKV2ReorderNegatives &) = delete; - /** - * @brief Prevent instances of this class from being copied (As this class contains pointers). - * @param [in] copiedInstance Const reference of CLTopKV2ReorderNegatives to be copied - * @return Reference of this instance - */ - CLTopKV2ReorderNegatives &operator=(const CLTopKV2ReorderNegatives &) = delete; - /** - * @brief Allow instances of this class to be moved - * @param [in] movedInstance Rvalue reference of CLTopKV2ReorderNegatives to be moved - */ - CLTopKV2ReorderNegatives(CLTopKV2ReorderNegatives &&) = default; - /** - * @brief Allow instances of this class to be moved - * @param [in] movedInstance Rvalue reference of CLTopKV2ReorderNegatives to be moved - * @return Reference of this instance - */ - CLTopKV2ReorderNegatives &operator=(CLTopKV2ReorderNegatives &&) = default; - - /** - * @brief Initialise kernel with params - * @param[out] first_negative_idx_buf Buffer of the first negative index - * @param[in] n Number times to find - * return N/A - */ - void configure(cl::Buffer *first_negative_idx_buf, int n); - - /** - * @brief Set buffers - * @param[in] in_key_buf Buffer of input key - * @param[out] out_key_buf Buffer of output key - * @param[in] in_ind_buf Buffer of input index - * @param[out] out_ind_buf Buffer of output index - * return N/A - */ - void setBuffers(cl::Buffer *in_key_buf, cl::Buffer *out_key_buf, cl::Buffer *in_ind_buf, - cl::Buffer *out_ind_buf) - { - _in_key_buf = in_key_buf; - _out_key_buf = out_key_buf; - _in_ind_buf = in_ind_buf; - _out_ind_buf = out_ind_buf; - } - - /* - * @brief Run CLTopKV2ReorderNegatives op - * @param[in] window Window to be used for in_slice - * @param[in] queue cl::CommandQueue - * @return N/A - */ - void run(const Window &window, cl::CommandQueue &queue) override; - -private: - cl::Buffer *_in_key_buf; - cl::Buffer *_out_key_buf; - cl::Buffer *_in_ind_buf; - cl::Buffer *_out_ind_buf; -}; - -/** - * @brief Class to define CLTopKV2Store - */ -class CLTopKV2Store : public ICLKernel -{ -public: - /** - * @brief Constructor - */ - CLTopKV2Store(); - /** - * @brief Prevent instances of this class from being copied (As this class contains pointers). - * @param [in] copiedInstance Const reference of CLTopKV2Store to be copied - */ - CLTopKV2Store(const CLTopKV2Store &) = delete; - /** - * @brief Prevent instances of this class from being copied (As this class contains pointers). - * @param [in] copiedInstance Const reference of CLTopKV2Store to be copied - * @return Reference of this instance - */ - CLTopKV2Store &operator=(const CLTopKV2Store &) = delete; - /** - * @brief Allow instances of this class to be moved - * @param [in] movedInstance Rvalue reference of CLTopKV2Store to be moved - */ - CLTopKV2Store(CLTopKV2Store &&) = default; - /** - * @brief Allow instances of this class to be moved - * @param [in] movedInstance Rvalue reference of CLTopKV2Store to be moved - * @return Reference of this instance - */ - CLTopKV2Store &operator=(CLTopKV2Store &&) = default; - - /** - * @brief Initialise kernel with params - * @param[out] values Values tensor to store - * @param[out] indices Indices tensor to be used for store - * @param[in] k K of the top k predictions - * @param[in] n Number times to store - * return N/A - */ - void configure(ICLTensor *values, ICLTensor *indices, int k, int n); - - /** - * @brief Set buffers - * @param[out] out_key_buf Buffer of output key - * @param[out] out_ind_buf Buffer of output index - * return N/A - */ - void setOutputBuffers(cl::Buffer *out_key_buf, cl::Buffer *out_ind_buf); - - /* - * @brief Run CLTopKV2Store op - * @param[in] window Window to be used for in_slice - * @param[in] queue cl::CommandQueue - * @return N/A - */ - void run(const Window &window, cl::CommandQueue &queue) override; - -private: - ICLTensor *_values; - ICLTensor *_indices; - cl::Buffer *_out_key_buf; - cl::Buffer *_out_ind_buf; -}; - -} // namespace arm_compute - -#endif // __ARM_COMPUTE_CLTOPKV2KERNEL_H__ diff --git a/libs/ARMComputeEx/arm_compute/core/NEON/kernels/NENormalizationLayerExKernel.h b/libs/ARMComputeEx/arm_compute/core/NEON/kernels/NENormalizationLayerExKernel.h deleted file mode 100644 index f7bf72985..000000000 --- a/libs/ARMComputeEx/arm_compute/core/NEON/kernels/NENormalizationLayerExKernel.h +++ /dev/null @@ -1,113 +0,0 @@ -/* - * Copyright (c) 2018 Samsung Electronics Co., Ltd. All Rights Reserved - * Copyright (c) 2016-2018 ARM Limited. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -#ifndef __ARM_COMPUTE_NENORMALIZATIONLAYEREXKERNEL_H__ -#define __ARM_COMPUTE_NENORMALIZATIONLAYEREXKERNEL_H__ - -#include "arm_compute/core/NEON/INEKernel.h" - -namespace arm_compute -{ -class ITensor; - -/** Interface for the normalization layer kernel. - */ -class NENormalizationLayerExKernel : public INEKernel -{ -public: - const char *name() const override { return "NENormalizationLayerKernel"; } - /** Default constructor */ - NENormalizationLayerExKernel(); - /** Prevent instances of this class from being copied (As this class contains pointers) */ - NENormalizationLayerExKernel(const NENormalizationLayerExKernel &) = delete; - /** Prevent instances of this class from being copied (As this class contains pointers) */ - NENormalizationLayerExKernel &operator=(const NENormalizationLayerExKernel &) = delete; - /** Default Move Constructor. */ - NENormalizationLayerExKernel(NENormalizationLayerExKernel &&) = default; - /** Default move assignment operator */ - NENormalizationLayerExKernel &operator=(NENormalizationLayerExKernel &&) = default; - /** Default destructor */ - ~NENormalizationLayerExKernel() = 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: FP16/F32. - * @param[in] input_squared Source with each element has been squared. 3 lower dims represent a - * single input with dimensions [width, height, IFM], - * Data type supported: same as @p input - * @param[out] output Destination tensor. Output will have the same number of dimensions as - * input. Data type supported: same as @p input - * @param[in] norm_info Normalization layer information like the normalization type, - * normalization size and other parameters. - */ - void configure(const ITensor *input, const ITensor *input_squared, ITensor *output, - NormalizationLayerInfo norm_info); - /** Static function to check if given info will lead to a valid configuration of @ref - * NENormalizationLayerKernel - * - * @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: FP16/F32. - * @param[in] input_squared Source with each element has been squared. 3 lower dims represent a - * single input with dimensions [width, height, IFM], - * Data type supported: same as @p input - * @param[in] output Destination tensor. Output will have the same number of dimensions as - * input. Data type supported: same as @p input - * @param[in] norm_info Normalization layer information like the normalization type, - * normalization size and other parameters. - * - * @return a status - */ - static Status validate(const ITensorInfo *input, const ITensorInfo *input_squared, - const ITensorInfo *output, NormalizationLayerInfo norm_info); - - // Inherited methods overridden: - void run(const Window &window, const ThreadInfo &info) override; - BorderSize border_size() const override; - -private: - /** Function to perform normalization depending on the given template - * dimension. The second template parameter specifies whether the - * normalization has to be 1D or 2D. - * - * @note Only supported normalizations are: - * - 1D over X or Z - * - 2D over X and Y - * - * @param[in] window Region on which to execute the kernel. - */ - template <DataType dt, unsigned int dim, bool do_2D_norm> - void normalize_float(const Window &window); - - /** Common signature for all the specialised normalization functions - * - * @param[in] window Region on which to execute the kernel. - */ - using NormalizationFunctionEx = void (NENormalizationLayerExKernel::*)(const Window &window); - -private: - NormalizationFunctionEx _func; - const ITensor *_input; - const ITensor *_input_squared; - ITensor *_output; - NormalizationLayerInfo _norm_info; - BorderSize _border_size; -}; -} // namespace arm_compute -#endif /*__ARM_COMPUTE_NENORMALIZATIONLAYEREXKERNEL_H__ */ diff --git a/libs/ARMComputeEx/arm_compute/core/TypesEx.h b/libs/ARMComputeEx/arm_compute/core/TypesEx.h deleted file mode 100644 index 8381f1cc6..000000000 --- a/libs/ARMComputeEx/arm_compute/core/TypesEx.h +++ /dev/null @@ -1,100 +0,0 @@ -/* - * Copyright (c) 2018 Samsung Electronics Co., Ltd. All Rights Reserved - * Copyright (c) 2016-2018 ARM Limited. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -#ifndef __ARM_COMPUTE_TYPESEX_H__ -#define __ARM_COMPUTE_TYPESEX_H__ - -#include <cmath> -#include <cstddef> -#include <cstdint> -#include <string> -#include <utility> - -namespace arm_compute -{ - -/** Available ArgIndex operations **/ -enum class ArgOperation -{ - MAX, - MIN, -}; - -/** Available reduce operations */ -enum class ReduceOperation -{ - MAX, /**< Max */ - MEAN, /**< Mean */ - SUM, /**< Sum */ - MIN, /**< Min */ -}; - -/** Available binary logical operations */ -enum class BinaryLogicalOperation -{ - AND, /**< AND */ - OR, /**< OR */ -}; - -enum class ComparisonOperation -{ - EQUAL, /**< EQUAL */ - NOT_EQUAL, /**< NOT_EQUAL */ -}; - -/** Activation Layer Information class */ -class ActivationLayerInfoEx -{ -public: - /** Available activation functions */ - enum class ActivationFunction - { - RSQRT /**< Inverse Square root ( \f$ f(x) = \rsqrt{x} \f$ )*/ - }; - - ActivationLayerInfoEx() = default; - /** Default Constructor - * - * @param[in] f The activation function to use. - * @param[in] a (Optional) The alpha parameter used by some activation functions - * (@ref ActivationFunction::BOUNDED_RELU, @ref ActivationFunction::LU_BOUNDED_RELU, - * @ref ActivationFunction::LINEAR, @ref ActivationFunction::TANH). - * @param[in] b (Optional) The beta parameter used by some activation functions (@ref - * ActivationFunction::LINEAR, @ref ActivationFunction::LU_BOUNDED_RELU, @ref - * ActivationFunction::TANH). - */ - ActivationLayerInfoEx(ActivationFunction f, float a = 0.0f, float b = 0.0f) - : _act(f), _a(a), _b(b), _enabled(true) - { - } - /** Get the type of activation function */ - ActivationFunction activation() const { return _act; } - /** Get the alpha value */ - float a() const { return _a; } - /** Get the beta value */ - float b() const { return _b; } - /** Check if initialised */ - bool enabled() const { return _enabled; } - -private: - ActivationFunction _act = {ActivationLayerInfoEx::ActivationFunction::RSQRT}; - float _a = {}; - float _b = {}; - bool _enabled = {false}; -}; - -} // namespace arm_compute -#endif /* __ARM_COMPUTE_TYPESEX_H__ */ diff --git a/libs/ARMComputeEx/arm_compute/core/UtilsEx.h b/libs/ARMComputeEx/arm_compute/core/UtilsEx.h deleted file mode 100644 index 8dd68a0c3..000000000 --- a/libs/ARMComputeEx/arm_compute/core/UtilsEx.h +++ /dev/null @@ -1,37 +0,0 @@ -/* - * Copyright (c) 2018 Samsung Electronics Co., Ltd. All Rights Reserved - * Copyright (c) 2016-2018 ARM Limited. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -#ifndef __ARM_COMPUTE_UTILSEX_H__ -#define __ARM_COMPUTE_UTILSEX_H__ - -#include "arm_compute/core/TypesEx.h" - -#include <cstdint> -#include <cstdlib> -#include <sstream> -#include <string> - -namespace arm_compute -{ -/** Translates a given activation function to a string. - * - * @param[in] act @ref ActivationLayerInfo::ActivationFunction to be translated to string. - * - * @return The string describing the activation function. - */ -const std::string &string_from_activation_func_ex(ActivationLayerInfoEx::ActivationFunction act); -} -#endif /*__ARM_COMPUTE_UTILSEX_H__ */ diff --git a/libs/ARMComputeEx/arm_compute/runtime/CL/functions/CLActivationLayerEx.h b/libs/ARMComputeEx/arm_compute/runtime/CL/functions/CLActivationLayerEx.h deleted file mode 100644 index 7e578550f..000000000 --- a/libs/ARMComputeEx/arm_compute/runtime/CL/functions/CLActivationLayerEx.h +++ /dev/null @@ -1,63 +0,0 @@ -/* - * Copyright (c) 2018 Samsung Electronics Co., Ltd. All Rights Reserved - * Copyright (c) 2016-2018 ARM Limited. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -#ifndef __ARM_COMPUTE_CLACTIVATIONLAYEREX_H__ -#define __ARM_COMPUTE_CLACTIVATIONLAYEREX_H__ - -#include "arm_compute/runtime/CL/ICLSimpleFunction.h" - -#include "arm_compute/core/TypesEx.h" - -namespace arm_compute -{ -class ICLTensor; - -/** Basic function to run @ref CLActivationLayerExKernel - * - * @note The function simulates an activation layer with the specified activation function. - */ -class CLActivationLayerEx : public ICLSimpleFunction -{ -public: - /** Set the input and output tensor. - * - * @note If the output tensor is a nullptr or is equal to the input, 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: - * QASYMM8/F16/F32. - * @param[out] output Destination tensor. Data type supported: same as @p input - * @param[in] act_info Activation layer parameters. - */ - void configure(ICLTensor *input, ICLTensor *output, ActivationLayerInfoEx act_info); - /** Static function to check if given info will lead to a valid configuration of @ref - * CLActivationLayer - * - * @param[in] input Source tensor info. In case of @p output tensor info = nullptr, this tensor - * will store the result - * of the activation function. Data types supported: QASYMM8/F16/F32. - * @param[in] output Destination tensor info. Data type supported: same as @p input - * @param[in] act_info Activation layer information. - * - * @return a status - */ - static Status validate(const ITensorInfo *input, const ITensorInfo *output, - const ActivationLayerInfoEx &act_info); -}; -} -#endif /* __ARM_COMPUTE_CLACTIVATIONLAYEREX_H__ */ diff --git a/libs/ARMComputeEx/arm_compute/runtime/CL/functions/CLArgMinMax.h b/libs/ARMComputeEx/arm_compute/runtime/CL/functions/CLArgMinMax.h deleted file mode 100644 index 8044c58af..000000000 --- a/libs/ARMComputeEx/arm_compute/runtime/CL/functions/CLArgMinMax.h +++ /dev/null @@ -1,114 +0,0 @@ -/* - * Copyright (c) 2018 Samsung Electronics Co., Ltd. All Rights Reserved - * Copyright (c) 2017 ARM Limited. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -/** - * @file CLArgMinMax.h - * @ingroup COM_AI_RUNTIME - * @brief This file contains arm_compute::CLArgMinMax class - */ - -#ifndef __ARM_COMPUTE_CLARG_MIN_MAX_H__ -#define __ARM_COMPUTE_CLARG_MIN_MAX_H__ - -#include "arm_compute/core/CL/kernels/CLArgMinMaxKernel.h" -#include "arm_compute/runtime/CL/CLTensor.h" -#include "arm_compute/runtime/IFunction.h" -#include "arm_compute/core/TypesEx.h" - -namespace arm_compute -{ -class ICLTensor; - -/** - * @brief Class to execute CLArgMinMax operation - */ -class CLArgMinMax : public IFunction -{ -public: - /** - * @brief Construct a new CLArgMinMax object - */ - CLArgMinMax(); - - /** - * @brief Prevent instances of this class from being copied (As this class contains pointers) - */ - CLArgMinMax(const CLArgMinMax &) = delete; - - /** - * @brief Prevent instances of this class from being copied (As this class contains pointers) - */ - CLArgMinMax &operator=(const CLArgMinMax &) = delete; - - /** - * @brief Construct a new CLArgMinMax object by using copy constructor - * @param[in] CLArgMinMax object to move - */ - CLArgMinMax(CLArgMinMax &&) = default; - - /** - * @brief Assign a CLArgMinMax object. - * @param[in] CLArgMinMax object to assign. This object will be moved. - */ - CLArgMinMax &operator=(CLArgMinMax &&) = default; - - /** - * @brief Initialise the kernel's inputs and outputs. - * @param[in] input Input tensor. Data types supported: U8/QASYMM8/S32/F32. - * @param[out] output The result of argminmaxMax operation. Data types supported: same as @p - * input. - * @param[in] axis Axis to argminmax. It must be sorted and no duplicates. - * @param[in] is_min True for ArgMin operation. - * @param[in] is_max Ture for ArgMax operation. - * @return N/A - */ - void configure(ICLTensor *input, ICLTensor *output, std::vector<uint32_t> argminmax_axis, - ArgOperation op); - - /** - * @brief Static function to check if given info will lead to a valid configuration - * @param[in] input Input tensor. Data types supported: U8/QASYMM8/S32/F32. - * @param[in] axis Axis to argminmax - * @param[out] output The result of argminmaxMax operation. Data types supported: same as @p - * input. - * @return a status - */ - static Status validate(const ITensorInfo *input, const std::vector<uint32_t> &argminmax_axis, - const ITensorInfo *output, ArgOperation op); - - /** - * @brief Run the kernels contained in the function - * This operation works on CPU on GPU depending on the value of argminmax_MAX_RUN_ON_CPU macro - * in CLArgMinMax.cpp. - * If argminmax_MAX_RUN_ON_CPU == 1, CPU runs this operation. - * Otherwise GPU runs this operation. - * @return N/A - */ - void run() override; - -private: - ICLTensor *_input; - ICLTensor *_output; - std::vector<uint32_t> _argminmax_axis; - ArgOperation _arg_op; - - std::unique_ptr<CLTensor[]> _interm_tensors{nullptr}; - std::unique_ptr<CLArgMinMaxKernel[]> _argminmax_kernels{nullptr}; - size_t _num_of_kernels; -}; -} -#endif /*__ARM_COMPUTE_CLargminmax_MAX_H__ */ diff --git a/libs/ARMComputeEx/arm_compute/runtime/CL/functions/CLArithmeticSubtractionEx.h b/libs/ARMComputeEx/arm_compute/runtime/CL/functions/CLArithmeticSubtractionEx.h deleted file mode 100644 index 34e6c6334..000000000 --- a/libs/ARMComputeEx/arm_compute/runtime/CL/functions/CLArithmeticSubtractionEx.h +++ /dev/null @@ -1,62 +0,0 @@ -/* - * Copyright (c) 2018 Samsung Electronics Co., Ltd. All Rights Reserved - * Copyright (c) 2016-2018 ARM Limited. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -#ifndef __ARM_COMPUTE_CLARITHMETICSUBTRACTIONEX_H__ -#define __ARM_COMPUTE_CLARITHMETICSUBTRACTIONEX_H__ - -#include "arm_compute/runtime/CL/ICLSimpleFunction.h" - -namespace arm_compute -{ -class ICLTensor; - -/** Basic function to run @ref CLArithmeticSubtractionExKernel - * - * @note The tensor data type for the inputs must be U8/S16/F16/F32. - * @note The function performs an arithmetic subtraction between two tensors. - */ -class CLArithmeticSubtractionEx : public ICLSimpleFunction -{ -public: - /** Initialise the kernel's inputs, output and convertion policy. - * - * @param[in, out] input1 An input tensor. Data types supported: U8/S16/F16/F32. - * The input tensor is [in, out] because its TensorInfo might be modified - * inside the kernel in case of broadcasting of dimension 0. - * @param[in, out] input2 An input tensor. Data types supported: same as @p input1. - * The input tensor is [in, out] because its TensorInfo might be modified - * inside the kernel in case of broadcasting of dimension 0. - * @param[out] output Output tensor. Data types supported: U8 (Only if both inputs are U8), - * S16/F16/F32. - * @param[in] policy Policy to use to handle overflow. - */ - void configure(ICLTensor *input1, ICLTensor *input2, ICLTensor *output, ConvertPolicy policy); - /** Static function to check if given info will lead to a valid configuration of @ref - * CLArithmeticSubtractionEx - * - * @param[in] input1 First tensor input info. Data types supported: U8/S16/F16/F32. - * @param[in] input2 Second tensor input info. Data types supported: U8/S16/F16/F32. - * @param[in] output Output tensor info. Data types supported: U8 (Only if both inputs are U8), - * S16/F16/F32. - * @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); -}; -} -#endif /* __ARM_COMPUTE_CLARITHMETICSUBTRACTIONEX_H__ */ diff --git a/libs/ARMComputeEx/arm_compute/runtime/CL/functions/CLBatchToSpaceND.h b/libs/ARMComputeEx/arm_compute/runtime/CL/functions/CLBatchToSpaceND.h deleted file mode 100644 index d16a0762d..000000000 --- a/libs/ARMComputeEx/arm_compute/runtime/CL/functions/CLBatchToSpaceND.h +++ /dev/null @@ -1,45 +0,0 @@ -/* - * Copyright (c) 2018 Samsung Electronics Co., Ltd. All Rights Reserved - * Copyright (c) 2016-2018 ARM Limited. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -#ifndef __ARM_COMPUTE_CLBATCH_TO_SPACE_ND_H__ -#define __ARM_COMPUTE_CLBATCH_TO_SPACE_ND_H__ - -#include "arm_compute/runtime/CL/ICLSimpleFunction.h" - -namespace arm_compute -{ -class ICLTensor; - -/** Basic function to run @ref CLBatchToSpaceNDKernel - * - * @note The tensor data type for the inputs must be U8/QASYMM8/S16/S32/F16/F32. - * @note The function converts the input tensor to the tensor of the output tensor's type. - */ -class CLBatchToSpaceND : public ICLSimpleFunction -{ -public: - /** Initialise the kernel's input and output. - * - * @param[in] input Input tensor. Data types supported: U8/QASYMM8/S16/S32/F16/F32. - * @param[out] output Output tensor. Data types supported: U8/QASYMM8/S16/S32/F16/F32. - * @param[in] block_size A pointer to an array of integer values specifying block sizes - * for spatial dimension. - */ - void configure(ICLTensor *input, ICLTensor *output, const int32_t *block_size); -}; - -} // namespace arm_compute -#endif /* __ARM_COMPUTE_CLBATCH_TO_SPACE_ND_H__ */ diff --git a/libs/ARMComputeEx/arm_compute/runtime/CL/functions/CLBinaryLogicalOp.h b/libs/ARMComputeEx/arm_compute/runtime/CL/functions/CLBinaryLogicalOp.h deleted file mode 100644 index 061e34f26..000000000 --- a/libs/ARMComputeEx/arm_compute/runtime/CL/functions/CLBinaryLogicalOp.h +++ /dev/null @@ -1,41 +0,0 @@ -/* - * Copyright (c) 2018 Samsung Electronics Co., Ltd. All Rights Reserved - * Copyright (c) 2016-2018 ARM Limited. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -#ifndef __ARM_COMPUTE_CLBINARYLOGICALOP_H__ -#define __ARM_COMPUTE_CLBINARYLOGICALOP_H__ - -#include "arm_compute/runtime/CL/ICLSimpleFunction.h" -#include "arm_compute/core/TypesEx.h" - -namespace arm_compute -{ -class ICLTensor; - -class CLBinaryLogicalOp : public ICLSimpleFunction -{ -public: - /** Initialise the function's source and destination. - * - * @param[in] input1 Source tensor1. Data types supported: U8, QASYMM8. - * @param[in] input2 Source tensor2. Data types supported: U8 QASYMM8. - * @param[out] output Output tensor. Data types supported: U8, QASYMM8. - */ - void configure(ICLTensor *input1, ICLTensor *input2, ICLTensor *output, - BinaryLogicalOperation op); -}; - -} // namespace arm_compute -#endif /*__ARM_COMPUTE_CLBINARYLOGICALOP_H__ */ diff --git a/libs/ARMComputeEx/arm_compute/runtime/CL/functions/CLCast.h b/libs/ARMComputeEx/arm_compute/runtime/CL/functions/CLCast.h deleted file mode 100644 index 56b8408e2..000000000 --- a/libs/ARMComputeEx/arm_compute/runtime/CL/functions/CLCast.h +++ /dev/null @@ -1,50 +0,0 @@ -/* - * Copyright (c) 2018 Samsung Electronics Co., Ltd. All Rights Reserved - * Copyright (c) 2016-2018 ARM Limited. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -/** - * @file CLCast.h - * @ingroup COM_AI_RUNTIME - * @brief This file contains arm_compute::CLCast class - */ - -#ifndef __ARM_COMPUTE_CLCAST_H__ -#define __ARM_COMPUTE_CLCAST_H__ - -#include "arm_compute/runtime/CL/ICLSimpleFunction.h" - -namespace arm_compute -{ -class ICLTensor; - -/** - * @brief Class to run @ref CLCastKernel. - * This converts the input tensor to the tensor of the output tensor's type. - */ -class CLCast : public ICLSimpleFunction -{ -public: - /** - * @brief Initialise the kernel's input and output - * @param[in, out] input Input tensor. Data types supported: U8/QASYMM8/S16/S32/F16/F32. - * The input tensor is [in, out] because its TensorInfo might be - * modified inside the kernel. - * @param[out] output Output tensor. Data types supported: U8/QASYMM8/S16/S32/F16/F32. - */ - void configure(ICLTensor *input, ICLTensor *output); -}; -} -#endif /* __ARM_COMPUTE_CLCAST_H__ */ diff --git a/libs/ARMComputeEx/arm_compute/runtime/CL/functions/CLComparisonOp.h b/libs/ARMComputeEx/arm_compute/runtime/CL/functions/CLComparisonOp.h deleted file mode 100644 index 1b0d70e7f..000000000 --- a/libs/ARMComputeEx/arm_compute/runtime/CL/functions/CLComparisonOp.h +++ /dev/null @@ -1,42 +0,0 @@ -/* - * Copyright (c) 2018 Samsung Electronics Co., Ltd. All Rights Reserved - * Copyright (c) 2016-2018 ARM Limited. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -#ifndef __ARM_COMPUTE_CLCOMPARISON_OP_H__ -#define __ARM_COMPUTE_CLCOMPARISON_OP_H__ - -#include "arm_compute/runtime/CL/ICLSimpleFunction.h" -#include "arm_compute/core/TypesEx.h" - -namespace arm_compute -{ -class ICLTensor; - -class CLComparisonOp : public ICLSimpleFunction -{ -public: - /** Initialise the function's source and destination. - * - * @param[in] input1 Source tensor1. Data types supported: - * U8/S8/QASYMM8/U16/S16/F16/U32/S32/F32. - * @param[in] input2 Source tensor2. Data types supported: - * U8/S8/QASYMM8/U16/S16/F16/U32/S32/F32. - * @param[out] output Output tensor. Data types supported: Same as @p input. - */ - void configure(ICLTensor *input1, ICLTensor *input2, ICLTensor *output, - const ComparisonOperation &op); -}; -} // namespace arm_compute -#endif /*__ARM_COMPUTE_CLCOMPARISON_OP_H__ */ diff --git a/libs/ARMComputeEx/arm_compute/runtime/CL/functions/CLDepthToSpace.h b/libs/ARMComputeEx/arm_compute/runtime/CL/functions/CLDepthToSpace.h deleted file mode 100644 index d78a6ada4..000000000 --- a/libs/ARMComputeEx/arm_compute/runtime/CL/functions/CLDepthToSpace.h +++ /dev/null @@ -1,44 +0,0 @@ -/* - * Copyright (c) 2018 Samsung Electronics Co., Ltd. All Rights Reserved - * Copyright (c) 2016-2018 ARM Limited. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -#ifndef __ARM_COMPUTE_CLDEPTHTOSPACE_H__ -#define __ARM_COMPUTE_CLDEPTHTOSPACE_H__ - -#include "arm_compute/runtime/CL/ICLSimpleFunction.h" - -namespace arm_compute -{ -class ICLTensor; - -/** Basic function to run @ref CLDepthToSpaceKernel - * - * @note The tensor data type for the inputs must be U8/QASYMM8/S16/S32/F16/F32. - * @note The function converts the input tensor to the tensor of the output tensor's type. - */ -class CLDepthToSpace : public ICLSimpleFunction -{ -public: - /** Initialise the kernel's input and output. - * - * @param[in] input Input tensor. Data types supported: U8/QASYMM8/S16/S32/F16/F32. - * @param[out] output Output tensor. Data types supported: U8/QASYMM8/S16/S32/F16/F32. - * @param[block_size] block size integer only - */ - void configure(ICLTensor *input, ICLTensor *output, const int32_t block_size); -}; -} // namesace arm_compute - -#endif /* __ARM_COMPUTE_CLDEPTHTOSPACE_H__ */ diff --git a/libs/ARMComputeEx/arm_compute/runtime/CL/functions/CLEmbeddingLookup.h b/libs/ARMComputeEx/arm_compute/runtime/CL/functions/CLEmbeddingLookup.h deleted file mode 100644 index 257772a89..000000000 --- a/libs/ARMComputeEx/arm_compute/runtime/CL/functions/CLEmbeddingLookup.h +++ /dev/null @@ -1,54 +0,0 @@ -/* - * Copyright (c) 2018 Samsung Electronics Co., Ltd. All Rights Reserved - * Copyright (c) 2016-2018 ARM Limited. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -/** - * @file CLEmbeddingLookup.h - * @ingroup COM_AI_RUNTIME - * @brief This file contains arm_compute::CLEmbeddingLookup class - */ - -#ifndef __ARM_COMPUTE_CLEMBEDDINGLOOKUP_H__ -#define __ARM_COMPUTE_CLEMBEDDINGLOOKUP_H__ - -#include "arm_compute/runtime/CL/ICLSimpleFunction.h" - -#include <vector> - -namespace arm_compute -{ -class ICLTensor; - -/** - * @brief Class to perform EmbeddingLookup operation - */ -class CLEmbeddingLookup : public ICLSimpleFunction -{ -public: - /** - * @brief Set the input and output tensors. - * @param[in] input Source tensor. - * Data types supported: U8/S8/QASYMM8/U16/S16/U32/S32/F16/F32 - * @param[out] output Destination tensor. Data types and data layouts supported: Same as @p - * input. - * @param[in] lookups Lookups 1D tensor that values are indices into the first dimension of - * input. - * @return N/A - */ - void configure(const ICLTensor *input, ICLTensor *output, const ICLTensor *lookups); -}; -} -#endif /*__ARM_COMPUTE_CLEMBEDDINGLOOKUP_H__ */ diff --git a/libs/ARMComputeEx/arm_compute/runtime/CL/functions/CLExp.h b/libs/ARMComputeEx/arm_compute/runtime/CL/functions/CLExp.h deleted file mode 100644 index 2d0fc23a4..000000000 --- a/libs/ARMComputeEx/arm_compute/runtime/CL/functions/CLExp.h +++ /dev/null @@ -1,38 +0,0 @@ -/* - * Copyright (c) 2018 Samsung Electronics Co., Ltd. All Rights Reserved - * Copyright (c) 2016-2018 ARM Limited. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -#ifndef __ARM_COMPUTE_CLEXP_H__ -#define __ARM_COMPUTE_CLEXP_H__ - -#include "arm_compute/runtime/CL/ICLSimpleFunction.h" - -namespace arm_compute -{ -class ICLTensor; - -/** Basic function to run @ref CLExpKernel */ -class CLExp : public ICLSimpleFunction -{ -public: - /** Set the source, destination of the kernel - * - * @param[in] input Source tensor. Data type supported: F32. - * @param[out] output Destination tensor. Data type supported: F32. - */ - void configure(const ICLTensor *input, ICLTensor *output); -}; -} -#endif /* __ARM_COMPUTE_CLEXP_H__ */ diff --git a/libs/ARMComputeEx/arm_compute/runtime/CL/functions/CLGather.h b/libs/ARMComputeEx/arm_compute/runtime/CL/functions/CLGather.h deleted file mode 100644 index f7fd3cda1..000000000 --- a/libs/ARMComputeEx/arm_compute/runtime/CL/functions/CLGather.h +++ /dev/null @@ -1,60 +0,0 @@ -/* - * Copyright (c) 2018 Samsung Electronics Co., Ltd. All Rights Reserved - * Copyright (c) 2016-2018 ARM Limited. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -/** - * @file CLGather.h - * @brief This file contains CLGather class - * @ingroup COM_AI_RUNTIME - */ - -#ifndef __ARM_COMPUTE_CLGATHER_H__ -#define __ARM_COMPUTE_CLGATHER_H__ - -#include "arm_compute/runtime/CL/ICLSimpleFunction.h" - -namespace arm_compute -{ -class ICLTensor; - -/** - * @brief Class to to run @ref CLGatherKernel. - */ -class CLGather : public ICLSimpleFunction -{ -public: - /** - * @brief Initialise the kernel's inputs, output and convertion policy. - * @param[in] input1 An input tensor. Data types supported: U8/S32/F32. - * @param[in] input2 An indexes tensor. Data types supported: S32. - * @param[out] output The output tensor, Data types supported: same as @p input1. - * @return N/A - */ - void configure(ICLTensor *input1, ICLTensor *input2, ICLTensor *output); - - /** - * @brief Static function to check if given info will lead to a valid configuration - * of @ref CLGather - * @param[in] input1 An input tensor. Data types supported: U8/S32/F32. - * @param[in] input2 An indexes tensor. Data types supported: S32. - * @param[out] output The output tensor, Data types supported: same as @p input1. - * @return a status - */ - static Status validate(const ITensorInfo *input1, const ITensorInfo *input2, - const ITensorInfo *output); -}; -} -#endif /*__ARM_COMPUTE_CLGATHER_H__ */ diff --git a/libs/ARMComputeEx/arm_compute/runtime/CL/functions/CLHashtableLookup.h b/libs/ARMComputeEx/arm_compute/runtime/CL/functions/CLHashtableLookup.h deleted file mode 100644 index 65aa6cbd5..000000000 --- a/libs/ARMComputeEx/arm_compute/runtime/CL/functions/CLHashtableLookup.h +++ /dev/null @@ -1,59 +0,0 @@ -/* - * Copyright (c) 2018 Samsung Electronics Co., Ltd. All Rights Reserved - * Copyright (c) 2016-2018 ARM Limited. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -/** - * @file CLHashtableLookup.h - * @ingroup COM_AI_RUNTIME - * @brief This file contains arm_compute::CLHashtableLookup class - */ - -#ifndef __ARM_COMPUTE_CLHASHTABLELOOKUP_H__ -#define __ARM_COMPUTE_CLHASHTABLELOOKUP_H__ - -#include "arm_compute/runtime/CL/ICLSimpleFunction.h" - -#include <vector> - -namespace arm_compute -{ -class ICLTensor; - -/** - * @brief Class to perform HashtableLookup operation - */ -class CLHashtableLookup : public ICLSimpleFunction -{ -public: - /** - * @brief Set the input and output tensors. - * @param[in] lookups Lookups 1D tensor that values are indices into the first dimension of - * input. - * @param[in] keys Keys 1D tensor. keys and input pair represent a map. - * Data types supported: S32 - * @param[in] input Source tensor. - * Data types supported: U8/S8/QASYMM8/U16/S16/U32/S32/F16/F32 - * @param[out] output Destination tensor. Data types and data layouts supported: Same as @p - * input. - * @param[out] hits Hits 1D tensor. A boolean tensor that indicates whether the lookup hits - * (True) or not (False). Data types supported: U8/QASYMM8 - * @return N/A - */ - void configure(const ICLTensor *lookups, const ICLTensor *keys, const ICLTensor *intput, - ICLTensor *output, ICLTensor *hits); -}; -} -#endif /*__ARM_COMPUTE_CLHASHTABLELOOKUP_H__ */ diff --git a/libs/ARMComputeEx/arm_compute/runtime/CL/functions/CLNeg.h b/libs/ARMComputeEx/arm_compute/runtime/CL/functions/CLNeg.h deleted file mode 100644 index 198a0fd4e..000000000 --- a/libs/ARMComputeEx/arm_compute/runtime/CL/functions/CLNeg.h +++ /dev/null @@ -1,39 +0,0 @@ -/* - * Copyright (c) 2018 Samsung Electronics Co., Ltd. All Rights Reserved - * Copyright (c) 2016-2018 ARM Limited. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -#ifndef __ARM_COMPUTE_CLNEG_H__ -#define __ARM_COMPUTE_CLNEG_H__ - -#include "arm_compute/runtime/CL/ICLSimpleFunction.h" - -namespace arm_compute -{ -class ICLTensor; - -class CLNeg : public ICLSimpleFunction -{ -public: - /** Initialise the function's source and destination. - * - * @param[in] input Source tensor. Data types supported: - * U8/S8/QASYMM8/U16/S16/F16/U32/S32/F32. - * @param[out] output Output tensor. Data types supported: Same as @p input. - * - */ - void configure(ICLTensor *input, ICLTensor *output); -}; -} // namespace arm_compute -#endif /*__ARM_COMPUTE_CLNEG_H__ */ diff --git a/libs/ARMComputeEx/arm_compute/runtime/CL/functions/CLNormalizationLayerEx.h b/libs/ARMComputeEx/arm_compute/runtime/CL/functions/CLNormalizationLayerEx.h deleted file mode 100644 index 4077245d5..000000000 --- a/libs/ARMComputeEx/arm_compute/runtime/CL/functions/CLNormalizationLayerEx.h +++ /dev/null @@ -1,77 +0,0 @@ -/* - * Copyright (c) 2018 Samsung Electronics Co., Ltd. All Rights Reserved - * Copyright (c) 2016-2018 ARM Limited. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -#ifndef __ARM_COMPUTE_CLNORMALIZATIONLAYEREX_H__ -#define __ARM_COMPUTE_CLNORMALIZATIONLAYEREX_H__ - -#include "arm_compute/runtime/IFunction.h" - -#include "arm_compute/core/CL/kernels/CLFillBorderKernel.h" -#include "arm_compute/core/CL/kernels/CLNormalizationLayerExKernel.h" - -namespace arm_compute -{ -class ICLTensor; - -/** Basic function to compute a normalization layer. This function calls the following CL kernels: - * - * -# @ref CLFillBorderKernel - * -# @ref CLNormalizationLayerKernelEx - * - */ -class CLNormalizationLayerEx : public IFunction -{ -public: - /** Default constructor */ - CLNormalizationLayerEx(); - /** Set the input and output tensors. - * - * @param[in, out] 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: F16/F32 (Written to by the border handler) - * @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(ICLTensor *input, ICLTensor *output, const NormalizationLayerInfo &norm_info); - /** Static function to check if given info will lead to a valid configuration of @ref - * CLNormalizationLayer - * - * @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: - * F16/F32 - * @param[in] 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. - * - * @return a status - */ - static Status validate(const ITensorInfo *input, const ITensorInfo *output, - const NormalizationLayerInfo &norm_info); - - // Inherited methods overridden: - void run() override; - -private: - CLNormalizationLayerExKernel _norm_kernel; /**< Normalization layer kernel to run */ - CLFillBorderKernel _border_handler; /**< Kernel to handle borders */ -}; -} -#endif /* __ARM_COMPUTE_CLNORMALIZATIONLAYEREX_H__ */ diff --git a/libs/ARMComputeEx/arm_compute/runtime/CL/functions/CLPReLU.h b/libs/ARMComputeEx/arm_compute/runtime/CL/functions/CLPReLU.h deleted file mode 100644 index 622a61b5e..000000000 --- a/libs/ARMComputeEx/arm_compute/runtime/CL/functions/CLPReLU.h +++ /dev/null @@ -1,40 +0,0 @@ -/* - * Copyright (c) 2018 Samsung Electronics Co., Ltd. All Rights Reserved - * Copyright (c) 2016-2018 ARM Limited. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -#ifndef __ARM_COMPUTE_CLPRELU_H__ -#define __ARM_COMPUTE_CLPRELU_H__ - -#include "arm_compute/runtime/CL/ICLSimpleFunction.h" - -namespace arm_compute -{ -class ICLTensor; - -class CLPReLU : public ICLSimpleFunction -{ -public: - /** Initialise the function's source and destination. - * - * @param[in] input. Data types supported: - * QASYMM8/F16/F32. - * @param[in] alpha. Data types supported: - * QASYMM8/F16/F32. - * @param[out] output Output tensor. Data types supported: Same as @p input. - */ - void configure(ICLTensor *input, ICLTensor *alpha, ICLTensor *output); -}; -} // namespace arm_compute -#endif /*__ARM_COMPUTE_CLPRELU_H__*/ diff --git a/libs/ARMComputeEx/arm_compute/runtime/CL/functions/CLPadLayerEx.h b/libs/ARMComputeEx/arm_compute/runtime/CL/functions/CLPadLayerEx.h deleted file mode 100644 index d6ea486d1..000000000 --- a/libs/ARMComputeEx/arm_compute/runtime/CL/functions/CLPadLayerEx.h +++ /dev/null @@ -1,47 +0,0 @@ -/* -* Copyright (c) 2018 Samsung Electronics Co., Ltd. All Rights Reserved -* Copyright (c) 2016-2018 ARM Limited. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ -#ifndef __ARM_COMPUTE_CLPADLAYEREX_H__ -#define __ARM_COMPUTE_CLPADLAYEREX_H__ - -#include "arm_compute/runtime/CL/ICLSimpleFunction.h" - -namespace arm_compute -{ -class ICLTensor; - -/** Basic function to run @ref CLPadLayerKernel - * - * @note The tensor data type for the inputs must be U8/QASYMM8/S16/S32/F16/F32. - * @note The function converts the input tensor to the tensor of the output tensor's type. - */ -class CLPadLayerEx : public ICLSimpleFunction -{ -public: - /** Initialise the kernel's input and output. - * - * @param[in] input Input tensor. Data types supported: - * U8/QASYMM8/S16/S32/F16/F32. - * @param[out] output Output tensor. Data types supported: - * U8/QASYMM8/S16/S32/F16/F32. - * @param[in] pad_size Tensor for Padding values in NHWC format shape [n, 2], - * where n is the rank of tensor . Data types supported: S32 - */ - void configure(ICLTensor *input, ICLTensor *output, ICLTensor *pad_size); -}; - -} // namespace arm_compute -#endif /* __ARM_COMPUTE_CLPADLAYEREX_H__ */ diff --git a/libs/ARMComputeEx/arm_compute/runtime/CL/functions/CLPermuteEx.h b/libs/ARMComputeEx/arm_compute/runtime/CL/functions/CLPermuteEx.h deleted file mode 100644 index 9a0cc213c..000000000 --- a/libs/ARMComputeEx/arm_compute/runtime/CL/functions/CLPermuteEx.h +++ /dev/null @@ -1,51 +0,0 @@ -/* - * Copyright (c) 2018 Samsung Electronics Co., Ltd. All Rights Reserved - * Copyright (c) 2016-2018 ARM Limited. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -#ifndef __ARM_COMPUTE_CLPERMUTEEX_H__ -#define __ARM_COMPUTE_CLPERMUTEEX_H__ - -#include "arm_compute/runtime/CL/ICLSimpleFunction.h" - -namespace arm_compute -{ -class ICLTensor; - -/** Basic function to execute an @ref CLPermuteKernel. */ -class CLPermuteEx : public ICLSimpleFunction -{ -public: - /** Set the input and output tensors. - * - * @param[in] input The input tensor to permute. Data types supported: - * U8/S8/QASYMM8/U16/S16/F16/U32/S32/F32 - * @param[in] output The output tensor. Data types supported: Same as @p input - * @param[in] perm Permutation vector - */ - void configure(const ICLTensor *input, ICLTensor *output, const PermutationVector &perm); - /** Static function to check if given info will lead to a valid configuration of @ref CLPermute. - * - * @param[in] input First tensor input info. Data types supported: - * U8/S8/QASYMM8/U16/S16/F16/U32/S32/F32. - * @param[in] output Output tensor info. Data types supported: same as @p input. - * @param[in] perm Permutation vector - * - * @return a status - */ - static Status validate(const ITensorInfo *input, const ITensorInfo *output, - const PermutationVector &perm); -}; -} -#endif /*__ARM_COMPUTE_CLPERMUTEEX_H__ */ diff --git a/libs/ARMComputeEx/arm_compute/runtime/CL/functions/CLPixelWiseDivision.h b/libs/ARMComputeEx/arm_compute/runtime/CL/functions/CLPixelWiseDivision.h deleted file mode 100644 index b142d3a2e..000000000 --- a/libs/ARMComputeEx/arm_compute/runtime/CL/functions/CLPixelWiseDivision.h +++ /dev/null @@ -1,80 +0,0 @@ -/* - * Copyright (c) 2018 Samsung Electronics Co., Ltd. All Rights Reserved - * Copyright (c) 2016-2018 ARM Limited. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -/** - * @file CLPixelWiseDivision.h - * @ingroup COM_AI_RUNTIME - * @brief This file contains arm_compute::CLPixelWiseDivision class - */ -#ifndef __ARM_COMPUTE_CLPIXELWISEDIVISION_H__ -#define __ARM_COMPUTE_CLPIXELWISEDIVISION_H__ - -#include "arm_compute/runtime/CL/ICLSimpleFunction.h" - -namespace arm_compute -{ -class ICLTensor; - -/** - * @brief Class to run @ref CLPixelWiseDivisionKernel. - */ -class CLPixelWiseDivision : public ICLSimpleFunction -{ -public: - /** - * @brief Initialise the kernel's inputs, output and convertion policy. - * @param[in, out] input1 An input tensor. Data types supported: U8/S16/F16/F32 - * The input tensor is [in, out] because its TensorInfo might be - * modified inside the kernel in case of broadcasting of dimension 0. - * @param[in, out] input2 An input tensor. Data types supported: same as @p input1. - * The input tensor is [in, out] because its TensorInfo might be - * modified inside the kernel in case of broadcasting of dimension 0. - * @param[out] output The output tensor, Data types supported: same as @p input1. - * Note: U8 requires both inputs to be U8. - * @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. - * @param[in] overflow_policy Overflow policy. Supported overflow policies: Wrap, Saturate - * @param[in] rounding_policy Rounding policy. Supported rounding modes: to zero, to nearest - * even. - * @return N/A - */ - void configure(ICLTensor *input1, ICLTensor *input2, ICLTensor *output, float scale = 1.f, - ConvertPolicy overflow_policy = ConvertPolicy::WRAP, - RoundingPolicy rounding_policy = RoundingPolicy::TO_ZERO); - - /** - * @brief Static function to check if given info will lead to a valid configuration of @ref - * CLPixelWiseDivision - * @param[in] input1 An input tensor info. Data types supported: U8/S16/F16/F32 - * @param[in] input2 An input tensor info. Data types supported: same as @p input1. - * @param[in] output The output tensor info, Data types supported: same as @p input1. - * Note: U8 requires both inputs to be U8. - * @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. - * @param[in] overflow_policy Overflow policy. Supported overflow policies: Wrap, Saturate - * @param[in] rounding_policy Rounding policy. Supported rounding modes: to zero, to nearest even. - * @return a status - */ - static Status validate(const ITensorInfo *input1, const ITensorInfo *input2, - const ITensorInfo *output, float scale = 1.f, - ConvertPolicy overflow_policy = ConvertPolicy::WRAP, - RoundingPolicy rounding_policy = RoundingPolicy::TO_ZERO); -}; -} -#endif /*__ARM_COMPUTE_CLPIXELWISEDIVISION_H__ */ diff --git a/libs/ARMComputeEx/arm_compute/runtime/CL/functions/CLReduceOperation.h b/libs/ARMComputeEx/arm_compute/runtime/CL/functions/CLReduceOperation.h deleted file mode 100644 index e1a6f6ab4..000000000 --- a/libs/ARMComputeEx/arm_compute/runtime/CL/functions/CLReduceOperation.h +++ /dev/null @@ -1,87 +0,0 @@ -/* - * Copyright (c) 2018 Samsung Electronics Co., Ltd. All Rights Reserved - * Copyright (c) 2016-2018 ARM Limited. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -/** - * @file CLReduceOperation.h - * @ingroup COM_AI_RUNTIME - * @brief This file contains arm_compute::CLReduceOperation class - */ - -#ifndef __ARM_COMPUTE_CLREDUCEOPERATION_H__ -#define __ARM_COMPUTE_CLREDUCEOPERATION_H__ - -#include "arm_compute/core/CL/kernels/CLReduceOperationKernel.h" -#include "arm_compute/core/TypesEx.h" -#include "arm_compute/runtime/CL/CLTensor.h" -#include "arm_compute/runtime/IFunction.h" - -namespace arm_compute -{ -class ICLTensor; - -/** - * @brief Class to perform ReduceOperation - */ -class CLReduceOperation : public IFunction -{ -public: - /** - * @brief Construct a new ReduceOperation object - */ - CLReduceOperation(); - - /** - * @brief Set the input and output tensors. - * @param[in] input Source tensor. Data types supported: U8/S32/F32 - * @param[out] output Destination tensor. Data types and data layouts supported: Same as @p - * input. - * @param[in] axis Axis along which to reduce. It must be sorted and no duplicates. - * @param[in] op Reduce operation to perform. - * @return N/A - */ - void configure(ICLTensor *input, ICLTensor *output, const std::set<uint32_t> &axis, - ReduceOperation op); - - /** - * @brief Static function to check if given info will lead to a valid configuration of @ref - * CLReduceOperation. - * @param[in] input Source tensor info. Data types supported: U8/S32/F32 - * @param[in] output Destination tensor info. Data types and data layouts supported: Same as @p - * input. - * @param[in] axis Axis along which to reduce. It must be sorted and no duplicates. - * @param[in] op Reduce operation to perform. - * @return a status - */ - static Status validate(const ITensorInfo *input, const ITensorInfo *output, - const std::set<uint32_t> &axis, const ReduceOperation &op); - - /** - * @brief Run the OpenCL kernel for this operation - * @return N/A - */ - void run() override; - -private: - ICLTensor *_input; - ICLTensor *_output; - std::set<uint32_t> _axis; - - std::unique_ptr<CLTensor[]> _interm_tensors{nullptr}; - std::unique_ptr<CLReduceOperationKernel[]> _reduce_kernels{nullptr}; -}; -} -#endif /*__ARM_COMPUTE_CLREDUCEOPERATION_H__ */ diff --git a/libs/ARMComputeEx/arm_compute/runtime/CL/functions/CLSpaceToBatchND.h b/libs/ARMComputeEx/arm_compute/runtime/CL/functions/CLSpaceToBatchND.h deleted file mode 100644 index 7e2df8986..000000000 --- a/libs/ARMComputeEx/arm_compute/runtime/CL/functions/CLSpaceToBatchND.h +++ /dev/null @@ -1,56 +0,0 @@ -/* - * Copyright (c) 2018 Samsung Electronics Co., Ltd. All Rights Reserved - * Copyright (c) 2016-2018 ARM Limited. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -#ifndef __ARM_COMPUTE_CLSPACE_TO_BATCH_ND_H__ -#define __ARM_COMPUTE_CLSPACE_TO_BATCH_ND_H__ - -#include "arm_compute/runtime/CL/ICLSimpleFunction.h" - -namespace arm_compute -{ -class ICLTensor; - -/** Basic function to run @ref CLSpaceToBatchNDKernel - * - * @note The tensor data type for the inputs must be U8/QASYMM8/S16/F16/S32/F32. - * @note The function divides "spatial" dimensions of the input into a grid of blocks of shape - * block_shape, and interleaves these blocks with the "batch" dimension such that in the output. - */ -class CLSpaceToBatchND : public ICLSimpleFunction -{ -public: - /** Initialise the kernel's input and output. - * - * @note The data layout of input and output must be the same. - * @note The number of dimensions of input and output must be 4, and `spatial` dimensions - * are height and width. - * @param[in] input Input tensor. Data types supported: U8/QASYMM8/S16/F16/S32/F32. - * Data layout supported: NCHW/NHWC - * @param[in] block_size Tensor of integer values specifying block sizes for spatial - * dimension. - * Data types supported: S32 - * @param[in] padding_size Tensor of integer values specifying padding sizes for spatial - * dimension. - * Data types supported: S32 - * @param[out] output Output tensor. Data types supported: same as @p input. - * Data layout supported: NCHW/NHWC - */ - void configure(const ICLTensor *input, const ICLTensor *block_size, const ICLTensor *padding_size, - ICLTensor *output); -}; - -} // namespace arm_compute -#endif /* __ARM_COMPUTE_CLSPACE_TO_BATCH_ND_H__ */ diff --git a/libs/ARMComputeEx/arm_compute/runtime/CL/functions/CLSpaceToDepth.h b/libs/ARMComputeEx/arm_compute/runtime/CL/functions/CLSpaceToDepth.h deleted file mode 100644 index 17f762092..000000000 --- a/libs/ARMComputeEx/arm_compute/runtime/CL/functions/CLSpaceToDepth.h +++ /dev/null @@ -1,44 +0,0 @@ -/* - * Copyright (c) 2018 Samsung Electronics Co., Ltd. All Rights Reserved - * Copyright (c) 2016-2018 ARM Limited. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -#ifndef __ARM_COMPUTE_CLSPACETODEPTH_H__ -#define __ARM_COMPUTE_CLSPACETODEPTH_H__ - -#include "arm_compute/runtime/CL/ICLSimpleFunction.h" - -namespace arm_compute -{ -class ICLTensor; - -/** Basic function to run @ref CLSpaceToDepthKernel - * - * @note The tensor data type for the inputs must be U8/QASYMM8/S16/S32/F16/F32. - * @note The function converts the input tensor to the tensor of the output tensor's type. - */ -class CLSpaceToDepth : public ICLSimpleFunction -{ -public: - /** Initialise the kernel's input and output. - * - * @param[in] input Input tensor. Data types supported: U8/QASYMM8/S16/S32/F16/F32. - * @param[out] output Output tensor. Data types supported: U8/QASYMM8/S16/S32/F16/F32. - * @param[block_size] block size integer only - */ - void configure(ICLTensor *input, ICLTensor *output, const int32_t block_size); -}; - -} // namespace arm_compute -#endif /* __ARM_COMPUTE_CLSPACETODEPTH_H__ */ diff --git a/libs/ARMComputeEx/arm_compute/runtime/CL/functions/CLSquaredDifference.h b/libs/ARMComputeEx/arm_compute/runtime/CL/functions/CLSquaredDifference.h deleted file mode 100644 index 3610ba71c..000000000 --- a/libs/ARMComputeEx/arm_compute/runtime/CL/functions/CLSquaredDifference.h +++ /dev/null @@ -1,40 +0,0 @@ -/* - * Copyright (c) 2018 Samsung Electronics Co., Ltd. All Rights Reserved - * Copyright (c) 2016-2018 ARM Limited. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -#ifndef __ARM_COMPUTE_CLSQUARED_DIFFERENCE_H__ -#define __ARM_COMPUTE_CLSQUARED_DIFFERENCE_H__ - -#include "arm_compute/runtime/CL/ICLSimpleFunction.h" - -namespace arm_compute -{ -class ICLTensor; - -class CLSquaredDifference : public ICLSimpleFunction -{ -public: - /** Initialise the function's source and destination. - * - * @param[in] input1 Source tensor1. Data types supported: - * U8/S8/QASYMM8/U16/S16/F16/U32/S32/F32. - * @param[in] input2 Source tensor2. Data types supported: - * U8/S8/QASYMM8/U16/S16/F16/U32/S32/F32. - * @param[out] output Output tensor. Data types supported: Same as @p input. - */ - void configure(ICLTensor *input1, ICLTensor *input2, ICLTensor *output); -}; -} // namespace arm_compute -#endif /*__ARM_COMPUTE_CLSQUARED_DIFFERENCE_H__*/ diff --git a/libs/ARMComputeEx/arm_compute/runtime/CL/functions/CLStridedSliceEx.h b/libs/ARMComputeEx/arm_compute/runtime/CL/functions/CLStridedSliceEx.h deleted file mode 100644 index 6b26a85c8..000000000 --- a/libs/ARMComputeEx/arm_compute/runtime/CL/functions/CLStridedSliceEx.h +++ /dev/null @@ -1,58 +0,0 @@ -/* - * Copyright (c) 2018 Samsung Electronics Co., Ltd. All Rights Reserved - * Copyright (c) 2017 ARM Limited. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -/** - * @file CLStridedSlice.h - * @ingroup COM_AI_RUNTIME - * @brief This file contains arm_compute::CLStridedSlice and arm_compute::CLStridedSliceCPU class - */ - -#ifndef __ARM_COMPUTE_CLSTRIDEDSLICEEX_H__ -#define __ARM_COMPUTE_CLSTRIDEDSLICEEX_H__ - -#include "arm_compute/runtime/CL/ICLSimpleFunction.h" - -namespace arm_compute -{ -class ICLTensor; - -/** - * @brief Class to run @ref CLStridedSliceKernel - */ -class CLStridedSliceEx : public ICLSimpleFunction -{ -public: - /** - * @brief Initialise the kernel's inputs and outputs - * @param[in] input Tensor input. Data type supported: - * U8/S8/QASYMM8/U16/S16/U32/S32/F16/F32 - * @param[out] output Output tensor. Data type supported: Same as @p input - * @param[in] beginData 'begin' vector of strided slice operation - * @param[in] endData 'end' vector of strided slice operation - * @param[in] stridesData 'strides' vector of strided slice operation - * @param[in] beginMask If the ith bit is set, begin[i] is ignored - * @param[in] endMask If the ith bit is set, end[i] is ignored - * @param[in] shrinkAxisMask If the ith bit is set, the ith specification shrinks the - * dimensionality by 1, taking on the value at index begin[i] - * @return N/A - */ - void configure(const ICLTensor *input, ICLTensor *output, ICLTensor *beginData, - ICLTensor *endData, ICLTensor *stridesData, int32_t beginMask, int32_t endMask, - int32_t shrinkAxisMask); -}; -} -#endif /*__ARM_COMPUTE_CLSTRIDEDSLICEEX_H__ */ diff --git a/libs/ARMComputeEx/arm_compute/runtime/CL/functions/CLTopKV2.h b/libs/ARMComputeEx/arm_compute/runtime/CL/functions/CLTopKV2.h deleted file mode 100644 index 5327e016f..000000000 --- a/libs/ARMComputeEx/arm_compute/runtime/CL/functions/CLTopKV2.h +++ /dev/null @@ -1,137 +0,0 @@ -/* - * Copyright (c) 2018 Samsung Electronics Co., Ltd. All Rights Reserved - * Copyright (c) 2016-2018 ARM Limited. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -/** - * @file CLTopKV2.h - * @ingroup COM_AI_RUNTIME - * @brief This file contains arm_compute::CLTopKV2 class - */ -#ifndef __ARM_COMPUTE_CLTOPK_V2_H__ -#define __ARM_COMPUTE_CLTOPK_V2_H__ - -#include "arm_compute/core/CL/kernels/CLTopKV2Kernel.h" - -#include "arm_compute/runtime/IFunction.h" - -namespace arm_compute -{ -class ICLTensor; - -/** - * @brief Class to execute TopKV2 operation. - */ -class CLTopKV2 : public IFunction -{ -public: - /** - * @brief Construct a new CLTopKV2 object - */ - CLTopKV2(); - - /** - * @brief Prevent instances of this class from being copied (As this class contains pointers) - */ - CLTopKV2(const CLTopKV2 &) = delete; - - /** - * @brief Prevent instances of this class from being copied (As this class contains pointers) - */ - CLTopKV2 &operator=(const CLTopKV2 &) = delete; - - /** - * @brief Construct a new CLTopKV2 object by using copy constructor - * @param[in] CLTopKV2 object to move - */ - CLTopKV2(CLTopKV2 &&) = default; - - /** - * @brief Assign a CLTopKV2 object. - * @param[in] CLTopKV2 object to assign. This object will be moved. - */ - CLTopKV2 &operator=(CLTopKV2 &&) = default; - - /** - * @brief Initialise the kernel's inputs and outputs. - * @param[in] input Input image. Data types supported: U8/S16/F32. - * @param[in] k The value of `k`. - * @param[out] values Top k values. Data types supported: S32 if input type is U8/S16, F32 if - * input type is F32. - * @param[out] indices Indices related to top k values. Data types supported: S32 if input type - * is U8/S16, F32 if input type is F32. - * @return N/A - */ - void configure(ICLTensor *input, int k, ICLTensor *values, ICLTensor *indices, - int total_bits = 32, int bits = 4); - - /** - * @brief Run the kernels contained in the function - * Depending on the value of the following environment variables it works differently: - * - If the value of environment variable "ACL_TOPKV2" == "GPU_SINGLE", - * quick sort on GPU is used. - * - If the value of environment variable "ACL_TOPKV2" == ""GPU"", - * radix sort on GPU is used. - * - For other value, TopKV2 runs on CPU - * @return N/A - */ - void run() override; - -private: - void run_on_cpu(); - void run_on_gpu(); - void run_on_gpu_single_quicksort(); - - uint32_t _k; - uint32_t _total_bits; - uint32_t _bits; - uint32_t _radix; - uint32_t _hist_buf_size; - uint32_t _glob_sum_buf_size; - uint32_t _n; - - ICLTensor *_input; - ICLTensor *_values; - ICLTensor *_indices; - - cl::Buffer _qs_idx_buf; - cl::Buffer _qs_temp_buf; - cl::Buffer _hist_buf; - cl::Buffer _glob_sum_buf; - cl::Buffer _temp_buf; - cl::Buffer _first_negative_idx_buf; - cl::Buffer _in_key_buf; - cl::Buffer _out_key_buf; - cl::Buffer _in_ind_buf; - cl::Buffer _out_ind_buf; - - cl::Buffer *_p_in_key_buf; - cl::Buffer *_p_out_key_buf; - cl::Buffer *_p_in_ind_buf; - cl::Buffer *_p_out_ind_buf; - - CLTopKV2Single _qs_kernel; - CLTopKV2Init _init_kernel; - CLRadixSortHistogram _hist_kernel; - CLRadixSortScanHistogram _scan_hist_kernel; - CLRadixSortGlobalScanHistogram _glob_scan_hist_kernel; - CLRadixSortPasteHistogram _paste_hist_kernel; - CLRadixSortReorder _reorder_kernel; - CLTopKV2FindFirstNegative _find_first_negative_kernel; - CLTopKV2ReorderNegatives _reorder_negatives_kernel; - CLTopKV2Store _store_kernel; -}; -} -#endif // __ARM_COMPUTE_CLTOPK_V2_H__ diff --git a/libs/ARMComputeEx/arm_compute/runtime/NEON/functions/NENormalizationLayerEx.h b/libs/ARMComputeEx/arm_compute/runtime/NEON/functions/NENormalizationLayerEx.h deleted file mode 100644 index fa7408ecd..000000000 --- a/libs/ARMComputeEx/arm_compute/runtime/NEON/functions/NENormalizationLayerEx.h +++ /dev/null @@ -1,83 +0,0 @@ -/* - * Copyright (c) 2018 Samsung Electronics Co., Ltd. All Rights Reserved - * Copyright (c) 2016-2018 ARM Limited. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -#ifndef __ARM_COMPUTE_NENORMALIZATIONLAYEREX_H__ -#define __ARM_COMPUTE_NENORMALIZATIONLAYEREX_H__ - -#include "arm_compute/runtime/IFunction.h" - -#include "arm_compute/core/NEON/kernels/NEFillBorderKernel.h" -#include "arm_compute/core/NEON/kernels/NENormalizationLayerExKernel.h" -#include "arm_compute/core/NEON/kernels/NEPixelWiseMultiplicationKernel.h" -#include "arm_compute/runtime/MemoryGroup.h" - -namespace arm_compute -{ -class ITensor; - -/** Basic function to compute a normalization layer. This function calls the following NEON kernels: - * - * -# @ref NEPixelWiseMultiplicationKernel - * -# @ref NEFillBorderKernel - * -# @ref NENormalizationLayerKernelEx - * - */ -class NENormalizationLayerEx : public IFunction -{ -public: - /** Default constructor */ - NENormalizationLayerEx(std::shared_ptr<IMemoryManager> 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 type supported: - * F16/F32 - * @param[out] output Destination with the same dimensions, data type and number of channels of - * @p input - * @param[in] norm_info Normalization layer information like the normalization type, - * normalization size and other parameters. - */ - void configure(const ITensor *input, ITensor *output, const NormalizationLayerInfo &norm_info); - /** Static function to check if given info will lead to a valid configuration of @ref - * NENormalizationLayer - * - * @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 type supported: - * F16/F32 - * @param[in] output Destination with the same dimensions, data type and number of channels of - * @p input - * @param[in] norm_info Normalization layer information like the normalization type, normalization - * size and other parameters. - * - * @return a status - */ - static Status validate(const ITensorInfo *input, const ITensorInfo *output, - const NormalizationLayerInfo &norm_info); - - // Inherited methods overridden: - void run() override; - -private: - MemoryGroup _memory_group; /**< Function memory group */ - NENormalizationLayerExKernel _norm_kernel; /**< Normalization layer kernel */ - NEPixelWiseMultiplicationKernel _multiply_kernel; /**< Pixel multiplication kernel */ - NEFillBorderKernel _border_handler; /**< Kernel to handle borders */ - Tensor _input_squared; /**< The intermediate buffer which stores results of squaring input */ -}; -} -#endif /* __ARM_COMPUTE_NENORMALIZATIONLAYEREX_H__ */ |