#include "lu.h"

void exact(int i, int j, int k, double u000ijk[], __global double *g_ce);

__kernel void setbv1(__global double *g_u,
                     __global double *g_ce,
                     int nx,
                     int ny,
                     int nz)
{
  int i, j, m;
  double temp1[5], temp2[5];

  j = get_global_id(1);
  i = get_global_id(0);
  if (j >= ny || i >= nx) return;

  __global double (*u)[ISIZ2/2*2+1][ISIZ1/2*2+1][5] = 
    (__global double (*)[ISIZ2/2*2+1][ISIZ1/2*2+1][5])g_u;

  exact( i, j, 0, temp1, g_ce );
  exact( i, j, nz-1, temp2, g_ce );
  for (m = 0; m < 5; m++) {
    u[0][j][i][m] = temp1[m];
    u[nz-1][j][i][m] = temp2[m];
  }
}

