# HG changeset patch # User Shohei KOKUBO # Date 1373953610 -32400 # Node ID 19ab54c76d6f99e405adb4e2398c8d29cb23a102 # Parent 8b50b1ee068e991fd351789de7ff761682171434 success run to fft diff -r 8b50b1ee068e -r 19ab54c76d6f example/fft/main.cc --- 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); diff -r 8b50b1ee068e -r 19ab54c76d6f example/fft/output.pgm Binary file example/fft/output.pgm has changed diff -r 8b50b1ee068e -r 19ab54c76d6f example/fft/ppe/butterfly.cc --- 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;