     compute_temp_vector.resize(pixelCount, pixelCount);
   }
 
-  if (compute_seed_ids.size() != MAX_LABELS || compute_seed_indices.size() != MAX_LABELS)
+  if (compute_seed_ids.size() != MAX_LABELS ||
+      compute_seed_indices.size() != MAX_LABELS)
   {
     compute_seed_ids.resize(MAX_LABELS, -1);
     compute_seed_indices.resize(MAX_LABELS, -1);

  surf2Dwrite<float4>(color, surfaceWrite, x*sizeof(float4), y);
}

void cudaJFAApolloniusThrust(cudaArray_t imageArray, int imageSize, int numLabels,
                            thrust::device_vector<float4> &seedbuffer,
                            thrust::device_vector<float> &distance_vector,
                            thrust::device_vector<int> &compute_vector,
                            thrust::device_vector<int> &compute_temp_vector,
                            thrust::device_vector<int> &compute_seed_ids,
                            thrust::device_vector<int> &compute_seed_indices)
{
  int pixelCount = imageSize * imageSize;
  if (compute_vector.size() != static_cast<unsigned long>(pixelCount))

  float4 *seedBufferPtr = thrust::raw_pointer_cast(seedbuffer.data());

  dim3 dimBlock(32, 32, 1);
  dim3 dimGrid(divUp(imageSize, dimBlock.x), divUp(imageSize, dimBlock.y), 1);

  cudaBindSurfaceToArray(surfaceWrite, imageArray);

  jfa_seed_kernel<<<dimGrid, dimBlock>>>(imageSize, numLabels, seedBufferPtr,
      raw_ptr, idptr, idxptr);
  cudaThreadSynchronize();

  compute_temp_vector = compute_vector;
  apollonius_cuda<<<dimGrid, dimBlock>>>(
      thrust::raw_pointer_cast(compute_vector.data()),
      thrust::raw_pointer_cast(distance_vector.data()), 1, imageSize,
      imageSize);

  for (int k = (imageSize / 2); k > 0; k /= 2)
  {
    apollonius_cuda<<<dimGrid, dimBlock>>>(
        thrust::raw_pointer_cast(compute_vector.data()),
        thrust::raw_pointer_cast(distance_vector.data()), k, imageSize,
        imageSize);
  }

  // colorize diagram
  jfa_thrust_gather<<<dimGrid, dimBlock>>>(imageSize, numLabels, raw_ptr,
      idptr, idxptr);
  cudaThreadSynchronize();
}

