21.02
|
GCKernelLibrary class. More...
#include <GCKernelLibrary.h>
Public Member Functions | |
GCKernelLibrary () | |
Default Constructor. More... | |
~GCKernelLibrary () | |
Default Destructor. More... | |
GCKernelLibrary (const GCKernelLibrary &)=delete | |
Prevent instances of this class from being copied. More... | |
const GCKernelLibrary & | operator= (const GCKernelLibrary &)=delete |
Prevent instances of this class from being copied. More... | |
void | init (std::string shader_path="./", EGLDisplay dpy=EGL_NO_DISPLAY, EGLContext ctx=EGL_NO_CONTEXT) |
Initialises the kernel library. More... | |
void | set_shader_path (const std::string &shader_path) |
Sets the path that the shaders reside in. More... | |
void | set_context (EGLDisplay dpy, EGLContext ctx) |
Sets display and context to create kernel. More... | |
GCKernel | create_kernel (const std::string &shader_name, const StringSet &build_options_set={}) const |
Creates a kernel from the kernel library. More... | |
void | save_binary () |
Serializes and saves programs to a binary. More... | |
void | load_binary () |
Load serialized binary with all the programs. More... | |
void | setup_dummy_fbo () |
Setup a dummy fbo to workaround an issue on Galaxy S8. More... | |
Static Public Member Functions | |
static GCKernelLibrary & | get () |
Get the static instance of GCKernelLibrary. More... | |
GCKernelLibrary class.
Definition at line 187 of file GCKernelLibrary.h.
GCKernelLibrary | ( | ) |
Default Constructor.
Definition at line 328 of file GCKernelLibrary.cpp.
~GCKernelLibrary | ( | ) |
Default Destructor.
Definition at line 535 of file GCKernelLibrary.cpp.
References ARM_COMPUTE_GL_CHECK, glBindFramebuffer(), glBindTexture(), glDeleteFramebuffers(), and glDeleteTextures().
|
delete |
Prevent instances of this class from being copied.
GCKernel create_kernel | ( | const std::string & | shader_name, |
const StringSet & | build_options_set = {} |
||
) | const |
Creates a kernel from the kernel library.
[in] | shader_name | Shader name. |
[in] | build_options_set | Shader build options as a set. |
Definition at line 366 of file GCKernelLibrary.cpp.
References ARM_COMPUTE_ERROR_VAR, build_options, GCKernel::clear_arguments(), GCProgram::compile_shader(), arm_compute::test::validation::dst, GCProgram::link_program(), arm_compute::read_file(), GCKernel::set_shader_params_binding_point(), arm_compute::test::validation::src, and GCKernel::use().
Referenced by GCLogits1DMaxKernel::configure(), GCScaleKernel::configure(), GCTransposeKernel::configure(), GCGEMMMatrixAccumulateBiasesKernel::configure(), GCPixelWiseMultiplicationKernel::configure(), GCDepthwiseConvolutionLayer3x3Kernel::configure(), GCFillBorderKernel::configure(), GCNormalizationLayerKernel::configure(), GCPoolingLayerKernel::configure(), GCGEMMMatrixAdditionKernel::configure(), GCNormalizePlanarYUVLayerKernel::configure(), GCAbsoluteDifferenceKernel::configure(), GCArithmeticAdditionKernel::configure(), GCGEMMTranspose1xWKernel::configure(), GCDirectConvolutionLayerKernel< kernel_size >::configure(), GCBatchNormalizationLayerKernel::configure(), GCDepthConcatenateLayerKernel::configure(), GCDropoutLayerKernel::configure(), GCLogits1DShiftExpSumKernel::configure(), GCGEMMMatrixMultiplyKernel::configure(), GCGEMMInterleave4x4Kernel::configure(), GCTensorShiftKernel::configure(), GCWeightsReshapeKernel::configure(), GCCol2ImKernel::configure(), GCIm2ColKernel::configure(), GCLogits1DNormKernel::configure(), and arm_compute::create_opengl_kernel().
|
static |
Get the static instance of GCKernelLibrary.
This method has been deprecated and will be removed in future releases.
Definition at line 333 of file GCKernelLibrary.cpp.
Referenced by GCLogits1DMaxKernel::configure(), GCScaleKernel::configure(), GCTransposeKernel::configure(), GCGEMMMatrixAccumulateBiasesKernel::configure(), GCPixelWiseMultiplicationKernel::configure(), GCDepthwiseConvolutionLayer3x3Kernel::configure(), GCFillBorderKernel::configure(), GCNormalizationLayerKernel::configure(), GCPoolingLayerKernel::configure(), GCGEMMMatrixAdditionKernel::configure(), GCNormalizePlanarYUVLayerKernel::configure(), GCAbsoluteDifferenceKernel::configure(), GCArithmeticAdditionKernel::configure(), GCGEMMTranspose1xWKernel::configure(), GCDirectConvolutionLayerKernel< kernel_size >::configure(), GCBatchNormalizationLayerKernel::configure(), GCDepthConcatenateLayerKernel::configure(), GCDropoutLayerKernel::configure(), GCLogits1DShiftExpSumKernel::configure(), GCGEMMMatrixMultiplyKernel::configure(), GCGEMMInterleave4x4Kernel::configure(), GCTensorShiftKernel::configure(), GCWeightsReshapeKernel::configure(), GCCol2ImKernel::configure(), GCIm2ColKernel::configure(), GCLogits1DNormKernel::configure(), arm_compute::create_opengl_kernel(), and GCScheduler::init().
void init | ( | std::string | shader_path = "./" , |
EGLDisplay | dpy = EGL_NO_DISPLAY , |
||
EGLContext | ctx = EGL_NO_CONTEXT |
||
) |
Initialises the kernel library.
[in] | shader_path | (Optional) Path of the directory from which shader sources are loaded. |
[in] | dpy | (Optional) EGLdisplay set by external application. |
[in] | ctx | (Optional) EGLContext set by external application. |
Definition at line 339 of file GCKernelLibrary.cpp.
References eglMakeCurrent(), and GCKernelLibrary::setup_dummy_fbo().
Referenced by GCRuntimeContext::GCRuntimeContext(), and GCScheduler::init().
void load_binary | ( | ) |
Load serialized binary with all the programs.
|
delete |
Prevent instances of this class from being copied.
void save_binary | ( | ) |
Serializes and saves programs to a binary.
void set_context | ( | EGLDisplay | dpy, |
EGLContext | ctx | ||
) |
Sets display and context to create kernel.
[in] | dpy | EGLdisplay set by external application. |
[in] | ctx | EGLContext set by external application. |
Definition at line 356 of file GCKernelLibrary.cpp.
References eglMakeCurrent(), and GCKernelLibrary::setup_dummy_fbo().
void set_shader_path | ( | const std::string & | shader_path | ) |
Sets the path that the shaders reside in.
[in] | shader_path | Path of the shader. |
Definition at line 351 of file GCKernelLibrary.cpp.
void setup_dummy_fbo | ( | ) |
Setup a dummy fbo to workaround an issue on Galaxy S8.
Definition at line 525 of file GCKernelLibrary.cpp.
References ARM_COMPUTE_GL_CHECK, glBindFramebuffer(), glBindTexture(), glFramebufferTexture2D(), glGenFramebuffers(), glGenTextures(), and glTexImage2D().
Referenced by GCKernelLibrary::init(), and GCKernelLibrary::set_context().