Mercurial > hg > Members > kono > Cerium
view example/Bulk/ppe/Twice.cc @ 757:5238f3e854fc
Test/create_task , create SPE task from application.
author | hiroki |
---|---|
date | Fri, 29 Jan 2010 14:34:30 +0900 |
parents | dbe137505f2e |
children | 458a1ad91427 |
line wrap: on
line source
#include <stdio.h> #include "SchedTask.h" #include "Twice.h" #include "Func.h" /* これは必須 */ SchedDefineTask(Twice); static int run(SchedTask *s,void *rbuf, void *wbuf) { int *i_data; int *o_data; long length; i_data = (int*)s->get_input(rbuf, 0); o_data = (int*)s->get_output(wbuf, 0); length = (long)s->get_param(0); for (int i = 0; i < length; i++) { o_data[i] = i_data[i] * 2; } return 0; }