#define T float
#define T2 float2

#define exp_1_8   (T2)(  1, -1 )//requires post-multiply by 1/sqrt(2)
#define exp_1_4   (T2)(  0, -1 )
#define exp_3_8   (T2)( -1, -1 )//requires post-multiply by 1/sqrt(2)

#define iexp_1_8   (T2)(  1, 1 )//requires post-multiply by 1/sqrt(2)
#define iexp_1_4   (T2)(  0, 1 )
#define iexp_3_8   (T2)( -1, 1 )//requires post-multiply by 1/sqrt(2)


__kernel void
chk1D_512(__global T2* work, int half_n_cmplx, __global int* fail)
{
    int i, tid = get_local_id(0);
    int blockIdx = get_group_id(0) * 512 + tid;
    T2 a[8], b[8];

    work = work + blockIdx;

    for (i = 0; i < 8; i++) {
        a[i] = work[i*64];
    }

    for (i = 0; i < 8; i++) {
        b[i] = work[half_n_cmplx+i*64];
    }

    for (i = 0; i < 8; i++) {
        if (a[i].x != b[i].x || a[i].y != b[i].y) {
            *fail = 1;
        }
    }
}

