added cuda call error checking to kmeans