Mercurial > hg > Members > kono > Cerium
view example/Bulk/ppe/Twice.cc @ 701:226d95fa2691 TaskArray
Bulk task worked on Mac OS X
author | Shinji KONO <kono@ie.u-ryukyu.ac.jp> |
---|---|
date | Mon, 14 Dec 2009 12:46:48 +0900 |
parents | 7e937a1cd121 |
children | 5df90e02e34f |
line wrap: on
line source
#include <stdio.h> #include "SchedTaskArray.h" #include "Twice.h" #include "Func.h" /* これは必須 */ SchedDefineTask(Twice); static int run(SchedTask *s,void *rbuf, void *wbuf) { // SchedTaskArray *a = (SchedTaskArray *)s; int *i_data; int *o_data; long length; int count = (int)s->get_param(0); for(int j = 0; j<count; j++) { i_data = (int*)s->get_input(rbuf, j); o_data = (int*)s->get_output(wbuf, j); length = (long)s->get_param(j+1); for (int i = 0; i < length; i++) { o_data[i] = i_data[i] * 2; } } return 0; }