blob: afcf014ad2c9c0609e1de5b5969e94bb95f78df3 [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
Yair Schwarzbaum298b2c02022-02-01 08:55:56 +020050struct CastDataTypeISASelectorData
51{
52 DataType src_dt;
53 DataType dst_dt;
54 const cpuinfo::CpuIsaInfo &isa;
55};
56
Giorgio Arena5ae8d802021-11-18 18:02:13 +000057struct PoolDataTypeISASelectorData
58{
Giorgio Arenad56d94d2022-02-07 16:19:55 +000059 DataType dt;
60 DataLayout dl;
61 int pool_stride_x;
62 Size2D pool_size;
63 cpuinfo::CpuIsaInfo isa;
Giorgio Arena5ae8d802021-11-18 18:02:13 +000064};
65
Dana Zlotnik6a2df882022-01-17 09:54:26 +020066struct ElementwiseDataTypeISASelectorData
67{
68 DataType dt;
69 cpuinfo::CpuIsaInfo isa;
70 int op;
71};
Dana Zlotnikebbae942022-02-03 12:52:15 +020072struct DepthwiseConv2dNativeDataTypeISASelectorData
73{
74 DataType weights_dt;
75 DataType source_dt;
76 const cpuinfo::CpuIsaInfo &isa;
77};
Giorgio Arena5ae8d802021-11-18 18:02:13 +000078// Selector pointer types
Dana Zlotnikebbae942022-02-03 12:52:15 +020079using DataTypeISASelectorPtr = std::add_pointer<bool(const DataTypeISASelectorData &data)>::type;
alerah01c9e519d2022-01-31 19:04:10 +020080using DataTypeDataLayoutSelectorPtr = std::add_pointer<bool(const DataTypeDataLayoutISASelectorData &data)>::type;
Dana Zlotnikebbae942022-02-03 12:52:15 +020081using PoolDataTypeISASelectorPtr = std::add_pointer<bool(const PoolDataTypeISASelectorData &data)>::type;
82using ElementwiseDataTypeISASelectorPtr = std::add_pointer<bool(const ElementwiseDataTypeISASelectorData &data)>::type;
83using DepthwiseConv2dNativeDataTypeISASelectorPtr = std::add_pointer<bool(const DepthwiseConv2dNativeDataTypeISASelectorData &data)>::type;
Yair Schwarzbaum298b2c02022-02-01 08:55:56 +020084using CastDataTypeISASelectorDataPtr = std::add_pointer<bool(const CastDataTypeISASelectorData &data)>::type;
Giorgio Arena5ae8d802021-11-18 18:02:13 +000085
86} // namespace kernels
87} // namespace cpu
88} // namespace arm_compute
89
90#endif // ARM_COMPUTE_CPU_KERNEL_SELECTION_TYPES_H