Caffe2 - C++ API
A deep learning, cross platform ML framework
net_async_task.h
1 #ifndef CAFFE2_NET_ASYNC_TASK_H
2 #define CAFFE2_NET_ASYNC_TASK_H
3 
4 #include "caffe2/core/net_async_base.h"
5 #include "caffe2/core/net_async_task_future.h"
6 #include "caffe2/core/operator.h"
7 
8 #include <vector>
9 
10 namespace caffe2 {
11 
12 // AsyncTask represents an asynchronous execution of a chain of ops.
13 class AsyncTask {
14  public:
15  AsyncTask(const std::vector<OperatorBase*>& ops);
16 
17  bool Run(const ExecutionOptions& options);
18 
19  void Reset();
20 
21  DeviceOption GetDeviceOption() const;
22 
23  AsyncTaskFuture& GetFuture();
24  const AsyncTaskFuture& GetFuture() const;
25 
26  private:
27  void handleChainError(
28  OperatorBase* op,
29  const char* err_msg,
30  bool save_exception = false);
31 
32  std::vector<OperatorBase*> ops_;
33  DeviceOption device_option_;
34  AsyncTaskFuture future_;
35 };
36 
37 } // namespace caffe2
38 
39 #endif // CAFFE2_NET_ASYNC_TASK_H
A global dictionary that holds information about what Caffe2 modules have been loaded in the current ...
Definition: blob.h:13