Mercurial > hg > Game > Cerium
diff TaskManager/Cell/spe/SpeTaskManagerImpl.cc @ 636:aba1600e8f83 draft
Cell Simple Task compiled. but not worked.
author | Shinji KONO <kono@ie.u-ryukyu.ac.jp> |
---|---|
date | Wed, 18 Nov 2009 19:09:40 +0900 |
parents | 64e05530e333 |
children | 20665e4060ea |
line wrap: on
line diff
--- a/TaskManager/Cell/spe/SpeTaskManagerImpl.cc Wed Nov 18 18:36:25 2009 +0900 +++ b/TaskManager/Cell/spe/SpeTaskManagerImpl.cc Wed Nov 18 19:09:40 2009 +0900 @@ -1,13 +1,39 @@ #include "SpeTaskManagerImpl.h" #include "Scheduler.h" +#include <stdlib.h> HTaskPtr TaskManagerImpl::create_task(int cmd) {return 0;} +HTaskPtr TaskManagerImpl::create_task(int cmd, memaddr rbuf, long rs, memaddr wbuf, long ws) { return 0; } void TaskManagerImpl::set_task_depend(HTaskPtr master, HTaskPtr slave) {} void TaskManagerImpl::spawn_task(HTaskPtr) {} void TaskManagerImpl::set_task_cpu(HTaskPtr, CPU_TYPE) {} -void* TaskManagerImpl::allocate(int size) { return scheduler->allocate(size); } -void* TaskManagerImpl::allocate(int size,int align) { return scheduler->allocate(size,align); } +void* +TaskManagerImpl::allocate(int size, int alignment) +{ + if (size==0) return 0; +#if defined(__SPU__) + return malloc(size); +#else + void *buff; + posix_memalign(&buff, alignment, size); + return buff; +#endif +} +void* +TaskManagerImpl::allocate(int size) +{ + if (size==0) return 0; +#if defined(__SPU__) + return malloc(size); +#else + void *buff; + posix_memalign(&buff, DEFAULT_ALIGNMENT, size); + return buff; +#endif +} + +