#include "bt.h"

__kernel void y_solve2(__global double *g_lhs,
                       int gp0,
                       int gp1,
                       int gp2)
{
  int i, j, k, n, m;

  k = get_global_id(2) + 1;
  i = get_global_id(1) + 1;
  if (k > (gp2-2) || i > (gp0-2)) return;

  j = get_global_id(0);
  if (j == 1) j = gp1-1;

  int my_id = (k-1)*(gp0-2) + (i-1);
  int my_offset = my_id * (PROBLEM_SIZE+1) * 3 * 5 * 5;
  __global double (*lhs)[3][5][5] =
    (__global double (*)[3][5][5])&g_lhs[my_offset];

  for (n = 0; n < 5; n++) {
    for (m = 0; m < 5; m++) {
      lhs[j][0][n][m] = 0.0;
      lhs[j][1][n][m] = 0.0;
      lhs[j][2][n][m] = 0.0;
    }
    lhs[j][1][n][n] = 1.0;
  }
}

