Mercurial > hg > Members > Moririn
comparison src/parallel_execution/context.h @ 326:f23f6d0aa4e9 examples_directory
Add examples/calc.cbc and build but not work
author | Tatsuki IHA <e125716@ie.u-ryukyu.ac.jp> |
---|---|
date | Tue, 18 Apr 2017 01:47:42 +0900 |
parents | f730761bb044 |
children | 534601ed8c50 |
comparison
equal
deleted
inserted
replaced
325:7d664be4efa5 | 326:f23f6d0aa4e9 |
---|---|
20 | 20 |
21 #define ALLOC_DATA_TYPE(context, dseg, t) ({\ | 21 #define ALLOC_DATA_TYPE(context, dseg, t) ({\ |
22 struct Meta* meta = (struct Meta*)context->heap;\ | 22 struct Meta* meta = (struct Meta*)context->heap;\ |
23 meta->type = D_##t;\ | 23 meta->type = D_##t;\ |
24 meta->size = 1;\ | 24 meta->size = 1;\ |
25 context->heap += sizeof(struct Meta); \ | 25 context->heap += sizeof(struct Meta);\ |
26 context->data[D_##dseg] = context->heap; context->heap += sizeof(struct t); (struct t *)context->data[D_##dseg]; }) | 26 context->data[D_##dseg] = context->heap; context->heap += sizeof(struct t); (struct t *)context->data[D_##dseg]; }) |
27 | 27 |
28 #define ALLOCATE(context, t) ({ \ | 28 #define ALLOCATE(context, t) ({ \ |
29 struct Meta* meta = (struct Meta*)context->heap;\ | 29 struct Meta* meta = (struct Meta*)context->heap;\ |
30 context->heap += sizeof(struct Meta);\ | 30 context->heap += sizeof(struct Meta);\ |
74 void* heapStart; | 74 void* heapStart; |
75 void* heap; | 75 void* heap; |
76 long heapLimit; | 76 long heapLimit; |
77 int dataNum; | 77 int dataNum; |
78 int idgCount; //number of waiting dataGear | 78 int idgCount; //number of waiting dataGear |
79 int idg; | |
80 int maxIdg; | |
79 int odg; | 81 int odg; |
80 int maxOdg; | 82 int maxOdg; |
81 int workerId; | 83 int workerId; |
82 #ifdef USE_CUDAWorker | 84 #ifdef USE_CUDAWorker |
83 int num_exec; | 85 int num_exec; |
106 volatile | 108 volatile |
107 #endif | 109 #endif |
108 union Data* taskManager; | 110 union Data* taskManager; |
109 enum Code createTask; // create NEW contexts for execution & argument | 111 enum Code createTask; // create NEW contexts for execution & argument |
110 enum Code spawn; // start NEW context on the worker | 112 enum Code spawn; // start NEW context on the worker |
113 enum Code setWaitTask; | |
111 enum Code shutdown; | 114 enum Code shutdown; |
112 | 115 |
113 enum Code next; | 116 enum Code next; |
114 enum Code task; | 117 enum Code task; |
115 struct Context* context; | 118 struct Context* context; |
119 union Data* data; | |
116 int worker; | 120 int worker; |
117 int cpu; | 121 int cpu; |
118 int gpu; | 122 int gpu; |
119 int io; | 123 int io; |
120 int maxCPU; | 124 int maxCPU; |
272 } SemaphoreImpl; | 276 } SemaphoreImpl; |
273 struct Allocate { | 277 struct Allocate { |
274 enum Code next; | 278 enum Code next; |
275 long size; | 279 long size; |
276 } Allocate; | 280 } Allocate; |
277 struct OutPutDataSegments { | 281 struct Integer { |
278 union Data **data; | 282 int value; |
279 } Ods; | 283 } Integer; |
280 }; // union Data end this is necessary for context generator | 284 }; // union Data end this is necessary for context generator |
281 | 285 |
282 typedef union Data Data; | 286 typedef union Data Data; |
283 | 287 |
284 #include "c/typedefData.h" | 288 #include "c/typedefData.h" |