Caffe2 - C++ API
A deep learning, cross platform ML framework
event_cpu.h
1 #include "caffe2/core/event.h"
2 
3 #include <atomic>
4 #include <condition_variable>
5 
6 namespace caffe2 {
7 
9  explicit CPUEventWrapper(const DeviceOption& option)
10  : status_(EventStatus::EVENT_INITIALIZED) {
11  CAFFE_ENFORCE(
12  option.device_type() == PROTO_CPU ||
13  option.device_type() == PROTO_MKLDNN ||
14  option.device_type() == PROTO_IDEEP,
15  "Expected CPU/MKLDNN/IDEEP device type");
16  }
17  ~CPUEventWrapper() {}
18 
19  std::mutex mutex_;
20  std::condition_variable cv_completed_;
21  std::atomic<int> status_;
22  std::string err_msg_;
23  std::vector<EventCallbackFunction> callbacks_;
24 };
25 
26 void EventCreateCPU(const DeviceOption& option, Event* event);
27 
28 void EventRecordCPU(
29  Event* event,
30  const void* /* unused */,
31  const char* err_msg);
32 
33 void EventFinishCPU(const Event* event);
34 
35 void EventWaitCPUCPU(const Event* event, void* /* context */);
36 
37 EventStatus EventQueryCPU(const Event* event);
38 
39 const std::string& EventErrorMessageCPU(const Event* event);
40 
41 void EventSetFinishedCPU(const Event* event, const char* err_msg);
42 
43 bool EventCanScheduleCPU(const Event*, const Event*);
44 
45 void EventResetCPU(Event*);
46 
47 } // namespace caffe2
A global dictionary that holds information about what Caffe2 modules have been loaded in the current ...
Definition: blob.h:13