libflame  revision_anchor
FLA_type_defs.h
Go to the documentation of this file.
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 FLA_TYPE_DEFS_H
12 #define FLA_TYPE_DEFS_H
13 
14 #if FLA_MULTITHREADING_MODEL == FLA_OPENMP
15 #ifdef FLA_ENABLE_TIDSP
16 #include <ti/omp/omp.h>
17 #else
18 #include <omp.h>
19 #endif
20 #elif FLA_MULTITHREADING_MODEL == FLA_PTHREADS
21 #include <pthread.h>
22 #endif
23 
24 
25 // --- Complex type definitions -----------------------------------------------
26 
27 #ifndef _DEFINED_SCOMPLEX
28 #define _DEFINED_SCOMPLEX
29 typedef struct scomplex
30 {
31  float real, imag;
32 } scomplex;
33 #endif
34 
35 #ifndef _DEFINED_DCOMPLEX
36 #define _DEFINED_DCOMPLEX
37 typedef struct dcomplex
38 {
39  double real, imag;
40 } dcomplex;
41 #endif
42 
43 
44 // --- Parameter and return type definitions ----------------------------------
45 
46 typedef int FLA_Bool;
47 typedef int FLA_Error;
48 typedef int FLA_Quadrant;
49 typedef int FLA_Datatype;
50 typedef int FLA_Elemtype;
51 typedef int FLA_Side;
52 typedef int FLA_Uplo;
53 typedef int FLA_Trans;
54 typedef int FLA_Conj;
55 typedef int FLA_Diag;
56 typedef int FLA_Dimension;
57 typedef int FLA_Pivot_type;
58 typedef int FLA_Direct;
59 typedef int FLA_Store;
60 typedef int FLA_Matrix_type;
61 typedef int FLA_Precision;
62 typedef int FLA_Domain;
63 typedef int FLA_Inv;
64 typedef int FLA_Evd_type;
65 typedef int FLA_Svd_type;
66 typedef int FLA_Machval;
67 typedef int FLA_Diag_off;
68 
69 #ifndef _DEFINED_DIM_T
70 #define _DEFINED_DIM_T
71 typedef unsigned long dim_t;
72 #endif
73 
74 // --- Intrinsic/assembly definitions ----------------------------------------
75 
76 #if FLA_VECTOR_INTRINSIC_TYPE == FLA_SSE_INTRINSICS
77 
78 #include "pmmintrin.h"
79 
80 //typedef double v2df __attribute__ ((vector_size (16)));
81 
82 typedef union
83 {
84  __m128 v;
85  float f[4];
86 } v4sf_t;
87 
88 typedef union
89 {
90  __m128d v;
91  double d[2];
92 } v2df_t;
93 
94 #endif
95 
96 // --- FLAME object definitions -----------------------------------------------
97 
98 typedef struct FLA_Lock_s FLA_Lock;
99 
100 //#ifdef FLA_ENABLE_MULTITHREADING
102 {
103  // Implementation-specific lock object
104 #if FLA_MULTITHREADING_MODEL == FLA_OPENMP
105  omp_lock_t lock;
106 #elif FLA_MULTITHREADING_MODEL == FLA_PTHREADS
107  pthread_mutex_t lock;
108 #endif
109 };
110 //#endif
111 
112 #ifdef FLA_ENABLE_SUPERMATRIX
113 typedef int FLASH_Verbose;
114 typedef int FLASH_Data_aff;
115 
116 typedef struct FLASH_Queue_s FLASH_Queue;
117 typedef struct FLASH_Task_s FLASH_Task;
118 typedef struct FLASH_Dep_s FLASH_Dep;
119 #endif
121 
122 typedef struct FLA_Obj_struct
123 {
124  // Basic object description fields
133  unsigned long id;
136 
138  void* buffer;
140 
142 
143 #ifdef FLA_ENABLE_SUPERMATRIX
144  // Fields for supermatrix
147 
148  // All the tasks that previously read this block, anti-dependency
152 
153  // Task that last overwrote this block, flow dependency
155 #endif
156 } FLA_Base_obj;
157 
158 typedef struct FLA_Obj_view
159 {
160  // Basic object view description fields
167 
169 
170 } FLA_Obj;
171 
172 #ifdef FLA_ENABLE_SUPERMATRIX
174 {
175  // Number of tasks currently in queue
176  unsigned int n_tasks;
177 
178  // Pointers to head (front) and tail (back) of queue
181 };
182 
184 {
185  // Execution information
186  int n_ready;
187 
188  // Labels
189  int order;
190  int queue;
191  int height;
192  int thread;
193  int cache;
195 
196  // Function pointer
197  void* func;
198 
199  // Control tree pointer
200  void* cntl;
201 
202  // Name of task
203  char* name;
204 
205  // GPU enabled task
207 
208  // Integer arguments
210  int* int_arg;
211 
212  // Constant FLA_Obj arguments
215 
216  // Input FLA_Obj arguments
219 
220  // Output FLA_Obj argument
223 
224  // Number of blocks within all macroblocks
226 
227  // Number of write after read dependencies
229 
230  // Dependence information
234 
235  // Support for a doubly linked list of tasks
238 
239  // Support for a doubly linked list for wait queue
242 };
243 
245 {
246  // Task yielding dependency
248 
249  // Support for linked list of FLASH_Deps
251 };
252 #endif // FLA_ENABLE_SUPERMATRIX
253 
255 {
256  // The thread's unique identifier
257  int id;
258 
259  // Pointer to variables needed to execute SuperMatrix mechanism
260  void* args;
261 
262 #if FLA_MULTITHREADING_MODEL == FLA_PTHREADS
263  // The thread object. Only needed for the POSIX threads implementation.
264  pthread_t pthread_obj;
265 #endif
266 };
267 
268 #endif // FLA_TYPE_DEFS_H
int height
Definition: FLA_type_defs.h:191
int * int_arg
Definition: FLA_type_defs.h:210
float real
Definition: blis_type_defs.h:134
int FLA_Svd_type
Definition: FLA_type_defs.h:65
int FLA_Pivot_type
Definition: FLA_type_defs.h:57
omp_lock_t lock
Definition: FLA_type_defs.h:105
FLASH_Dep * dep_arg_head
Definition: FLA_type_defs.h:232
unsigned long dim_t
Definition: FLA_type_defs.h:71
struct dcomplex dcomplex
FLASH_Dep * read_task_tail
Definition: FLA_type_defs.h:151
FLASH_Task * next_task
Definition: FLA_type_defs.h:237
FLA_Uplo uplo
Definition: FLA_type_defs.h:141
struct scomplex scomplex
int FLA_Matrix_type
Definition: FLA_type_defs.h:60
FLASH_Task * prev_wait
Definition: FLA_type_defs.h:240
int n_fla_args
Definition: FLA_type_defs.h:213
Definition: FLA_type_defs.h:244
FLA_Base_obj * base
Definition: FLA_type_defs.h:168
int n_ready
Definition: FLA_type_defs.h:186
void * cntl
Definition: FLA_type_defs.h:200
dim_t n_index
Definition: FLA_type_defs.h:135
pthread_mutex_t lock
Definition: FLA_type_defs.h:107
int FLA_Direct
Definition: FLA_type_defs.h:58
dim_t m
Definition: FLA_type_defs.h:127
unsigned long id
Definition: FLA_type_defs.h:133
int FLA_Diag
Definition: FLA_type_defs.h:55
int FLA_Elemtype
Definition: FLA_type_defs.h:50
int n_read_tasks
Definition: FLA_type_defs.h:149
FLASH_Dep * dep_arg_tail
Definition: FLA_type_defs.h:233
int FLA_Diag_off
Definition: FLA_type_defs.h:67
int FLA_Error
Definition: FLA_type_defs.h:47
Definition: FLA_type_defs.h:183
int FLASH_Verbose
Definition: FLA_type_defs.h:113
Definition: FLA_type_defs.h:82
FLA_Bool enabled_gpu
Definition: FLA_type_defs.h:206
FLASH_Task * task
Definition: FLA_type_defs.h:247
FLASH_Task * next_wait
Definition: FLA_type_defs.h:241
FLASH_Task * tail
Definition: FLA_type_defs.h:180
Definition: FLA_type_defs.h:158
int n_int_args
Definition: FLA_type_defs.h:209
int FLA_Store
Definition: FLA_type_defs.h:59
dim_t m
Definition: FLA_type_defs.h:163
FLASH_Dep * next_dep
Definition: FLA_type_defs.h:250
int FLA_Conj
Definition: FLA_type_defs.h:54
int n_dep_args
Definition: FLA_type_defs.h:231
Definition: FLA_type_defs.h:101
int buffer_info
Definition: FLA_type_defs.h:139
int n_input_args
Definition: FLA_type_defs.h:217
int FLA_Domain
Definition: FLA_type_defs.h:62
dim_t n
Definition: FLA_type_defs.h:128
dim_t offn
Definition: FLA_type_defs.h:162
int FLA_Machval
Definition: FLA_type_defs.h:66
FLASH_Task * head
Definition: FLA_type_defs.h:179
Definition: blis_type_defs.h:132
int n_output_args
Definition: FLA_type_defs.h:221
void * buffer
Definition: FLA_type_defs.h:138
Definition: FLA_type_defs.h:254
dim_t n_inner
Definition: FLA_type_defs.h:166
dim_t n_elem_alloc
Definition: FLA_type_defs.h:137
int n_war_args
Definition: FLA_type_defs.h:228
dim_t m_inner
Definition: FLA_type_defs.h:165
int queue
Definition: FLA_type_defs.h:190
Definition: blis_type_defs.h:116
FLA_Obj * output_arg
Definition: FLA_type_defs.h:222
int n_macro_args
Definition: FLA_type_defs.h:225
int FLA_Trans
Definition: FLA_type_defs.h:53
int FLA_Precision
Definition: FLA_type_defs.h:61
int order
Definition: FLA_type_defs.h:189
int FLA_Uplo
Definition: FLA_type_defs.h:52
int FLA_Side
Definition: FLA_type_defs.h:51
void * args
Definition: FLA_type_defs.h:260
int FLA_Inv
Definition: FLA_type_defs.h:63
FLA_Bool hit
Definition: FLA_type_defs.h:194
FLASH_Task * prev_task
Definition: FLA_type_defs.h:236
struct FLA_Obj_struct FLA_Base_obj
dim_t m_inner
Definition: FLA_type_defs.h:131
FLASH_Task * write_task
Definition: FLA_type_defs.h:154
int FLA_Evd_type
Definition: FLA_type_defs.h:64
int FLA_Datatype
Definition: FLA_type_defs.h:49
int FLASH_Data_aff
Definition: FLA_type_defs.h:114
int n_write_blocks
Definition: FLA_type_defs.h:146
dim_t cs
Definition: FLA_type_defs.h:130
FLA_Obj * input_arg
Definition: FLA_type_defs.h:218
int FLA_Bool
Definition: FLA_type_defs.h:46
pthread_t pthread_obj
Definition: FLA_type_defs.h:264
FLA_Datatype datatype
Definition: FLA_type_defs.h:125
dim_t n
Definition: FLA_type_defs.h:164
dim_t n_inner
Definition: FLA_type_defs.h:132
int cache
Definition: FLA_type_defs.h:193
int n_read_blocks
Definition: FLA_type_defs.h:145
int id
Definition: FLA_type_defs.h:257
struct FLA_Obj_view FLA_Obj
int thread
Definition: FLA_type_defs.h:192
__m128 v
Definition: FLA_type_defs.h:84
FLA_Obj * fla_arg
Definition: FLA_type_defs.h:214
unsigned int n_tasks
Definition: FLA_type_defs.h:176
FLA_Elemtype elemtype
Definition: FLA_type_defs.h:126
Definition: FLA_type_defs.h:122
int FLA_Quadrant
Definition: FLA_type_defs.h:48
dim_t m_index
Definition: FLA_type_defs.h:134
dim_t rs
Definition: FLA_type_defs.h:129
int FLA_Dimension
Definition: FLA_type_defs.h:56
float imag
Definition: blis_type_defs.h:134
void * func
Definition: FLA_type_defs.h:197
Definition: FLA_type_defs.h:173
dim_t offm
Definition: FLA_type_defs.h:161
Definition: blis_type_defs.h:137
char * name
Definition: FLA_type_defs.h:203
FLASH_Dep * read_task_head
Definition: FLA_type_defs.h:150