Mercurial > hg > Game > Cerium
view example/multiply/ppe/Multi.cc @ 1672:32bc4ea3557f draft
set_param in multi-dimension destroy shared TaskList. make dimension parammeter x,y,z in SchedTask.
author | Shinji KONO <kono@ie.u-ryukyu.ac.jp> |
---|---|
date | Thu, 18 Jul 2013 11:20:51 +0900 |
parents | 0e1d40a3474b |
children | 1755ae347fce |
line wrap: on
line source
#include <stdio.h> #include "SchedTask.h" #include "Multi.h" #include "Func.h" #include "GpuScheduler.h" /* これは必須 */ SchedDefineTask(Multiply); static int run(SchedTask *s,void *rbuf, void *wbuf) { float *A,*B,*C; A = (float*)s->get_input(rbuf, 0); B = (float*)s->get_input(rbuf, 1); C = (float*)s->get_output(wbuf, 0); long i = s->x; long a = (long)s->get_param(3); long b = (long)s->get_param(4); if (a==256 && b==512) { C[i]=A[i]*B[i]; } return 0; }