 }
 #endif
 
+  }
 }
 
 inline void checkCudaError(cudaError_t error) {

  int length_per_time = s_per_time * num_coords;
  int times = (int) num_clusters / s_per_time;

  int new_cluster_idx = 0;
  float dist, min_dist = 3.40282e+38;

  // save centroids into shared memory by tiles, and calculate distances
  for (int t = 0; t < times; t ++) {

    for (int i = tid; i < length_per_time; i ++) {
      s_clusters[i] = clusters[t * s_per_time + i];
    }

	  __syncthreads();

#ifdef DEVICE_TIMING
clock_t start;

	  for (int i = 0; i < num_coords; i++) {
		  atomicAdd(&new_clusters[new_cluster_idx * num_coords + i], 
            points[i * num_points + obj_idx]);
	  }

  	__syncthreads();

#ifdef DEVICE_TIMING
if (tid == 0) {
