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 
8 class CAFFE2_API AsyncSchedulingNet : public AsyncNetBase {
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 RunAsync() override;
19 
20  void pollAndSchedule(int task_id);
21  void schedule(int task_id, bool run_inline = false) noexcept;
22  void reset() override;
23  virtual void finishRun();
24  void parentCallback(int parent_id);
25  bool isInlineTask(int parent_id, int child_id) const;
26 
27  std::mutex running_mutex_;
28  std::condition_variable running_cv_;
29  std::atomic<bool> running_;
30 
31  std::atomic<int> processed_tasks_num_;
32 
33  C10_DISABLE_COPY_AND_ASSIGN(AsyncSchedulingNet);
34 };
35 
36 } // namespace caffe2
37 
38 #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 ...
Definition: blob.h:13