 } while(0);
 
 //set x and y through xyvals
-__global__ void k2(int *xyvals, int *trace) {
+__global__ void k2(int *xyvals, int *trace, int*final) {
   __shared__ int A[2][4];
   int buf, x, y, i, j;
   int lid = threadIdx.x;

    printf("---\n");
  }

  cudaFree(d_xyvals);
  cudaFree(d_trace);
  delete[] trace;
  return 0;


  cudaMalloc((void **)&d_trace, d_trace_size);
  cudaMemcpy(d_trace, trace, d_trace_size, cudaMemcpyHostToDevice);

  // also record the final state of A
  int final[8];
  for (int i=0; i<8; i++) {
    final[i] = 99;
  }
  int *d_final;
  size_t d_final_size = sizeof(int)*8;
  cudaMalloc((void **)&d_final, d_final_size);
  cudaMemcpy(d_final, final, d_final_size, cudaMemcpyHostToDevice);

  // run kernel
  printf("Set x and y through xyvals[%d,%d]...", xyvals[0], xyvals[1]);
  ASSERT_NO_CUDA_ERROR();
  k2<<</*gridDim=*/1, GROUPSIZE>>>(d_xyvals, d_trace, d_final);
  ASSERT_NO_CUDA_ERROR();
  printf("[done]\n");

