TISP User Guide
TISP_DSPLIB_types.hpp
Go to the documentation of this file.
1 #ifndef _TISP_DSPLIB_TYPES_HPP_
2 #define _TISP_DSPLIB_TYPES_HPP_
3 
4 #include "dsplib.h"
5 #include <stdint.h>
6 
7 template <int32_t dType> struct DSPLIB_element_type {
8  using type = uint8_t;
9 };
10 
11 template <> struct DSPLIB_element_type<DSPLIB_UINT8> {
12  using type = uint8_t;
13 };
14 
15 template <> struct DSPLIB_element_type<DSPLIB_INT8> {
16  using type = int8_t;
17 };
18 
19 template <> struct DSPLIB_element_type<DSPLIB_UINT16> {
20  using type = uint16_t;
21 };
22 
23 template <> struct DSPLIB_element_type<DSPLIB_INT16> {
24  using type = int16_t;
25 };
26 
27 template <> struct DSPLIB_element_type<DSPLIB_UINT32> {
28  using type = uint32_t;
29 };
30 
31 template <> struct DSPLIB_element_type<DSPLIB_INT32> {
32  using type = int32_t;
33 };
34 
35 template <typename T> struct DSPLIB_element_dType {
36  static constexpr size_t value = DSPLIB_INT8;
37 };
38 
39 template <> struct DSPLIB_element_dType<int8_t> {
40  static constexpr size_t value = DSPLIB_INT8;
41 };
42 
43 template <> struct DSPLIB_element_dType<int16_t> {
44  static constexpr size_t value = DSPLIB_INT16;
45 };
46 
47 template <> struct DSPLIB_element_dType<int32_t> {
48  static constexpr size_t value = DSPLIB_INT32;
49 };
50 
51 template <> struct DSPLIB_element_dType<float> {
52  static constexpr size_t value = DSPLIB_FLOAT32;
53 };
54 
55 template <> struct DSPLIB_element_dType<double> {
56  static constexpr size_t value = DSPLIB_FLOAT64;
57 };
58 
59 template <> struct DSPLIB_element_dType<uint8_t> {
60  static constexpr size_t value = DSPLIB_UINT8;
61 };
62 
63 template <> struct DSPLIB_element_dType<uint16_t> {
64  static constexpr size_t value = DSPLIB_UINT16;
65 };
66 
67 template <> struct DSPLIB_element_dType<uint32_t> {
68  static constexpr size_t value = DSPLIB_UINT32;
69 };
70 
71 #endif
static constexpr size_t value