blob: 1d599a246c484de5bf6c3d479c0f1237742c7b07 [file] [log] [blame]
Sang-Hoon Park5db75c32021-01-07 16:59:32 +00001/*
2 * Copyright (c) 2021 Arm Limited.
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_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)
62DEFINE_TYPES(bfloat16_t)
63
64#undef DEFINE_TYPES
65
66} // namespace wrapper
67} // namespace arm_compute
68
Michalis Spyrou20fca522021-06-07 14:23:57 +010069#endif /* defined(ARM_COMPUTE_ENABLE_SVE) */
Sang-Hoon Park5db75c32021-01-07 16:59:32 +000070#endif /* #ifndef SRC_CORE_NEON_WRAPPER_SVTRAITS_H */