# HG changeset patch # User Shinji KONO # Date 1260113554 -32400 # Node ID b386522827ae7bb2b994e1aebf8a4d39f3d47573 # Parent 458a1ad91427d6ba9828c08dcc7825d525352bc8 Bulk task on going. diff -r 458a1ad91427 -r b386522827ae TaskManager/Cell/spe/main.cc --- a/TaskManager/Cell/spe/main.cc Sun Dec 06 23:03:28 2009 +0900 +++ b/TaskManager/Cell/spe/main.cc Mon Dec 07 00:32:34 2009 +0900 @@ -4,6 +4,8 @@ #include "spu_mfcio.h" #include "error.h" #include "SysFunc.h" +#include "SchedNop.h" + extern unsigned char _end[]; @@ -36,7 +38,7 @@ tm->set_scheduler(manager); - manager->run(); + manager->run(new ScedNop()); manager->finish(); diff -r 458a1ad91427 -r b386522827ae TaskManager/ChangeLog --- a/TaskManager/ChangeLog Sun Dec 06 23:03:28 2009 +0900 +++ b/TaskManager/ChangeLog Mon Dec 07 00:32:34 2009 +0900 @@ -1,3 +1,14 @@ + +2009-12-7 Shinji KONO + + pipeline stageは、loop local だから、instance 変数である必 + 要はない。途中で中断することはない。これを一時変数にして、 + 再帰的にpipeline stage を呼び出せば良いらしい。 + + pipeline stage のtask1に引数で new SchedTaskList を渡すと、 + run()でtask1 = new SchedNop() するよりループ二回ぐらい高速 + になるらしい。が、おそらく、ほとんど影響はない。 + 2009-12-6 Shinji KONO やっぱり、Graphical なprofileが欲しいかな。どのDMA/Taskに時間がかかっている diff -r 458a1ad91427 -r b386522827ae TaskManager/Fifo/FifoTaskManagerImpl.cc --- a/TaskManager/Fifo/FifoTaskManagerImpl.cc Sun Dec 06 23:03:28 2009 +0900 +++ b/TaskManager/Fifo/FifoTaskManagerImpl.cc Mon Dec 07 00:32:34 2009 +0900 @@ -6,6 +6,7 @@ #include "SchedTask.h" #include "types.h" #include "error.h" +#include "SchedNop.h" FifoTaskManagerImpl::~FifoTaskManagerImpl() { @@ -162,7 +163,8 @@ mainScheduler->mail_write_from_host((memaddr)MY_SPE_COMMAND_EXIT); // scheduler は受け取ったメールを元に実行する - mainScheduler->run(); + // new SchedTaskList(list, mainScheduler) の方が良さそうだけど... + mainScheduler->run(new SchedNop()); } } diff -r 458a1ad91427 -r b386522827ae TaskManager/kernel/ppe/Task.h --- a/TaskManager/kernel/ppe/Task.h Sun Dec 06 23:03:28 2009 +0900 +++ b/TaskManager/kernel/ppe/Task.h Mon Dec 07 00:32:34 2009 +0900 @@ -111,6 +111,14 @@ return size; } + Task * next() + { + char *p = (char*)t; + p += t->size(); + return (Task*)p; + } + + // #define add_param(param) add_param_t((memaddr)(param)) #define set_param(index,param) set_param_t(index, (memaddr) (param)) diff -r 458a1ad91427 -r b386522827ae TaskManager/kernel/schedule/Scheduler.cc --- a/TaskManager/kernel/schedule/Scheduler.cc Sun Dec 06 23:03:28 2009 +0900 +++ b/TaskManager/kernel/schedule/Scheduler.cc Mon Dec 07 00:32:34 2009 +0900 @@ -63,11 +63,12 @@ } void -Scheduler::run() +Scheduler::run(SchedTaskBase* task1) { - task1 = new SchedNop(); - task2 = new SchedNop(); - task3 = new SchedNop(); + + // Pipeline Stage + SchedTaskBase* task2 = new SchedNop(); + SchedTaskBase* task3 = new SchedNop(); // main loop do { diff -r 458a1ad91427 -r b386522827ae TaskManager/kernel/schedule/Scheduler.h --- a/TaskManager/kernel/schedule/Scheduler.h Sun Dec 06 23:03:28 2009 +0900 +++ b/TaskManager/kernel/schedule/Scheduler.h Mon Dec 07 00:32:34 2009 +0900 @@ -72,10 +72,6 @@ DmaManager* connector; TaskManagerImpl* manager; - // Pipeline Stage - SchedTaskBase* task1; - SchedTaskBase* task2; - SchedTaskBase* task3; /* functions */ void init(TaskManagerImpl *m); diff -r 458a1ad91427 -r b386522827ae TaskManager/kernel/sys_task/TaskArray.cc --- a/TaskManager/kernel/sys_task/TaskArray.cc Sun Dec 06 23:03:28 2009 +0900 +++ b/TaskManager/kernel/sys_task/TaskArray.cc Mon Dec 07 00:32:34 2009 +0900 @@ -6,20 +6,13 @@ SchedDefineTask(TaskArray); -#ifdef SIMPLE_TASK -static Task * -next(Task *t) -{ - char *p = (char*)t; - p += t->size(); - return (Task*)p; -} -#endif static int run(SchedTask *s,void *rbuf, void *wbuf) { #ifdef SIMPLE_TASK + +#ifdef TEST_TASK_ARRAY Task *task = (Task *)rbuf; Task *last = (Task*)(((char*)rbuf)+ s->read_size()); @@ -27,9 +20,15 @@ while( task < last) { s->printf(" task = %lx\n" ,(long) task); task->print(); - task = next(task); + task = task->next(); } +#else + + Task *task = (Task *)rbuf; + SchedTaskArray *nextSched = createSchedTaskArray(s->get_scheduler(), task); + s->get_scheduler()->run(nextSched); + #endif - +#endif return 0; } diff -r 458a1ad91427 -r b386522827ae example/Bulk/ppe/Twice.cc --- a/example/Bulk/ppe/Twice.cc Sun Dec 06 23:03:28 2009 +0900 +++ b/example/Bulk/ppe/Twice.cc Mon Dec 07 00:32:34 2009 +0900 @@ -1,5 +1,5 @@ #include -#include "SchedTask.h" +#include "SchedTaskArray.h" #include "Twice.h" #include "Func.h" @@ -9,7 +9,8 @@ static int run(SchedTask *s,void *rbuf, void *wbuf) { -#if 0 + SchedTaskArray *a = (SchedTaskArray *)s; + int *i_data; int *o_data; long length; @@ -21,7 +22,6 @@ for (int i = 0; i < length; i++) { o_data[i] = i_data[i] * 2; } -#endif return 0; }