blob: 44ddf9808dc6451f2b7f8ee6189f2027cb81c3f5 [file] [log] [blame]
Georgios Pinitasff4fca02020-10-02 21:00:00 +01001/*
Michalis Spyroua3c9a3b2020-12-08 21:02:16 +00002 * Copyright (c) 2020-2021 Arm Limited.
Georgios Pinitasff4fca02020-10-02 21:00:00 +01003 *
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 SRC_CORE_COMMON_REGISTRARS_H
25#define SRC_CORE_COMMON_REGISTRARS_H
26
Michalis Spyrouaa51a5b2020-11-22 00:49:42 +000027#if defined(ENABLE_FP16_KERNELS)
28
Georgios Pinitasbdcdc392021-04-22 16:42:03 +010029#if defined(ENABLE_SVE)
Michalis Spyrouaa51a5b2020-11-22 00:49:42 +000030#define REGISTER_FP16_SVE(func_name) &(func_name)
Georgios Pinitasbdcdc392021-04-22 16:42:03 +010031#else /* !defined(ENABLE_SVE) */
Michalis Spyrouaa51a5b2020-11-22 00:49:42 +000032#define REGISTER_FP16_SVE(func_name) nullptr
Georgios Pinitasbdcdc392021-04-22 16:42:03 +010033#endif /* defined(ENABLE_SVE) */
Michalis Spyrouaa51a5b2020-11-22 00:49:42 +000034
Georgios Pinitasbdcdc392021-04-22 16:42:03 +010035#if defined(ENABLE_NEON) && defined(__ARM_FEATURE_FP16_VECTOR_ARITHMETIC)
Georgios Pinitasff4fca02020-10-02 21:00:00 +010036#define REGISTER_FP16_NEON(func_name) &(func_name)
Georgios Pinitasbdcdc392021-04-22 16:42:03 +010037#else /* !defined(ENABLE_NEON) */
Georgios Pinitasff4fca02020-10-02 21:00:00 +010038#define REGISTER_FP16_NEON(func_name) nullptr
Georgios Pinitasbdcdc392021-04-22 16:42:03 +010039#endif /* defined(ENABLE_NEON) && defined(__ARM_FEATURE_FP16_VECTOR_ARITHMETIC) */
Michalis Spyrouaa51a5b2020-11-22 00:49:42 +000040
41#else /* !defined(ENABLE_FP16_KERNELS) */
42#define REGISTER_FP16_NEON(func_name) nullptr
43#define REGISTER_FP16_SVE(func_name) nullptr
Georgios Pinitasff4fca02020-10-02 21:00:00 +010044#endif /* defined(__ARM_FEATURE_FP16_VECTOR_ARITHMETIC) && defined(ENABLE_FP16_KERNELS) */
45
46#if defined(ENABLE_FP32_KERNELS)
Georgios Pinitasbdcdc392021-04-22 16:42:03 +010047
48#if defined(ENABLE_SVE)
Michalis Spyrouaa51a5b2020-11-22 00:49:42 +000049#define REGISTER_FP32_SVE(func_name) &(func_name)
Georgios Pinitasbdcdc392021-04-22 16:42:03 +010050#else /* !defined(ENABLE_SVE) */
51#define REGISTER_FP32_SVE(func_name) nullptr
52#endif /* defined(ENABLE_SVE) */
53
54#if defined(ENABLE_NEON)
Georgios Pinitasff4fca02020-10-02 21:00:00 +010055#define REGISTER_FP32_NEON(func_name) &(func_name)
Georgios Pinitasbdcdc392021-04-22 16:42:03 +010056#else /* !defined(ENABLE_NEON) */
57#define REGISTER_FP32_NEON(func_name) nullptr
58#endif /* defined(ENABLE_NEON) */
59
Georgios Pinitasff4fca02020-10-02 21:00:00 +010060#else /* defined(ENABLE_FP32_KERNELS) */
61#define REGISTER_FP32_NEON(func_name) nullptr
Michalis Spyrouaa51a5b2020-11-22 00:49:42 +000062#define REGISTER_FP32_SVE(func_name) nullptr
Georgios Pinitasff4fca02020-10-02 21:00:00 +010063#endif /* defined(ENABLE_FP32_KERNELS) */
64
Michalis Spyrouc4d45552020-10-19 12:41:30 +010065#if defined(ENABLE_QASYMM8_SIGNED_KERNELS)
Georgios Pinitasbdcdc392021-04-22 16:42:03 +010066
Michalis Spyrouc4d45552020-10-19 12:41:30 +010067#define REGISTER_QASYMM8_SIGNED_NEON(func_name) &(func_name)
Georgios Pinitasbdcdc392021-04-22 16:42:03 +010068
69#if defined(ENABLE_SVE)
70#define REGISTER_QASYMM8_SIGNED_SVE(func_name) &(func_name)
71#else /* !defined(ENABLE_SVE) */
72#define REGISTER_QASYMM8_SIGNED_SVE(func_name) nullptr
73#endif /* defined(ENABLE_SVE) */
74
Michalis Spyrouc4d45552020-10-19 12:41:30 +010075#else /* defined(ENABLE_QASYMM8_SIGNED_KERNELS) */
76#define REGISTER_QASYMM8_SIGNED_NEON(func_name) nullptr
Michalis Spyrouaa51a5b2020-11-22 00:49:42 +000077#define REGISTER_QASYMM8_SIGNED_SVE(func_name) nullptr
Michalis Spyrouc4d45552020-10-19 12:41:30 +010078#endif /* defined(ENABLE_QASYMM8_SIGNED_KERNELS) */
79
80#if defined(ENABLE_QASYMM8_KERNELS)
81#define REGISTER_QASYMM8_NEON(func_name) &(func_name)
Georgios Pinitasbdcdc392021-04-22 16:42:03 +010082
83#if defined(ENABLE_SVE)
84#define REGISTER_QASYMM8_SVE(func_name) &(func_name)
85#else /* !defined(ENABLE_SVE) */
86#define REGISTER_QASYMM8_SVE(func_name) nullptr
87#endif /* defined(ENABLE_SVE) */
88
Michalis Spyrouc4d45552020-10-19 12:41:30 +010089#else /* defined(ENABLE_QASYMM8_KERNELS) */
90#define REGISTER_QASYMM8_NEON(func_name) nullptr
Michalis Spyrouaa51a5b2020-11-22 00:49:42 +000091#define REGISTER_QASYMM8_SVE(func_name) nullptr
Michalis Spyrouc4d45552020-10-19 12:41:30 +010092#endif /* defined(ENABLE_QASYMM8_KERNELS) */
93
94#if defined(ENABLE_QSYMM16_KERNELS)
Georgios Pinitasbdcdc392021-04-22 16:42:03 +010095
Michalis Spyrouc4d45552020-10-19 12:41:30 +010096#define REGISTER_QSYMM16_NEON(func_name) &(func_name)
Georgios Pinitasbdcdc392021-04-22 16:42:03 +010097
98#if defined(ENABLE_SVE)
99#define REGISTER_QSYMM16_SVE(func_name) &(func_name)
100#else /* !defined(ENABLE_SVE) */
101#define REGISTER_QSYMM16_SVE(func_name) nullptr
102#endif /* defined(ENABLE_SVE) */
103
Michalis Spyrouc4d45552020-10-19 12:41:30 +0100104#else /* defined(ENABLE_QSYMM16_KERNELS) */
105#define REGISTER_QSYMM16_NEON(func_name) nullptr
Michalis Spyrouaa51a5b2020-11-22 00:49:42 +0000106#define REGISTER_QSYMM16_SVE(func_name) nullptr
Michalis Spyrouc4d45552020-10-19 12:41:30 +0100107#endif /* defined(ENABLE_QSYMM16_KERNELS) */
108
Michalis Spyroua3c9a3b2020-12-08 21:02:16 +0000109#if defined(ENABLE_INTEGER_KERNELS)
Georgios Pinitasbdcdc392021-04-22 16:42:03 +0100110
111#if defined(ENABLE_SVE)
Michalis Spyroua3c9a3b2020-12-08 21:02:16 +0000112#define REGISTER_INTEGER_SVE(func_name) &(func_name)
Georgios Pinitasbdcdc392021-04-22 16:42:03 +0100113#else /* !defined(ENABLE_SVE) */
114#define REGISTER_INTEGER_SVE(func_name) nullptr
115#endif /* defined(ENABLE_SVE) */
116
117#if defined(ENABLE_NEON)
Michalis Spyroua3c9a3b2020-12-08 21:02:16 +0000118#define REGISTER_INTEGER_NEON(func_name) &(func_name)
Georgios Pinitasbdcdc392021-04-22 16:42:03 +0100119#else /* !defined(ENABLE_NEON) */
120#define REGISTER_INTEGER_NEON(func_name) nullptr
121#endif /* defined(ENABLE_NEON) */
122
Michalis Spyroua3c9a3b2020-12-08 21:02:16 +0000123#else /* defined(ENABLE_INTEGER_KERNELS) */
124#define REGISTER_INTEGER_NEON(func_name) nullptr
125#define REGISTER_INTEGER_SVE(func_name) nullptr
126#endif /* defined(ENABLE_INTEGER_KERNELS) */
127
Georgios Pinitasff4fca02020-10-02 21:00:00 +0100128#endif /* SRC_CORE_COMMON_REGISTRARS_H */