Mercurial > hg > Game > Cerium
annotate example/fft/ppe/transpose.cc @ 1566:7d307bac94a6 draft
fft
author | Shohei KOKUBO <e105744@ie.u-ryukyu.ac.jp> |
---|---|
date | Sat, 16 Mar 2013 18:36:50 +0900 |
parents | 3df1868130cb |
children | 9832a5eb2027 |
rev | line source |
---|---|
1557 | 1 #include "transpose.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 |
9 SchedDefineTask1(transpose,transpose); | |
10 | |
11 static int | |
12 transpose(SchedTask* s,void* rbuf,void* wbuf) | |
13 { | |
1566 | 14 cl_float2* src = (cl_float2*)s->get_inputAddr(0); |
15 int* n = (int*)s->get_inputAddr(1); | |
16 cl_float2* dst = (cl_float2*)s->get_outputAddr(0); | |
17 unsigned int* xgid = (unsigned int*)s->global_get(FIRSTID); | |
18 unsigned int* ygid = (unsigned int*)s->global_get(SECONDID); | |
1557 | 19 |
1560
3df1868130cb
fix fft ppe example
Shohei KOKUBO <e105744@ie.u-ryukyu.ac.jp>
parents:
1557
diff
changeset
|
20 unsigned int iid = ygid[0] * n[0] + xgid[0]; |
3df1868130cb
fix fft ppe example
Shohei KOKUBO <e105744@ie.u-ryukyu.ac.jp>
parents:
1557
diff
changeset
|
21 unsigned int oid = xgid[0] * n[0] + ygid[0]; |
1557 | 22 |
23 dst[oid] = src[iid]; | |
24 | |
25 return 0; | |
26 } |