softmax on gpu

This commit is contained in:
Joseph Redmon
2014-10-21 14:49:18 -07:00
parent 9b3c7136f3
commit 158bb1bee9
17 changed files with 440 additions and 97 deletions

View File

@ -2,6 +2,7 @@
#define MAXPOOL_LAYER_H
#include "image.h"
#include "opencl.h"
typedef struct {
int batch;
@ -11,13 +12,23 @@ typedef struct {
int *indexes;
float *delta;
float *output;
#ifdef GPU
cl_mem indexes_cl;
cl_mem output_cl;
cl_mem delta_cl;
#endif
} maxpool_layer;
image get_maxpool_image(maxpool_layer layer);
maxpool_layer *make_maxpool_layer(int batch, int h, int w, int c, int size, int stride);
void resize_maxpool_layer(maxpool_layer *layer, int h, int w, int c);
void forward_maxpool_layer(const maxpool_layer layer, float *input);
void backward_maxpool_layer(const maxpool_layer layer, float *input, float *delta);
void backward_maxpool_layer(const maxpool_layer layer, float *delta);
#ifdef GPU
void forward_maxpool_layer_gpu(maxpool_layer layer, cl_mem input);
void backward_maxpool_layer_gpu(maxpool_layer layer, cl_mem delta);
#endif
#endif