 		
 		cudaMemcpy(d_V, V, m*n*sizeof(int), cudaMemcpyHostToDevice);
 
-		knn<<<m, m, m*m*sizeof(int)>>>(m, n, k, d_V, d_out);
+		dim3 blk(m, m);
+		knn<<<1, blk, m*m*sizeof(int)>>>(m, n, k, d_V, d_out);
 
 		cudaMemcpy(out, d_out, m*k*sizeof(int), cudaMemcpyDeviceToHost);
 

	int sum;
	int count;
	int num;
	int is_duplicate;
//	__shared__ int D[m*m];

	computeDist(m, n, V);
	__syncthreads();
	// let the first thread select the k-min dist
	i = blockIdx.x;
	if(threadIdx.x == 0)
	{
		for(count=0; count<k; count++)
		{

	
				if(!is_duplicate)
				{
					if(i < j)
					{
						dist = D[i*m+j];
					}
					else
					{
						dist = D[j*m+i];
					}
					if(dist < temp)
					{
						temp = dist;
						out[i*k+count] = j;
					}
				}
