2022-11-01 17:24:29 +01:00
|
|
|
#include "struct.h"
|
|
|
|
|
2023-05-13 15:50:01 +02:00
|
|
|
|
2022-11-01 17:24:29 +01:00
|
|
|
/*
|
2022-12-19 15:49:18 +01:00
|
|
|
* Effectue la convolution naïvement sur le processeur
|
2022-11-01 17:24:29 +01:00
|
|
|
*/
|
2023-05-13 17:22:47 +02:00
|
|
|
void make_convolution_cpu(Kernel_cnn* kernel, float*** input, float*** output, int output_width, int stride, int padding);
|
2022-11-01 17:24:29 +01:00
|
|
|
|
|
|
|
#ifdef __CUDACC__
|
|
|
|
/*
|
|
|
|
* Kernel de la convolution sur carte graphique
|
|
|
|
*/
|
2023-05-15 11:55:50 +02:00
|
|
|
__global__ void make_convolution_kernel(float**** weights, float*** bias, int k_size, int rows, int columns, float*** input, float*** output, int output_width, int stride, int padding);
|
2022-11-01 17:24:29 +01:00
|
|
|
|
|
|
|
/*
|
2022-12-19 15:49:18 +01:00
|
|
|
* Effectue la convolution naïvement sur la carte graphique
|
2022-11-01 17:24:29 +01:00
|
|
|
*/
|
2023-05-13 17:22:47 +02:00
|
|
|
void make_convolution_device(Kernel_cnn* kernel, float*** input, float*** output, int output_width, int stride, int padding);
|
2022-11-01 17:24:29 +01:00
|
|
|
#endif
|
|
|
|
|
2023-05-13 22:42:13 +02:00
|
|
|
#ifdef __CUDACC__
|
|
|
|
extern "C"
|
|
|
|
#endif
|
2022-11-01 17:24:29 +01:00
|
|
|
/*
|
|
|
|
* Détermine si la convolution peut-être faite sur la carte graphique au moment de la compilation
|
|
|
|
*/
|
2023-05-13 17:22:47 +02:00
|
|
|
void make_convolution(Kernel_cnn* kernel, float*** input, float*** output, int output_width, int stride, int padding);
|