Georgios Pinitas | ff4fca0 | 2020-10-02 21:00:00 +0100 | [diff] [blame] | 1 | /* |
Michalis Spyrou | a3c9a3b | 2020-12-08 21:02:16 +0000 | [diff] [blame] | 2 | * Copyright (c) 2020-2021 Arm Limited. |
Georgios Pinitas | ff4fca0 | 2020-10-02 21:00:00 +0100 | [diff] [blame] | 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 SRC_CORE_COMMON_REGISTRARS_H |
| 25 | #define SRC_CORE_COMMON_REGISTRARS_H |
| 26 | |
Michalis Spyrou | aa51a5b | 2020-11-22 00:49:42 +0000 | [diff] [blame] | 27 | #if defined(ENABLE_FP16_KERNELS) |
| 28 | |
Georgios Pinitas | bdcdc39 | 2021-04-22 16:42:03 +0100 | [diff] [blame^] | 29 | #if defined(ENABLE_SVE) |
Michalis Spyrou | aa51a5b | 2020-11-22 00:49:42 +0000 | [diff] [blame] | 30 | #define REGISTER_FP16_SVE(func_name) &(func_name) |
Georgios Pinitas | bdcdc39 | 2021-04-22 16:42:03 +0100 | [diff] [blame^] | 31 | #else /* !defined(ENABLE_SVE) */ |
Michalis Spyrou | aa51a5b | 2020-11-22 00:49:42 +0000 | [diff] [blame] | 32 | #define REGISTER_FP16_SVE(func_name) nullptr |
Georgios Pinitas | bdcdc39 | 2021-04-22 16:42:03 +0100 | [diff] [blame^] | 33 | #endif /* defined(ENABLE_SVE) */ |
Michalis Spyrou | aa51a5b | 2020-11-22 00:49:42 +0000 | [diff] [blame] | 34 | |
Georgios Pinitas | bdcdc39 | 2021-04-22 16:42:03 +0100 | [diff] [blame^] | 35 | #if defined(ENABLE_NEON) && defined(__ARM_FEATURE_FP16_VECTOR_ARITHMETIC) |
Georgios Pinitas | ff4fca0 | 2020-10-02 21:00:00 +0100 | [diff] [blame] | 36 | #define REGISTER_FP16_NEON(func_name) &(func_name) |
Georgios Pinitas | bdcdc39 | 2021-04-22 16:42:03 +0100 | [diff] [blame^] | 37 | #else /* !defined(ENABLE_NEON) */ |
Georgios Pinitas | ff4fca0 | 2020-10-02 21:00:00 +0100 | [diff] [blame] | 38 | #define REGISTER_FP16_NEON(func_name) nullptr |
Georgios Pinitas | bdcdc39 | 2021-04-22 16:42:03 +0100 | [diff] [blame^] | 39 | #endif /* defined(ENABLE_NEON) && defined(__ARM_FEATURE_FP16_VECTOR_ARITHMETIC) */ |
Michalis Spyrou | aa51a5b | 2020-11-22 00:49:42 +0000 | [diff] [blame] | 40 | |
| 41 | #else /* !defined(ENABLE_FP16_KERNELS) */ |
| 42 | #define REGISTER_FP16_NEON(func_name) nullptr |
| 43 | #define REGISTER_FP16_SVE(func_name) nullptr |
Georgios Pinitas | ff4fca0 | 2020-10-02 21:00:00 +0100 | [diff] [blame] | 44 | #endif /* defined(__ARM_FEATURE_FP16_VECTOR_ARITHMETIC) && defined(ENABLE_FP16_KERNELS) */ |
| 45 | |
| 46 | #if defined(ENABLE_FP32_KERNELS) |
Georgios Pinitas | bdcdc39 | 2021-04-22 16:42:03 +0100 | [diff] [blame^] | 47 | |
| 48 | #if defined(ENABLE_SVE) |
Michalis Spyrou | aa51a5b | 2020-11-22 00:49:42 +0000 | [diff] [blame] | 49 | #define REGISTER_FP32_SVE(func_name) &(func_name) |
Georgios Pinitas | bdcdc39 | 2021-04-22 16:42:03 +0100 | [diff] [blame^] | 50 | #else /* !defined(ENABLE_SVE) */ |
| 51 | #define REGISTER_FP32_SVE(func_name) nullptr |
| 52 | #endif /* defined(ENABLE_SVE) */ |
| 53 | |
| 54 | #if defined(ENABLE_NEON) |
Georgios Pinitas | ff4fca0 | 2020-10-02 21:00:00 +0100 | [diff] [blame] | 55 | #define REGISTER_FP32_NEON(func_name) &(func_name) |
Georgios Pinitas | bdcdc39 | 2021-04-22 16:42:03 +0100 | [diff] [blame^] | 56 | #else /* !defined(ENABLE_NEON) */ |
| 57 | #define REGISTER_FP32_NEON(func_name) nullptr |
| 58 | #endif /* defined(ENABLE_NEON) */ |
| 59 | |
Georgios Pinitas | ff4fca0 | 2020-10-02 21:00:00 +0100 | [diff] [blame] | 60 | #else /* defined(ENABLE_FP32_KERNELS) */ |
| 61 | #define REGISTER_FP32_NEON(func_name) nullptr |
Michalis Spyrou | aa51a5b | 2020-11-22 00:49:42 +0000 | [diff] [blame] | 62 | #define REGISTER_FP32_SVE(func_name) nullptr |
Georgios Pinitas | ff4fca0 | 2020-10-02 21:00:00 +0100 | [diff] [blame] | 63 | #endif /* defined(ENABLE_FP32_KERNELS) */ |
| 64 | |
Michalis Spyrou | c4d4555 | 2020-10-19 12:41:30 +0100 | [diff] [blame] | 65 | #if defined(ENABLE_QASYMM8_SIGNED_KERNELS) |
Georgios Pinitas | bdcdc39 | 2021-04-22 16:42:03 +0100 | [diff] [blame^] | 66 | |
Michalis Spyrou | c4d4555 | 2020-10-19 12:41:30 +0100 | [diff] [blame] | 67 | #define REGISTER_QASYMM8_SIGNED_NEON(func_name) &(func_name) |
Georgios Pinitas | bdcdc39 | 2021-04-22 16:42:03 +0100 | [diff] [blame^] | 68 | |
| 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 Spyrou | c4d4555 | 2020-10-19 12:41:30 +0100 | [diff] [blame] | 75 | #else /* defined(ENABLE_QASYMM8_SIGNED_KERNELS) */ |
| 76 | #define REGISTER_QASYMM8_SIGNED_NEON(func_name) nullptr |
Michalis Spyrou | aa51a5b | 2020-11-22 00:49:42 +0000 | [diff] [blame] | 77 | #define REGISTER_QASYMM8_SIGNED_SVE(func_name) nullptr |
Michalis Spyrou | c4d4555 | 2020-10-19 12:41:30 +0100 | [diff] [blame] | 78 | #endif /* defined(ENABLE_QASYMM8_SIGNED_KERNELS) */ |
| 79 | |
| 80 | #if defined(ENABLE_QASYMM8_KERNELS) |
| 81 | #define REGISTER_QASYMM8_NEON(func_name) &(func_name) |
Georgios Pinitas | bdcdc39 | 2021-04-22 16:42:03 +0100 | [diff] [blame^] | 82 | |
| 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 Spyrou | c4d4555 | 2020-10-19 12:41:30 +0100 | [diff] [blame] | 89 | #else /* defined(ENABLE_QASYMM8_KERNELS) */ |
| 90 | #define REGISTER_QASYMM8_NEON(func_name) nullptr |
Michalis Spyrou | aa51a5b | 2020-11-22 00:49:42 +0000 | [diff] [blame] | 91 | #define REGISTER_QASYMM8_SVE(func_name) nullptr |
Michalis Spyrou | c4d4555 | 2020-10-19 12:41:30 +0100 | [diff] [blame] | 92 | #endif /* defined(ENABLE_QASYMM8_KERNELS) */ |
| 93 | |
| 94 | #if defined(ENABLE_QSYMM16_KERNELS) |
Georgios Pinitas | bdcdc39 | 2021-04-22 16:42:03 +0100 | [diff] [blame^] | 95 | |
Michalis Spyrou | c4d4555 | 2020-10-19 12:41:30 +0100 | [diff] [blame] | 96 | #define REGISTER_QSYMM16_NEON(func_name) &(func_name) |
Georgios Pinitas | bdcdc39 | 2021-04-22 16:42:03 +0100 | [diff] [blame^] | 97 | |
| 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 Spyrou | c4d4555 | 2020-10-19 12:41:30 +0100 | [diff] [blame] | 104 | #else /* defined(ENABLE_QSYMM16_KERNELS) */ |
| 105 | #define REGISTER_QSYMM16_NEON(func_name) nullptr |
Michalis Spyrou | aa51a5b | 2020-11-22 00:49:42 +0000 | [diff] [blame] | 106 | #define REGISTER_QSYMM16_SVE(func_name) nullptr |
Michalis Spyrou | c4d4555 | 2020-10-19 12:41:30 +0100 | [diff] [blame] | 107 | #endif /* defined(ENABLE_QSYMM16_KERNELS) */ |
| 108 | |
Michalis Spyrou | a3c9a3b | 2020-12-08 21:02:16 +0000 | [diff] [blame] | 109 | #if defined(ENABLE_INTEGER_KERNELS) |
Georgios Pinitas | bdcdc39 | 2021-04-22 16:42:03 +0100 | [diff] [blame^] | 110 | |
| 111 | #if defined(ENABLE_SVE) |
Michalis Spyrou | a3c9a3b | 2020-12-08 21:02:16 +0000 | [diff] [blame] | 112 | #define REGISTER_INTEGER_SVE(func_name) &(func_name) |
Georgios Pinitas | bdcdc39 | 2021-04-22 16:42:03 +0100 | [diff] [blame^] | 113 | #else /* !defined(ENABLE_SVE) */ |
| 114 | #define REGISTER_INTEGER_SVE(func_name) nullptr |
| 115 | #endif /* defined(ENABLE_SVE) */ |
| 116 | |
| 117 | #if defined(ENABLE_NEON) |
Michalis Spyrou | a3c9a3b | 2020-12-08 21:02:16 +0000 | [diff] [blame] | 118 | #define REGISTER_INTEGER_NEON(func_name) &(func_name) |
Georgios Pinitas | bdcdc39 | 2021-04-22 16:42:03 +0100 | [diff] [blame^] | 119 | #else /* !defined(ENABLE_NEON) */ |
| 120 | #define REGISTER_INTEGER_NEON(func_name) nullptr |
| 121 | #endif /* defined(ENABLE_NEON) */ |
| 122 | |
Michalis Spyrou | a3c9a3b | 2020-12-08 21:02:16 +0000 | [diff] [blame] | 123 | #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 Pinitas | ff4fca0 | 2020-10-02 21:00:00 +0100 | [diff] [blame] | 128 | #endif /* SRC_CORE_COMMON_REGISTRARS_H */ |