MagmaDNN  1.0
c++NeuralNetworkFramework
pooling.h
Go to the documentation of this file.
1 
9 #pragma once
10 
11 #include "tensor/tensor.h"
12 #include "utilities_internal.h"
13 
14 enum pooling_mode {
15  MAX_POOL,
16  AVERAGE_POOL
17 };
18 
19 #if defined(_HAS_CUDA_)
20 #include "cudnn.h"
21 #endif
22 
23 namespace magmadnn {
24 namespace math {
25 
26 template <typename T>
27 void pooling(Tensor<T> *x, Tensor<T> *out);
28 
29 template <typename T>
30 void pooling_grad(Tensor<T> *x, Tensor<T> *y, Tensor<T> *grad, Tensor<T> *out);
31 
32 
33 #if defined(_HAS_CUDA_)
34 
35 struct cudnn_pooling_settings_t {
36  cudnnPoolingDescriptor_t poolingDesc;
37 };
38 
39 template <typename T>
40 void pooling_device(Tensor<T> *x, Tensor<T> *out, cudnn_pooling_settings_t settings);
41 
42 template <typename T>
43 void pooling_grad_device(Tensor<T> *x, Tensor<T> *y, Tensor<T> *grad, Tensor<T> *out, cudnn_pooling_settings_t settings);
44 
45 #endif
46 
47 }
48 }
Definition: addop.cpp:11