                         cudaMemcpyHostToDevice));
   CUDA_CHECK(cudaMemcpy(deviceQueries, queries, Q*D*sizeof(double), 
                         cudaMemcpyHostToDevice));
-
 
 /*  
   printf("--- Data Matrix ---\n");

__global__ void compute_dist(double* data, double* query, double* dist, 
                              int D, int N) {
  
  // Use shared memory for faster computation and reduction
  __shared__ double Z[DIM_THREADS][MAX_THREADS/DIM_THREADS];
  unsigned int tix = threadIdx.x;
  unsigned int tiy = threadIdx.y;
  
  unsigned int data_ind = threadIdx.x + threadIdx.y*D + blockIdx.x*blockDim.y*D;
  unsigned int query_ind = threadIdx.x + blockIdx.y*D;

/*  unsigned int i = blockIdx.x*blockDim.x*blockDim.y + threadIdx.y*blockDim.x +
                    threadIdx.x;
*/

  // Save the difference in the appropriate possition.
  double tmp = 0;

  if (tix < D && data_ind < N*D) {
    tmp = data[data_ind] - query[query_ind];
  }

  Z[tix][tiy] = tmp * tmp;

  __syncthreads();

  // Perform reduction

  print_GPU_Mat(deviceQueries, Q*D);
*/  

  compute_dist<<<gridSize, blockSize>>>(deviceData,deviceQueries,
                                          deviceDist,D,N);

