 /**
 * Example of use of kNN search CUDA.
 */
-extern "C" void  runKnnCuda(Points r, Points queries, std::vector<int>& indexes){
-	
+extern "C" void  runKnnCuda(Points r, Points queries, int* indexes){
+
 	// Variables and parameters
 	float* ref;											// Pointer to reference point array
 	float* query;										// Pointer to query point array

		query[i + query_nb] = (float)queries.getPoint(i).y;
		query[i + (2 * query_nb)] = (float)queries.getPoint(i).z;
	}
	
	// Variables for duration evaluation
	cudaEvent_t start, stop;
	cudaEventCreate(&start);

	cudaEventRecord(start, 0);
	
	knn(ref, ref_nb, query, query_nb, dim, k, dist, ind);
	
	cudaEventRecord(stop, 0);
	cudaEventSynchronize(stop);
	cudaEventElapsedTime(&elapsed_time, start, stop);
	printf("Vincent Knn done in %f s for %d iterations (%f s by iteration)\n", elapsed_time / 1000, iterations, elapsed_time / (iterations * 1000));
	
	for (int i = 0; i < query_nb; ++i)
	{
		for (int j = 0; j < k; ++j)
		{ 
			indexes[i * k + j] = ind[j * query_nb+ i];
		}
	}
	
	// Destroy cuda event object and free memory
	cudaEventDestroy(start);
