Mercurial > hg > GearsTemplate
annotate src/parallel_execution/context.h @ 465:b6437feb04ee
Running CUDA examples
author | Tatsuki IHA <innparusu@cr.ie.u-ryukyu.ac.jp> |
---|---|
date | Thu, 21 Dec 2017 00:34:25 +0900 |
parents | 7d67c9cf09ee |
children | 355f7f78e3cf 71b634a5ed65 |
rev | line source |
---|---|
86 | 1 /* Context definition for llrb example */ |
132 | 2 #ifndef CONTEXT_H |
3 #define CONTEXT_H | |
207
7470b8382672
Fix compile error to stack_test
Tatsuki IHA <e125716@ie.u-ryukyu.ac.jp>
parents:
194
diff
changeset
|
4 #include <stdlib.h> |
86 | 5 #include <pthread.h> |
304
9755206813cb
helper_string.h for ANSI C
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
302
diff
changeset
|
6 #ifdef USE_CUDAWorker |
98 | 7 #include <cuda.h> |
462
8d7e5d48cad3
Running CPU examples
Tatsuki IHA <innparusu@cr.ie.u-ryukyu.ac.jp>
parents:
461
diff
changeset
|
8 #include <driver_types.h> |
8d7e5d48cad3
Running CPU examples
Tatsuki IHA <innparusu@cr.ie.u-ryukyu.ac.jp>
parents:
461
diff
changeset
|
9 #include <cuda_runtime.h> |
465
b6437feb04ee
Running CUDA examples
Tatsuki IHA <innparusu@cr.ie.u-ryukyu.ac.jp>
parents:
464
diff
changeset
|
10 #include "helper_cuda.h" |
101 | 11 #endif |
86 | 12 |
95
3e28ee215c0e
modify twice, use OSAtomiceCompareAndSwap
Shohei KOKUBO <e105744@ie.u-ryukyu.ac.jp>
parents:
92
diff
changeset
|
13 #define ALLOCATE_SIZE 20000000 |
101 | 14 #define NEW(type) (type*)(calloc(1, sizeof(type))) |
15 #define NEWN(n, type) (type*)(calloc(n, sizeof(type))) | |
16 | |
133 | 17 #define ALLOC_DATA(context, dseg) ({\ |
434
b75badf42701
Define Executor to context
Tatsuki IHA <innparusu@cr.ie.u-ryukyu.ac.jp>
parents:
431
diff
changeset
|
18 Meta* meta = (Meta*)context->heap;\ |
148
473b7d990a1f
fix data gears type enum
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
147
diff
changeset
|
19 meta->type = D_##dseg;\ |
434
b75badf42701
Define Executor to context
Tatsuki IHA <innparusu@cr.ie.u-ryukyu.ac.jp>
parents:
431
diff
changeset
|
20 meta->size = sizeof(dseg);\ |
430
35b37fe8d3a7
Add size member in struct Meta
Tatsuki IHA <innparusu@cr.ie.u-ryukyu.ac.jp>
parents:
429
diff
changeset
|
21 meta->len = 1;\ |
434
b75badf42701
Define Executor to context
Tatsuki IHA <innparusu@cr.ie.u-ryukyu.ac.jp>
parents:
431
diff
changeset
|
22 context->heap += sizeof(Meta);\ |
b75badf42701
Define Executor to context
Tatsuki IHA <innparusu@cr.ie.u-ryukyu.ac.jp>
parents:
431
diff
changeset
|
23 context->data[D_##dseg] = context->heap; context->heap += sizeof(dseg); (dseg *)context->data[D_##dseg]; }) |
101 | 24 |
133 | 25 #define ALLOC_DATA_TYPE(context, dseg, t) ({\ |
434
b75badf42701
Define Executor to context
Tatsuki IHA <innparusu@cr.ie.u-ryukyu.ac.jp>
parents:
431
diff
changeset
|
26 Meta* meta = (Meta*)context->heap;\ |
148
473b7d990a1f
fix data gears type enum
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
147
diff
changeset
|
27 meta->type = D_##t;\ |
434
b75badf42701
Define Executor to context
Tatsuki IHA <innparusu@cr.ie.u-ryukyu.ac.jp>
parents:
431
diff
changeset
|
28 meta->size = sizeof(t);\ |
430
35b37fe8d3a7
Add size member in struct Meta
Tatsuki IHA <innparusu@cr.ie.u-ryukyu.ac.jp>
parents:
429
diff
changeset
|
29 meta->len = 1;\ |
434
b75badf42701
Define Executor to context
Tatsuki IHA <innparusu@cr.ie.u-ryukyu.ac.jp>
parents:
431
diff
changeset
|
30 context->heap += sizeof(Meta);\ |
b75badf42701
Define Executor to context
Tatsuki IHA <innparusu@cr.ie.u-ryukyu.ac.jp>
parents:
431
diff
changeset
|
31 context->data[D_##dseg] = context->heap; context->heap += sizeof(t); (t *)context->data[D_##dseg]; }) |
86 | 32 |
132 | 33 #define ALLOCATE(context, t) ({ \ |
434
b75badf42701
Define Executor to context
Tatsuki IHA <innparusu@cr.ie.u-ryukyu.ac.jp>
parents:
431
diff
changeset
|
34 Meta* meta = (Meta*)context->heap;\ |
b75badf42701
Define Executor to context
Tatsuki IHA <innparusu@cr.ie.u-ryukyu.ac.jp>
parents:
431
diff
changeset
|
35 context->heap += sizeof(Meta);\ |
133 | 36 union Data* data = context->heap; \ |
434
b75badf42701
Define Executor to context
Tatsuki IHA <innparusu@cr.ie.u-ryukyu.ac.jp>
parents:
431
diff
changeset
|
37 context->heap += sizeof(t); \ |
148
473b7d990a1f
fix data gears type enum
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
147
diff
changeset
|
38 meta->type = D_##t; \ |
434
b75badf42701
Define Executor to context
Tatsuki IHA <innparusu@cr.ie.u-ryukyu.ac.jp>
parents:
431
diff
changeset
|
39 meta->size = sizeof(t); \ |
430
35b37fe8d3a7
Add size member in struct Meta
Tatsuki IHA <innparusu@cr.ie.u-ryukyu.ac.jp>
parents:
429
diff
changeset
|
40 meta->len = 1;\ |
133 | 41 data; }) |
132 | 42 |
430
35b37fe8d3a7
Add size member in struct Meta
Tatsuki IHA <innparusu@cr.ie.u-ryukyu.ac.jp>
parents:
429
diff
changeset
|
43 #define ALLOCATE_ARRAY(context, t, length) ({ \ |
434
b75badf42701
Define Executor to context
Tatsuki IHA <innparusu@cr.ie.u-ryukyu.ac.jp>
parents:
431
diff
changeset
|
44 Meta* meta = (Meta*)context->heap;\ |
b75badf42701
Define Executor to context
Tatsuki IHA <innparusu@cr.ie.u-ryukyu.ac.jp>
parents:
431
diff
changeset
|
45 context->heap += sizeof(Meta);\ |
404
c5cd9888bf2a
Fix bitonicSort
Tatsuki IHA <innparusu@cr.ie.u-ryukyu.ac.jp>
parents:
402
diff
changeset
|
46 union Data* data = context->heap; \ |
434
b75badf42701
Define Executor to context
Tatsuki IHA <innparusu@cr.ie.u-ryukyu.ac.jp>
parents:
431
diff
changeset
|
47 context->heap += sizeof(t)*length; \ |
404
c5cd9888bf2a
Fix bitonicSort
Tatsuki IHA <innparusu@cr.ie.u-ryukyu.ac.jp>
parents:
402
diff
changeset
|
48 meta->type = D_##t; \ |
434
b75badf42701
Define Executor to context
Tatsuki IHA <innparusu@cr.ie.u-ryukyu.ac.jp>
parents:
431
diff
changeset
|
49 meta->size = sizeof(t)*length; \ |
430
35b37fe8d3a7
Add size member in struct Meta
Tatsuki IHA <innparusu@cr.ie.u-ryukyu.ac.jp>
parents:
429
diff
changeset
|
50 meta->len = length; \ |
404
c5cd9888bf2a
Fix bitonicSort
Tatsuki IHA <innparusu@cr.ie.u-ryukyu.ac.jp>
parents:
402
diff
changeset
|
51 data; }) |
c5cd9888bf2a
Fix bitonicSort
Tatsuki IHA <innparusu@cr.ie.u-ryukyu.ac.jp>
parents:
402
diff
changeset
|
52 |
430
35b37fe8d3a7
Add size member in struct Meta
Tatsuki IHA <innparusu@cr.ie.u-ryukyu.ac.jp>
parents:
429
diff
changeset
|
53 #define ALLOCATE_PTR_ARRAY(context, dseg, length) ({\ |
434
b75badf42701
Define Executor to context
Tatsuki IHA <innparusu@cr.ie.u-ryukyu.ac.jp>
parents:
431
diff
changeset
|
54 Meta* meta = (Meta*)context->heap;\ |
b75badf42701
Define Executor to context
Tatsuki IHA <innparusu@cr.ie.u-ryukyu.ac.jp>
parents:
431
diff
changeset
|
55 context->heap += sizeof(Meta);\ |
236 | 56 union Data* data = context->heap; \ |
434
b75badf42701
Define Executor to context
Tatsuki IHA <innparusu@cr.ie.u-ryukyu.ac.jp>
parents:
431
diff
changeset
|
57 context->heap += sizeof(dseg *)*length; \ |
236 | 58 meta->type = D_##dseg; \ |
434
b75badf42701
Define Executor to context
Tatsuki IHA <innparusu@cr.ie.u-ryukyu.ac.jp>
parents:
431
diff
changeset
|
59 meta->size = sizeof(dseg *)*length; \ |
430
35b37fe8d3a7
Add size member in struct Meta
Tatsuki IHA <innparusu@cr.ie.u-ryukyu.ac.jp>
parents:
429
diff
changeset
|
60 meta->len = length; \ |
236 | 61 data; }) |
62 | |
327
534601ed8c50
Running dependency example for single thread and single task
Tatsuki IHA <e125716@ie.u-ryukyu.ac.jp>
parents:
326
diff
changeset
|
63 #define ALLOCATE_DATA_GEAR(context, t) ({ \ |
534601ed8c50
Running dependency example for single thread and single task
Tatsuki IHA <e125716@ie.u-ryukyu.ac.jp>
parents:
326
diff
changeset
|
64 union Data* data = ALLOCATE(context, t); \ |
434
b75badf42701
Define Executor to context
Tatsuki IHA <innparusu@cr.ie.u-ryukyu.ac.jp>
parents:
431
diff
changeset
|
65 Meta* meta = GET_META(data); \ |
449
0181b7fa5f53
Using SynchornizedQueue in data gear wait list
Tatsuki IHA <innparusu@cr.ie.u-ryukyu.ac.jp>
parents:
447
diff
changeset
|
66 meta->wait = createSynchronizedQueue(context); \ |
327
534601ed8c50
Running dependency example for single thread and single task
Tatsuki IHA <e125716@ie.u-ryukyu.ac.jp>
parents:
326
diff
changeset
|
67 data; }) |
534601ed8c50
Running dependency example for single thread and single task
Tatsuki IHA <e125716@ie.u-ryukyu.ac.jp>
parents:
326
diff
changeset
|
68 |
430
35b37fe8d3a7
Add size member in struct Meta
Tatsuki IHA <innparusu@cr.ie.u-ryukyu.ac.jp>
parents:
429
diff
changeset
|
69 #define ALLOC(context, t) (&ALLOCATE(context, t)->t) |
35b37fe8d3a7
Add size member in struct Meta
Tatsuki IHA <innparusu@cr.ie.u-ryukyu.ac.jp>
parents:
429
diff
changeset
|
70 |
434
b75badf42701
Define Executor to context
Tatsuki IHA <innparusu@cr.ie.u-ryukyu.ac.jp>
parents:
431
diff
changeset
|
71 #define GET_META(dseg) ((Meta*)(((void*)dseg) - sizeof(Meta))) |
288 | 72 #define GET_TYPE(dseg) (GET_META(dseg)->type) |
352
3e01e963eb2d
Fix compile error for calc example but not work
Tatsuki IHA <innparusu@cr.ie.u-ryukyu.ac.jp>
parents:
344
diff
changeset
|
73 #define GET_SIZE(dseg) (GET_META(dseg)->size) |
430
35b37fe8d3a7
Add size member in struct Meta
Tatsuki IHA <innparusu@cr.ie.u-ryukyu.ac.jp>
parents:
429
diff
changeset
|
74 #define GET_LEN(dseg) (GET_META(dseg)->len) |
288 | 75 #define GET_WAIT_LIST(dseg) (GET_META(dseg)->wait) |
132 | 76 |
149 | 77 #define Gearef(context, t) (&(context)->data[D_##t]->t) |
186 | 78 |
434
b75badf42701
Define Executor to context
Tatsuki IHA <innparusu@cr.ie.u-ryukyu.ac.jp>
parents:
431
diff
changeset
|
79 // (SingleLinkedStack *)context->data[D_Stack]->Stack.stack->Stack.stack |
232 | 80 |
438
7679093bdd72
Work CUDAtwice
Tatsuki IHA <innparusu@cr.ie.u-ryukyu.ac.jp>
parents:
436
diff
changeset
|
81 #define GearImpl(context, intf, name) (Gearef(context, intf)->name->intf.name) |
232 | 82 |
186 | 83 #include "c/enumCode.h" |
86 | 84 |
85 enum Relational { | |
86 EQ, | |
87 GT, | |
88 LT, | |
89 }; | |
90 | |
186 | 91 #include "c/enumData.h" |
86 | 92 |
93 struct Context { | |
94 enum Code next; | |
230 | 95 struct Worker* worker; |
96 struct TaskManager* taskManager; | |
86 | 97 int codeNum; |
98 __code (**code) (struct Context*); | |
99 void* heapStart; | |
100 void* heap; | |
101 long heapLimit; | |
87 | 102 int dataNum; |
236 | 103 int idgCount; //number of waiting dataGear |
326
f23f6d0aa4e9
Add examples/calc.cbc and build but not work
Tatsuki IHA <e125716@ie.u-ryukyu.ac.jp>
parents:
320
diff
changeset
|
104 int idg; |
f23f6d0aa4e9
Add examples/calc.cbc and build but not work
Tatsuki IHA <e125716@ie.u-ryukyu.ac.jp>
parents:
320
diff
changeset
|
105 int maxIdg; |
282
a3448b0f0a56
Add input data gear
Tatsuki IHA <e125716@ie.u-ryukyu.ac.jp>
parents:
278
diff
changeset
|
106 int odg; |
288 | 107 int maxOdg; |
242 | 108 int workerId; |
410
85b0ddbf458e
Fix CudaWorker
Tatsuki IHA <innparusu@cr.ie.u-ryukyu.ac.jp>
parents:
406
diff
changeset
|
109 int gpu; // GPU task |
406
9b35e6581b5c
Use task member of context by par goto meta
Tatsuki IHA <innparusu@cr.ie.u-ryukyu.ac.jp>
parents:
405
diff
changeset
|
110 struct Context* task; |
398
fc4fcd441700
Fix spanwTasks
Tatsuki IHA <innparusu@cr.ie.u-ryukyu.ac.jp>
parents:
397
diff
changeset
|
111 struct Queue* tasks; |
308 | 112 #ifdef USE_CUDAWorker |
113 int num_exec; | |
114 CUmodule module; | |
115 CUfunction function; | |
438
7679093bdd72
Work CUDAtwice
Tatsuki IHA <innparusu@cr.ie.u-ryukyu.ac.jp>
parents:
436
diff
changeset
|
116 #endif |
86 | 117 union Data **data; |
372
d6ce4273e7d1
Add dimension task spawn
Tatsuki IHA <innparusu@cr.ie.u-ryukyu.ac.jp>
parents:
369
diff
changeset
|
118 |
d6ce4273e7d1
Add dimension task spawn
Tatsuki IHA <innparusu@cr.ie.u-ryukyu.ac.jp>
parents:
369
diff
changeset
|
119 /* multi dimension parameter */ |
374
fb50cf8aa615
Add Iterator Interface
Tatsuki IHA <innparusu@cr.ie.u-ryukyu.ac.jp>
parents:
372
diff
changeset
|
120 int iterate; |
fb50cf8aa615
Add Iterator Interface
Tatsuki IHA <innparusu@cr.ie.u-ryukyu.ac.jp>
parents:
372
diff
changeset
|
121 struct Iterator* iterator; |
86 | 122 }; |
123 | |
438
7679093bdd72
Work CUDAtwice
Tatsuki IHA <innparusu@cr.ie.u-ryukyu.ac.jp>
parents:
436
diff
changeset
|
124 typedef int Int; |
7679093bdd72
Work CUDAtwice
Tatsuki IHA <innparusu@cr.ie.u-ryukyu.ac.jp>
parents:
436
diff
changeset
|
125 #ifndef USE_CUDAWorker |
7679093bdd72
Work CUDAtwice
Tatsuki IHA <innparusu@cr.ie.u-ryukyu.ac.jp>
parents:
436
diff
changeset
|
126 typedef unsigned long long CUdeviceptr; |
7679093bdd72
Work CUDAtwice
Tatsuki IHA <innparusu@cr.ie.u-ryukyu.ac.jp>
parents:
436
diff
changeset
|
127 #endif |
86 | 128 union Data { |
133 | 129 struct Meta { |
130 enum DataType type; | |
236 | 131 long size; |
430
35b37fe8d3a7
Add size member in struct Meta
Tatsuki IHA <innparusu@cr.ie.u-ryukyu.ac.jp>
parents:
429
diff
changeset
|
132 long len; |
176 | 133 struct Queue* wait; // tasks waiting this dataGear |
441
5a737c3df91c
Add AtomicReference Implements of Atomic Interface
Tatsuki IHA <innparusu@cr.ie.u-ryukyu.ac.jp>
parents:
438
diff
changeset
|
134 } Meta; |
259
195518ab62fc
fix type gathering pattern match in generate_stub.pl
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
254
diff
changeset
|
135 struct Context Context; |
464
7d67c9cf09ee
Rename from Time interface to Timer interface
Tatsuki IHA <innparusu@cr.ie.u-ryukyu.ac.jp>
parents:
462
diff
changeset
|
136 struct Timer { |
7d67c9cf09ee
Rename from Time interface to Timer interface
Tatsuki IHA <innparusu@cr.ie.u-ryukyu.ac.jp>
parents:
462
diff
changeset
|
137 union Data* timer; |
364
a0a3301bac4d
Add Time interface
Tatsuki IHA <innparusu@cr.ie.u-ryukyu.ac.jp>
parents:
362
diff
changeset
|
138 enum Code start; |
a0a3301bac4d
Add Time interface
Tatsuki IHA <innparusu@cr.ie.u-ryukyu.ac.jp>
parents:
362
diff
changeset
|
139 enum Code end; |
102 | 140 enum Code next; |
464
7d67c9cf09ee
Rename from Time interface to Timer interface
Tatsuki IHA <innparusu@cr.ie.u-ryukyu.ac.jp>
parents:
462
diff
changeset
|
141 } Timer; |
7d67c9cf09ee
Rename from Time interface to Timer interface
Tatsuki IHA <innparusu@cr.ie.u-ryukyu.ac.jp>
parents:
462
diff
changeset
|
142 struct TimerImpl { |
95
3e28ee215c0e
modify twice, use OSAtomiceCompareAndSwap
Shohei KOKUBO <e105744@ie.u-ryukyu.ac.jp>
parents:
92
diff
changeset
|
143 double time; |
464
7d67c9cf09ee
Rename from Time interface to Timer interface
Tatsuki IHA <innparusu@cr.ie.u-ryukyu.ac.jp>
parents:
462
diff
changeset
|
144 } TimerImpl; |
86 | 145 struct LoopCounter { |
146 int i; | |
217
c34e6aa10967
Fix DataGear access name
Tatsuki IHA <e125716@ie.u-ryukyu.ac.jp>
parents:
207
diff
changeset
|
147 } LoopCounter; |
176 | 148 struct TaskManager { |
320
f730761bb044
non CUDA case clean up
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
316
diff
changeset
|
149 union Data* taskManager; |
234 | 150 enum Code spawn; // start NEW context on the worker |
398
fc4fcd441700
Fix spanwTasks
Tatsuki IHA <innparusu@cr.ie.u-ryukyu.ac.jp>
parents:
397
diff
changeset
|
151 enum Code spawnTasks; // start NEW tasks on the worker |
176 | 152 enum Code shutdown; |
405
8915fce522b3
Fix shutdown TaskManager
Tatsuki IHA <innparusu@cr.ie.u-ryukyu.ac.jp>
parents:
404
diff
changeset
|
153 enum Code incrementTaskCount; |
8915fce522b3
Fix shutdown TaskManager
Tatsuki IHA <innparusu@cr.ie.u-ryukyu.ac.jp>
parents:
404
diff
changeset
|
154 enum Code decrementTaskCount; |
184 | 155 enum Code next; |
353
b07078bd1f2c
Add spawn Tasks to TaskManagerImpl
Tatsuki IHA <innparusu@cr.ie.u-ryukyu.ac.jp>
parents:
352
diff
changeset
|
156 enum Code next1; |
459
57c715bd6283
Change taskManager parameter from context to task
Tatsuki IHA <innparusu@cr.ie.u-ryukyu.ac.jp>
parents:
454
diff
changeset
|
157 enum Code setWaitTask; |
57c715bd6283
Change taskManager parameter from context to task
Tatsuki IHA <innparusu@cr.ie.u-ryukyu.ac.jp>
parents:
454
diff
changeset
|
158 struct Context* task; |
398
fc4fcd441700
Fix spanwTasks
Tatsuki IHA <innparusu@cr.ie.u-ryukyu.ac.jp>
parents:
397
diff
changeset
|
159 struct Queue* tasks; |
326
f23f6d0aa4e9
Add examples/calc.cbc and build but not work
Tatsuki IHA <e125716@ie.u-ryukyu.ac.jp>
parents:
320
diff
changeset
|
160 union Data* data; |
184 | 161 } TaskManager; |
182 | 162 struct TaskManagerImpl { |
388 | 163 enum Code next; |
233 | 164 int numWorker; |
410
85b0ddbf458e
Fix CudaWorker
Tatsuki IHA <innparusu@cr.ie.u-ryukyu.ac.jp>
parents:
406
diff
changeset
|
165 int sendCPUWorkerIndex; |
85b0ddbf458e
Fix CudaWorker
Tatsuki IHA <innparusu@cr.ie.u-ryukyu.ac.jp>
parents:
406
diff
changeset
|
166 int sendGPUWorkerIndex; |
405
8915fce522b3
Fix shutdown TaskManager
Tatsuki IHA <innparusu@cr.ie.u-ryukyu.ac.jp>
parents:
404
diff
changeset
|
167 int taskCount; |
239 | 168 pthread_mutex_t mutex; |
184 | 169 struct Queue* activeQueue; |
170 struct Queue* taskQueue; | |
244 | 171 struct Worker** workers; |
352
3e01e963eb2d
Fix compile error for calc example but not work
Tatsuki IHA <innparusu@cr.ie.u-ryukyu.ac.jp>
parents:
344
diff
changeset
|
172 struct LoopCounter* loopCounter; |
461
6b71cf5b1c22
Change Interface files from cbc to header
Tatsuki IHA <innparusu@cr.ie.u-ryukyu.ac.jp>
parents:
459
diff
changeset
|
173 int cpu; |
6b71cf5b1c22
Change Interface files from cbc to header
Tatsuki IHA <innparusu@cr.ie.u-ryukyu.ac.jp>
parents:
459
diff
changeset
|
174 int gpu; |
6b71cf5b1c22
Change Interface files from cbc to header
Tatsuki IHA <innparusu@cr.ie.u-ryukyu.ac.jp>
parents:
459
diff
changeset
|
175 int io; |
6b71cf5b1c22
Change Interface files from cbc to header
Tatsuki IHA <innparusu@cr.ie.u-ryukyu.ac.jp>
parents:
459
diff
changeset
|
176 int maxCPU; |
184 | 177 } TaskManagerImpl; |
86 | 178 struct Worker { |
232 | 179 union Data* worker; |
222
77faa28128b4
Add taskSend for TaskManager
Tatsuki IHA <e125716@ie.u-ryukyu.ac.jp>
parents:
218
diff
changeset
|
180 enum Code taskReceive; |
176 | 181 enum Code shutdown; |
230 | 182 enum Code next; |
244 | 183 struct Queue* tasks; |
411
0eba9a04633f
Work CUDAtwice
Tatsuki IHA <innparusu@cr.ie.u-ryukyu.ac.jp>
parents:
410
diff
changeset
|
184 pthread_t thread; |
288 | 185 struct TaskManager* taskManager; |
184 | 186 } Worker; |
232 | 187 struct CPUWorker { |
242 | 188 pthread_mutex_t mutex; |
189 pthread_cond_t cond; | |
232 | 190 struct Context* context; |
191 int id; | |
192 } CPUWorker; | |
302 | 193 #ifdef USE_CUDAWorker |
194 struct CUDAWorker { | |
316
54d203daf06b
CUDAtwice.cbc is called.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
309
diff
changeset
|
195 CUdevice device; |
54d203daf06b
CUDAtwice.cbc is called.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
309
diff
changeset
|
196 CUcontext cuCtx; |
233 | 197 pthread_t thread; |
232 | 198 struct Context* context; |
199 int id; | |
200 struct Queue* tasks; | |
201 int runFlag; | |
202 enum Code next; | |
451
dcc42f3e7e97
Auto choice blockDim
Tatsuki IHA <innparusu@cr.ie.u-ryukyu.ac.jp>
parents:
450
diff
changeset
|
203 int numStream; |
436
08a93fc2f0d3
Fix CudaExecutor but not work
Tatsuki IHA <innparusu@cr.ie.u-ryukyu.ac.jp>
parents:
435
diff
changeset
|
204 struct Executor* executor; |
305 | 205 CUstream *stream; |
206 } CUDAWorker; | |
187 | 207 #else |
302 | 208 struct CUDAWorker { |
305 | 209 } CUDAWorker; |
101 | 210 #endif |
177 | 211 struct Main { |
212 enum Code code; | |
213 enum Code next; | |
214 struct Queue* args; | |
185 | 215 } Main; |
169
ea7b11f3e717
Using Queue Interface
Tatsuki IHA <e125716@ie.u-ryukyu.ac.jp>
parents:
168
diff
changeset
|
216 // Queue Interface |
90 | 217 struct Queue { |
136 | 218 union Data* queue; |
167 | 219 union Data* data; |
220 enum Code whenEmpty; | |
221 enum Code clear; | |
222 enum Code put; | |
223 enum Code take; | |
224 enum Code isEmpty; | |
130 | 225 enum Code next; |
184 | 226 } Queue; |
167 | 227 struct SingleLinkedQueue { |
228 struct Element* top; | |
229 struct Element* last; | |
184 | 230 } SingleLinkedQueue; |
282
a3448b0f0a56
Add input data gear
Tatsuki IHA <e125716@ie.u-ryukyu.ac.jp>
parents:
278
diff
changeset
|
231 struct SynchronizedQueue { |
a3448b0f0a56
Add input data gear
Tatsuki IHA <e125716@ie.u-ryukyu.ac.jp>
parents:
278
diff
changeset
|
232 struct Element* top; |
a3448b0f0a56
Add input data gear
Tatsuki IHA <e125716@ie.u-ryukyu.ac.jp>
parents:
278
diff
changeset
|
233 struct Element* last; |
444
0c024ea61601
Using cas interface but occurred warning
Tatsuki IHA <innparusu@cr.ie.u-ryukyu.ac.jp>
parents:
441
diff
changeset
|
234 struct Atomic* atomic; |
282
a3448b0f0a56
Add input data gear
Tatsuki IHA <e125716@ie.u-ryukyu.ac.jp>
parents:
278
diff
changeset
|
235 } SynchronizedQueue; |
132 | 236 // Stack Interface |
130 | 237 struct Stack { |
132 | 238 union Data* stack; |
130 | 239 union Data* data; |
133 | 240 union Data* data1; |
438
7679093bdd72
Work CUDAtwice
Tatsuki IHA <innparusu@cr.ie.u-ryukyu.ac.jp>
parents:
436
diff
changeset
|
241 enum Code whenEmpty; |
145
cc071cf1ba85
add stack clear interface
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
144
diff
changeset
|
242 enum Code clear; |
130 | 243 enum Code push; |
244 enum Code pop; | |
133 | 245 enum Code pop2; |
130 | 246 enum Code isEmpty; |
134
2eccf4564efe
fix stack call in rb_tree
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
133
diff
changeset
|
247 enum Code get; |
133 | 248 enum Code get2; |
130 | 249 enum Code next; |
194 | 250 } Stack; |
132 | 251 // Stack implementations |
252 struct SingleLinkedStack { | |
253 struct Element* top; | |
194 | 254 } SingleLinkedStack; |
132 | 255 struct ArrayStack { |
256 int size; | |
257 int limit; | |
258 struct Element* array; | |
194 | 259 } ArrayStack; |
132 | 260 // Stack implementation end |
90 | 261 struct Element { |
113
d05b9937aa95
Change element data from Task to Data
Tatsuki IHA <e125716@ie.u-ryukyu.ac.jp>
parents:
112
diff
changeset
|
262 union Data* data; |
90 | 263 struct Element* next; |
194 | 264 } Element; |
86 | 265 struct Array { |
438
7679093bdd72
Work CUDAtwice
Tatsuki IHA <innparusu@cr.ie.u-ryukyu.ac.jp>
parents:
436
diff
changeset
|
266 int prefix; |
7679093bdd72
Work CUDAtwice
Tatsuki IHA <innparusu@cr.ie.u-ryukyu.ac.jp>
parents:
436
diff
changeset
|
267 Int* array; |
194 | 268 } Array; |
86 | 269 struct Tree { |
166 | 270 union Data* tree; |
271 struct Node* node; | |
152 | 272 enum Code put; |
273 enum Code get; | |
274 enum Code remove; | |
171 | 275 enum Code clear; |
152 | 276 enum Code next; |
166 | 277 } Tree; |
172 | 278 struct RedBlackTree { |
152 | 279 struct Node* root; |
122 | 280 struct Node* current; // reading node of original tree |
138 | 281 struct Node* previous; // parent of reading node of original tree |
124 | 282 struct Node* newNode; // writing node of new tree |
143
34a7a21edc36
recude stack get using traverse field
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
138
diff
changeset
|
283 struct Node* parent; |
438
7679093bdd72
Work CUDAtwice
Tatsuki IHA <innparusu@cr.ie.u-ryukyu.ac.jp>
parents:
436
diff
changeset
|
284 struct Node* grandparent; |
132 | 285 struct Stack* nodeStack; |
86 | 286 int result; |
172 | 287 } RedBlackTree; |
147 | 288 struct RotateTree { |
289 enum Code next; | |
172 | 290 struct RedBlackTree* traverse; |
147 | 291 struct Tree* tree; |
217
c34e6aa10967
Fix DataGear access name
Tatsuki IHA <e125716@ie.u-ryukyu.ac.jp>
parents:
207
diff
changeset
|
292 } RotateTree; |
86 | 293 struct Node { |
294 int key; // comparable data segment | |
90 | 295 union Data* value; |
86 | 296 struct Node* left; |
297 struct Node* right; | |
298 // need to balancing | |
299 enum Color { | |
300 Red, | |
301 Black, | |
454 | 302 // Red eq 0,Black eq 1. enum name convert intager. |
86 | 303 } color; |
217
c34e6aa10967
Fix DataGear access name
Tatsuki IHA <e125716@ie.u-ryukyu.ac.jp>
parents:
207
diff
changeset
|
304 } Node; |
441
5a737c3df91c
Add AtomicReference Implements of Atomic Interface
Tatsuki IHA <innparusu@cr.ie.u-ryukyu.ac.jp>
parents:
438
diff
changeset
|
305 struct Atomic { |
5a737c3df91c
Add AtomicReference Implements of Atomic Interface
Tatsuki IHA <innparusu@cr.ie.u-ryukyu.ac.jp>
parents:
438
diff
changeset
|
306 union Data* atomic; |
444
0c024ea61601
Using cas interface but occurred warning
Tatsuki IHA <innparusu@cr.ie.u-ryukyu.ac.jp>
parents:
441
diff
changeset
|
307 union Data** ptr; |
0c024ea61601
Using cas interface but occurred warning
Tatsuki IHA <innparusu@cr.ie.u-ryukyu.ac.jp>
parents:
441
diff
changeset
|
308 union Data* oldData; |
0c024ea61601
Using cas interface but occurred warning
Tatsuki IHA <innparusu@cr.ie.u-ryukyu.ac.jp>
parents:
441
diff
changeset
|
309 union Data* newData; |
441
5a737c3df91c
Add AtomicReference Implements of Atomic Interface
Tatsuki IHA <innparusu@cr.ie.u-ryukyu.ac.jp>
parents:
438
diff
changeset
|
310 enum Code checkAndSet; |
5a737c3df91c
Add AtomicReference Implements of Atomic Interface
Tatsuki IHA <innparusu@cr.ie.u-ryukyu.ac.jp>
parents:
438
diff
changeset
|
311 enum Code next; |
5a737c3df91c
Add AtomicReference Implements of Atomic Interface
Tatsuki IHA <innparusu@cr.ie.u-ryukyu.ac.jp>
parents:
438
diff
changeset
|
312 enum Code fail; |
5a737c3df91c
Add AtomicReference Implements of Atomic Interface
Tatsuki IHA <innparusu@cr.ie.u-ryukyu.ac.jp>
parents:
438
diff
changeset
|
313 } Atomic; |
5a737c3df91c
Add AtomicReference Implements of Atomic Interface
Tatsuki IHA <innparusu@cr.ie.u-ryukyu.ac.jp>
parents:
438
diff
changeset
|
314 struct AtomicReference { |
5a737c3df91c
Add AtomicReference Implements of Atomic Interface
Tatsuki IHA <innparusu@cr.ie.u-ryukyu.ac.jp>
parents:
438
diff
changeset
|
315 } AtomicReference; |
286 | 316 struct Semaphore { |
317 union Data* semaphore; | |
318 enum Code p; | |
319 enum Code v; | |
320 enum Code next; | |
321 } Semaphore; | |
322 struct SemaphoreImpl { | |
323 int value; | |
324 pthread_mutex_t mutex; | |
325 pthread_cond_t cond; | |
326 } SemaphoreImpl; | |
86 | 327 struct Allocate { |
328 enum Code next; | |
329 long size; | |
217
c34e6aa10967
Fix DataGear access name
Tatsuki IHA <e125716@ie.u-ryukyu.ac.jp>
parents:
207
diff
changeset
|
330 } Allocate; |
326
f23f6d0aa4e9
Add examples/calc.cbc and build but not work
Tatsuki IHA <e125716@ie.u-ryukyu.ac.jp>
parents:
320
diff
changeset
|
331 struct Integer { |
f23f6d0aa4e9
Add examples/calc.cbc and build but not work
Tatsuki IHA <e125716@ie.u-ryukyu.ac.jp>
parents:
320
diff
changeset
|
332 int value; |
f23f6d0aa4e9
Add examples/calc.cbc and build but not work
Tatsuki IHA <e125716@ie.u-ryukyu.ac.jp>
parents:
320
diff
changeset
|
333 } Integer; |
404
c5cd9888bf2a
Fix bitonicSort
Tatsuki IHA <innparusu@cr.ie.u-ryukyu.ac.jp>
parents:
402
diff
changeset
|
334 struct SortArray { |
c5cd9888bf2a
Fix bitonicSort
Tatsuki IHA <innparusu@cr.ie.u-ryukyu.ac.jp>
parents:
402
diff
changeset
|
335 struct Integer *array; //Array arrayじゃできない? |
379
2744cb933ebc
Fix compile error for bitonicSort but not work
Tatsuki IHA <innparusu@cr.ie.u-ryukyu.ac.jp>
parents:
375
diff
changeset
|
336 int loopCounter; |
404
c5cd9888bf2a
Fix bitonicSort
Tatsuki IHA <innparusu@cr.ie.u-ryukyu.ac.jp>
parents:
402
diff
changeset
|
337 int block; |
c5cd9888bf2a
Fix bitonicSort
Tatsuki IHA <innparusu@cr.ie.u-ryukyu.ac.jp>
parents:
402
diff
changeset
|
338 int first; |
383
300c18700ca5
Add split to bitonicSort
Tatsuki IHA <innparusu@cr.ie.u-ryukyu.ac.jp>
parents:
381
diff
changeset
|
339 int prefix; |
374
fb50cf8aa615
Add Iterator Interface
Tatsuki IHA <innparusu@cr.ie.u-ryukyu.ac.jp>
parents:
372
diff
changeset
|
340 } SortArray; |
fb50cf8aa615
Add Iterator Interface
Tatsuki IHA <innparusu@cr.ie.u-ryukyu.ac.jp>
parents:
372
diff
changeset
|
341 struct Iterator { |
375
ad44fdb11433
Fix compile error but not work
Tatsuki IHA <innparusu@cr.ie.u-ryukyu.ac.jp>
parents:
374
diff
changeset
|
342 union Data* iterator; |
ad44fdb11433
Fix compile error but not work
Tatsuki IHA <innparusu@cr.ie.u-ryukyu.ac.jp>
parents:
374
diff
changeset
|
343 struct Context* task; |
410
85b0ddbf458e
Fix CudaWorker
Tatsuki IHA <innparusu@cr.ie.u-ryukyu.ac.jp>
parents:
406
diff
changeset
|
344 int numGPU; |
374
fb50cf8aa615
Add Iterator Interface
Tatsuki IHA <innparusu@cr.ie.u-ryukyu.ac.jp>
parents:
372
diff
changeset
|
345 enum Code exec; |
fb50cf8aa615
Add Iterator Interface
Tatsuki IHA <innparusu@cr.ie.u-ryukyu.ac.jp>
parents:
372
diff
changeset
|
346 enum Code barrier; |
fb50cf8aa615
Add Iterator Interface
Tatsuki IHA <innparusu@cr.ie.u-ryukyu.ac.jp>
parents:
372
diff
changeset
|
347 enum Code whenWait; |
fb50cf8aa615
Add Iterator Interface
Tatsuki IHA <innparusu@cr.ie.u-ryukyu.ac.jp>
parents:
372
diff
changeset
|
348 enum Code next; |
fb50cf8aa615
Add Iterator Interface
Tatsuki IHA <innparusu@cr.ie.u-ryukyu.ac.jp>
parents:
372
diff
changeset
|
349 } Iterator; |
402
e958a409943c
Change iterator implement from oneDim to multiDim
Tatsuki IHA <innparusu@cr.ie.u-ryukyu.ac.jp>
parents:
398
diff
changeset
|
350 struct MultiDimIterator { |
374
fb50cf8aa615
Add Iterator Interface
Tatsuki IHA <innparusu@cr.ie.u-ryukyu.ac.jp>
parents:
372
diff
changeset
|
351 int x; |
402
e958a409943c
Change iterator implement from oneDim to multiDim
Tatsuki IHA <innparusu@cr.ie.u-ryukyu.ac.jp>
parents:
398
diff
changeset
|
352 int y; |
e958a409943c
Change iterator implement from oneDim to multiDim
Tatsuki IHA <innparusu@cr.ie.u-ryukyu.ac.jp>
parents:
398
diff
changeset
|
353 int z; |
374
fb50cf8aa615
Add Iterator Interface
Tatsuki IHA <innparusu@cr.ie.u-ryukyu.ac.jp>
parents:
372
diff
changeset
|
354 int count; |
402
e958a409943c
Change iterator implement from oneDim to multiDim
Tatsuki IHA <innparusu@cr.ie.u-ryukyu.ac.jp>
parents:
398
diff
changeset
|
355 int counterX; |
e958a409943c
Change iterator implement from oneDim to multiDim
Tatsuki IHA <innparusu@cr.ie.u-ryukyu.ac.jp>
parents:
398
diff
changeset
|
356 int counterY; |
e958a409943c
Change iterator implement from oneDim to multiDim
Tatsuki IHA <innparusu@cr.ie.u-ryukyu.ac.jp>
parents:
398
diff
changeset
|
357 int counterZ; |
e958a409943c
Change iterator implement from oneDim to multiDim
Tatsuki IHA <innparusu@cr.ie.u-ryukyu.ac.jp>
parents:
398
diff
changeset
|
358 } MultiDimIterator; |
e958a409943c
Change iterator implement from oneDim to multiDim
Tatsuki IHA <innparusu@cr.ie.u-ryukyu.ac.jp>
parents:
398
diff
changeset
|
359 struct MultiDim { |
e958a409943c
Change iterator implement from oneDim to multiDim
Tatsuki IHA <innparusu@cr.ie.u-ryukyu.ac.jp>
parents:
398
diff
changeset
|
360 int x; |
e958a409943c
Change iterator implement from oneDim to multiDim
Tatsuki IHA <innparusu@cr.ie.u-ryukyu.ac.jp>
parents:
398
diff
changeset
|
361 int y; |
e958a409943c
Change iterator implement from oneDim to multiDim
Tatsuki IHA <innparusu@cr.ie.u-ryukyu.ac.jp>
parents:
398
diff
changeset
|
362 int z; |
e958a409943c
Change iterator implement from oneDim to multiDim
Tatsuki IHA <innparusu@cr.ie.u-ryukyu.ac.jp>
parents:
398
diff
changeset
|
363 } MultiDim; |
434
b75badf42701
Define Executor to context
Tatsuki IHA <innparusu@cr.ie.u-ryukyu.ac.jp>
parents:
431
diff
changeset
|
364 struct Executor { |
436
08a93fc2f0d3
Fix CudaExecutor but not work
Tatsuki IHA <innparusu@cr.ie.u-ryukyu.ac.jp>
parents:
435
diff
changeset
|
365 union Data* executor; |
434
b75badf42701
Define Executor to context
Tatsuki IHA <innparusu@cr.ie.u-ryukyu.ac.jp>
parents:
431
diff
changeset
|
366 struct Context* task; |
b75badf42701
Define Executor to context
Tatsuki IHA <innparusu@cr.ie.u-ryukyu.ac.jp>
parents:
431
diff
changeset
|
367 enum Code read; |
b75badf42701
Define Executor to context
Tatsuki IHA <innparusu@cr.ie.u-ryukyu.ac.jp>
parents:
431
diff
changeset
|
368 enum Code exec; |
b75badf42701
Define Executor to context
Tatsuki IHA <innparusu@cr.ie.u-ryukyu.ac.jp>
parents:
431
diff
changeset
|
369 enum Code write; |
b75badf42701
Define Executor to context
Tatsuki IHA <innparusu@cr.ie.u-ryukyu.ac.jp>
parents:
431
diff
changeset
|
370 enum Code next; |
b75badf42701
Define Executor to context
Tatsuki IHA <innparusu@cr.ie.u-ryukyu.ac.jp>
parents:
431
diff
changeset
|
371 } Executor; |
b75badf42701
Define Executor to context
Tatsuki IHA <innparusu@cr.ie.u-ryukyu.ac.jp>
parents:
431
diff
changeset
|
372 #ifdef USE_CUDAWorker |
435
af0ec811b20e
Add CUDAExecutor
Tatsuki IHA <innparusu@cr.ie.u-ryukyu.ac.jp>
parents:
434
diff
changeset
|
373 struct CUDAExecutor { |
436
08a93fc2f0d3
Fix CudaExecutor but not work
Tatsuki IHA <innparusu@cr.ie.u-ryukyu.ac.jp>
parents:
435
diff
changeset
|
374 CUdeviceptr** kernelParams; |
08a93fc2f0d3
Fix CudaExecutor but not work
Tatsuki IHA <innparusu@cr.ie.u-ryukyu.ac.jp>
parents:
435
diff
changeset
|
375 struct CUDABuffer* buffer; |
451
dcc42f3e7e97
Auto choice blockDim
Tatsuki IHA <innparusu@cr.ie.u-ryukyu.ac.jp>
parents:
450
diff
changeset
|
376 int maxThreadPerBlock; |
435
af0ec811b20e
Add CUDAExecutor
Tatsuki IHA <innparusu@cr.ie.u-ryukyu.ac.jp>
parents:
434
diff
changeset
|
377 } CUDAExecutor; |
af0ec811b20e
Add CUDAExecutor
Tatsuki IHA <innparusu@cr.ie.u-ryukyu.ac.jp>
parents:
434
diff
changeset
|
378 struct CUDABuffer { |
431
b3359544adbb
Edit cudaExec but not work
Tatsuki IHA <innparusu@cr.ie.u-ryukyu.ac.jp>
parents:
430
diff
changeset
|
379 int inputLen; |
b3359544adbb
Edit cudaExec but not work
Tatsuki IHA <innparusu@cr.ie.u-ryukyu.ac.jp>
parents:
430
diff
changeset
|
380 int outputLen; |
b3359544adbb
Edit cudaExec but not work
Tatsuki IHA <innparusu@cr.ie.u-ryukyu.ac.jp>
parents:
430
diff
changeset
|
381 union Data** inputData; |
b3359544adbb
Edit cudaExec but not work
Tatsuki IHA <innparusu@cr.ie.u-ryukyu.ac.jp>
parents:
430
diff
changeset
|
382 union Data** outputData; |
435
af0ec811b20e
Add CUDAExecutor
Tatsuki IHA <innparusu@cr.ie.u-ryukyu.ac.jp>
parents:
434
diff
changeset
|
383 } CUDABuffer; |
438
7679093bdd72
Work CUDAtwice
Tatsuki IHA <innparusu@cr.ie.u-ryukyu.ac.jp>
parents:
436
diff
changeset
|
384 CUdeviceptr CUdeviceptr; |
7679093bdd72
Work CUDAtwice
Tatsuki IHA <innparusu@cr.ie.u-ryukyu.ac.jp>
parents:
436
diff
changeset
|
385 #else |
7679093bdd72
Work CUDAtwice
Tatsuki IHA <innparusu@cr.ie.u-ryukyu.ac.jp>
parents:
436
diff
changeset
|
386 struct CUDAExecutor { |
7679093bdd72
Work CUDAtwice
Tatsuki IHA <innparusu@cr.ie.u-ryukyu.ac.jp>
parents:
436
diff
changeset
|
387 } CUDAExecutor; |
7679093bdd72
Work CUDAtwice
Tatsuki IHA <innparusu@cr.ie.u-ryukyu.ac.jp>
parents:
436
diff
changeset
|
388 struct CUDABuffer { |
7679093bdd72
Work CUDAtwice
Tatsuki IHA <innparusu@cr.ie.u-ryukyu.ac.jp>
parents:
436
diff
changeset
|
389 } CUDABuffer; |
7679093bdd72
Work CUDAtwice
Tatsuki IHA <innparusu@cr.ie.u-ryukyu.ac.jp>
parents:
436
diff
changeset
|
390 CUdeviceptr CUdeviceptr; |
7679093bdd72
Work CUDAtwice
Tatsuki IHA <innparusu@cr.ie.u-ryukyu.ac.jp>
parents:
436
diff
changeset
|
391 #endif |
7679093bdd72
Work CUDAtwice
Tatsuki IHA <innparusu@cr.ie.u-ryukyu.ac.jp>
parents:
436
diff
changeset
|
392 Int Int; |
447
57132ef16009
Remove ALLOCATE_DATA_GEAR from par goto code gear arguments
Tatsuki IHA <innparusu@cr.ie.u-ryukyu.ac.jp>
parents:
444
diff
changeset
|
393 struct Memory { |
57132ef16009
Remove ALLOCATE_DATA_GEAR from par goto code gear arguments
Tatsuki IHA <innparusu@cr.ie.u-ryukyu.ac.jp>
parents:
444
diff
changeset
|
394 union Data* adr; |
57132ef16009
Remove ALLOCATE_DATA_GEAR from par goto code gear arguments
Tatsuki IHA <innparusu@cr.ie.u-ryukyu.ac.jp>
parents:
444
diff
changeset
|
395 int length; |
57132ef16009
Remove ALLOCATE_DATA_GEAR from par goto code gear arguments
Tatsuki IHA <innparusu@cr.ie.u-ryukyu.ac.jp>
parents:
444
diff
changeset
|
396 union Data* body; |
57132ef16009
Remove ALLOCATE_DATA_GEAR from par goto code gear arguments
Tatsuki IHA <innparusu@cr.ie.u-ryukyu.ac.jp>
parents:
444
diff
changeset
|
397 int hash; |
57132ef16009
Remove ALLOCATE_DATA_GEAR from par goto code gear arguments
Tatsuki IHA <innparusu@cr.ie.u-ryukyu.ac.jp>
parents:
444
diff
changeset
|
398 } Memory; |
254 | 399 }; // union Data end this is necessary for context generator |
259
195518ab62fc
fix type gathering pattern match in generate_stub.pl
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
254
diff
changeset
|
400 typedef union Data Data; |
195518ab62fc
fix type gathering pattern match in generate_stub.pl
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
254
diff
changeset
|
401 |
186 | 402 #include "c/typedefData.h" |
278 | 403 |
404 #include "c/extern.h" | |
405 | |
406 extern __code start_code(struct Context* context); | |
407 extern __code exit_code(struct Context* context); | |
408 extern __code meta(struct Context* context, enum Code next); | |
398
fc4fcd441700
Fix spanwTasks
Tatsuki IHA <innparusu@cr.ie.u-ryukyu.ac.jp>
parents:
397
diff
changeset
|
409 extern __code par_meta(struct Context* context, enum Code spawns, enum Code next); |
278 | 410 extern void initContext(struct Context* context); |
411 | |
132 | 412 #endif |