Mercurial > hg > Game > Cerium
changeset 1609:5d0b20373d95 draft
merge
author | Yuhi TOMARI <yuhi@cr.ie.u-ryukyu.ac.jp> |
---|---|
date | Tue, 16 Apr 2013 18:28:22 +0900 |
parents | 8841d97c37e5 (diff) 5deb318564ec (current diff) |
children | da6835e6d306 |
files | TaskManager/kernel/ppe/CpuThreads.cc |
diffstat | 5 files changed, 19 insertions(+), 11 deletions(-) [+] |
line wrap: on
line diff
--- a/TaskManager/Cell/CellTaskManagerImpl.cc Tue Apr 16 14:43:25 2013 +0900 +++ b/TaskManager/Cell/CellTaskManagerImpl.cc Tue Apr 16 18:28:22 2013 +0900 @@ -175,11 +175,6 @@ } -int -CellTaskManagerImpl::max_cpu() { - return machineNum; -} - static void loop_check(HTask *p, HTask *me, int depth) { if (p == me) printf("*%lx ", (long) p); // loop @@ -229,7 +224,7 @@ memaddr data; // SPE Scheduler からの mail check - while (speThreads->has_mail(id, 1, &data)) { + while (speThreads->has_mail(id,1,&data)) { if (data == (memaddr) MY_SPE_STATUS_READY) { // MY_SPE_STATUS_READY: SPE が持ってた Task 全て終了 // freeAll する前に循環リストに戻す @@ -339,7 +334,10 @@ tmp->getLast()->next = 0; TaskListPtr p = tmp->getFirst(); // printf("SPE %d task list sending\n",id); + + // speThreads->send_mail(id, 1, p); speThreads->spawn_task(id, p); + // printf("SPE %d task list sent\n",id); }
--- a/TaskManager/Cell/CellTaskManagerImpl.h Tue Apr 16 14:43:25 2013 +0900 +++ b/TaskManager/Cell/CellTaskManagerImpl.h Tue Apr 16 18:28:22 2013 +0900 @@ -43,7 +43,6 @@ void polling(); void debug_check_spe_idle(QueueInfo<HTask> * activeTaskQueue, int spe_running_); void print_arch(); - int max_cpu(); private: void send_taskList(int id); void show_dead_lock_info();
--- a/TaskManager/kernel/ppe/CpuThreads.cc Tue Apr 16 14:43:25 2013 +0900 +++ b/TaskManager/kernel/ppe/CpuThreads.cc Tue Apr 16 18:28:22 2013 +0900 @@ -102,16 +102,17 @@ } void -CpuThreads::spawn_task(int cpu_num, TaskListPtr p) { +CpuThreads::spawn_task(int id, TaskListPtr p) { if (p->dim>0) { int dim_count = (p->x)*(p->y)*(p->z); if (cpu_num < dim_count) - p->self->flag.dim_count = cpu_num; - for (int i = 0; i < cpu_num; i++) { + dim_count = cpu_num; + p->self->flag.dim_count = dim_count; + for (int i = 0; i < dim_count; i++) { send_mail(i+SPE_0,1,(memaddr*)&p); // i+min_cpu() } } else { - send_mail(cpu_num,1,(memaddr*)&p); + send_mail(id, 1, (memaddr*)&p); } }
--- a/TaskManager/kernel/ppe/CpuThreads.h Tue Apr 16 14:43:25 2013 +0900 +++ b/TaskManager/kernel/ppe/CpuThreads.h Tue Apr 16 18:28:22 2013 +0900 @@ -36,6 +36,7 @@ virtual int is_gpu(int cpuid); virtual void set_NDRange(void *ndr); virtual void spawn_task(int cpu_num,TaskListPtr p); + private: /* variables */ pthread_t *threads;