Compute Library
 21.02
svtraits.h
Go to the documentation of this file.
1 /*
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
26 #if defined(__ARM_FEATURE_SVE)
27 #include "src/core/NEON/SVEMath.h"
28 #include <arm_sve.h>
29 
30 namespace arm_compute
31 {
32 namespace wrapper
33 {
34 template <typename T>
35 struct sve_scalar;
36 template <typename T>
37 struct 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 
51 DEFINE_TYPES(int8_t)
52 DEFINE_TYPES(uint8_t)
53 DEFINE_TYPES(int16_t)
54 DEFINE_TYPES(uint16_t)
55 DEFINE_TYPES(int32_t)
56 DEFINE_TYPES(uint32_t)
57 DEFINE_TYPES(int64_t)
58 DEFINE_TYPES(uint64_t)
59 DEFINE_TYPES(float16_t)
60 DEFINE_TYPES(float32_t)
61 DEFINE_TYPES(float64_t)
62 DEFINE_TYPES(bfloat16_t)
63 
64 #undef DEFINE_TYPES
65 
66 } // namespace wrapper
67 } // namespace arm_compute
68 
69 #endif /* defined(__ARM_FEATURE_SVE) */
70 #endif /* #ifndef SRC_CORE_NEON_WRAPPER_SVTRAITS_H */
Copyright (c) 2017-2021 Arm Limited.