Anthony Barbier | 6ff3b19 | 2017-09-04 18:44:23 +0100 | [diff] [blame] | 1 | /* |
Michalis Spyrou | ebcebf1 | 2020-10-21 00:04:14 +0100 | [diff] [blame] | 2 | * Copyright (c) 2016-2020 Arm Limited. |
Anthony Barbier | 6ff3b19 | 2017-09-04 18:44:23 +0100 | [diff] [blame] | 3 | * |
| 4 | * SPDX-License-Identifier: MIT |
| 5 | * |
| 6 | * Permission is hereby granted, free of charge, to any person obtaining a copy |
| 7 | * of this software and associated documentation files (the "Software"), to |
| 8 | * deal in the Software without restriction, including without limitation the |
| 9 | * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or |
| 10 | * sell copies of the Software, and to permit persons to whom the Software is |
| 11 | * furnished to do so, subject to the following conditions: |
| 12 | * |
| 13 | * The above copyright notice and this permission notice shall be included in all |
| 14 | * copies or substantial portions of the Software. |
| 15 | * |
| 16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR |
| 17 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, |
| 18 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE |
| 19 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER |
| 20 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, |
| 21 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE |
| 22 | * SOFTWARE. |
| 23 | */ |
Michalis Spyrou | f464337 | 2019-11-29 16:17:13 +0000 | [diff] [blame] | 24 | #ifndef ARM_COMPUTE_NEACCUMULATE_H |
| 25 | #define ARM_COMPUTE_NEACCUMULATE_H |
Anthony Barbier | 6ff3b19 | 2017-09-04 18:44:23 +0100 | [diff] [blame] | 26 | |
Michalis Spyrou | 95abfdd | 2018-11-28 14:59:47 +0000 | [diff] [blame] | 27 | #include "arm_compute/runtime/NEON/INESimpleFunctionNoBorder.h" |
Anthony Barbier | 6ff3b19 | 2017-09-04 18:44:23 +0100 | [diff] [blame] | 28 | |
| 29 | #include <cstdint> |
| 30 | |
| 31 | namespace arm_compute |
| 32 | { |
| 33 | class ITensor; |
| 34 | |
morgolock | 0c86265 | 2020-11-06 08:59:45 +0000 | [diff] [blame^] | 35 | /** Basic function to run @ref NEAccumulateKernel |
| 36 | * |
| 37 | * @deprecated This function is deprecated and is intended to be removed in 21.05 release |
| 38 | * |
| 39 | */ |
Michalis Spyrou | 95abfdd | 2018-11-28 14:59:47 +0000 | [diff] [blame] | 40 | class NEAccumulate : public INESimpleFunctionNoBorder |
Anthony Barbier | 6ff3b19 | 2017-09-04 18:44:23 +0100 | [diff] [blame] | 41 | { |
| 42 | public: |
Michalis Spyrou | ebcebf1 | 2020-10-21 00:04:14 +0100 | [diff] [blame] | 43 | /** Default constructor */ |
| 44 | NEAccumulate() = default; |
| 45 | /** Prevent instances of this class from being copied (As this class contains pointers) */ |
| 46 | NEAccumulate(const NEAccumulate &) = delete; |
| 47 | /** Prevent instances of this class from being copied (As this class contains pointers) */ |
| 48 | NEAccumulate &operator=(const NEAccumulate &) = delete; |
| 49 | /** Prevent instances of this class from being moved (As this class contains non movable objects) */ |
| 50 | NEAccumulate(NEAccumulate &&) = delete; |
| 51 | /** Prevent instances of this class from being moved (As this class contains non movable objects) */ |
| 52 | NEAccumulate &operator=(NEAccumulate &&) = delete; |
| 53 | /** Default destructor */ |
| 54 | ~NEAccumulate(); |
Anthony Barbier | 6ff3b19 | 2017-09-04 18:44:23 +0100 | [diff] [blame] | 55 | /** Set the input and accumulation tensors |
| 56 | * |
| 57 | * @param[in] input Source tensor. Data type supported: U8. |
| 58 | * @param[out] output Destination tensor. Data type supported: S16. |
| 59 | */ |
| 60 | void configure(const ITensor *input, ITensor *output); |
| 61 | }; |
| 62 | |
morgolock | 0c86265 | 2020-11-06 08:59:45 +0000 | [diff] [blame^] | 63 | /** Basic function to run @ref NEAccumulateWeightedKernel |
| 64 | * |
| 65 | * @deprecated This function is deprecated and is intended to be removed in 21.05 release |
| 66 | * |
| 67 | */ |
Michalis Spyrou | 95abfdd | 2018-11-28 14:59:47 +0000 | [diff] [blame] | 68 | class NEAccumulateWeighted : public INESimpleFunctionNoBorder |
Anthony Barbier | 6ff3b19 | 2017-09-04 18:44:23 +0100 | [diff] [blame] | 69 | { |
| 70 | public: |
Michalis Spyrou | ebcebf1 | 2020-10-21 00:04:14 +0100 | [diff] [blame] | 71 | /** Default constructor */ |
| 72 | NEAccumulateWeighted() = default; |
| 73 | /** Prevent instances of this class from being copied (As this class contains pointers) */ |
| 74 | NEAccumulateWeighted(const NEAccumulateWeighted &) = delete; |
| 75 | /** Prevent instances of this class from being copied (As this class contains pointers) */ |
| 76 | NEAccumulateWeighted &operator=(const NEAccumulateWeighted &) = delete; |
| 77 | /** Prevent instances of this class from being moved (As this class contains non movable objects) */ |
| 78 | NEAccumulateWeighted(NEAccumulateWeighted &&) = delete; |
| 79 | /** Prevent instances of this class from being moved (As this class contains non movable objects) */ |
| 80 | NEAccumulateWeighted &operator=(NEAccumulateWeighted &&) = delete; |
| 81 | /** Default destructor */ |
| 82 | ~NEAccumulateWeighted(); |
Anthony Barbier | 6ff3b19 | 2017-09-04 18:44:23 +0100 | [diff] [blame] | 83 | /** Set the input and accumulation tensors, and the scale value |
| 84 | * |
| 85 | * @param[in] input Source tensor. Data type supported: U8. |
| 86 | * @param[in] alpha The input scalar value with a value input the range of [0, 1.0] |
| 87 | * @param[in,out] output Accumulated tensor. Data type supported: U8. |
| 88 | * @param[in] use_fp16 (Optional) If true the FP16 kernels will be used. If false F32 kernels are used. |
| 89 | */ |
| 90 | void configure(const ITensor *input, float alpha, ITensor *output, bool use_fp16 = false); |
| 91 | }; |
| 92 | |
morgolock | 0c86265 | 2020-11-06 08:59:45 +0000 | [diff] [blame^] | 93 | /** Basic function to run @ref NEAccumulateSquaredKernel |
| 94 | * |
| 95 | * @deprecated This function is deprecated and is intended to be removed in 21.05 release |
| 96 | * |
| 97 | */ |
Michalis Spyrou | 95abfdd | 2018-11-28 14:59:47 +0000 | [diff] [blame] | 98 | class NEAccumulateSquared : public INESimpleFunctionNoBorder |
Anthony Barbier | 6ff3b19 | 2017-09-04 18:44:23 +0100 | [diff] [blame] | 99 | { |
| 100 | public: |
Michalis Spyrou | ebcebf1 | 2020-10-21 00:04:14 +0100 | [diff] [blame] | 101 | /** Default constructor */ |
| 102 | NEAccumulateSquared() = default; |
| 103 | /** Prevent instances of this class from being copied (As this class contains pointers) */ |
| 104 | NEAccumulateSquared(const NEAccumulateSquared &) = delete; |
| 105 | /** Prevent instances of this class from being copied (As this class contains pointers) */ |
| 106 | NEAccumulateSquared &operator=(const NEAccumulateSquared &) = delete; |
| 107 | /** Prevent instances of this class from being moved (As this class contains non movable objects) */ |
| 108 | NEAccumulateSquared(NEAccumulateSquared &&) = delete; |
| 109 | /** Prevent instances of this class from being moved (As this class contains non movable objects) */ |
| 110 | NEAccumulateSquared &operator=(NEAccumulateSquared &&) = delete; |
| 111 | /** Default destructor */ |
| 112 | ~NEAccumulateSquared(); |
Anthony Barbier | 6ff3b19 | 2017-09-04 18:44:23 +0100 | [diff] [blame] | 113 | /** Set the input and accumulation tensors and the shift value. |
| 114 | * |
| 115 | * @param[in] input Source tensor. Data type supported: U8. |
| 116 | * @param[in] shift The input with a value input the range of [0, 15] |
| 117 | * @param[in,out] output Accumulated tensor. Data type supported: S16. |
| 118 | */ |
| 119 | void configure(const ITensor *input, uint32_t shift, ITensor *output); |
| 120 | }; |
Michalis Spyrou | 95abfdd | 2018-11-28 14:59:47 +0000 | [diff] [blame] | 121 | } // namespace arm_compute |
Michalis Spyrou | f464337 | 2019-11-29 16:17:13 +0000 | [diff] [blame] | 122 | #endif /*ARM_COMPUTE_NEACCUMULATE_H */ |