Caffe2 - C++ API
A deep learning, cross platform ML framework
net_async_scheduling.h
1 #ifndef CAFFE2_CORE_NET_ASYNC_SCHEDULING_H_
2 #define CAFFE2_CORE_NET_ASYNC_SCHEDULING_H_
3 
4 #include "caffe2/core/net_async_base.h"
5 
6 namespace caffe2 {
7 
9  public:
11  const std::shared_ptr<const NetDef>& net_def,
12  Workspace* ws);
13  ~AsyncSchedulingNet() override;
14 
15  void Wait() override;
16 
17  protected:
18  bool DoRunAsync() override;
19 
20  void pollAndSchedule(int task_id);
21  void schedule(int task_id);
22  void reset();
23  virtual void finishRun();
24  int updateParentCount(int child_id);
25 
26  std::mutex running_mutex_;
27  std::condition_variable running_cv_;
28  std::atomic<bool> running_;
29  std::atomic<bool> success_;
30 
31  std::mutex cleanup_mutex_;
32  std::atomic<bool> cleanup_;
33 
34  std::atomic<int> processed_tasks_num_;
35  std::mutex exception_mutex_;
36  std::vector<std::string> exception_messages_;
37 
38  DISABLE_COPY_AND_ASSIGN(AsyncSchedulingNet);
39 };
40 
41 } // namespace caffe2
42 
43 #endif // CAFFE2_CORE_NET_ASYNC_SCHEDULING_H_
Workspace is a class that holds all the related objects created during runtime: (1) all blobs...
Definition: workspace.h:47
A global dictionary that holds information about what Caffe2 modules have been loaded in the current ...