Mercurial > hg > Members > kono > Cerium
view example/share_task/spe/Load.cc @ 848:df80613f1e1a
addChild fix
author | tkaito |
---|---|
date | Sun, 06 Jun 2010 03:31:52 +0900 |
parents | ab866bc8a624 |
children |
line wrap: on
line source
#include <stdio.h> #include <string.h> #include "Load.h" #include "Func.h" /* これは必須 */ SchedDefineTask(Load); static int run(SchedTask *s, void *rbuf, void *wbuf) { int *idata = (int*)s->get_input(rbuf, 0); int *odata; int length = (long)s->get_param(0); // SPU LS 内に領域確保し、データをコピー odata = (int*)s->global_alloc(DATA_ID, sizeof(int)*length); memcpy(odata, idata, sizeof(int)*length); s->printf("[TASK_LOAD] "); for (int i = 0; i < length; i++) { s->printf("%03d ", odata[i]); } s->printf("\n"); return 0; }