blob: 330d27275217ad30a442e3523a5a21428ac94a00 [file] [log] [blame]
Sang-Hoon Park5db75c32021-01-07 16:59:32 +00001/*
Pablo Marquez Tello586fff92022-06-10 09:20:14 +01002 * Copyright (c) 2021-2022 Arm Limited.
Sang-Hoon Park5db75c32021-01-07 16:59:32 +00003 *
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_NEON_WRAPPER_SVTRAITS_H
25#define SRC_CORE_NEON_WRAPPER_SVTRAITS_H
Michalis Spyrou20fca522021-06-07 14:23:57 +010026#if defined(ARM_COMPUTE_ENABLE_SVE)
Sang-Hoon Park5db75c32021-01-07 16:59:32 +000027#include "src/core/NEON/SVEMath.h"
Felix Thomasmathibalanafd38f02023-09-27 17:46:17 +010028
Sang-Hoon Park5db75c32021-01-07 16:59:32 +000029#include <arm_sve.h>
30
31namespace arm_compute
32{
33namespace wrapper
34{
35template <typename T>
36struct sve_scalar;
37template <typename T>
38struct sve_vector;
39
40#define DEFINE_TYPES(stype) \
41 template <> \
42 struct sve_scalar<sv##stype> \
43 { \
44 using type = stype; \
45 }; \
46 template <> \
47 struct sve_vector<stype> \
48 { \
49 using type = sv##stype; \
50 };
51
52DEFINE_TYPES(int8_t)
53DEFINE_TYPES(uint8_t)
54DEFINE_TYPES(int16_t)
55DEFINE_TYPES(uint16_t)
56DEFINE_TYPES(int32_t)
57DEFINE_TYPES(uint32_t)
58DEFINE_TYPES(int64_t)
59DEFINE_TYPES(uint64_t)
60DEFINE_TYPES(float16_t)
61DEFINE_TYPES(float32_t)
62DEFINE_TYPES(float64_t)
Pablo Marquez Tello586fff92022-06-10 09:20:14 +010063
64#if __ARM_FEATURE_SVE_BF16
Sang-Hoon Park5db75c32021-01-07 16:59:32 +000065DEFINE_TYPES(bfloat16_t)
Pablo Marquez Tello586fff92022-06-10 09:20:14 +010066#endif // #if __ARM_FEATURE_SVE_BF16
Sang-Hoon Park5db75c32021-01-07 16:59:32 +000067
68#undef DEFINE_TYPES
69
70} // namespace wrapper
71} // namespace arm_compute
72
Michalis Spyrou20fca522021-06-07 14:23:57 +010073#endif /* defined(ARM_COMPUTE_ENABLE_SVE) */
Sang-Hoon Park5db75c32021-01-07 16:59:32 +000074#endif /* #ifndef SRC_CORE_NEON_WRAPPER_SVTRAITS_H */