Mercurial > hg > Members > kono > Cerium
annotate example/basic/spe/Twice.cc @ 281:6774e3e92539
changeset:260 repair
author | tkaito@localhost.localdomain |
---|---|
date | Fri, 05 Jun 2009 11:47:19 +0900 |
parents | 5c194c71eca8 |
children | 58fd16298954 |
rev | line source |
---|---|
109 | 1 #include <stdio.h> |
2 #include "SchedTask.h" | |
3 #include "Twice.h" | |
4 #include "Func.h" | |
5 | |
6 /* ¤³¤ì¤Ïɬ¿Ü */ | |
7 SchedDefineTask(Twice); | |
8 | |
9 int | |
10 Twice::run(void *rbuf, void *wbuf) | |
11 { | |
12 int *i_data; | |
13 int *o_data; | |
14 int length; | |
15 | |
16 i_data = (int*)get_input(rbuf, 0); | |
17 o_data = (int*)get_output(wbuf, 0); | |
18 length = get_param(0); | |
19 | |
20 for (int i = 0; i < length; i++) { | |
21 o_data[i] = i_data[i] * 2; | |
22 } | |
23 | |
24 return 0; | |
25 } |