Mercurial > hg > Game > Cerium
changeset 1661:19ab54c76d6f draft
success run to fft
author | Shohei KOKUBO <e105744@ie.u-ryukyu.ac.jp> |
---|---|
date | Tue, 16 Jul 2013 14:46:50 +0900 |
parents | 8b50b1ee068e |
children | d865530672fa |
files | example/fft/main.cc example/fft/output.pgm example/fft/ppe/butterfly.cc |
diffstat | 3 files changed, 13 insertions(+), 9 deletions(-) [+] |
line wrap: on
line diff
--- a/example/fft/main.cc Tue Jul 16 13:06:31 2013 +0900 +++ b/example/fft/main.cc Tue Jul 16 14:46:50 2013 +0900 @@ -225,7 +225,7 @@ // Butterfly Operation waitTask = fftCore(manager, rm, xm, wm, m, forward,sfac); - + // Transpose matrix int length_r =n*n; setWorkSize(gws,lws,n,n); @@ -238,7 +238,7 @@ first_trns->iterate(gws[0],gws[1]); // Butterfly Operation - waitTask = fftCore(manager, xm, rm, wm, m, forward,first_trns); + waitTask = fftCore(manager, rm, xm, wm, m, forward,first_trns); // Apply high-pass filter HTask *hpfl = manager->create_task(HIGH_PASS_FILTER);
--- a/example/fft/ppe/butterfly.cc Tue Jul 16 13:06:31 2013 +0900 +++ b/example/fft/ppe/butterfly.cc Tue Jul 16 14:46:50 2013 +0900 @@ -19,7 +19,7 @@ unsigned long nid = (unsigned long)s->get_param(1); long n = (long)s->get_param(3); - long direction_flag = (long)s->get_param(4); + unsigned long direction_flag = (unsigned long)s->get_param(4); long iter = (long)s->get_param(5); int butterflySize = 1 << (iter-1); @@ -40,14 +40,18 @@ xbxx.x = xbxx.y = xb.x; xbyy.x = xbyy.y = xb.y; - wab.x = (cl_float)((cl_uint)w[l].x ^ 0x0); - wab.y = (cl_float)((cl_uint)w[l].y ^ direction_flag); + wab.x = w[l].x; + if(direction_flag == 0x80000000) { + wab.y = -w[l].y; + } else { + wab.y = w[l].y; + } - wayx.x = (cl_float)((cl_uint)wab.y ^ 0x80000000); - wayx.y = (cl_float)((cl_uint)wab.x ^ 0x0); + wayx.x = -wab.y; + wayx.y = wab.x; - wbyx.x = (cl_float)((cl_uint)wab.y ^ 0x0); - wbyx.y = (cl_float)((cl_uint)wab.x ^ 0x80000000); + wbyx.x = wab.y; + wbyx.y = -wab.x; resa.x = xa.x + xbxx.x*wab.x + xbyy.x*wayx.x; resa.y = xa.y + xbxx.y*wab.y + xbyy.y*wayx.y;