anapt 7 years ago
parent
commit
a876298bed
  1. 29
      README.md
  2. 2
      mean_shift_cuda/meanshift_gpu_utils.h

29
README.md

@ -1,3 +1,4 @@
# Mean-shift # Mean-shift
[Mean-shift] is a mathematical procedure, adopted in algorithms, designed in the 70's by Fukunaga and Hostetler. The algorithm is used for: [Mean-shift] is a mathematical procedure, adopted in algorithms, designed in the 70's by Fukunaga and Hostetler. The algorithm is used for:
@ -8,9 +9,15 @@
## Repository ## Repository
This repository provides a serial implementation of the algorithm in C language, as well as the parallel equivalent in CUDA. The project was undertaken as part of the "Parallel and distributed systems" course of AUTH university. This repository provides a serial implementation of the algorithm in C language, as well as two versions of the parallel equivalent in CUDA, with and without the usage of shared memory. The project was undertaken as part of the "Parallel and distributed systems" course of AUTH university.
A [Gaussian] kernel was used for the weighting function. The code was tested for different data sets and information regarding the execution time and correctness were extracted. In addition, the two versions of the parallel algorithm were tested and compared.
## Dependencies
For the serial algorithm only a compiler is needed (e.g. gcc).
A [Gaussian] kernel was used for the weighting function. The code was tested for different data sets and information regarding the execution time and correctness were extracted. In addition, two versions of the parallel algorithm were tested and compared, with and without the usage of shared memory respectively. To compile the parallel versions, the standard CUDA toolkit installation instructions for the intended platform should be followed beforehand as described [here].
## Compilation ## Compilation
@ -22,7 +29,20 @@ $ make
## Usage ## Usage
blah blah, arguments needed etc Run the code with the command:
```sh
$ ./meanshift h e N D Pd Pl
```
where:
1. **h** is the desirable variance
2. **e** is the min distance, between two points, that is taken into account in computations
3. **N** is the the number of points
4. **D** is the number of dimensions of each point
5. **Pd** is the path of the dataset file
6. **Pl** is the path of the labels file
7. **--verbose** | **-v** is an optional flag to enable execution information output
8. **--output** | **-o** is an optional flag to enable points output in each iteration
**Free Software, Hell Yeah!** **Free Software, Hell Yeah!**
@ -30,4 +50,5 @@ blah blah, arguments needed etc
[//]: # (Links) [//]: # (Links)
[Mean-shift]: <https://en.wikipedia.org/wiki/Mean_shift> [Mean-shift]: <https://en.wikipedia.org/wiki/Mean_shift>
[Gaussian]: <https://en.wikipedia.org/wiki/Gaussian_function> [Gaussian]: <https://en.wikipedia.org/wiki/Gaussian_function>
[here]: <https://docs.nvidia.com/cuda/cuda-quick-start-guide/>

2
mean_shift_cuda/meanshift_gpu_utils.h

@ -27,7 +27,7 @@ extern cudaDeviceProp device_properties;
void set_GPU(); void set_GPU();
//Function meanshift recursively shifts original points according to the mean-shift algorithm saving //Function meanshift recursively shifts original points according to the mean-shift algorithm saving
//the result to shiftedPoints, h is the desirable deviation //the result to shiftedPoints, h is the desired deviation
int meanshift(double **original_points, double ***shifted_points, int h); int meanshift(double **original_points, double ***shifted_points, int h);
//Function init_device_memory allocates memory for necessary arrays in the device //Function init_device_memory allocates memory for necessary arrays in the device

Loading…
Cancel
Save