21.02
|
Provides global access to a OpenGL ES context and command queue. More...
#include <GCScheduler.h>
Public Member Functions | |
GCScheduler () | |
Constructor. More... | |
~GCScheduler () | |
Destructor. More... | |
GCScheduler (const GCScheduler &)=delete | |
Prevent instances of this class from being copied. More... | |
GCScheduler & | operator= (const GCScheduler &)=delete |
Prevent instances of this class from being copied. More... | |
void | default_init () |
Initialises the context and command queue used by the scheduler to default values and sets a default device and kernel path for the GCKernelLibrary. More... | |
void | default_init_with_context (EGLDisplay display, EGLContext ctx) |
Initializes the context and display used by the Scheduler. More... | |
void | dispatch (IGCKernel &kernel, bool flush=true) |
Schedule the execution of the passed kernel if possible. More... | |
void | init (EGLDisplay dpy, EGLContext ctx) |
Initialises the display and context to be used by the scheduler. More... | |
void | memory_barrier () |
Defines a barrier ordering memory transactions. More... | |
GPUTarget | get_target () const |
Get the target GPU. More... | |
void | set_target (GPUTarget target) |
Accessor to set target GPU to be used by the scheduler. More... | |
Static Public Member Functions | |
static GCScheduler & | get () |
Access the scheduler singleton. More... | |
Provides global access to a OpenGL ES context and command queue.
Definition at line 37 of file GCScheduler.h.
GCScheduler | ( | ) |
~GCScheduler | ( | ) |
Destructor.
Definition at line 39 of file GCScheduler.cpp.
References eglDestroyContext(), and eglTerminate().
|
delete |
Prevent instances of this class from being copied.
void default_init | ( | ) |
Initialises the context and command queue used by the scheduler to default values and sets a default device and kernel path for the GCKernelLibrary.
Definition at line 48 of file GCScheduler.cpp.
References GCScheduler::init().
Referenced by GCDeviceBackend::initialize_backend(), and main().
void default_init_with_context | ( | EGLDisplay | display, |
EGLContext | ctx | ||
) |
Initializes the context and display used by the Scheduler.
[in] | display | Display to use |
[in] | ctx | Context to use |
Definition at line 55 of file GCScheduler.cpp.
References arm_compute::get_target_from_device().
void dispatch | ( | IGCKernel & | kernel, |
bool | flush = true |
||
) |
Schedule the execution of the passed kernel if possible.
[in] | kernel | Kernel to execute. |
[in] | flush | (Optional) Specifies if the command queue will be flushed after running the kernel. |
Definition at line 77 of file GCScheduler.cpp.
References ARM_COMPUTE_GL_CHECK, glFlush(), IGCKernel::run(), and IKernel::window().
Referenced by GCGEMM::prepare(), IGCSimpleFunction::run(), GCDropoutLayer::run(), GCConcatenateLayer::run(), GCBatchNormalizationLayer::run(), GCConvolutionLayerReshapeWeights::run(), GCNormalizationLayer::run(), GCDepthwiseConvolutionLayer3x3::run(), GCSoftmaxLayer::run(), GCPoolingLayer::run(), GCNormalizePlanarYUVLayer::run(), GCDirectConvolutionLayer::run(), GCFullyConnectedLayer::run(), GCGEMM::run(), and GCConvolutionLayer::run().
|
static |
Access the scheduler singleton.
Definition at line 70 of file GCScheduler.cpp.
References arm_compute::opengles31_is_available().
Referenced by GCGEMM::configure(), GCConvolutionLayer::configure(), GCDeviceBackend::initialize_backend(), main(), GCGEMM::prepare(), IGCSimpleFunction::run(), GCDropoutLayer::run(), GCConcatenateLayer::run(), GCConvolutionLayerReshapeWeights::run(), GCBatchNormalizationLayer::run(), GCNormalizationLayer::run(), GCDepthwiseConvolutionLayer3x3::run(), GCSoftmaxLayer::run(), GCPoolingLayer::run(), GCNormalizePlanarYUVLayer::run(), GCDirectConvolutionLayer::run(), GCFullyConnectedLayer::run(), GCGEMM::run(), and GCConvolutionLayer::run().
|
inline |
Get the target GPU.
Definition at line 81 of file GCScheduler.h.
Referenced by GCGEMM::configure().
void init | ( | EGLDisplay | dpy, |
EGLContext | ctx | ||
) |
Initialises the display and context to be used by the scheduler.
[in] | dpy | The EGL display connection |
[in] | ctx | The EGL rendering context |
Definition at line 63 of file GCScheduler.cpp.
References GCKernelLibrary::get(), arm_compute::get_target_from_device(), and GCKernelLibrary::init().
Referenced by GCScheduler::default_init().
void memory_barrier | ( | ) |
Defines a barrier ordering memory transactions.
Definition at line 86 of file GCScheduler.cpp.
References ARM_COMPUTE_ERROR_ON_MSG, ARM_COMPUTE_ERROR_ON_MSG_VAR, ARM_COMPUTE_GL_CHECK, ARM_COMPUTE_UNUSED, eglBindAPI(), eglChooseConfig(), eglCreateContext(), eglGetDisplay(), eglGetError(), eglInitialize(), eglMakeCurrent(), eglQueryString(), and glMemoryBarrier().
Referenced by GCGEMM::prepare(), IGCSimpleFunction::run(), GCNormalizationLayer::run(), GCSoftmaxLayer::run(), GCDepthwiseConvolutionLayer3x3::run(), GCPoolingLayer::run(), GCDirectConvolutionLayer::run(), GCFullyConnectedLayer::run(), GCGEMM::run(), and GCConvolutionLayer::run().
|
delete |
Prevent instances of this class from being copied.
|
inline |
Accessor to set target GPU to be used by the scheduler.
[in] | target | The target GPU. |
Definition at line 89 of file GCScheduler.h.