Caffe
internal_thread.hpp
1 #ifndef CAFFE_INTERNAL_THREAD_HPP_
2 #define CAFFE_INTERNAL_THREAD_HPP_
3 
4 #include "caffe/common.hpp"
5 
10 namespace boost { class thread; }
11 
12 namespace caffe {
13 
20  public:
21  InternalThread() : thread_() {}
22  virtual ~InternalThread();
23 
29  void StartInternalThread();
30 
32  void StopInternalThread();
33 
34  bool is_started() const;
35 
36  protected:
37  /* Implement this method in your subclass
38  with the code you want your thread to run. */
39  virtual void InternalThreadEntry() {}
40 
41  /* Should be tested when running loops to exit when requested. */
42  bool must_stop();
43 
44  private:
45  void entry(int device, Caffe::Brew mode, int rand_seed,
46  int solver_count, int solver_rank, bool multiprocess);
47 
48  shared_ptr<boost::thread> thread_;
49 };
50 
51 } // namespace caffe
52 
53 #endif // CAFFE_INTERNAL_THREAD_HPP_
A layer factory that allows one to register layers. During runtime, registered layers can be called b...
Definition: blob.hpp:14
Definition: internal_thread.hpp:10
Definition: internal_thread.hpp:19