Caffe2 - C++ API
A deep learning, cross platform ML framework
context.cc
1 #include "context.h"
2 
3 #include "caffe2/core/allocator.h"
4 #include "caffe2/core/context.h"
5 #include "caffe2/core/logging.h"
6 #include "caffe2/core/tensor.h"
7 
8 namespace caffe2 {
9 
10 CAFFE_KNOWN_TYPE(GLTensor<GLfloat>);
11 CAFFE_KNOWN_TYPE(GLTensor<GLhalf>);
12 CAFFE_KNOWN_TYPE(GLTensor<half>);
13 CAFFE_KNOWN_TYPE(Tensor<GLContext>);
14 
15 bool GLContext::initialized = false;
16 
17 GLContext::GLContext() {
18  CAFFE_ENFORCE(arm_compute::opengles31_is_available());
19  if(!initialized) {
20  arm_compute::GCScheduler::get().default_init();
21  initialized = true;
22  }
23 }
24 
25 void EventCreateOPENGL(const DeviceOption & /* unused */,
26  Event * /* unused */) {}
27 void EventRecordOPENGL(Event * /* unused */, const void * /* unused */,
28  const char * /* unused */) {}
29 void EventWaitOPENGLOPENGL(const Event * /* unused */, void * /* unused */) {}
30 void EventFinishOPENGL(const Event * /* unused */) {}
31 void EventResetOPENGL(Event * /* unused */) {}
32 
33 REGISTER_EVENT_CREATE_FUNCTION(OPENGL, EventCreateOPENGL);
34 REGISTER_EVENT_RECORD_FUNCTION(OPENGL, EventRecordOPENGL);
35 REGISTER_EVENT_WAIT_FUNCTION(OPENGL, OPENGL, EventWaitOPENGLOPENGL);
36 REGISTER_EVENT_FINISH_FUNCTION(OPENGL, EventFinishOPENGL);
37 REGISTER_EVENT_RESET_FUNCTION(OPENGL, EventResetOPENGL);
38 
39 } // namespace caffe2
A global dictionary that holds information about what Caffe2 modules have been loaded in the current ...