1 /*
2 
3     Copyright (C) 2014, The University of Texas at Austin
4 
5     This file is part of libflame and is available under the 3-Clause
6     BSD license, which can be found in the LICENSE file at the top-level
7     directory, or at http://opensource.org/licenses/BSD-3-Clause
8 
9 */
10 
11 #ifndef BLIS1_TYPE_DEFS_H
12 #define BLIS1_TYPE_DEFS_H
13 
14 // --- Basic type definitions -------------------------------------------------
15 
16 /*
17 // --- trans ---
18 
19 #define BLIS1_NO_TRANSPOSE      'n'
20 #define BLIS1_TRANSPOSE         't'
21 #define BLIS1_CONJ_NO_TRANSPOSE 'c'
22 #define BLIS1_CONJ_TRANSPOSE    'h'
23 
24 // --- conj ---
25 
26 #define BLIS1_NO_CONJUGATE      'n'
27 #define BLIS1_CONJUGATE         'c'
28 
29 // --- uplo ---
30 
31 #define BLIS1_LOWER_TRIANGULAR  'l'
32 #define BLIS1_UPPER_TRIANGULAR  'u'
33 
34 // --- side ---
35 
36 #define BLIS1_LEFT              'l'
37 #define BLIS1_RIGHT             'r'
38 
39 // --- diag ---
40 
41 #define BLIS1_NONUNIT_DIAG      'n'
42 #define BLIS1_UNIT_DIAG         'u'
43 #define BLIS1_ZERO_DIAG         'z'
44 */
45 
46 #define BLIS1_TRANS_BEGIN 100
47 #define BLIS1_UPLO_BEGIN  200
48 #define BLIS1_SIDE_BEGIN  300
49 #define BLIS1_DIAG_BEGIN  400
50 #define BLIS1_CONJ_BEGIN  500
51 
52 typedef enum
53 {
54 	BLIS1_NO_TRANSPOSE = BLIS1_TRANS_BEGIN,
55 	BLIS1_TRANSPOSE,
56 	BLIS1_CONJ_NO_TRANSPOSE,
57 	BLIS1_CONJ_TRANSPOSE
58 } trans1_t;
59 
60 typedef enum
61 {
62 	BLIS1_LOWER_TRIANGULAR = BLIS1_UPLO_BEGIN,
63 	BLIS1_UPPER_TRIANGULAR
64 } uplo1_t;
65 
66 typedef enum
67 {
68 	BLIS1_LEFT = BLIS1_SIDE_BEGIN,
69 	BLIS1_RIGHT
70 } side1_t;
71 
72 typedef enum
73 {
74 	BLIS1_NONUNIT_DIAG = BLIS1_DIAG_BEGIN,
75 	BLIS1_UNIT_DIAG,
76 	BLIS1_ZERO_DIAG
77 } diag1_t;
78 
79 typedef enum
80 {
81 	BLIS1_NO_CONJUGATE = BLIS1_CONJ_BEGIN,
82 	BLIS1_CONJUGATE
83 } conj1_t;
84 
85 
86 
87 
88 
89 // --- Intrinsic/assembly definitions ----------------------------------------
90 
91 /*
92 #ifndef BLIS1_FROM_LIBFLAME
93     #error "NOT using blis from libflame"
94 #else
95     #error "using blis from libflame"
96 #endif
97 */
98 
99 /*
100 #if BLIS1_VECTOR_INTRINSIC_TYPE == BLIS1_SSE_INTRINSICS
101     #error "using sse in blis"
102 #elif  BLIS1_VECTOR_INTRINSIC_TYPE == BLIS1_NO_INTRINSICS
103     #error "NOT using sse in blis"
104 #else
105     #error "undefined case!"
106 #endif
107 */
108 
109 // Only define vector intrinsics types if they are not already provided by
110 // libflame.
111 #ifndef BLIS1_FROM_LIBFLAME
112 
113 #if BLIS1_VECTOR_INTRINSIC_TYPE == BLIS1_SSE_INTRINSICS
114 
115 #include "pmmintrin.h"
116 typedef union
117 {
118     __m128d v;
119     double  d[2];
120 } v2df_t;
121 #endif
122 
123 #endif
124 
125 
126 // --- Complex type definitions -----------------------------------------------
127 
128 // Only define complex types if they are not already provided by libflame.
129 //#ifndef BLIS1_ENABLE_USE_OF_LIBFLAME_TYPES
130 #ifndef BLIS1_FROM_LIBFLAME
131 
132 typedef struct scomplex
133 {
134   float real, imag;
135 } scomplex;
136 
137 typedef struct dcomplex
138 {
139   double real, imag;
140 } dcomplex;
141 
142 #endif
143 
144 
145 #endif // BLIS1_TYPE_DEFS_H
146