 	}
 
 
-	__global__ void SearchBatch_knn(const CUDA_KDNode *nodes, const int *indexes, const Kd_tree_point *pts, int num_pts, Kd_tree_point *queries, int num_queries, int *ret_index, float *ret_dist, int k)
+	__global__ void SearchBatch_knn(const CUDA_KDNode *nodes, const int *indexes, const Kd_tree_point *pts, int num_pts, Kd_tree_point *queries, int num_queries, int *ret_index, double *ret_dist, int k)
 	{
 		int idx = blockIdx.x*blockDim.x + threadIdx.x;
 

#include <cuda_runtime.h>
#include <cstdio>


namespace P_RVD{



				//Now we get enough neighbors in cur node
				int *temp_index = (int*)malloc(sizeof(int) * nodes[cur].num_indexes);
				double *temp_dists = (double*)malloc(sizeof(double) * nodes[cur].num_indexes);

				for (int i = 0; i < nodes[cur].num_indexes; ++i)
				{
