Compute Library
 22.05
CLSynthetizeFunctionInitOutputWithZeroAndWithZeroConstantBorder< K, bordersize > Class Template Reference

As above but this also initializes to zero the input tensor. More...

#include <Helper.h>

Collaboration diagram for CLSynthetizeFunctionInitOutputWithZeroAndWithZeroConstantBorder< K, bordersize >:
[legend]

Public Member Functions

template<typename T , typename... Args>
void configure (T first, T second, Args &&... args)
 Configure the kernel. More...
 
void run () override final
 Run the kernels contained in the function. More...
 
- Public Member Functions inherited from IFunction
virtual ~IFunction ()=default
 Destructor. More...
 
virtual void prepare ()
 Prepare the function for executing. More...
 

Detailed Description

template<typename K, int bordersize>
class arm_compute::test::CLSynthetizeFunctionInitOutputWithZeroAndWithZeroConstantBorder< K, bordersize >

As above but this also initializes to zero the input tensor.

Definition at line 186 of file Helper.h.

Member Function Documentation

◆ configure()

void configure ( first,
second,
Args &&...  args 
)
inline

Configure the kernel.

Parameters
[in]firstFirst input argument.
[in]secondSecond input argument.
[in]argsRest of the configuration arguments.

Definition at line 196 of file Helper.h.

References GemmTuner::args, arm_compute::CONSTANT, CLScheduler::get(), and arm_compute::test::validation::k.

197  {
198  auto k = std::make_unique<K>();
199  k->set_target(CLScheduler::get().target());
200  k->configure(first, second, std::forward<Args>(args)...);
201  _kernel = std::move(k);
202  _border_handler.configure(first, BorderSize(bordersize), BorderMode::CONSTANT, PixelValue());
203  _fill.configure(second, PixelValue());
204  }
void configure(const CLCompileContext &compile_context, ICLTensor *tensor, BorderSize border_size, BorderMode border_mode, const PixelValue &constant_border_value=PixelValue())
Initialise the kernel&#39;s input, output and border mode.
static CLScheduler & get()
Access the scheduler singleton.
void configure(ICLTensor *tensor, const PixelValue &constant_value, Window *window=nullptr)
Initialize the kernel&#39;s tensor and filling value.
Definition: CLFill.cpp:52

◆ run()

void run ( )
inlinefinaloverridevirtual

Run the kernels contained in the function.

For CPU kernels:

  • Multi-threading is used for the kernels which are parallelisable.
  • By default std::thread::hardware_concurrency() threads are used.
Note
CPPScheduler::set_num_threads() can be used to manually set the number of threads

For OpenCL kernels:

  • All the kernels are enqueued on the queue associated with CLScheduler.
  • The queue is then flushed.
Note
The function will not block until the kernels are executed. It is the user's responsibility to wait.
Will call prepare() on first run if hasn't been done

Implements IFunction.

Definition at line 207 of file Helper.h.

References ARM_COMPUTE_ERROR_ON_MSG, CLScheduler::enqueue(), and CLScheduler::get().

208  {
209  ARM_COMPUTE_ERROR_ON_MSG(!_kernel, "The CL kernel or function isn't configured");
210 
211  _fill.run();
212  CLScheduler::get().enqueue(_border_handler, false);
213  CLScheduler::get().enqueue(*_kernel);
214  }
static CLScheduler & get()
Access the scheduler singleton.
void run() override
Run the kernels contained in the function.
Definition: CLFill.cpp:72
#define ARM_COMPUTE_ERROR_ON_MSG(cond, msg)
Definition: Error.h:456
void enqueue(ICLKernel &kernel, bool flush=true)
Schedule the execution of the passed kernel if possible.

The documentation for this class was generated from the following file: