Mercurial > hg > Game > Cerium
annotate example/fft/ppe/transpose.cc @ 1817:b0376e1c51e9 draft
use get_input & get_output
author | Shohei KOKUBO <e105744@ie.u-ryukyu.ac.jp> |
---|---|
date | Fri, 13 Dec 2013 05:18:58 +0900 |
parents | 32bc4ea3557f |
children | 144e573b030b |
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 { | |
1817
b0376e1c51e9
use get_input & get_output
Shohei KOKUBO <e105744@ie.u-ryukyu.ac.jp>
parents:
1672
diff
changeset
|
14 cl_float2* src = (cl_float2*)s->get_input(rbuf,0); |
1571 | 15 |
1817
b0376e1c51e9
use get_input & get_output
Shohei KOKUBO <e105744@ie.u-ryukyu.ac.jp>
parents:
1672
diff
changeset
|
16 cl_float2* dst = (cl_float2*)s->get_output(wbuf,0); |
1571 | 17 |
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:
1643
diff
changeset
|
18 unsigned long xgid = 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:
1643
diff
changeset
|
19 unsigned long ygid = s->y; // (unsigned long)s->get_param(1); |
1557 | 20 |
1643 | 21 long n = (long)s->get_param(3); |
22 | |
23 unsigned int iid = ygid * n + xgid; | |
24 unsigned int oid = xgid * n + ygid; | |
1557 | 25 |
26 dst[oid] = src[iid]; | |
27 | |
28 return 0; | |
29 } |