Compute Library
 21.02
NEFill Class Reference

Basic function to run cpu::kernels::CpuFillKernel. More...

#include <NEFill.h>

Collaboration diagram for NEFill:
[legend]

Public Member Functions

 NEFill ()
 Default Constructor. More...
 
 ~NEFill ()
 Default Destructor. More...
 
 NEFill (const NEFill &)=delete
 Prevent instances of this class from being copied (As this class contains pointers) More...
 
 NEFill (NEFill &&)
 Default move constructor. More...
 
NEFilloperator= (const NEFill &)=delete
 Prevent instances of this class from being copied (As this class contains pointers) More...
 
NEFilloperator= (NEFill &&)
 Default move assignment operator. More...
 
void configure (ITensor *tensor, PixelValue constant_value)
 Initialize the function. More...
 
void run () override
 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

Basic function to run cpu::kernels::CpuFillKernel.

Definition at line 39 of file NEFill.h.

Constructor & Destructor Documentation

◆ NEFill() [1/3]

NEFill ( )

Default Constructor.

Definition at line 39 of file NEFill.cpp.

References NEFill::operator=(), and NEFill::~NEFill().

40  : _impl(std::make_unique<Impl>())
41 {
42 }

◆ ~NEFill()

~NEFill ( )
default

Default Destructor.

Referenced by NEFill::NEFill().

◆ NEFill() [2/3]

NEFill ( const NEFill )
delete

Prevent instances of this class from being copied (As this class contains pointers)

◆ NEFill() [3/3]

NEFill ( NEFill &&  )
default

Default move constructor.

Member Function Documentation

◆ configure()

void configure ( ITensor tensor,
PixelValue  constant_value 
)

Initialize the function.

Parameters
[in,out]tensorSource tensor. Data types supported: All
[in]constant_valueConstant value to use to fill tensor.

Definition at line 47 of file NEFill.cpp.

References ARM_COMPUTE_ERROR_ON_NULLPTR, and ITensor::info().

48 {
50 
51  _impl->tensor = tensor;
52  _impl->op = std::make_unique<cpu::CpuFill>();
53  _impl->op->configure(tensor->info(), constant_value);
54 }
#define ARM_COMPUTE_ERROR_ON_NULLPTR(...)
Definition: Validate.h:161

◆ operator=() [1/2]

NEFill& operator= ( const NEFill )
delete

Prevent instances of this class from being copied (As this class contains pointers)

Referenced by NEFill::NEFill().

◆ operator=() [2/2]

NEFill & operator= ( NEFill &&  )
default

Default move assignment operator.

◆ run()

void run ( )
overridevirtual

Run the kernels contained in the function.

For Neon 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 56 of file NEFill.cpp.

References arm_compute::ACL_SRC_DST, and ITensorPack::add_tensor().

57 {
58  ITensorPack pack;
59  pack.add_tensor(TensorType::ACL_SRC_DST, _impl->tensor);
60  _impl->op->run(pack);
61 }

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