1 #ifndef CAFFE_ACL_BATCH_NORMAL_HPP_
2 #define CAFFE_ACL_BATCH_NORMAL_HPP_
6 #include "caffe/blob.hpp"
7 #include "caffe/layer.hpp"
8 #include "caffe/proto/caffe.pb.h"
10 #include "caffe/layers/batch_norm_layer.hpp"
13 #include "caffe/acl_operator.hpp"
20 * @brief ACL implementation of BatchNormLayer.
21 * Fallback to BatchNormLayer for some corner cases.
23 template <typename Dtype>
24 class ACLBatchNormLayer : public ACLOperator,public BatchNormLayer<Dtype> {
26 explicit ACLBatchNormLayer(const LayerParameter& param)
27 : ACLOperator(param),BatchNormLayer<Dtype>(param) {}
28 virtual void LayerSetUp(const vector<Blob<Dtype>*>& bottom,
29 const vector<Blob<Dtype>*>& top);
30 virtual void Reshape(const vector<Blob<Dtype>*>& bottom,
31 const vector<Blob<Dtype>*>& top);
32 virtual ~ACLBatchNormLayer();
35 virtual void Forward_gpu(const vector<Blob<Dtype>*>& bottom,
36 const vector<Blob<Dtype>*>& top);
37 virtual void Forward_cpu(const vector<Blob<Dtype>*>& bottom,
38 const vector<Blob<Dtype>*>& top);
39 virtual void Backward_gpu(const vector<Blob<Dtype>*>& top,
40 const vector<bool>& propagate_down, const vector<Blob<Dtype>*>& bottom){
43 virtual void Backward_cpu(const vector<Blob<Dtype>*>& top,
44 const vector<bool>& propagate_down, const vector<Blob<Dtype>*>& bottom){
47 virtual void SetupACLOperator(const vector<Blob<Dtype>*>& bottom,
48 const vector<Blob<Dtype>*>& top);
49 virtual bool Bypass_acl(const vector<Blob<Dtype>*>& bottom,const vector<Blob<Dtype>*>& top);
55 #endif // CAFFE_ACL_BATCH_NORMAL_HPP_