• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright (c) 2016-2020 Arm Limited.
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  */
24 #ifndef ARM_COMPUTE_CLACCUMULATE_H
25 #define ARM_COMPUTE_CLACCUMULATE_H
26 
27 #include "arm_compute/runtime/CL/ICLSimpleFunction.h"
28 
29 #include <cstdint>
30 
31 namespace arm_compute
32 {
33 class CLCompileContext;
34 class ICLTensor;
35 
36 /** Basic function to run @ref CLAccumulateKernel
37  *
38  * @deprecated This function is deprecated and is intended to be removed in 21.05 release
39  *
40 */
41 class CLAccumulate : public ICLSimpleFunction
42 {
43 public:
44     /** Set the input and accumulation tensors.
45      *
46      * @param[in]  input Source tensor. Data types supported: U8.
47      * @param[out] accum Destination tensor. Data types supported: S16.
48      */
49     void configure(const ICLTensor *input, ICLTensor *accum);
50     /** Set the input and accumulation tensors.
51      *
52      * @param[in]  compile_context The compile context to be used.
53      * @param[in]  input           Source tensor. Data types supported: U8.
54      * @param[out] accum           Destination tensor. Data types supported: S16.
55      */
56     void configure(const CLCompileContext &compile_context, const ICLTensor *input, ICLTensor *accum);
57 };
58 
59 /** Basic function to run @ref CLAccumulateWeightedKernel
60  *
61  * @deprecated This function is deprecated and is intended to be removed in 21.05 release
62  *
63 */
64 class CLAccumulateWeighted : public ICLSimpleFunction
65 {
66 public:
67     /** Set the input and accumulation tensors, and the scale value.
68      *
69      * @param[in]     input Source tensor. Data types supported: U8.
70      * @param[in]     alpha The input scalar value with a value input the range of [0, 1.0]. Data types supported: F32.
71      * @param[in,out] accum Accumulated tensor. Data types supported: U8.
72      */
73     void configure(const ICLTensor *input, float alpha, ICLTensor *accum);
74     /** Set the input and accumulation tensors, and the scale value.
75      *
76      * @param[in]     compile_context The compile context to be used.
77      * @param[in]     input           Source tensor. Data types supported: U8.
78      * @param[in]     alpha           The input scalar value with a value input the range of [0, 1.0]. Data types supported: F32.
79      * @param[in,out] accum           Accumulated tensor. Data types supported: U8.
80      */
81     void configure(const CLCompileContext &compile_context, const ICLTensor *input, float alpha, ICLTensor *accum);
82 };
83 
84 /** Basic function to run @ref CLAccumulateSquaredKernel
85  *
86  * @deprecated This function is deprecated and is intended to be removed in 21.05 release
87  *
88 */
89 class CLAccumulateSquared : public ICLSimpleFunction
90 {
91 public:
92     /** Set the input and accumulation tensors and the shift value.
93      *
94      * @param[in]     input Source tensor. Data types supported: U8.
95      * @param[in]     shift The input with a value input the range of [0, 15]. Data types supported: U32.
96      * @param[in,out] accum Accumulated tensor. Data types supported: S16.
97      */
98     void configure(const ICLTensor *input, uint32_t shift, ICLTensor *accum);
99     /** Set the input and accumulation tensors and the shift value.
100      *
101      * @param[in]     compile_context The compile context to be used.
102      * @param[in]     input           Source tensor. Data types supported: U8.
103      * @param[in]     shift           The input with a value input the range of [0, 15]. Data types supported: U32.
104      * @param[in,out] accum           Accumulated tensor. Data types supported: S16.
105      */
106     void configure(const CLCompileContext &compile_context, const ICLTensor *input, uint32_t shift, ICLTensor *accum);
107 };
108 }
109 #endif /*ARM_COMPUTE_CLACCUMULATE_H */
110