| 51 | |
| 52 | template <typename Dtype> |
| 53 | class BasePrefetchingDataLayer : |
| 54 | public BaseDataLayer<Dtype>, public InternalThread { |
| 55 | public: |
| 56 | explicit BasePrefetchingDataLayer(const LayerParameter& param); |
| 57 | // LayerSetUp: implements common data layer setup functionality, and calls |
| 58 | // DataLayerSetUp to do special data layer setup for individual layer types. |
| 59 | // This method may not be overridden. |
| 60 | void LayerSetUp(const vector<Blob<Dtype>*>& bottom, |
| 61 | const vector<Blob<Dtype>*>& top); |
| 62 | |
| 63 | virtual void Forward_cpu(const vector<Blob<Dtype>*>& bottom, |
| 64 | const vector<Blob<Dtype>*>& top); |
| 65 | virtual void Forward_gpu(const vector<Blob<Dtype>*>& bottom, |
| 66 | const vector<Blob<Dtype>*>& top); |
| 67 | |
| 68 | protected: |
| 69 | virtual void InternalThreadEntry(); |
| 70 | virtual void load_batch(Batch<Dtype>* batch) = 0; |
| 71 | |
| 72 | vector<shared_ptr<Batch<Dtype> > > prefetch_; |
| 73 | BlockingQueue<Batch<Dtype>*> prefetch_free_; |
| 74 | BlockingQueue<Batch<Dtype>*> prefetch_full_; |
| 75 | Batch<Dtype>* prefetch_current_; |
| 76 | |
| 77 | Blob<Dtype> transformed_data_; |
| 78 | }; |
| 79 | |
| 80 | } // namespace caffe |
| 81 |
nothing calls this directly
no outgoing calls
no test coverage detected