summaryrefslogtreecommitdiff
path: root/tnet_io/KaldiLib/Types.h
blob: 6a5bfac14b99140720fdfd97be71bada2bee2490 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
#ifndef TNet_Types_h
#define TNet_Types_h

#ifdef HAVE_ATLAS
extern "C"{
  #include <cblas.h>
  #include <clapack.h>
}
#endif


namespace TNet 
{
  // TYPEDEFS ..................................................................
#if DOUBLEPRECISION
  typedef double  BaseFloat;
#else
  typedef float   BaseFloat;
#endif

#ifndef UINT_16
  typedef unsigned short  UINT_16   ;
  typedef unsigned        UINT_32   ;
  typedef short           INT_16    ;
  typedef int             INT_32    ;
  typedef float           FLOAT_32  ;
  typedef double          DOUBLE_64 ;
#endif



  // ...........................................................................
  // The following declaration assumes that SSE instructions are enabled
  // and that we are using GNU C/C++ compiler, which defines the __attribute__ 
  // notation.
  //
  // ENABLE_SSE is defined in <config.h>. Its value depends on options given
  // in the configure phase of builidng the library
#if defined(__GNUC__ )
  // vector of four single floats
  typedef float  v4sf __attribute__((vector_size(16))); 
  // vector of two single doubles
  typedef double v2sd __attribute__((vector_size(16))); 

  typedef BaseFloat BaseFloat16Aligned __attribute__((aligned(16))) ;

  typedef union 
  {
    v4sf    v;
    float   f[4];
  } f4vector; 

  typedef union 
  {
    v2sd    v;
    double  f[2];
  } d2vector; 
#endif // ENABLE_SSE && defined(__GNUC__ )



  typedef enum
  {
#ifdef HAVE_ATLAS
    TRANS    = CblasTrans,
    NO_TRANS = CblasNoTrans
#else
    TRANS    = 'T',
    NO_TRANS = 'N'
#endif
  } MatrixTrasposeType;



} // namespace TNet

#endif // #ifndef TNet_Types_h