Mercurial > hg > Game > Cerium
changeset 2002:bbc8802bb0fd draft
return correct TaskList address in iterate
author | kkb |
---|---|
date | Fri, 02 May 2014 20:44:05 +0900 |
parents | 3e3cc12096f7 |
children | 7dc90c83a787 |
files | TaskManager/Cell/CellTaskManagerImpl.cc TaskManager/kernel/ppe/HTask.cc TaskManager/test/IterateTest/main.cc example/Bulk/Makefile |
diffstat | 4 files changed, 20 insertions(+), 17 deletions(-) [+] |
line wrap: on
line diff
--- a/TaskManager/Cell/CellTaskManagerImpl.cc Fri May 02 19:56:25 2014 +0900 +++ b/TaskManager/Cell/CellTaskManagerImpl.cc Fri May 02 20:44:05 2014 +0900 @@ -135,6 +135,8 @@ while(tl) { TaskListPtr dm = createTaskList(); memcpy(dm,tl, ((memaddr)tl->last()) - (memaddr(tl))); + // tl->waiter points tl's address so fix it + dm->waiter = dm; taskListInfo[i+id_offset]->addLast(dm); tl = tl->next; }
--- a/TaskManager/kernel/ppe/HTask.cc Fri May 02 19:56:25 2014 +0900 +++ b/TaskManager/kernel/ppe/HTask.cc Fri May 02 20:44:05 2014 +0900 @@ -43,13 +43,13 @@ HTask::iterate(long x, long y) { this->flag.dim_count = 1; TaskList *tl = (TaskList*)rbuf; - tl->self = this; - tl->set_last(last); - - tl->dim=2; - tl->x=x; - tl->y=y; - tl->z=1; + for (;tl;tl=tl->next) { + tl->set_last(last); + tl->dim=1; + tl->x=x; + tl->y=y; + tl->z=1; + } mimpl->spawn_task(this); } @@ -57,13 +57,13 @@ HTask::iterate(long x, long y, long z) { this->flag.dim_count = 1; TaskList *tl = (TaskList*)rbuf; - tl->self = this; - tl->set_last(last); - - tl->dim=3; - tl->x=x; - tl->y=y; - tl->z=z; + for (;tl;tl=tl->next) { + tl->set_last(last); + tl->dim=1; + tl->x=x; + tl->y=y; + tl->z=z; + } mimpl->spawn_task(this); }
--- a/TaskManager/test/IterateTest/main.cc Fri May 02 19:56:25 2014 +0900 +++ b/TaskManager/test/IterateTest/main.cc Fri May 02 20:44:05 2014 +0900 @@ -94,7 +94,7 @@ second->set_inData(0,(memaddr)A,sizeof(float)*length); second->set_inData(1,(memaddr)B,sizeof(float)*length); second->set_outData(0,(memaddr)C,sizeof(float)*length); - // second->wait_for(first); + second->wait_for(first); second->iterate(length); third = manager->create_task(MULTIPLY_TASK); @@ -102,7 +102,7 @@ third->set_inData(0,(memaddr)A,sizeof(float)*length); third->set_inData(1,(memaddr)B,sizeof(float)*length); third->set_outData(0,(memaddr)C,sizeof(float)*length); - // third->wait_for(second); + third->wait_for(second); third->iterate(length); }