diff options
author | Georgios Pinitas <georgios.pinitas@arm.com> | 2019-10-25 18:25:17 +0100 |
---|---|---|
committer | Georgios Pinitas <georgios.pinitas@arm.com> | 2019-11-01 17:26:05 +0000 |
commit | 7ae80a928564eba96c4fef0b91b1c50e1647fb8d (patch) | |
tree | 18a6a38e9d61f09f46cc08ba231802eb4519b846 /arm_compute/core/GLES_COMPUTE/GCKernelLibrary.h | |
parent | bfd75d64b99342a6cb46380f7173c39026ed7ea2 (diff) | |
download | ComputeLibrary-7ae80a928564eba96c4fef0b91b1c50e1647fb8d.tar.gz |
COMPMID-2549: Add GLES Runtime Context interfaces.
* Creates interfaces and concrete classes
* Ports GCActivationalLayer
* Adapts test framework and relevant tests
Change-Id: Ide36cd65ebf185958db3c4a5bebd630fcb2f39b3
Signed-off-by: Georgios Pinitas <georgios.pinitas@arm.com>
Reviewed-on: https://review.mlplatform.org/c/2199
Reviewed-by: Pablo Marquez <pablo.tello@arm.com>
Tested-by: Arm Jenkins <bsgcomp@arm.com>
Comments-Addressed: Arm Jenkins <bsgcomp@arm.com>
Diffstat (limited to 'arm_compute/core/GLES_COMPUTE/GCKernelLibrary.h')
-rw-r--r-- | arm_compute/core/GLES_COMPUTE/GCKernelLibrary.h | 55 |
1 files changed, 13 insertions, 42 deletions
diff --git a/arm_compute/core/GLES_COMPUTE/GCKernelLibrary.h b/arm_compute/core/GLES_COMPUTE/GCKernelLibrary.h index 89d6d17eb5..92e6bee4ef 100644 --- a/arm_compute/core/GLES_COMPUTE/GCKernelLibrary.h +++ b/arm_compute/core/GLES_COMPUTE/GCKernelLibrary.h @@ -36,7 +36,7 @@ namespace arm_compute { /** GCProgram class */ -class GCProgram +class GCProgram final { public: /** Default constructor. */ @@ -84,7 +84,7 @@ private: }; /** GCKernel class */ -class GCKernel +class GCKernel final { public: /** Default Constructor. */ @@ -184,22 +184,21 @@ private: }; /** GCKernelLibrary class */ -class GCKernelLibrary +class GCKernelLibrary final { using StringSet = std::set<std::string>; -private: +public: /** Default Constructor. */ GCKernelLibrary(); + /** Default Destructor */ ~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; /** Get the static instance of @ref GCKernelLibrary. - * + * This method has been deprecated and will be removed in the next release. * @return The static instance of GCKernelLibrary. */ static GCKernelLibrary &get(); @@ -209,40 +208,18 @@ public: * @param[in] dpy (Optional) EGLdisplay set by external application. * @param[in] ctx (Optional) EGLContext set by external application. */ - void init(std::string shader_path = "./", EGLDisplay dpy = EGL_NO_DISPLAY, EGLContext ctx = EGL_NO_CONTEXT) - { - //TODO: deal with old display and context. - _shader_path = std::move(shader_path); - - _display = dpy; - _context = ctx; - - eglMakeCurrent(_display, EGL_NO_SURFACE, EGL_NO_SURFACE, _context); - setup_dummy_fbo(); - } - + void init(std::string shader_path = "./", EGLDisplay dpy = EGL_NO_DISPLAY, EGLContext ctx = EGL_NO_CONTEXT); /** Sets the path that the shaders reside in. * * @param[in] shader_path Path of the shader. */ - void set_shader_path(const std::string &shader_path) - { - _shader_path = shader_path; - }; + void set_shader_path(const std::string &shader_path); /** Sets display and context to create kernel. * * @param[in] dpy EGLdisplay set by external application. * @param[in] ctx EGLContext set by external application. */ - void set_context(EGLDisplay dpy, EGLContext ctx) - { - //TODO: deal with old display and context. - _display = dpy; - _context = ctx; - - eglMakeCurrent(dpy, EGL_NO_SURFACE, EGL_NO_SURFACE, ctx); - setup_dummy_fbo(); - }; + void set_context(EGLDisplay dpy, EGLContext ctx); /** Creates a kernel from the kernel library. * * @param[in] shader_name Shader name. @@ -251,17 +228,11 @@ public: * @return The created kernel. */ GCKernel create_kernel(const std::string &shader_name, const StringSet &build_options_set = {}) const; - /** Serializes and saves programs to a binary. - * - */ + /** Serializes and saves programs to a binary. */ void save_binary(); - /** Load serialized binary with all the programs. - * - */ + /** Load serialized binary with all the programs. */ void load_binary(); - /** Setup a dummy fbo to workaround an issue on Galaxy S8. - * - */ + /** Setup a dummy fbo to workaround an issue on Galaxy S8. */ void setup_dummy_fbo(); private: @@ -296,5 +267,5 @@ private: static const std::map<std::string, std::string> _program_source_map; /**< Contains sources for all programs. Used for compile-time shader inclusion. */ }; -} +} // namespace arm_compute #endif /* __ARM_COMPUTE_GCKERNELLIBRARY_H__ */ |