Apostolos Fanakis
7 years ago
6 changed files with 85 additions and 65 deletions
@ -1,19 +1,26 @@ |
|||||
#ifndef SERIAL_KERNELS_H /* Include guard */ |
#ifndef SERIAL_KERNELS_H /* Include guard */ |
||||
#define SERIAL_KERNELS_H |
#define SERIAL_KERNELS_H |
||||
|
|
||||
|
/* Structures */ |
||||
|
|
||||
|
//Matrix is used to describe matrices
|
||||
typedef struct { |
typedef struct { |
||||
int width; |
int width; |
||||
int height; |
int height; |
||||
double *elements; |
double *elements; |
||||
} Matrix; |
} Matrix; |
||||
|
|
||||
|
//Kernel calculate_kernel_matrix_kernel calculates the current kernel matrix
|
||||
__global__ void calculate_kernel_matrix_kernel(Matrix shifted_points, Matrix original_points, |
__global__ void calculate_kernel_matrix_kernel(Matrix shifted_points, Matrix original_points, |
||||
double deviation, Matrix kernel_matrix); |
double deviation, Matrix kernel_matrix); |
||||
|
|
||||
//Function multiply_kernel calculates the product of matrices 1 and 2 into output.
|
//Kernel denominator_kernel calculates the sum in the denominator of the fraction used to find new
|
||||
__global__ void shift_points_kernel(Matrix original_points, Matrix kernel_matrix, Matrix shifted_points, |
//(shifted) positions of the points
|
||||
Matrix new_shift, Matrix denominator, Matrix mean_shift_vector); |
|
||||
|
|
||||
__global__ void denominator_kernel(Matrix denominator, Matrix kernel_matrix); |
__global__ void denominator_kernel(Matrix denominator, Matrix kernel_matrix); |
||||
|
|
||||
|
//Kernel shift_points_kernel shifts the positions of all points and calculates the new mean shift
|
||||
|
//vector according to the new point array
|
||||
|
__global__ void shift_points_kernel(Matrix original_points, Matrix kernel_matrix, |
||||
|
Matrix shifted_points, Matrix new_shift, Matrix denominator, Matrix mean_shift_vector); |
||||
|
|
||||
#endif //SERIAL_KERNELS_H
|
#endif //SERIAL_KERNELS_H
|
Loading…
Reference in new issue