Mercurial > hg > Members > e085722 > Cerium
annotate example/Simple/spe/Twice.cc @ 5:8f445f1bfe66 default tip
3d camera
author | Daiki KINJYO <e085722@ie.u-ryukyu.ac.jp> |
---|---|
date | Mon, 06 Dec 2010 17:20:56 +0900 |
parents | 04e28d8d3c6f |
children |
rev | line source |
---|---|
0 | 1 #include <stdio.h> |
2 #include "SchedTask.h" | |
3 #include "Twice.h" | |
4 #include "Func.h" | |
5 | |
6 /* これは必須 */ | |
7 SchedDefineTask(Twice); | |
8 | |
9 static int | |
10 run(SchedTask *s,void *rbuf, void *wbuf) | |
11 { | |
12 int *i_data; | |
13 int *o_data; | |
14 long length; | |
15 | |
16 i_data = (int*)rbuf; | |
17 o_data = (int*)wbuf; | |
18 length = s->read_size()/sizeof(int); | |
19 | |
20 for (int i = 0; i < length; i++) { | |
21 o_data[i] = i_data[i] * 2; | |
22 } | |
23 s->printf("SPE %d end\n",s->get_cpuid()); | |
24 | |
25 return 0; | |
26 } |