blob: 8c5a39ad49ae9bb8ae69f7c32b9d21013f7314cf [file] [log] [blame]
Giorgio Arena5ae8d802021-11-18 18:02:13 +00001/*
2 * Copyright (c) 2021-2022 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_CPU_KERNEL_SELECTION_TYPES_H
25#define ARM_COMPUTE_CPU_KERNEL_SELECTION_TYPES_H
26
27#include "arm_compute/core/Types.h"
28#include "src/common/cpuinfo/CpuIsaInfo.h"
29
30namespace arm_compute
31{
32namespace cpu
33{
34namespace kernels
35{
36// Selector data types
37struct DataTypeISASelectorData
38{
Giorgio Arenad56d94d2022-02-07 16:19:55 +000039 DataType dt;
40 cpuinfo::CpuIsaInfo isa;
Giorgio Arena5ae8d802021-11-18 18:02:13 +000041};
42
alerah01c9e519d2022-01-31 19:04:10 +020043struct DataTypeDataLayoutISASelectorData
44{
45 DataType dt;
46 DataLayout dl;
47 const cpuinfo::CpuIsaInfo &isa;
48};
49
Giorgio Arena5ae8d802021-11-18 18:02:13 +000050struct PoolDataTypeISASelectorData
51{
Giorgio Arenad56d94d2022-02-07 16:19:55 +000052 DataType dt;
53 DataLayout dl;
54 int pool_stride_x;
55 Size2D pool_size;
56 cpuinfo::CpuIsaInfo isa;
Giorgio Arena5ae8d802021-11-18 18:02:13 +000057};
58
Dana Zlotnik6a2df882022-01-17 09:54:26 +020059struct ElementwiseDataTypeISASelectorData
60{
61 DataType dt;
62 cpuinfo::CpuIsaInfo isa;
63 int op;
64};
Dana Zlotnikebbae942022-02-03 12:52:15 +020065struct DepthwiseConv2dNativeDataTypeISASelectorData
66{
67 DataType weights_dt;
68 DataType source_dt;
69 const cpuinfo::CpuIsaInfo &isa;
70};
Giorgio Arena5ae8d802021-11-18 18:02:13 +000071// Selector pointer types
Dana Zlotnikebbae942022-02-03 12:52:15 +020072using DataTypeISASelectorPtr = std::add_pointer<bool(const DataTypeISASelectorData &data)>::type;
alerah01c9e519d2022-01-31 19:04:10 +020073using DataTypeDataLayoutSelectorPtr = std::add_pointer<bool(const DataTypeDataLayoutISASelectorData &data)>::type;
Dana Zlotnikebbae942022-02-03 12:52:15 +020074using PoolDataTypeISASelectorPtr = std::add_pointer<bool(const PoolDataTypeISASelectorData &data)>::type;
75using ElementwiseDataTypeISASelectorPtr = std::add_pointer<bool(const ElementwiseDataTypeISASelectorData &data)>::type;
76using DepthwiseConv2dNativeDataTypeISASelectorPtr = std::add_pointer<bool(const DepthwiseConv2dNativeDataTypeISASelectorData &data)>::type;
Giorgio Arena5ae8d802021-11-18 18:02:13 +000077
78} // namespace kernels
79} // namespace cpu
80} // namespace arm_compute
81
82#endif // ARM_COMPUTE_CPU_KERNEL_SELECTION_TYPES_H