Mercurial > hg > Game > Cerium
changeset 706:b2b4a1243961 draft simple-task-regression
no compile error on Cell. Regression Test.
Cell failed some how.
author | Shinji KONO <kono@ie.u-ryukyu.ac.jp> |
---|---|
date | Mon, 14 Dec 2009 20:21:59 +0900 |
parents | a6aa3fb8b9fb |
children | 9dc7969daf79 |
files | Renderer/Engine/Makefile.def Renderer/Test/Makefile.cell Renderer/Test/Makefile.def TaskManager/Cell/spe/main.cc TaskManager/Makefile.cell TaskManager/Makefile.def TaskManager/kernel/ppe/HTaskInfo.cc TaskManager/kernel/ppe/Task.cc TaskManager/kernel/schedule/SchedTask.cc TaskManager/kernel/schedule/SchedTaskArray.cc TaskManager/kernel/schedule/SchedTaskArray.h TaskManager/kernel/schedule/SchedTaskArrayLoad.cc example/Bulk/spe/Twice.cc example/Bulk/spe/spe-main.cc example/Simple/spe/Twice.cc example/basic/Makefile.def |
diffstat | 16 files changed, 37 insertions(+), 25 deletions(-) [+] |
line wrap: on
line diff
--- a/Renderer/Engine/Makefile.def Mon Dec 14 20:00:42 2009 +0900 +++ b/Renderer/Engine/Makefile.def Mon Dec 14 20:21:59 2009 +0900 @@ -6,7 +6,7 @@ ABI = -m$(ABIBIT) CC = g++ OPT = -g -CFLAGS = -g -Wall $(ABI) $(OPT) -DSIMPLE_TASK # -DDEBUG +CFLAGS = -g -Wall $(ABI) $(OPT) # -DSIMPLE_TASK # -DDEBUG INCLUDE = -I$(CERIUM)/include/TaskManager -I. # LIBS = -L$(CERIUM)/TaskManager -m$(ABIBIT)
--- a/Renderer/Test/Makefile.cell Mon Dec 14 20:00:42 2009 +0900 +++ b/Renderer/Test/Makefile.cell Mon Dec 14 20:21:59 2009 +0900 @@ -11,7 +11,7 @@ .cc.o: $(CC) $(CFLAGS) $(INCLUDE) -c $< -o $@ -ALL = ball_bound boss1_action direction gaplant ieshoot node panel universe untitled vacuum dynamic viewer SgRootChange +ALL = spe-main ball_bound boss1_action direction gaplant ieshoot node panel universe untitled vacuum dynamic viewer SgRootChange all: $(ALL) speobject:
--- a/Renderer/Test/Makefile.def Mon Dec 14 20:00:42 2009 +0900 +++ b/Renderer/Test/Makefile.def Mon Dec 14 20:21:59 2009 +0900 @@ -4,7 +4,7 @@ ABIBIT = 32 ABI = -m$(ABIBIT) CC = g++ -CFLAGS = -g -Wall $(ABI) -DSIPMLE_TASK # -O -DDEBUG +CFLAGS = -g -Wall $(ABI) # -DSIPMLE_TASK # -O -DDEBUG INCLUDE = -I$(CERIUM)/include/TaskManager -I$(CERIUM)/Renderer/Engine -I. -I$(CERIUM)/include/Cerium LIBS = -L$(CERIUM)/TaskManager -L$(CERIUM)/Renderer/Engine $(ABI)
--- a/TaskManager/Cell/spe/main.cc Mon Dec 14 20:00:42 2009 +0900 +++ b/TaskManager/Cell/spe/main.cc Mon Dec 14 20:21:59 2009 +0900 @@ -38,7 +38,7 @@ tm->set_scheduler(manager); - manager->run(new ScedNop()); + manager->run(new SchedNop()); manager->finish();
--- a/TaskManager/Makefile.cell Mon Dec 14 20:00:42 2009 +0900 +++ b/TaskManager/Makefile.cell Mon Dec 14 20:21:59 2009 +0900 @@ -11,6 +11,8 @@ $(CELL_SPE_DIR)/SchedTaskList.cc \ $(CELL_SPE_DIR)/SchedMail.cc \ $(CELL_SPE_DIR)/SchedTask.cc \ + $(CELL_SPE_DIR)/SchedTaskArray.cc \ + $(CELL_SPE_DIR)/SchedTaskArrayLoad.cc \ $(CELL_SPE_DIR)/Scheduler.cc\ $(CELL_SPE_DIR)/SchedNop.cc \ $(CELL_SPE_DIR)/MemList.cc \
--- a/TaskManager/Makefile.def Mon Dec 14 20:00:42 2009 +0900 +++ b/TaskManager/Makefile.def Mon Dec 14 20:21:59 2009 +0900 @@ -29,8 +29,8 @@ ABIBIT = 32 -SIMPLE_TASK=-DSIMPLE_TASK -# SIMPLE_TASK= +# SIMPLE_TASK=-DSIMPLE_TASK +SIMPLE_TASK= # OPT = -O9 OPT = -g
--- a/TaskManager/kernel/ppe/HTaskInfo.cc Mon Dec 14 20:00:42 2009 +0900 +++ b/TaskManager/kernel/ppe/HTaskInfo.cc Mon Dec 14 20:21:59 2009 +0900 @@ -67,7 +67,7 @@ #ifndef SIMPLE_TASK q->inData.clear(); q->outData.clear(); - q->param_size = 0; + q->param_count = 0; #else q->param_index = 0; q->in_index = 0;
--- a/TaskManager/kernel/ppe/Task.cc Mon Dec 14 20:00:42 2009 +0900 +++ b/TaskManager/kernel/ppe/Task.cc Mon Dec 14 20:21:59 2009 +0900 @@ -44,9 +44,9 @@ int Task::add_param_t(memaddr _param) { - if (param_size >= MAX_PARAMS) return -1; + if (param_count >= MAX_PARAMS) return -1; - this->param[param_size++] = _param; + this->param[param_count++] = _param; return 0; }
--- a/TaskManager/kernel/schedule/SchedTask.cc Mon Dec 14 20:00:42 2009 +0900 +++ b/TaskManager/kernel/schedule/SchedTask.cc Mon Dec 14 20:21:59 2009 +0900 @@ -284,10 +284,10 @@ void* SchedTask::get_input(void *buff, int index) { printf("Cannot use inData in SimpleTask use TaskArray\n"); return NULL; } -memaddr SchedTask::get_inputAddr(int index) { return NULL; } +memaddr SchedTask::get_inputAddr(int index) { return 0; } int SchedTask::get_inputSize(int index) {return 0; } void* SchedTask::get_output(void *buff, int index) {return 0; } -memaddr SchedTask::get_outputAddr(int index) { return NULL; } +memaddr SchedTask::get_outputAddr(int index) { return 0; } int SchedTask::get_outputSize(int index) { return 0; } memaddr SchedTask::get_param(int index) { return 0; }
--- a/TaskManager/kernel/schedule/SchedTaskArray.cc Mon Dec 14 20:00:42 2009 +0900 +++ b/TaskManager/kernel/schedule/SchedTaskArray.cc Mon Dec 14 20:21:59 2009 +0900 @@ -1,6 +1,7 @@ #include "SchedTaskArray.h" #include "Scheduler.h" +#ifdef SIMPLE_TASK SchedTaskArray::SchedTaskArray(Scheduler *s, SchedTaskBase *savedTask_, Task *curTask_, Task *_array) { @@ -231,5 +232,6 @@ return *task->param(index); } +#endif /* end */
--- a/TaskManager/kernel/schedule/SchedTaskArray.h Mon Dec 14 20:00:42 2009 +0900 +++ b/TaskManager/kernel/schedule/SchedTaskArray.h Mon Dec 14 20:21:59 2009 +0900 @@ -41,7 +41,7 @@ memaddr get_inputAddr(int); int get_inputSize(int); void* get_output(void*, int); - char* get_outputAddr(int); + memaddr get_outputAddr(int); int get_outputSize(int); memaddr get_param(int);
--- a/TaskManager/kernel/schedule/SchedTaskArrayLoad.cc Mon Dec 14 20:00:42 2009 +0900 +++ b/TaskManager/kernel/schedule/SchedTaskArrayLoad.cc Mon Dec 14 20:21:59 2009 +0900 @@ -2,6 +2,8 @@ #include "SchedTaskArray.h" #include "Task.h" +#ifdef SIMPLE_TASK + SchedTaskArrayLoad::SchedTaskArrayLoad(Scheduler *s, SchedTaskBase *savedTask_) { SchedTask *sv = (SchedTask*)savedTask_; @@ -33,5 +35,6 @@ Task *nextTask = (Task *)readbuf; return new SchedTaskArray(scheduler, savedTask, nextTask, nextTask); } +#endif /* end */
--- a/example/Bulk/spe/Twice.cc Mon Dec 14 20:00:42 2009 +0900 +++ b/example/Bulk/spe/Twice.cc Mon Dec 14 20:21:59 2009 +0900 @@ -1,5 +1,5 @@ #include <stdio.h> -#include "SchedTask.h" +#include "SchedTaskArray.h" #include "Twice.h" #include "Func.h" @@ -7,18 +7,23 @@ SchedDefineTask(Twice); static int -run(SchedTask *s, void *rbuf, void *wbuf) +run(SchedTask *s,void *rbuf, void *wbuf) { + // SchedTaskArray *a = (SchedTaskArray *)s; + int *i_data; int *o_data; - int length; + long length; + int count = (int)s->get_param(0); - i_data = (int*)s->get_input(rbuf, 0); - o_data = (int*)s->get_output(wbuf, 0); - length = (long)s->get_param(0); - - for (int i = 0; i < length; i++) { - o_data[i] = i_data[i] * 2; + for(int j = 0; j<count; j++) { + i_data = (int*)s->get_input(rbuf, j); + o_data = (int*)s->get_output(wbuf, j); + length = (long)s->get_param(j+1); + + for (int i = 0; i < length; i++) { + o_data[i] = i_data[i] * 2; + } } return 0;
--- a/example/Bulk/spe/spe-main.cc Mon Dec 14 20:00:42 2009 +0900 +++ b/example/Bulk/spe/spe-main.cc Mon Dec 14 20:21:59 2009 +0900 @@ -10,5 +10,5 @@ void task_init(Scheduler *s) { - SchedRegisterTask(TWICE_TASK, Twice); + SchedRegister(Twice); }
--- a/example/Simple/spe/Twice.cc Mon Dec 14 20:00:42 2009 +0900 +++ b/example/Simple/spe/Twice.cc Mon Dec 14 20:21:59 2009 +0900 @@ -7,11 +7,11 @@ SchedDefineTask(Twice); static int -run(SchedTask *s, void *rbuf, void *wbuf) +run(SchedTask *s,void *rbuf, void *wbuf) { int *i_data; int *o_data; - int length; + long length; i_data = (int*)rbuf; o_data = (int*)wbuf;