Mercurial > hg > Game > Cerium
view example/Pipeline/spe/Twice.cc @ 1131:220f9032d2d2 draft
RENDERING_TASK was divided into CREATE_PP_TASK and CREATE_SP_TASK.
author | root@dolphins.cr.ie.u-ryukyu.ac.jp |
---|---|
date | Sun, 13 Feb 2011 23:29:11 +0900 |
parents | 62b72c6199f3 |
children |
line wrap: on
line source
#include <stdio.h> #include "SchedTask.h" #include "Twice.h" #include "Func.h" /* これは必須 */ SchedDefineTask(Twice); static int run(SchedTask *s,void *rbuf, void *wbuf) { int *i_data; int *o_data; long length; i_data = (int*)rbuf; o_data = (int*)wbuf; length = s->read_size()/sizeof(int); for (int i = 0; i < length; i++) { o_data[i] = i_data[i] * 2; } s->printf("SPE %d end\n",s->get_cpuid()); return 0; }