Mercurial > hg > Members > kono > Cerium
diff example/basic/spe/Twice.cc @ 109:5c194c71eca8
Cerium cvs version
author | gongo@gendarme.local |
---|---|
date | Wed, 12 Nov 2008 17:39:33 +0900 |
parents | |
children | 58fd16298954 |
line wrap: on
line diff
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/example/basic/spe/Twice.cc Wed Nov 12 17:39:33 2008 +0900 @@ -0,0 +1,25 @@ +#include <stdio.h> +#include "SchedTask.h" +#include "Twice.h" +#include "Func.h" + +/* ¤³¤ì¤Ïɬ¿Ü */ +SchedDefineTask(Twice); + +int +Twice::run(void *rbuf, void *wbuf) +{ + int *i_data; + int *o_data; + int length; + + i_data = (int*)get_input(rbuf, 0); + o_data = (int*)get_output(wbuf, 0); + length = get_param(0); + + for (int i = 0; i < length; i++) { + o_data[i] = i_data[i] * 2; + } + + return 0; +}