blob: 176a863ac5c8698f251e9938493bcfa5503f3ed5 [file] [log] [blame]
Mohammed Suhail Munshi8609ca02024-02-29 17:00:07 +00001/*
2 * Copyright (c) 2024 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
25#ifndef ACL_ARM_COMPUTE_FUNCTION_INFO_SCATTERINFO_H
26#define ACL_ARM_COMPUTE_FUNCTION_INFO_SCATTERINFO_H
27
28#include "arm_compute/core/Error.h"
29
30namespace arm_compute
31{
32/** Scatter Function */
33enum class ScatterFunction
34{
35 Update = 0,
36 Add = 1,
37 Sub = 2,
38 Max = 3,
39 Min = 4
40};
41/** Scatter operator information */
42struct ScatterInfo
43{
44 ScatterInfo(ScatterFunction f, bool zero) : func(f), zero_initialization(zero)
45 {
46 ARM_COMPUTE_ERROR_ON_MSG(f != ScatterFunction::Add && zero,
47 "Zero initialisation is only supported with Add Scatter Function.");
48 }
49 ScatterFunction func; /**< Type of scatter function to use with scatter operator*/
50 bool zero_initialization{false}; /**< Fill output tensors with 0. Only available with add scatter function. */
51};
52} // namespace arm_compute
53
54#endif // ACL_ARM_COMPUTE_FUNCTION_INFO_SCATTERINFO_H