blob: 65f6c7093d44324e6680d1af35589046d16c7fe8 [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
Michalis Spyrou20fca522021-06-07 14:23:57 +010029#if defined(ARM_COMPUTE_ENABLE_SVE)
Michalis Spyrouaa51a5b2020-11-22 00:49:42 +000030#define REGISTER_FP16_SVE(func_name) &(func_name)
Michalis Spyrou20fca522021-06-07 14:23:57 +010031#else /* !defined(ARM_COMPUTE_ENABLE_SVE) */
Michalis Spyrouaa51a5b2020-11-22 00:49:42 +000032#define REGISTER_FP16_SVE(func_name) nullptr
Michalis Spyrou20fca522021-06-07 14:23:57 +010033#endif /* defined(ARM_COMPUTE_ENABLE_SVE) */
Michalis Spyrouaa51a5b2020-11-22 00:49:42 +000034
Michalis Spyrou20fca522021-06-07 14:23:57 +010035#if defined(ARM_COMPUTE_ENABLE_NEON) && defined(__ARM_FEATURE_FP16_VECTOR_ARITHMETIC)
Georgios Pinitasff4fca02020-10-02 21:00:00 +010036#define REGISTER_FP16_NEON(func_name) &(func_name)
Michalis Spyrou20fca522021-06-07 14:23:57 +010037#else /* !defined(ARM_COMPUTE_ENABLE_NEON) */
Georgios Pinitasff4fca02020-10-02 21:00:00 +010038#define REGISTER_FP16_NEON(func_name) nullptr
Michalis Spyrou20fca522021-06-07 14:23:57 +010039#endif /* defined(ARM_COMPUTE_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
Michalis Spyrou20fca522021-06-07 14:23:57 +010048#if defined(ARM_COMPUTE_ENABLE_SVE)
Michalis Spyrouaa51a5b2020-11-22 00:49:42 +000049#define REGISTER_FP32_SVE(func_name) &(func_name)
Michalis Spyrou20fca522021-06-07 14:23:57 +010050#else /* !defined(ARM_COMPUTE_ENABLE_SVE) */
Georgios Pinitasbdcdc392021-04-22 16:42:03 +010051#define REGISTER_FP32_SVE(func_name) nullptr
Michalis Spyrou20fca522021-06-07 14:23:57 +010052#endif /* defined(ARM_COMPUTE_ENABLE_SVE) */
Georgios Pinitasbdcdc392021-04-22 16:42:03 +010053
Michalis Spyrou20fca522021-06-07 14:23:57 +010054#if defined(ARM_COMPUTE_ENABLE_NEON)
Georgios Pinitasff4fca02020-10-02 21:00:00 +010055#define REGISTER_FP32_NEON(func_name) &(func_name)
Michalis Spyrou20fca522021-06-07 14:23:57 +010056#else /* !defined(ARM_COMPUTE_ENABLE_NEON) */
Georgios Pinitasbdcdc392021-04-22 16:42:03 +010057#define REGISTER_FP32_NEON(func_name) nullptr
Michalis Spyrou20fca522021-06-07 14:23:57 +010058#endif /* defined(ARM_COMPUTE_ENABLE_NEON) */
Georgios Pinitasbdcdc392021-04-22 16:42:03 +010059
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
Michalis Spyrou20fca522021-06-07 14:23:57 +010069#if defined(ARM_COMPUTE_ENABLE_SVE)
Georgios Pinitasbdcdc392021-04-22 16:42:03 +010070#define REGISTER_QASYMM8_SIGNED_SVE(func_name) &(func_name)
Michalis Spyrou20fca522021-06-07 14:23:57 +010071#else /* !defined(ARM_COMPUTE_ENABLE_SVE) */
Georgios Pinitasbdcdc392021-04-22 16:42:03 +010072#define REGISTER_QASYMM8_SIGNED_SVE(func_name) nullptr
Michalis Spyrou20fca522021-06-07 14:23:57 +010073#endif /* defined(ARM_COMPUTE_ENABLE_SVE) */
Georgios Pinitasbdcdc392021-04-22 16:42:03 +010074
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
Michalis Spyrou20fca522021-06-07 14:23:57 +010083#if defined(ARM_COMPUTE_ENABLE_SVE)
Georgios Pinitasbdcdc392021-04-22 16:42:03 +010084#define REGISTER_QASYMM8_SVE(func_name) &(func_name)
Michalis Spyrou20fca522021-06-07 14:23:57 +010085#else /* !defined(ARM_COMPUTE_ENABLE_SVE) */
Georgios Pinitasbdcdc392021-04-22 16:42:03 +010086#define REGISTER_QASYMM8_SVE(func_name) nullptr
Michalis Spyrou20fca522021-06-07 14:23:57 +010087#endif /* defined(ARM_COMPUTE_ENABLE_SVE) */
Georgios Pinitasbdcdc392021-04-22 16:42:03 +010088
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
Michalis Spyrou20fca522021-06-07 14:23:57 +010098#if defined(ARM_COMPUTE_ENABLE_SVE)
Georgios Pinitasbdcdc392021-04-22 16:42:03 +010099#define REGISTER_QSYMM16_SVE(func_name) &(func_name)
Michalis Spyrou20fca522021-06-07 14:23:57 +0100100#else /* !defined(ARM_COMPUTE_ENABLE_SVE) */
Georgios Pinitasbdcdc392021-04-22 16:42:03 +0100101#define REGISTER_QSYMM16_SVE(func_name) nullptr
Michalis Spyrou20fca522021-06-07 14:23:57 +0100102#endif /* defined(ARM_COMPUTE_ENABLE_SVE) */
Georgios Pinitasbdcdc392021-04-22 16:42:03 +0100103
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
Michalis Spyrou20fca522021-06-07 14:23:57 +0100111#if defined(ARM_COMPUTE_ENABLE_SVE)
Michalis Spyroua3c9a3b2020-12-08 21:02:16 +0000112#define REGISTER_INTEGER_SVE(func_name) &(func_name)
Michalis Spyrou20fca522021-06-07 14:23:57 +0100113#else /* !defined(ARM_COMPUTE_ENABLE_SVE) */
Georgios Pinitasbdcdc392021-04-22 16:42:03 +0100114#define REGISTER_INTEGER_SVE(func_name) nullptr
Michalis Spyrou20fca522021-06-07 14:23:57 +0100115#endif /* defined(ARM_COMPUTE_ENABLE_SVE) */
Georgios Pinitasbdcdc392021-04-22 16:42:03 +0100116
Michalis Spyrou20fca522021-06-07 14:23:57 +0100117#if defined(ARM_COMPUTE_ENABLE_NEON)
Michalis Spyroua3c9a3b2020-12-08 21:02:16 +0000118#define REGISTER_INTEGER_NEON(func_name) &(func_name)
Michalis Spyrou20fca522021-06-07 14:23:57 +0100119#else /* !defined(ARM_COMPUTE_ENABLE_NEON) */
Georgios Pinitasbdcdc392021-04-22 16:42:03 +0100120#define REGISTER_INTEGER_NEON(func_name) nullptr
Michalis Spyrou20fca522021-06-07 14:23:57 +0100121#endif /* defined(ARM_COMPUTE_ENABLE_NEON) */
Georgios Pinitasbdcdc392021-04-22 16:42:03 +0100122
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 */