Mercurial > hg > Members > kono > Cerium
annotate example/basic/spe/Twice.cc @ 799:bf4ee251767e
add forgotten virutal
author | Shinji KONO <kono@ie.u-ryukyu.ac.jp> |
---|---|
date | Wed, 19 May 2010 19:49:49 +0900 |
parents | ab866bc8a624 |
children |
rev | line source |
---|---|
109 | 1 #include <stdio.h> |
2 #include "SchedTask.h" | |
3 #include "Twice.h" | |
4 #include "Func.h" | |
5 | |
298 | 6 /* これは必須 */ |
109 | 7 SchedDefineTask(Twice); |
8 | |
467
44c0bce54dcf
fix all examples. test_render is not working now.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
298
diff
changeset
|
9 static int |
44c0bce54dcf
fix all examples. test_render is not working now.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
298
diff
changeset
|
10 run(SchedTask *s, void *rbuf, void *wbuf) |
109 | 11 { |
12 int *i_data; | |
13 int *o_data; | |
14 int length; | |
15 | |
467
44c0bce54dcf
fix all examples. test_render is not working now.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
298
diff
changeset
|
16 i_data = (int*)s->get_input(rbuf, 0); |
44c0bce54dcf
fix all examples. test_render is not working now.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
298
diff
changeset
|
17 o_data = (int*)s->get_output(wbuf, 0); |
626
ab866bc8a624
64bit mode compatibility on Cell
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
467
diff
changeset
|
18 length = (long)s->get_param(0); |
109 | 19 |
20 for (int i = 0; i < length; i++) { | |
21 o_data[i] = i_data[i] * 2; | |
22 } | |
23 | |
24 return 0; | |
25 } |