Mercurial > hg > GearsTemplate
changeset 257:cd3486e4ba70
fix make error of twice
author | mir3636 |
---|---|
date | Fri, 27 Jan 2017 21:20:07 +0900 |
parents | d2f5d6fc56fa |
children | 4fe19a06d666 195518ab62fc |
files | src/parallel_execution/CMakeLists.txt src/parallel_execution/generate_context.pl src/parallel_execution/main.c src/parallel_execution/taskManager.c src/parallel_execution/test/queue_test.c src/parallel_execution/twice.c src/parallel_execution/worker.c |
diffstat | 7 files changed, 13 insertions(+), 11 deletions(-) [+] |
line wrap: on
line diff
--- a/src/parallel_execution/CMakeLists.txt Fri Jan 27 20:40:28 2017 +0900 +++ b/src/parallel_execution/CMakeLists.txt Fri Jan 27 21:20:07 2017 +0900 @@ -27,9 +27,6 @@ list(APPEND _Gears_CSOURCES ${j}) endforeach(i) - #message(${_Gears_SOURCES}) - #message(${_Gears_CSOURCES}) - add_custom_command ( OUTPUT c/${_Gears_TARGET}-context.c DEPENDS ${_Gears_CSOURCES}
--- a/src/parallel_execution/generate_context.pl Fri Jan 27 20:40:28 2017 +0900 +++ b/src/parallel_execution/generate_context.pl Fri Jan 27 21:20:07 2017 +0900 @@ -71,6 +71,11 @@ my (%mCodeGear) = (%codeGear); +while (<*.c>) { + next if (/context.c/); + &getStubInfo($_); +} + &generateContext(); sub getStubInfo {
--- a/src/parallel_execution/main.c Fri Jan 27 20:40:28 2017 +0900 +++ b/src/parallel_execution/main.c Fri Jan 27 21:20:07 2017 +0900 @@ -139,7 +139,7 @@ Gearef(context, TaskManager)); } -__code createTask2(Context* context, LoopCounter* loopCounter, TaskManager* taskManager, Context* task, Array* array) { +__code createTask2(struct Context* context, LoopCounter* loopCounter, TaskManager* taskManager,struct Context* task, Array* array) { int i = loopCounter->i; if ((length/split*i) < length) {
--- a/src/parallel_execution/taskManager.c Fri Jan 27 20:40:28 2017 +0900 +++ b/src/parallel_execution/taskManager.c Fri Jan 27 21:20:07 2017 +0900 @@ -5,7 +5,7 @@ #include "origin_cs.h" #include <stdio.h> -void createWorkers(Context* context, TaskManager* taskManeger, TaskManagerImpl* taskManagerImpl); +void createWorkers(struct Context* context, TaskManager* taskManeger, TaskManagerImpl* taskManagerImpl); union Data* createTaskManager(struct Context* context, int numCPU, int numGPU, int numIO) { struct TaskManager* taskManager = &ALLOCATE(context, TaskManager)->TaskManager; @@ -28,7 +28,7 @@ return (union Data*)(taskManager); } -void createWorkers(Context* context, TaskManager* taskManager, TaskManagerImpl* taskManagerImpl) { +void createWorkers(struct Context* context, TaskManager* taskManager, TaskManagerImpl* taskManagerImpl) { int i = 0; taskManagerImpl->workers = (Worker**)ALLOC_ARRAY(context, Worker, taskManager->maxCPU); for (;i<taskManager->gpu;i++) { @@ -58,7 +58,7 @@ goto createTask(context, Gearef(context,TaskManager)); } -__code setWorker(struct Context* context, TaskManagerImpl* taskManager, Context* task, enum Code next) { +__code setWorker(struct Context* context, TaskManagerImpl* taskManager, struct Context* task, enum Code next) { task->workerId = taskManager->sendWorkerIndex; if(++taskManager->sendWorkerIndex >= taskManager->numWorker) { taskManager->sendWorkerIndex = 0;
--- a/src/parallel_execution/test/queue_test.c Fri Jan 27 20:40:28 2017 +0900 +++ b/src/parallel_execution/test/queue_test.c Fri Jan 27 21:20:07 2017 +0900 @@ -65,7 +65,7 @@ } int main(int argc, char const* argv[]) { - Context* main_context = NEW(struct Context); + struct Context* main_context = NEW(struct Context); initContext(main_context); main_context->next = C_queueTest1; goto start_code(main_context);
--- a/src/parallel_execution/twice.c Fri Jan 27 20:40:28 2017 +0900 +++ b/src/parallel_execution/twice.c Fri Jan 27 21:20:07 2017 +0900 @@ -3,7 +3,7 @@ #include "context.h" #include "origin_cs.h" -__code twice(struct Context* context, struct LoopCounter* loopCounter, int index, int prefix, int* array, Context* workerContext) { +__code twice(struct Context* context, struct LoopCounter* loopCounter, int index, int prefix, int* array, struct Context* workerContext) { int i = loopCounter->i; if (i < prefix) { array[i+index*prefix] = array[i+index*prefix]*2; @@ -17,6 +17,6 @@ } __code twice_stub(struct Context* context) { - Context* workerContext = context->worker->worker->CPUWorker.context; + struct Context* workerContext = context->worker->worker->CPUWorker.context; goto twice(context, Gearef(context, LoopCounter), 0, 0, NULL, workerContext); }
--- a/src/parallel_execution/worker.c Fri Jan 27 20:40:28 2017 +0900 +++ b/src/parallel_execution/worker.c Fri Jan 27 21:20:07 2017 +0900 @@ -47,7 +47,7 @@ __code getTask_stub(struct Context* context) { Worker* worker = &Gearef(context,Worker)->worker->Worker; - Context* task = &Gearef(context, Queue)->data->context; + struct Context* task = &Gearef(context, Queue)->data->context; goto getTask(context, worker, task); }