Skip to content
Snippets Groups Projects
Select Git revision
  • 04a5e4e1095fd1ec581120fec2a0d47b753ea880
  • trunk
  • RELEASE_6_5_DRIVEDB
  • RELEASE_6_6_DRIVEDB
  • RELEASE_7_0_DRIVEDB
  • RELEASE_7_2_DRIVEDB
  • RELEASE_7_3_DRIVEDB
  • RELEASE_6_0_DRIVEDB
  • RELEASE_6_1_DRIVEDB
  • RELEASE_6_2_DRIVEDB
  • RELEASE_6_3_DRIVEDB
  • RELEASE_6_4_DRIVEDB
  • tags/RELEASE_7_4
  • tags/RELEASE_7_3
  • RELEASE_5_41_DRIVEDB
  • RELEASE_5_42_DRIVEDB
  • RELEASE_5_43_DRIVEDB
  • tags/RELEASE_7_2
  • tags/RELEASE_7_1
  • tags/RELEASE_7_0
  • RELEASE_5_40_DRIVEDB
21 results

notify

Blame
  • fft_base_kernels.h 10.01 KiB
    #ifndef __CL_FFT_BASE_KERNELS_ 
    #define __CL_FFT_BASE_KERNELS_ 
    
    #include <string.h> 
    
    using namespace std; 
    
    static string baseKernels = string 
    ( 
      "#ifndef M_PI\n" 
      "#define M_PI 0x1.921fb54442d18p+1\n" 
      "#endif\n" 
      "#define complexMul(a,b) ((float2)(mad(-(a).y, (b).y, (a).x * (b).x), mad((a).y, (b).x, (a).x * (b).y)))\n" 
      "#define conj(a) ((float2)((a).x, -(a).y))\n" 
      "#define conjTransp(a) ((float2)(-(a).y, (a).x))\n"           
      "\n" 
      "#define fftKernel2(a,dir) \\\n" 
      "{ \\\n" 
      "    float2 c = (a)[0];    \\\n" 
      "    (a)[0] = c + (a)[1];  \\\n" 
      "    (a)[1] = c - (a)[1];  \\\n" 
      "}\n" 
      "\n"                         
      "#define fftKernel2S(d1,d2,dir) \\\n" 
      "{ \\\n" 
      "    float2 c = (d1);   \\\n" 
      "    (d1) = c + (d2);   \\\n" 
      "    (d2) = c - (d2);   \\\n" 
      "}\n" 
      "\n"                         
      "#define fftKernel4(a,dir) \\\n" 
      "{ \\\n" 
      "    fftKernel2S((a)[0], (a)[2], dir); \\\n" 
      "    fftKernel2S((a)[1], (a)[3], dir); \\\n" 
      "    fftKernel2S((a)[0], (a)[1], dir); \\\n" 
      "    (a)[3] = (float2)(dir)*(conjTransp((a)[3])); \\\n" 
      "    fftKernel2S((a)[2], (a)[3], dir); \\\n" 
      "    float2 c = (a)[1]; \\\n" 
      "    (a)[1] = (a)[2]; \\\n" 
      "    (a)[2] = c; \\\n" 
      "}\n" 
      "\n"                         
      "#define fftKernel4s(a0,a1,a2,a3,dir) \\\n" 
      "{ \\\n" 
      "    fftKernel2S((a0), (a2), dir); \\\n" 
      "    fftKernel2S((a1), (a3), dir); \\\n" 
      "    fftKernel2S((a0), (a1), dir); \\\n" 
      "    (a3) = (float2)(dir)*(conjTransp((a3))); \\\n" 
      "    fftKernel2S((a2), (a3), dir); \\\n" 
      "    float2 c = (a1); \\\n" 
      "    (a1) = (a2); \\\n" 
      "    (a2) = c; \\\n"  
      "}\n" 
      "\n"                         
      "#define bitreverse8(a) \\\n" 
      "{ \\\n" 
      "    float2 c; \\\n" 
      "    c = (a)[1]; \\\n" 
      "    (a)[1] = (a)[4]; \\\n" 
      "    (a)[4] = c; \\\n" 
      "    c = (a)[3]; \\\n" 
      "    (a)[3] = (a)[6]; \\\n" 
      "    (a)[6] = c; \\\n" 
      "}\n" 
      "\n"                         
      "#define fftKernel8(a,dir) \\\n" 
      "{ \\\n" 
      " const float2 w1  = (float2)(0x1.6a09e6p-1f,  dir*0x1.6a09e6p-1f);  \\\n" 
      " const float2 w3  = (float2)(-0x1.6a09e6p-1f, dir*0x1.6a09e6p-1f);  \\\n" 
      " float2 c; \\\n"