view example/fft/gpu/spinFact.cl @ 1753:c1711deae8c5 draft

remove fft/output.pgm
author kkb
date Fri, 22 Nov 2013 11:10:29 +0900
parents e0560291611b
children 144e573b030b
line wrap: on
line source

#define PI 3.14159265358979323846f
#define PI_2 1.57079632679489661923f

__kernel
void spinFact(__constant long *param, __global float2 *w)
{
    unsigned long i = (unsigned long)get_global_id(0);
    long n =param[3];

    float2 angle;
    angle.x = (float)(2*i*PI/(float)n);
    angle.y = (float)((2*i*PI/(float)n) + PI_2);
    
    w[i].x = cos((float)angle.x);
    w[i].y = cos((float)angle.y);
}