-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmaxpool_layer.h
47 lines (40 loc) · 1.02 KB
/
maxpool_layer.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
#ifndef _MAXPOOL_LAYER_H_
#define _MAXPOOL_LAYER_H_
#ifdef __cplusplus
extern "C"
{
#endif
#include "znet.h"
#include "zutils.h"
#ifdef OPENCL
struct maxpool_gpu_context;
typedef struct maxpool_gpu_context maxpool_gpu_context;
#endif
typedef struct {
LAYER_TYPE type;
dim3 input_size;
dim3 output_size;
int filter_size;
int stride;
int padding;
int batch_size;
int ninputs;
int noutputs;
float *input;
float *output;
#ifdef OPENCL
maxpool_gpu_context *mpgc;
#endif
} maxpool_layer;
AICORE_LOCAL void free_maxpool_layer(void *_layer);
AICORE_LOCAL void print_maxpool_layer_info(void *_layer, int id);
AICORE_LOCAL void set_maxpool_layer_input(void *_layer, void *input);
AICORE_LOCAL void *get_maxpool_layer_output(void *_layer);
AICORE_LOCAL void forward_maxpool_layer(void *_layer, znet *net);
AICORE_LOCAL void backward_maxpool_layer(maxpool_layer *layer, znet *net);
AICORE_LOCAL int maxpool_output_width(maxpool_layer *layer);
AICORE_LOCAL int maxpool_output_height(maxpool_layer *layer);
#ifdef __cplusplus
}
#endif
#endif