#include "ft.h"

#define CFFTS_BARRIER(m)    barrier(m)

void vranlc(int n, double *x, double a, __global double y[]);

//---------------------------------------------------------------------
// Go through by z planes filling in one square at a time.
//---------------------------------------------------------------------
__kernel void compute_initial_conditions(__global dcomplex *u0,
                                         __global const double *starts,
                                         int d1,
                                         int d2,
                                         int d3)
{
  double x0;
  int j;

  int k = get_global_id(0);
  if (k >= d3) return;

  x0 = starts[k];
  int kidx = k * d2 * (d1+1);
  for (j = 0; j < d2; j++) {
    vranlc(2*NX, &x0, A, (__global double *)&u0[kidx + j*(d1+1) + 0]);
  }
}

