blob: 1881411880e17d6feb8270394a4e4bfa642bb1e9 [file] [log] [blame]
Anthony Barbier6ff3b192017-09-04 18:44:23 +01001/*
Michalis Spyrouebcebf12020-10-21 00:04:14 +01002 * Copyright (c) 2016-2020 Arm Limited.
Anthony Barbier6ff3b192017-09-04 18:44:23 +01003 *
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 Spyrouf4643372019-11-29 16:17:13 +000024#ifndef ARM_COMPUTE_NEACCUMULATE_H
25#define ARM_COMPUTE_NEACCUMULATE_H
Anthony Barbier6ff3b192017-09-04 18:44:23 +010026
Michalis Spyrou95abfdd2018-11-28 14:59:47 +000027#include "arm_compute/runtime/NEON/INESimpleFunctionNoBorder.h"
Anthony Barbier6ff3b192017-09-04 18:44:23 +010028
29#include <cstdint>
30
31namespace arm_compute
32{
33class ITensor;
34
morgolock0c862652020-11-06 08:59:45 +000035/** 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 Spyrou95abfdd2018-11-28 14:59:47 +000040class NEAccumulate : public INESimpleFunctionNoBorder
Anthony Barbier6ff3b192017-09-04 18:44:23 +010041{
42public:
Michalis Spyrouebcebf12020-10-21 00:04:14 +010043 /** 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 Barbier6ff3b192017-09-04 18:44:23 +010055 /** 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
morgolock0c862652020-11-06 08:59:45 +000063/** 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 Spyrou95abfdd2018-11-28 14:59:47 +000068class NEAccumulateWeighted : public INESimpleFunctionNoBorder
Anthony Barbier6ff3b192017-09-04 18:44:23 +010069{
70public:
Michalis Spyrouebcebf12020-10-21 00:04:14 +010071 /** 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 Barbier6ff3b192017-09-04 18:44:23 +010083 /** 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
morgolock0c862652020-11-06 08:59:45 +000093/** 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 Spyrou95abfdd2018-11-28 14:59:47 +000098class NEAccumulateSquared : public INESimpleFunctionNoBorder
Anthony Barbier6ff3b192017-09-04 18:44:23 +010099{
100public:
Michalis Spyrouebcebf12020-10-21 00:04:14 +0100101 /** 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 Barbier6ff3b192017-09-04 18:44:23 +0100113 /** 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 Spyrou95abfdd2018-11-28 14:59:47 +0000121} // namespace arm_compute
Michalis Spyrouf4643372019-11-29 16:17:13 +0000122#endif /*ARM_COMPUTE_NEACCUMULATE_H */