 
 // Helper definition
 #define VAR(v, i) __typeof(i) v=(i)
-#define FOR(i, j, k) for (int i = (j); i <= (k); ++i)
+#define FOR(i, j, k) for (i = (j); i <= (k); ++i)
 #define FORD(i, j, k)for (int i=(j); i >= (k); --i)
 #define FORE(i, c) for(VAR(i, (c).begin()); i != (c).end(); ++i)
 #define REP(i, n) for(int i = 0;i <(n); ++i)

	int v1 = BLOCK_SIZE * block + ty;
	int v2 = BLOCK_SIZE * block + tx;  

	__shared__ int primary_d[BLOCK_SIZE][BLOCK_SIZE];
	__shared__ int primary_p[BLOCK_SIZE][BLOCK_SIZE];

	if (v1 < n && v2 < n) 
	{
		 primary_d[ty][tx] = d[v1 * pitch + v2];
		 primary_p[ty][tx] = p[v1 * pitch + v2];
		 newPred = primary_p[ty][tx];
	}
	else 

			p[v1 * V + v2] = v1;
	}

	int v;
	FOR (v, 0, V - 1)
		G[v * V + v] = 0;

