torch7 wrapper for knn CUDA code