24 #ifndef ARM_COMPUTE_CLSCHEDULER_H 25 #define ARM_COMPUTE_CLSCHEDULER_H 121 cl::CommandQueue &
queue();
188 void flush_queue(
bool flush);
191 static std::once_flag _initialize_symbols;
193 cl::Context _context;
194 cl::CommandQueue _queue;
196 bool _is_initialised;
200 bool _job_chaining_enabled;
201 int _job_chaining_size;
202 int _job_chaining_count;
void set_target(GPUTarget target)
Accessor to set target GPU to be used by the scheduler.
void default_reinit(ICLTuner *cl_tuner=nullptr, CLGEMMHeuristicsHandle *gemm_h=nullptr, CLBackendType cl_backend_type=CLBackendType::Native)
Re-initializes the context and command queue used by the scheduler to default values and sets a defau...
void enable_job_chaining(int job_chaining_size)
Enable job chaining.
GPUTarget target() const
Get the target GPU.
void set_context(cl::Context context)
Accessor to set the CL context to be used by the scheduler.
void default_init_with_context(cl::Device &device, cl::Context &ctx, ICLTuner *cl_tuner=nullptr, CLGEMMHeuristicsHandle *gemm_h=nullptr)
Initialises the scheduler with context and device provided by the user.
void default_init(ICLTuner *cl_tuner=nullptr, CLGEMMHeuristicsHandle *gemm_h=nullptr, CLBackendType cl_backend_type=CLBackendType::Native)
Initialises the context and command queue used by the scheduler to default values and sets a default ...
CLScheduler & operator=(const CLScheduler &)=delete
Prevent instances of this class from being copied (As this class contains pointers) ...
~CLScheduler()=default
Default destructor.
bool is_initialised() const
Common interface for all the OpenCL kernels.
CLGEMMHeuristicsHandle * gemm_heuristics() const
Accessor for the associated CLGEMMHeuristicsHandle.
Copyright (c) 2017-2023 Arm Limited.
cl::Context & context()
Accessor for the associated CL context.
cl::Event enqueue_sync_event()
Enqueues a marker into the associated command queue and return the event.
Interface used to tune the local work-group size of OpenCL kernels.
void enqueue_op(ICLKernel &kernel, ITensorPack &tensors, bool flush=true)
Schedule the execution of the passed kernel if possible.
void set_tuner(ICLTuner *tuner)
Accessor to set the CL tuner to be used by the scheduler.
cl::CommandQueue & queue()
Accessor for the associated CL command queue.
void enqueue(ICLKernel &kernel, bool flush=true)
Schedule the execution of the passed kernel if possible.
void set_queue(cl::CommandQueue queue)
Accessor to set the CL command queue to be used by the scheduler.
CLScheduler()
Constructor.
void sync()
Blocks until all commands in the associated command queue have finished.
Handle for loading and retrieving GEMM heuristics.
CLBackendType
List the possible OpenCL backends.
GPUTarget
Available GPU Targets.
Provides global access to a CL context and command queue.
Wrapper to configure the Khronos OpenCL C++ header.
Basic interface for tuning the OpenCL kernels.
void tune_kernel_static(ICLKernel &kernel)
Tunes OpenCL kernel.
void init(cl::Context context, cl::CommandQueue queue, const cl::Device &device, ICLTuner *cl_tuner=nullptr, CLGEMMHeuristicsHandle *gemm_h=nullptr, CLBackendType cl_backend_type=CLBackendType::Native)
Initialises the context and command queue to be used by the scheduler.