Mercurial > hg > Game > Cerium
annotate example/Simple/ppe/Twice.cc @ 2048:6796d85f3d6b draft
remove error
author | Masataka Kohagura <kohagura@cr.ie.u-ryukyu.ac.jp> |
---|---|
date | Thu, 28 Jan 2016 00:05:49 +0900 |
parents | b158873485f6 |
children |
rev | line source |
---|---|
634 | 1 #include <stdio.h> |
2 #include "SchedTask.h" | |
3 #include "Twice.h" | |
4 #include "Func.h" | |
5 | |
6 /* これは必須 */ | |
1474 | 7 SchedDefineTask1(Twice, twice_run); |
634 | 8 |
9 static int | |
1474 | 10 twice_run(SchedTask *s,void *rbuf, void *wbuf) |
634 | 11 { |
12 int *i_data; | |
13 int *o_data; | |
14 long length; | |
15 | |
16 i_data = (int*)rbuf; | |
17 o_data = (int*)wbuf; | |
635
c56f6847fb87
SimpleTask worked on Mac OS X
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
634
diff
changeset
|
18 length = s->read_size()/sizeof(int); |
634 | 19 |
20 for (int i = 0; i < length; i++) { | |
21 o_data[i] = i_data[i] * 2; | |
22 } | |
640
ecf056ddd21a
SimpeTask on Cell worked.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
635
diff
changeset
|
23 s->printf("PPE %d end\n",s->get_cpuid()); |
634 | 24 |
25 return 0; | |
26 } |