blob: cce2837a8d2e66269c69f46693ba38be7d93d27d [file] [log] [blame]
George Wort5a97b282018-12-21 16:21:04 +00001/*
2 * Copyright (c) 2018-2019 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_NEELEMENTWISEUNARYLAYER_H__
25#define __ARM_COMPUTE_NEELEMENTWISEUNARYLAYER_H__
26
27#include "arm_compute/runtime/NEON/INESimpleFunction.h"
28
29namespace arm_compute
30{
31class ITensor;
32
33/** Basic function to perform inverse square root on an input tensor. */
34class NERsqrtLayer : public INESimpleFunction
35{
36public:
37 /** Initialize the function
38 *
39 * @param[in] input Input tensor. Data types supported: F16/F32.
40 * @param[out] output Output tensor. Data types supported: same as @p input.
41 */
42 void configure(const ITensor *input, ITensor *output);
43 /** Static function to check if given info will lead to a valid configuration of @ref NERsqrtLayer
44 *
45 * @param[in] input First tensor input info. Data types supported: F16/F32.
46 * @param[in] output Output tensor info. Data types supported: Same as @p input.
47 *
48 * @return a status
49 */
50 static Status validate(const ITensorInfo *input, const ITensorInfo *output);
51};
52
53/** Basic function to perform exponential on an input tensor. */
54class NEExpLayer : public INESimpleFunction
55{
56public:
57 /** Initialize the function
58 *
59 * @param[in] input Input tensor. Data types supported: F16/F32.
60 * @param[out] output Output tensor. Data types supported: same as @p input.
61 */
62 void configure(const ITensor *input, ITensor *output);
63 /** Static function to check if given info will lead to a valid configuration of @ref NEExpLayer
64 *
65 * @param[in] input First tensor input info. Data types supported: F16/F32.
66 * @param[in] output Output tensor info. Data types supported: Same as @p input.
67 *
68 * @return a status
69 */
70 static Status validate(const ITensorInfo *input, const ITensorInfo *output);
71};
Usama Ariff6e475c2019-05-10 12:06:28 +010072
73/** Basic function to negate an input tensor. */
74class NENegLayer : public INESimpleFunction
75{
76public:
77 /** Initialize the function
78 *
79 * @param[in] input Input tensor. Data types supported: F16/F32/S32.
80 * @param[out] output Output tensor. Data types supported: same as @p input.
81 */
82 void configure(const ITensor *input, ITensor *output);
83 /** Static function to check if given info will lead to a valid configuration of @ref NENegLayer
84 *
85 * @param[in] input First tensor input info. Data types supported: F16/F32/S32.
86 * @param[in] output Output tensor info. Data types supported: Same as @p input.
87 *
88 * @return a status
89 */
90 static Status validate(const ITensorInfo *input, const ITensorInfo *output);
91};
Usama Arifc255aa72019-05-13 16:26:29 +010092
93/** Basic function to compute the natural logarithm of an input tensor. */
94class NELogLayer : public INESimpleFunction
95{
96public:
97 /** Initialize the function
98 *
99 * @param[in] input Input tensor. Data types supported: F16/F32/S32.
100 * @param[out] output Output tensor. Data types supported: same as @p input.
101 */
102 void configure(const ITensor *input, ITensor *output);
103 /** Static function to check if given info will lead to a valid configuration of @ref NELogLayer
104 *
105 * @param[in] input First tensor input info. Data types supported: F16/F32/S32.
106 * @param[in] output Output tensor info. Data types supported: Same as @p input.
107 *
108 * @return a status
109 */
110 static Status validate(const ITensorInfo *input, const ITensorInfo *output);
111};
George Wort5a97b282018-12-21 16:21:04 +0000112} // namespace arm_compute
113#endif /* __ARM_COMPUTE_NEELEMENTWISEUNARYLAYER_H__ */