diff options
Diffstat (limited to 'arm_compute')
-rw-r--r-- | arm_compute/core/GLES_COMPUTE/GCKernelLibrary.h | 14 | ||||
-rw-r--r-- | arm_compute/runtime/CL/CLScheduler.h | 3 | ||||
-rw-r--r-- | arm_compute/runtime/GLES_COMPUTE/GCScheduler.h | 24 |
3 files changed, 23 insertions, 18 deletions
diff --git a/arm_compute/core/GLES_COMPUTE/GCKernelLibrary.h b/arm_compute/core/GLES_COMPUTE/GCKernelLibrary.h index db2d979156..34bd5673b8 100644 --- a/arm_compute/core/GLES_COMPUTE/GCKernelLibrary.h +++ b/arm_compute/core/GLES_COMPUTE/GCKernelLibrary.h @@ -191,14 +191,13 @@ class GCKernelLibrary private: /** Default Constructor. */ GCKernelLibrary(); + ~GCKernelLibrary(); public: /** Prevent instances of this class from being copied. */ GCKernelLibrary(const GCKernelLibrary &) = delete; /** Prevent instances of this class from being copied. */ const GCKernelLibrary &operator=(const GCKernelLibrary &) = delete; - /** Default Destructor. */ - ~GCKernelLibrary(); static GCKernelLibrary &get(); /** Initialises the kernel library. @@ -215,13 +214,6 @@ public: _display = dpy; _context = ctx; - if(_display == EGL_NO_DISPLAY || _context == EGL_NO_CONTEXT) - { - setup_context(); - - _own_context = true; - } - eglMakeCurrent(_display, EGL_NO_SURFACE, EGL_NO_SURFACE, _context); setup_dummy_fbo(); } @@ -289,15 +281,11 @@ private: * @return Concatenated string. */ std::string stringify_set(const StringSet &s) const; - /** Set up EGL context. - */ - void setup_context(); EGLDisplay _display; /**< Underlying EGL Display. */ EGLContext _context; /**< Underlying EGL Context. */ GLuint _frame_buffer; /**< Dummy fbo */ GLuint _tex_rt; /**< Dummy texture for render target */ - bool _own_context; /**< Self created context or not. */ std::string _shader_path; /**< Path to the shaders folder. */ mutable std::map<std::string, const GCProgram> _programs_map; /**< Map with all already loaded program data. */ mutable std::map<std::string, const GCKernel> _built_programs_map; /**< Map with all already built program data. */ diff --git a/arm_compute/runtime/CL/CLScheduler.h b/arm_compute/runtime/CL/CLScheduler.h index 1a7befc046..f700bbb679 100644 --- a/arm_compute/runtime/CL/CLScheduler.h +++ b/arm_compute/runtime/CL/CLScheduler.h @@ -199,6 +199,9 @@ private: */ cl::NDRange tune_kernel(ICLKernel &kernel); + /** Flag to ensure symbols initialisation is happening before Scheduler creation */ + static std::once_flag _initialize_symbols; + cl::Context _context; cl::CommandQueue _queue; GPUTarget _target; diff --git a/arm_compute/runtime/GLES_COMPUTE/GCScheduler.h b/arm_compute/runtime/GLES_COMPUTE/GCScheduler.h index 817f8b54b1..8aac9c4023 100644 --- a/arm_compute/runtime/GLES_COMPUTE/GCScheduler.h +++ b/arm_compute/runtime/GLES_COMPUTE/GCScheduler.h @@ -35,10 +35,6 @@ class IGCKernel; /** Provides global access to a OpenGL ES context and command queue. */ class GCScheduler { -private: - /** Constructor */ - GCScheduler(); - public: /** Access the scheduler singleton. * @@ -67,7 +63,25 @@ public: /** Blocks until all commands in the associated command queue have finished. */ void sync(); + +private: + /** Constructor */ + GCScheduler(); + /** Destructor */ + ~GCScheduler(); + /** Prevent instances of this class from being copied */ + GCScheduler(const GCScheduler &) = delete; + /** Prevent instances of this class from being copied */ + GCScheduler &operator=(const GCScheduler &) = delete; + + /** Set up EGL context */ + void setup_context(); + + /** Flag to ensure symbols initialisation is happening before Scheduler creation */ + static std::once_flag _initialize_symbols; + + EGLDisplay _display; /**< Underlying EGL Display. */ + EGLContext _context; /**< Underlying EGL Context. */ }; } - #endif /* __ARM_COMPUTE_GCSCHEDULER_H__ */ |