Mercurial > hg > GearsTemplate
comparison src/parallel_execution/context.h @ 237:6f6cc49213c5
fix
author | mir3636 |
---|---|
date | Tue, 24 Jan 2017 09:19:58 +0900 |
parents | 865179a0a56d |
children | cc13a1608364 |
comparison
equal
deleted
inserted
replaced
236:865179a0a56d | 237:6f6cc49213c5 |
---|---|
34 meta->size = 1; \ | 34 meta->size = 1; \ |
35 data; }) | 35 data; }) |
36 | 36 |
37 #define ALLOC(context, t) (&ALLOCATE(context, t)->t) | 37 #define ALLOC(context, t) (&ALLOCATE(context, t)->t) |
38 | 38 |
39 #define ALLOC_ARRY(context, dseg, size) ({\ | 39 #define ALLOC_ARRAY(context, dseg, len) ({\ |
40 struct Meta* meta = (struct Meta*)context->heap;\ | 40 struct Meta* meta = (struct Meta*)context->heap;\ |
41 context->heap += sizeof(struct Meta);\ | 41 context->heap += sizeof(struct Meta);\ |
42 union Data* data = context->heap; \ | 42 union Data* data = context->heap; \ |
43 context->heap += sizeof(struct t)*size; \ | 43 context->heap += sizeof(struct dseg)*len; \ |
44 meta->type = D_##dseg; \ | 44 meta->type = D_##dseg; \ |
45 meta->size = size; \ | 45 meta->size = len; \ |
46 data; }) | 46 data; }) |
47 | 47 |
48 #define GET_TYPE(dseg) ({ \ | 48 #define GET_TYPE(dseg) ({ \ |
49 struct Meta* meta = (struct Meta*)(((void*)dseg) - sizeof(struct Meta));\ | 49 struct Meta* meta = (struct Meta*)(((void*)dseg) - sizeof(struct Meta));\ |
50 meta->type; }) | 50 meta->type; }) |
105 struct Context* context; | 105 struct Context* context; |
106 int worker; | 106 int worker; |
107 int cpu; | 107 int cpu; |
108 int gpu; | 108 int gpu; |
109 int io; | 109 int io; |
110 int maxCPU; | |
110 } TaskManager; | 111 } TaskManager; |
111 struct TaskManagerImpl { | 112 struct TaskManagerImpl { |
112 int numWorker; | 113 int numWorker; |
113 struct Queue* activeQueue; | 114 struct Queue* activeQueue; |
114 struct Queue* taskQueue; | 115 struct Queue* taskQueue; |