Exercise 3 for the course "Parallel and distributed systems" of THMMY in AUTH university.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

49 lines
1.3 KiB

#include <stdio.h>
#include <stdlib.h>
#include <sys/time.h>
#include "meanshift_utils.h"
#include "meanshift_gpu_utils.h"
7 years ago
int DEVIATION = 1;
int NUMBER_OF_POINTS = 600;
int DIMENSIONS = 2;
7 years ago
const char *POINTS_FILENAME = "../data/X.bin";
const char *LABELS_FILENAME = "../data/L.bin";
7 years ago
parameters params;
struct timeval startwtime, endwtime;
double seq_time;
int main(int argc, char **argv){
int iterations = 0;
double **vectors, **shifted_points;
char *labels;
7 years ago
params.epsilon = 0.0001;
7 years ago
params.verbose = false;
7 years ago
params.display = true;
7 years ago
printf("here::");
7 years ago
//get_args(argc, argv, &params); //commented out while in development
init(&vectors, &labels);
//save_matrix(vectors, 0);
// tic
gettimeofday (&startwtime, NULL);
7 years ago
printf("wtf");
7 years ago
iterations = meanshift(vectors, &shifted_points, DEVIATION, &params);
// toc
gettimeofday (&endwtime, NULL);
seq_time = (double)((endwtime.tv_usec - startwtime.tv_usec)/1.0e6 + endwtime.tv_sec - startwtime.tv_sec);
7 years ago
7 years ago
7 years ago
// printf("\nTotal number of iterations = %d\n", iterations);
// printf("%s wall clock time = %f\n","Mean Shift", seq_time);
printf("%f \n", seq_time);
//TODO write output points to file -> plot later
//save_matrix(shifted_points, iterations);
7 years ago
}