view example/fft/cuda/spinFact.cu @ 2048:6796d85f3d6b draft

remove error
author Masataka Kohagura <kohagura@cr.ie.u-ryukyu.ac.jp>
date Thu, 28 Jan 2016 00:05:49 +0900
parents 4cf85b48ab9e
children
line wrap: on
line source

extern "C" {
#include <math.h>
    
#define PI 3.14159265358979323846
#define PI_2 1.57079632679489661923
    
    __global__ void
    spinFact(long* param, float* w)
    {
        unsigned long i = blockIdx.x*blockDim.x+threadIdx.x; // (unsigned long)s->get_param(0);
    
        long n = param[0];

        float angle[2];
        angle[0] = (float)(2*i*PI/(float)n);
        angle[1] = (float)((2*i*PI/(float)n) + PI_2);

        w[2*i] = cos(angle[0]);
        w[2*i+1] = cos(angle[1]);
    }
}