Caffe2 - C++ API
A deep learning, cross platform ML framework
net_async_scheduling.h
1 
17 #ifndef CAFFE2_CORE_NET_ASYNC_SCHEDULING_H_
18 #define CAFFE2_CORE_NET_ASYNC_SCHEDULING_H_
19 
20 #include "caffe2/core/net_async_base.h"
21 
22 namespace caffe2 {
23 
25  public:
27  const std::shared_ptr<const NetDef>& net_def,
28  Workspace* ws);
29  ~AsyncSchedulingNet() override;
30 
31  void Wait() override;
32 
33  protected:
34  bool DoRunAsync() override;
35 
36  void pollAndSchedule(int task_id);
37  void schedule(int task_id);
38  void reset();
39  virtual void finishRun();
40  int updateParentCount(int child_id);
41 
42  std::mutex running_mutex_;
43  std::condition_variable running_cv_;
44  std::atomic<bool> running_;
45  std::atomic<bool> success_;
46 
47  std::mutex cleanup_mutex_;
48  std::atomic<bool> cleanup_;
49 
50  std::atomic<int> processed_tasks_num_;
51  std::mutex exception_mutex_;
52  std::vector<std::string> exception_messages_;
53 
54  DISABLE_COPY_AND_ASSIGN(AsyncSchedulingNet);
55 };
56 
57 } // namespace caffe2
58 
59 #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:63
Copyright (c) 2016-present, Facebook, Inc.