comparison src/parallel_execution/worker.c @ 227:991f3d1ce072

fix worker
author ikkun
date Fri, 20 Jan 2017 19:12:29 +0900
parents 77faa28128b4
children a1fb3f2d1a36
comparison
equal deleted inserted replaced
226:68c03e7057d9 227:991f3d1ce072
10 worker->taskReceive = C_taskReceiveWorker; 10 worker->taskReceive = C_taskReceiveWorker;
11 worker->shutdown = C_shutdownWorker; 11 worker->shutdown = C_shutdownWorker;
12 return (union Data*)(worker); 12 return (union Data*)(worker);
13 } 13 }
14 14
15 __code taskSend(struct Context* context) { 15 __code taskSendWorker(struct Context* context) {
16 } 16 }
17 17
18 __code exectureWorker(struct Context* context) { 18 __code taskSendWorker_stub(struct Context* context) {
19 goto taskSendWorker(context);
20 }
21
22 __code executeWorker(struct Context* context, Worker* worker) {
19 worker->next = worker->taskReceive; 23 worker->next = worker->taskReceive;
20 goto meta(context, task->code); 24 goto meta(context, task->code);
21 } 25 }
22 26
23 __code taskReceive(struct Context* context) { 27 __code executeWorker_stub(struct Context* context) {
24 queue->queue = (union Data*)worker->worker->Worker.tasks; 28 Worker* worker = &Gearef(context,Worker);
25 queue->next = worker->execute; 29 goto extcuteWorker(context,worker);
26 goto meta(context, queue->queue->Queue.take); 30 }
31
32 __code taskReceiveWorker(struct Context* context, Worker* worker) {
33 Queue* queue = &Gearef(context,queue);
34 queue->queue = worker->tasks;
35 queue->next = C_getTask1;
36 goto meta(context, queue->take);
37 }
38
39 __code taskReceiveWorker_stub(struct Context* context) {
40 Worker* worker = Gearef(context,Worker).worker;
41 goto taskReceiveWorker(context,queue);
27 } 42 }
28 43
29 __code getTask1(struct Context* context, struct Queue* queue) { 44 __code getTask1(struct Context* context, struct Queue* queue) {
30 queue->next = C_getTask2; 45 queue->next = C_getTask2;
31 goto meta(context, queue->take); 46 goto meta(context, queue->take);
49 cuMemcpyHtoDAsync(context,context,context,context->stream); 64 cuMemcpyHtoDAsync(context,context,context,context->stream);
50 cuLaunchkanel(); 65 cuLaunchkanel();
51 cuMemcpyDtoHAsync(); 66 cuMemcpyDtoHAsync();
52 } 67 }
53 #endif 68 #endif
69
70 __code shutdownWorker(struct Context* context) {
71
72 }