Mercurial > hg > Gears > GearsAgda
comparison src/parallel_execution/main.c @ 217:c34e6aa10967
Fix DataGear access name
author | Tatsuki IHA <e125716@ie.u-ryukyu.ac.jp> |
---|---|
date | Mon, 09 Jan 2017 01:18:13 +0900 |
parents | 962fbfe777bb |
children | d8a59b727f65 |
comparison
equal
deleted
inserted
replaced
216:6578c5c274ba | 217:c34e6aa10967 |
---|---|
64 | 64 |
65 goto meta(context, C_code2); | 65 goto meta(context, C_code2); |
66 } | 66 } |
67 | 67 |
68 __code code2_stub(struct Context* context) { | 68 __code code2_stub(struct Context* context) { |
69 goto code2(context, &context->data[D_Node]->node.value->Array, &context->data[D_LoopCounter]->loopCounter); | 69 goto code2(context, &context->data[D_Node]->Node.value->Array, &context->data[D_LoopCounter]->LoopCounter); |
70 } | 70 } |
71 | 71 |
72 __code createData1(struct Context* context, struct Allocate* allocate, struct LoopCounter* loopCounter) { | 72 __code createData1(struct Context* context, struct Allocate* allocate, struct LoopCounter* loopCounter) { |
73 int i = loopCounter->i; | 73 int i = loopCounter->i; |
74 | 74 |
82 loopCounter->i = 0; | 82 loopCounter->i = 0; |
83 goto meta(context, C_code1); | 83 goto meta(context, C_code1); |
84 } | 84 } |
85 | 85 |
86 __code createData1_stub(struct Context* context) { | 86 __code createData1_stub(struct Context* context) { |
87 goto createData1(context, &context->data[D_Allocate]->allocate, &context->data[D_LoopCounter]->loopCounter); | 87 goto createData1(context, &context->data[D_Allocate]->Allocate, &context->data[D_LoopCounter]->LoopCounter); |
88 } | 88 } |
89 | 89 |
90 __code createData2(struct Context* context, struct LoopCounter* loopCounter, struct Array* array, struct Node* node, Tree* tree) { | 90 __code createData2(struct Context* context, struct LoopCounter* loopCounter, struct Array* array, struct Node* node, Tree* tree) { |
91 int i = loopCounter->i; | 91 int i = loopCounter->i; |
92 | 92 |
103 goto meta(context, loopCounter->tree->put); | 103 goto meta(context, loopCounter->tree->put); |
104 } | 104 } |
105 | 105 |
106 __code createData2_stub(struct Context* context) { | 106 __code createData2_stub(struct Context* context) { |
107 goto createData2(context, | 107 goto createData2(context, |
108 &context->data[D_LoopCounter]->loopCounter, | 108 &context->data[D_LoopCounter]->LoopCounter, |
109 &context->data[context->dataNum]->Array, | 109 &context->data[context->dataNum]->Array, |
110 &context->data[D_Node]->node, | 110 &context->data[D_Node]->Node, |
111 Gearef(context, Tree)); | 111 Gearef(context, Tree)); |
112 } | 112 } |
113 | 113 |
114 __code createTask1(struct Context* context, struct LoopCounter* loopCounter, struct Task* task, struct Element* element) { | 114 __code createTask1(struct Context* context, struct LoopCounter* loopCounter, struct Task* task, struct Element* element) { |
115 task->code = C_twice; | 115 task->code = C_twice; |
124 } | 124 } |
125 | 125 |
126 __code createTask1_stub(struct Context* context) { | 126 __code createTask1_stub(struct Context* context) { |
127 Task* task = &ALLOCATE(context, Task)->Task; | 127 Task* task = &ALLOCATE(context, Task)->Task; |
128 goto createTask1(context, | 128 goto createTask1(context, |
129 &context->data[D_LoopCounter]->loopCounter, | 129 &context->data[D_LoopCounter]->LoopCounter, |
130 task, | 130 task, |
131 &context->data[D_Element]->Element); | 131 &context->data[D_Element]->Element); |
132 } | 132 } |
133 | 133 |
134 //__code createTask4(struct Context* context, struct LoopCounter* loopCounter, struct Task* task, struct Queue* waitMe, struct OdsQueue* waitI, struct Element* element, struct Queue* activeQueue) { | 134 //__code createTask4(struct Context* context, struct LoopCounter* loopCounter, struct Task* task, struct Queue* waitMe, struct OdsQueue* waitI, struct Element* element, struct Queue* activeQueue) { |
195 loopCounter->i = 0; | 195 loopCounter->i = 0; |
196 goto meta(context, C_taskManager); | 196 goto meta(context, C_taskManager); |
197 } | 197 } |
198 | 198 |
199 __code createWorker1_stub(struct Context* context) { | 199 __code createWorker1_stub(struct Context* context) { |
200 goto createWorker1(context, &context->data[D_LoopCounter]->loopCounter, &context->data[D_Worker]->Worker); | 200 goto createWorker1(context, &context->data[D_LoopCounter]->LoopCounter, &context->data[D_Worker]->Worker); |
201 } | 201 } |
202 | 202 |
203 __code taskManager(struct Context* context, struct LoopCounter* loopCounter, struct Worker* worker) { | 203 __code taskManager(struct Context* context, struct LoopCounter* loopCounter, struct Worker* worker) { |
204 int i = loopCounter->i; | 204 int i = loopCounter->i; |
205 | 205 |
216 t->next = C_code2; | 216 t->next = C_code2; |
217 goto meta(context, C_end_time); | 217 goto meta(context, C_end_time); |
218 } | 218 } |
219 | 219 |
220 __code taskManager_stub(struct Context* context) { | 220 __code taskManager_stub(struct Context* context) { |
221 goto taskManager(context, &context->data[D_LoopCounter]->loopCounter, &context->data[D_Worker]->Worker); | 221 goto taskManager(context, &context->data[D_LoopCounter]->LoopCounter, &context->data[D_Worker]->Worker); |
222 } | 222 } |
223 | 223 |
224 void init(int argc, char** argv) { | 224 void init(int argc, char** argv) { |
225 for (int i = 1; argv[i]; ++i) { | 225 for (int i = 1; argv[i]; ++i) { |
226 if (strcmp(argv[i], "-cpu") == 0) | 226 if (strcmp(argv[i], "-cpu") == 0) |