blob: 5ccd0ba8f122f68f8baf6db86bb7ddce771833b6 [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"
28#include <arm_sve.h>
29
30namespace arm_compute
31{
32namespace wrapper
33{
34template <typename T>
35struct sve_scalar;
36template <typename T>
37struct sve_vector;
38
39#define DEFINE_TYPES(stype) \
40 template <> \
41 struct sve_scalar<sv##stype> \
42 { \
43 using type = stype; \
44 }; \
45 template <> \
46 struct sve_vector<stype> \
47 { \
48 using type = sv##stype; \
49 };
50
51DEFINE_TYPES(int8_t)
52DEFINE_TYPES(uint8_t)
53DEFINE_TYPES(int16_t)
54DEFINE_TYPES(uint16_t)
55DEFINE_TYPES(int32_t)
56DEFINE_TYPES(uint32_t)
57DEFINE_TYPES(int64_t)
58DEFINE_TYPES(uint64_t)
59DEFINE_TYPES(float16_t)
60DEFINE_TYPES(float32_t)
61DEFINE_TYPES(float64_t)
Pablo Marquez Tello586fff92022-06-10 09:20:14 +010062
63#if __ARM_FEATURE_SVE_BF16
Sang-Hoon Park5db75c32021-01-07 16:59:32 +000064DEFINE_TYPES(bfloat16_t)
Pablo Marquez Tello586fff92022-06-10 09:20:14 +010065#endif // #if __ARM_FEATURE_SVE_BF16
Sang-Hoon Park5db75c32021-01-07 16:59:32 +000066
67#undef DEFINE_TYPES
68
69} // namespace wrapper
70} // namespace arm_compute
71
Michalis Spyrou20fca522021-06-07 14:23:57 +010072#endif /* defined(ARM_COMPUTE_ENABLE_SVE) */
Sang-Hoon Park5db75c32021-01-07 16:59:32 +000073#endif /* #ifndef SRC_CORE_NEON_WRAPPER_SVTRAITS_H */