Kmeans implementation in C / Cuda