blob: cc95584048ea7ef9e9d10ef7e7af8b466ddc3472 [file] [log] [blame]
Georgios Pinitas6d9d6f42018-12-24 16:10:47 +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_NE_SLICE_H__
25#define __ARM_COMPUTE_NE_SLICE_H__
26
27#include "arm_compute/runtime/NEON/INESimpleFunctionNoBorder.h"
28
29namespace arm_compute
30{
31// Forward Declarations
32class ITensor;
33
34/** Basic function to perform tensor slicing */
35class NESlice : public INESimpleFunctionNoBorder
36{
37public:
38 /** Configure kernel
39 *
40 * @note Supported tensor rank: up to 4
41 * @note Start indices must be non-negative. 0 <= starts[i]
42 * @note End coordinates can be negative, which represents the number of elements before the end of that dimension.
43 * @note End indices are not inclusive unless negative.
44 *
45 * @param[in] input Source tensor. Data type supported: U8/S8/QASYMM8/U16/S16/U32/S32/F16/F32
46 * @param[out] output Destination tensor. Data type supported: Same as @p input
47 * @param[in] starts The starts of the dimensions of the input tensor to be sliced. The length must be of rank(input).
48 * @param[in] ends The ends of the dimensions of the input tensor to be sliced. The length must be of rank(input).
49 */
50 void configure(const ITensor *input, ITensor *output, const Coordinates &starts, const Coordinates &ends);
51
52 /** Static function to check if given info will lead to a valid configuration of @ref NESlice
53 *
54 * @note Supported tensor rank: up to 4
55 * @note Start indices must be non-negative. 0 <= starts[i]
56 * @note End coordinates can be negative, which represents the number of elements before the end of that dimension.
57 * @note End indices are not inclusive unless negative.
58 *
59 * @param[in] input Source tensor info. Data type supported: U8/S8/QASYMM8/U16/S16/U32/S32/F16/F32
60 * @param[in] output Destination tensor info. Data type supported: Same as @p input
61 * @param[in] starts The starts of the dimensions of the input tensor to be sliced. The length must be of rank(input).
62 * @param[in] ends The ends of the dimensions of the input tensor to be sliced. The length must be of rank(input).
63 *
64 * @return A status
65 */
66 static Status validate(const ITensorInfo *input, const ITensorInfo *output, const Coordinates &starts, const Coordinates &ends);
67};
68} // namespace arm_compute
69#endif /* __ARM_COMPUTE_NE_SLICE_H__ */