Mercurial > hg > Game > Cerium
annotate example/fft/ppe/norm.cc @ 1835:144e573b030b draft
fix fft
author | Shohei KOKUBO <e105744@ie.u-ryukyu.ac.jp> |
---|---|
date | Fri, 20 Dec 2013 03:00:32 +0900 |
parents | b0376e1c51e9 |
children |
rev | line source |
---|---|
1557 | 1 #include "norm.h" |
2 #ifdef __APPLE__ | |
3 #include <OpenCL/opencl.h> | |
4 #else | |
5 #include <CL/cl.h> | |
6 #endif | |
1566 | 7 #include "Func.h" |
1557 | 8 SchedDefineTask1(norm,norm); |
9 | |
10 static int | |
11 norm(SchedTask* s, void* rbuf,void* wbuf) | |
12 { | |
1817
b0376e1c51e9
use get_input & get_output
Shohei KOKUBO <e105744@ie.u-ryukyu.ac.jp>
parents:
1674
diff
changeset
|
13 cl_float2* in_x = (cl_float2*)s->get_input(rbuf,0); |
1658 | 14 |
1817
b0376e1c51e9
use get_input & get_output
Shohei KOKUBO <e105744@ie.u-ryukyu.ac.jp>
parents:
1674
diff
changeset
|
15 cl_float2* out_x = (cl_float2*)s->get_output(wbuf,0); |
1571 | 16 |
1672
32bc4ea3557f
set_param in multi-dimension destroy shared TaskList. make dimension parammeter x,y,z in SchedTask.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
1669
diff
changeset
|
17 unsigned long gid = s->x; // (unsigned long)s->get_param(0); |
32bc4ea3557f
set_param in multi-dimension destroy shared TaskList. make dimension parammeter x,y,z in SchedTask.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
1669
diff
changeset
|
18 unsigned long nid = s->y; //(unsigned long)s->get_param(1); |
1835 | 19 |
20 long n = (long)s->get_param(0); | |
1674 | 21 |
1658 | 22 out_x[nid*n+gid].x = in_x[nid*n+gid].x / (float)n; |
23 out_x[nid*n+gid].y = in_x[nid*n+gid].y / (float)n; | |
1557 | 24 |
25 return 0; | |
26 } |