diff src/parallel_execution/main.cbc @ 278:23767f714f4a

fix generate_stub
author mir3636
date Thu, 02 Feb 2017 20:27:56 +0900
parents 9d671e63df74
children b5e8fce400a5
line wrap: on
line diff
--- a/src/parallel_execution/main.cbc	Thu Feb 02 18:29:50 2017 +0900
+++ b/src/parallel_execution/main.cbc	Thu Feb 02 20:27:56 2017 +0900
@@ -2,12 +2,7 @@
 #include <string.h>
 #include <stdlib.h>
 
-#include "context.h"
-#include "origin_cs.h"
-
-extern union Data* createRedBlackTree(struct Context* context);
-extern union Data* createTaskManager(struct Context* context, int numCPU, int numGPU, int numIO);
-extern void allocator(struct Context* context);
+#include "../context.h"
 
 int cpu_num = 1;
 int length = 102400;
@@ -29,7 +24,7 @@
     }
 }
 
-__code initDataGears(struct Context* context, struct LoopCounter* loopCounter, struct TaskManager* taskManager) {
+__code initDataGears(struct LoopCounter* loopCounter, struct TaskManager* taskManager) {
     loopCounter->tree = &createRedBlackTree(context)->Tree;
     loopCounter->i = 0;
     taskManager->taskManager = (union Data*)&createTaskManager(context, cpu_num, 0, 0)->TaskManager;
@@ -40,7 +35,7 @@
     goto initDataGears(context, Gearef(context, LoopCounter), Gearef(context, TaskManager));
 }
 
-__code code1(struct Context* context, struct Time* time) {
+__code code1(struct Time* time) {
     printf("cpus:\t\t%d\n", cpu_num);
     printf("length:\t\t%d\n", length);
     printf("length/task:\t%d\n", length/split);
@@ -59,7 +54,7 @@
     goto code1(context, Gearef(context, Time));
 }
 
-__code code2(struct Context* context, struct Array* array, struct LoopCounter* loopCounter) {
+__code code2(struct Array* array, struct LoopCounter* loopCounter) {
     int i = loopCounter->i;
 
     if (i < length) {
@@ -79,7 +74,7 @@
     goto code2(context, &context->data[D_Node]->Node.value->Array, &context->data[D_LoopCounter]->LoopCounter);
 }
 
-__code createData1(struct Context* context, struct Allocate* allocate, struct LoopCounter* loopCounter) {
+__code createData1(struct Allocate* allocate, struct LoopCounter* loopCounter) {
     int i = loopCounter->i;
 
     if ((length/split*i) < length) {
@@ -94,7 +89,7 @@
     goto createData1(context, Gearef(context, Allocate), Gearef(context, LoopCounter));
 }
 
-__code createData2(struct Context* context, struct LoopCounter* loopCounter, struct Array* array, struct Node* node, Tree* tree) {
+__code createData2(struct LoopCounter* loopCounter, struct Array* array, struct Node* node, Tree* tree) {
     int i = loopCounter->i;
 
     array->index = i;
@@ -121,7 +116,7 @@
             Gearef(context, Tree));
 }
 
-__code createTask1(struct Context* context, struct LoopCounter* loopCounter, struct TaskManager* taskManager) {
+__code createTask1(struct LoopCounter* loopCounter, struct TaskManager* taskManager) {
     int i = loopCounter->i;
 
     if ((length/split*i) < length) {
@@ -139,7 +134,7 @@
             Gearef(context, TaskManager));
 }
 
-__code createTask2(struct Context* context, LoopCounter* loopCounter, TaskManager* taskManager,struct Context* task, Array* array) {
+__code createTask2(LoopCounter* loopCounter, TaskManager* taskManager,struct Context* task, Array* array) {
     int i = loopCounter->i;
 
     if ((length/split*i) < length) {