#include "lu.h"

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

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

  k = get_global_id(1);
  i = get_global_id(0);
  if (k >= nz || 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, 0, k, temp1, g_ce );
  exact( i, ny-1, k, temp2, g_ce );
  for (m = 0; m < 5; m++) {
    u[k][0][i][m] = temp1[m];
    u[k][ny-1][i][m] = temp2[m];
  }
}

