     // Get padded grid ID
     const int pid = (j + 1)*(N + 2) + (i + 1);
 
-    float invD = 0.25;
+    datafloat invD = 0.25;
 
     newu[pid] = invD*(rhs[pid]
 		      + u[pid - (N+2)]


#define BDIM 256

/* 

   Poisson problem:  diff(u, x, 2) + diff(u, y, 2) = f

  dim3 rGrid((N*N + rBlock.x - 1)/rBlock.x);

  // Host Arrays
  datafloat *h_u   = (datafloat*) calloc((N+2)*(N+2), sizeof(datafloat));
  datafloat *h_u2  = (datafloat*) calloc((N+2)*(N+2), sizeof(datafloat));
  datafloat *h_rhs = (datafloat*) calloc((N+2)*(N+2), sizeof(datafloat));

  datafloat *h_res = (datafloat*) calloc(rGrid.x, sizeof(datafloat));

  datafloat delta = 2./(N+1);
  datafloat normRHS = 0;
  for(int j = 0; j < N+2; ++j){
    for(int i = 0; i < N+2; ++i){
      datafloat x = -1 + delta*i;
      datafloat y = -1 + delta*j;

      h_rhs[i + (N+2)*j] = delta*delta*(2.*M_PI*M_PI*sin(M_PI*x)*sin(M_PI*y));
      normRHS += pow(h_rhs[i+(N+2)*j],2);
