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