The project is implemented in two versions. One cuda paralled and one cpu sequential sourced from https://www.eecs.northwestern.edu/~wkliao/Kmeans/index.html
To run the project first you need some sample input. To do this run:
make generate_input
and then:
./generate_input.o <number_of_points> <dimensions> <out_filename>
this should generate an input file in the correct format
To run cuda version build it using make and run:
./kmeans_cuda.o -i <input_file> -n <number_of_clusters>
To run it on cpu simply got to /sequential_kmeans and use make and run:
./seq_main -i <input_file> -n <number_of_clusters>
For an input of size 1000000 x 30 and K = 300 the running times where:
- Cpu - 949.3460s with input loading time of 1.3776s
- Gpu - 29.34938s with imput loading time of 3.41724s