Mercurial > hg > Members > kono > Cerium
annotate example/Simple/spe/Twice.cc @ 638:671fca057ad3
hmmmm
author | Shinji KONO <kono@ie.u-ryukyu.ac.jp> |
---|---|
date | Thu, 19 Nov 2009 18:18:20 +0900 |
parents | 8cc609285bbe |
children | a909c50081c2 |
rev | line source |
---|---|
634 | 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 int length; | |
15 | |
16 i_data = (int*)rbuf; | |
17 o_data = (int*)wbuf; | |
635
8cc609285bbe
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 } | |
23 | |
24 return 0; | |
25 } |