blob: f78ce0e149fbf6572325769ac2d1ac27692b287c [file] [log] [blame]
Anthony Barbier6ff3b192017-09-04 18:44:23 +01001/*
Michele Di Giorgiod9eaf612020-07-08 11:12:57 +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_CLACCUMULATE_H
25#define ARM_COMPUTE_CLACCUMULATE_H
Anthony Barbier6ff3b192017-09-04 18:44:23 +010026
27#include "arm_compute/runtime/CL/ICLSimpleFunction.h"
28
29#include <cstdint>
30
31namespace arm_compute
32{
Sang-Hoon Parkbef7fa22020-10-21 15:58:54 +010033class CLCompileContext;
Anthony Barbier6ff3b192017-09-04 18:44:23 +010034class ICLTensor;
35
morgolock00c76012020-11-06 10:40:12 +000036/** 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*/
Anthony Barbier6ff3b192017-09-04 18:44:23 +010041class CLAccumulate : public ICLSimpleFunction
42{
43public:
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);
Manuel Bottini2b84be52020-04-08 10:15:51 +010050 /** 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);
Anthony Barbier6ff3b192017-09-04 18:44:23 +010057};
58
morgolock00c76012020-11-06 10:40:12 +000059/** 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*/
Anthony Barbier6ff3b192017-09-04 18:44:23 +010064class CLAccumulateWeighted : public ICLSimpleFunction
65{
66public:
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);
Manuel Bottini2b84be52020-04-08 10:15:51 +010074 /** 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);
Anthony Barbier6ff3b192017-09-04 18:44:23 +010082};
83
morgolock00c76012020-11-06 10:40:12 +000084/** 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*/
Anthony Barbier6ff3b192017-09-04 18:44:23 +010089class CLAccumulateSquared : public ICLSimpleFunction
90{
91public:
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);
Manuel Bottini2b84be52020-04-08 10:15:51 +010099 /** 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);
Anthony Barbier6ff3b192017-09-04 18:44:23 +0100107};
108}
Michalis Spyrouf4643372019-11-29 16:17:13 +0000109#endif /*ARM_COMPUTE_CLACCUMULATE_H */