comparison src/parallel_execution/context.h @ 186:dbc064c26b98

generate context script
author mir3636
date Thu, 15 Dec 2016 19:38:18 +0900
parents 247a2c4a8908
children bacc37265386
comparison
equal deleted inserted replaced
185:247a2c4a8908 186:dbc064c26b98
33 #define GET_TYPE(dseg) ({ \ 33 #define GET_TYPE(dseg) ({ \
34 struct Meta* meta = (struct Meta*)(((void*)dseg) - sizeof(struct Meta));\ 34 struct Meta* meta = (struct Meta*)(((void*)dseg) - sizeof(struct Meta));\
35 meta->type; }) 35 meta->type; })
36 36
37 #define Gearef(context, t) (&(context)->data[D_##t]->t) 37 #define Gearef(context, t) (&(context)->data[D_##t]->t)
38 enum Code { 38
39 C_code1, 39 #include "c/enumCode.h"
40 C_code2,
41 C_code3,
42 C_code4,
43 C_code5,
44 C_find,
45 Not_find,
46 Code6,
47 Allocator,
48 C_put,
49 C_replaceNode,
50 C_replaceNode1,
51 C_insertNode,
52 Compare,
53 C_rotateLeft,
54 C_rotateLeft1,
55 C_rotateRight,
56 C_rotateRight1,
57 SetTree,
58 C_insertCase1,
59 C_insertCase2,
60 C_insertCase3,
61 C_insertCase4,
62 C_insertCase5,
63 C_insertCase51,
64 C_stackClear,
65 C_get,
66 C_search,
67 Delete,
68 Delete1,
69 Delete2,
70 Delete3,
71 Replace_d1,
72 Replace_d2,
73 FindMax1,
74 FindMax2,
75 DeleteCase1,
76 DeleteCase2,
77 DeleteCase3,
78 DeleteCase4,
79 DeleteCase5,
80 DeleteCase6,
81 CreateWorker,
82 TaskManager,
83 C_spawnTaskManager,
84 C_shutdownTaskManager,
85 C_QueueTest1,
86 C_QueueTest2,
87 C_QueueTest3,
88 C_QueueTest4,
89 CreateData1,
90 CreateData2,
91 CreateTask1,
92 CreateTask2,
93 CreateTask3,
94 CreateTask4,
95 PutQueue1,
96 PutQueue2,
97 PutQueue3,
98 PutQueue4,
99 C_getTask1,
100 C_getTask2,
101 C_clearSingleLinkedStack,
102 C_pushSingleLinkedStack,
103 C_popSingleLinkedStack,
104 C_pop2SingleLinkedStack,
105 C_getSingleLinkedStack,
106 C_get2SingleLinkedStack,
107 C_isEmptySingleLinkedStack,
108 C_takeSingleLinkedQueue,
109 C_putSingleLinkedQueue,
110 C_isEmptySingleLinkedQueue,
111 C_clearSingleLinkedQueue,
112 C_takeSynchronizedQueue,
113 C_putSynchronizedQueue,
114 C_isEmptySynchronizedQueue,
115 C_clearSynchronizedQueue,
116 C_putRedBlackTree,
117 C_getRedBlackTree,
118 C_removeRedBlackTree,
119 C_clearRedBlackTree,
120 SpawnTask,
121 C_executeWorker,
122 C_taskSendWorker,
123 C_taskReciveWorker,
124 C_shutdownWorker,
125 Twice,
126 StartTime,
127 EndTime,
128 Exit,
129 };
130 40
131 enum Relational { 41 enum Relational {
132 EQ, 42 EQ,
133 GT, 43 GT,
134 LT, 44 LT,
135 }; 45 };
136 46
137 enum DataType { 47 #include "c/enumData.h"
138 D_Worker,
139 D_Allocate,
140 D_SingleLinkedStack,
141 D_Stack,
142 D_RedBlackTree,
143 D_Tree,
144 D_Task,
145 D_Traverse,
146 D_RotateTree,
147 D_Node,
148 D_LoopCounter,
149 D_Time,
150 D_Element,
151 D_ActiveQueue,
152 D_WaitQueue,
153 D_SingleLinkedQueue,
154 D_SynchronizedQueue,
155 D_Queue
156 };
157 48
158 struct Context { 49 struct Context {
159 enum Code next; 50 enum Code next;
160 int codeNum; 51 int codeNum;
161 __code (**code) (struct Context*); 52 __code (**code) (struct Context*);
310 long size; 201 long size;
311 } allocate; 202 } allocate;
312 struct OutPutDataSegments { 203 struct OutPutDataSegments {
313 union Data **data; 204 union Data **data;
314 } ods; 205 } ods;
315 }; 206 }; // union Data end
316 207
317 // typedef struct RotateTree D_RotateTree; 208 #include "c/typedefData.h"
318 typedef struct Time Time;
319 typedef struct LoopCounter LoopCounter;
320 typedef struct Worker Worker;
321 typedef struct CudaTask CudaTask;
322 typedef struct Task Task;
323 typedef struct Queue Queue;
324 typedef struct SingleLinkedQueue SingleLinkedQueue;
325 typedef struct SynchronizedQueue SynchronizedQueue;
326 typedef struct Stack Stack;
327 typedef struct SingleLinkedStack SingleLinkedStack;
328 typedef struct ArrayStack ArrayStack;
329 typedef struct Element Element;
330 typedef struct Array Array;
331 typedef struct RedBlackTree RedBlackTree;
332 typedef struct Tree Tree;
333 typedef struct RotateTree RotateTree;
334 typedef struct Node Node;
335 typedef struct Allocate Allocate;
336 typedef struct OutputDataSegments OutputDataSegments;
337 209
338 union MetaData { 210 union MetaData {
339 struct Queue waitMeTasks; 211 struct Queue waitMeTasks;
340 struct Queue waitI; 212 struct Queue waitI;
341 }; 213 };