1 #ifndef CAFFE_ACL_BASE_CONV_LAYER_HPP_
2 #define CAFFE_ACL_BASE_CONV_LAYER_HPP_
6 #include "caffe/blob.hpp"
7 #include "caffe/layer.hpp"
8 #include "caffe/proto/caffe.pb.h"
10 #include "caffe/layers/conv_layer.hpp"
13 #include "caffe/acl_layer.hpp"
20 * @brief ACL implementation of ConvolutionLayer.
21 * Fallback to ConvolutionLayer for some corner cases.
24 template <typename Dtype,typename GPUConvLayer,typename CPUConvLayer>
25 class ACLConvolutionLayer : public ACLBaseLayer<GPUConvLayer,CPUConvLayer>,public ConvolutionLayer<Dtype> {
27 explicit ACLConvolutionLayer(const LayerParameter& param)
28 : ConvolutionLayer<Dtype>(param) {}
29 virtual void LayerSetUp(const vector<Blob<Dtype>*>& bottom,
30 const vector<Blob<Dtype>*>& top);
31 virtual void Reshape(const vector<Blob<Dtype>*>& bottom,
32 const vector<Blob<Dtype>*>& top);
33 virtual ~ACLConvolutionLayer();
36 virtual void Forward_gpu(const vector<Blob<Dtype>*>& bottom,
37 const vector<Blob<Dtype>*>& top);
38 virtual void Forward_cpu(const vector<Blob<Dtype>*>& bottom,
39 const vector<Blob<Dtype>*>& top);
40 virtual void Backward_gpu(const vector<Blob<Dtype>*>& top,
41 const vector<bool>& propagate_down, const vector<Blob<Dtype>*>& bottom){
44 virtual void Backward_cpu(const vector<Blob<Dtype>*>& top,
45 const vector<bool>& propagate_down, const vector<Blob<Dtype>*>& bottom){
48 virtual void SetupACLLayer(const vector<Blob<Dtype>*>& bottom,
49 const vector<Blob<Dtype>*>& top);
56 // Instantiate a class with float and double specifications.
57 #define INSTANTIATE_CONV_CLASS(classname,GPUConvLayer,CPUConvLayer) \
58 template class classname<float,GPUConvLayer,CPUConvLayer>; \
59 template class classname<double,GPUConvLayer,CPUConvLayer>
61 #endif // CAFFE_ACL_BASE_CONV_LAYER_HPP_