1 #ifndef CAFFE_ACL_SOFTMAX_LAYER_HPP_
2 #define CAFFE_ACL_SOFTMAX_LAYER_HPP_
6 #include "caffe/blob.hpp"
7 #include "caffe/layer.hpp"
8 #include "caffe/proto/caffe.pb.h"
10 #include "caffe/layers/softmax_layer.hpp"
13 #include "caffe/acl_operator.hpp"
20 * @brief ACL implementation of SoftmaxLayer.
21 * Fallback to SoftmaxLayer for some corner cases.
23 template <typename Dtype>
24 class ACLSoftmaxLayer : public ACLOperator,public SoftmaxLayer<Dtype> {
26 explicit ACLSoftmaxLayer(const LayerParameter& param)
27 : ACLOperator(param),SoftmaxLayer<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 ~ACLSoftmaxLayer();
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_SOFTMAX_LAYER_HPP_