Mercurial > hg > Game > Cerium
view example/Bulk/ppe/Twice.cc @ 1582:046695c73cb0 draft
add min_cpu(), max_cpu() (Who implements these?)
author | Shinji KONO <kono@ie.u-ryukyu.ac.jp> |
---|---|
date | Sat, 30 Mar 2013 23:34:59 +0900 |
parents | 8ecdbe8fde1f |
children |
line wrap: on
line source
#include <stdio.h> #include "Twice.h" #include "Func.h" /* これは必須 */ SchedDefineTask1(Twice,twice_run); static int twice_run(SchedTask *s,void *rbuf, void *wbuf) { // SchedTaskArray *a = (SchedTaskArray *)s; int *i_data; int *o_data; long length; long count = (long)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; }