Compute Library
 21.02
NEFloor Class Reference

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

#include <NEFloor.h>

Collaboration diagram for NEFloor:
[legend]

Public Member Functions

 NEFloor ()
 Constructor. More...
 
 NEFloor (const NEFloor &)=delete
 Prevent instances of this class from being copied (As this class contains pointers) More...
 
 NEFloor (NEFloor &&)
 Default move constructor. More...
 
NEFlooroperator= (const NEFloor &)=delete
 Prevent instances of this class from being copied (As this class contains pointers) More...
 
NEFlooroperator= (NEFloor &&)
 Default move assignment operator. More...
 
 ~NEFloor ()
 Destructor. More...
 
void configure (const ITensor *input, ITensor *output)
 Set the source, destination of the kernel. 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...
 

Static Public Member Functions

static Status validate (const ITensorInfo *input, const ITensorInfo *output)
 Static function to check if given info will lead to a valid configuration of NEFloor. More...
 

Detailed Description

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

Definition at line 40 of file NEFloor.h.

Constructor & Destructor Documentation

◆ NEFloor() [1/3]

NEFloor ( )

Constructor.

Definition at line 38 of file NEFloor.cpp.

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

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

◆ NEFloor() [2/3]

NEFloor ( const NEFloor )
delete

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

◆ NEFloor() [3/3]

NEFloor ( NEFloor &&  )
default

Default move constructor.

◆ ~NEFloor()

~NEFloor ( )
default

Destructor.

Referenced by NEFloor::NEFloor().

Member Function Documentation

◆ configure()

void configure ( const ITensor input,
ITensor output 
)

Set the source, destination of the kernel.

Parameters
[in]inputSource tensor. Data type supported: F16/F32.
[out]outputDestination tensor. Same as input

Definition at line 46 of file NEFloor.cpp.

References ARM_COMPUTE_ERROR_ON_NULLPTR, and arm_compute::test::validation::input.

47 {
49 
50  _impl->src = input;
51  _impl->dst = output;
52 
53  _impl->op = std::make_unique<cpu::CpuFloor>();
54  _impl->op->configure(_impl->src->info(), _impl->dst->info());
55 }
#define ARM_COMPUTE_ERROR_ON_NULLPTR(...)
Definition: Validate.h:161

◆ operator=() [1/2]

NEFloor& operator= ( const NEFloor )
delete

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

Referenced by NEFloor::NEFloor().

◆ operator=() [2/2]

NEFloor & operator= ( NEFloor &&  )
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 62 of file NEFloor.cpp.

References arm_compute::ACL_DST, arm_compute::ACL_SRC, and ITensorPack::add_tensor().

63 {
64  ITensorPack pack;
65  pack.add_tensor(TensorType::ACL_SRC, _impl->src);
66  pack.add_tensor(TensorType::ACL_DST, _impl->dst);
67  _impl->op->run(pack);
68 }

◆ validate()

Status validate ( const ITensorInfo input,
const ITensorInfo output 
)
static

Static function to check if given info will lead to a valid configuration of NEFloor.

Parameters
[in]inputSource tensor info. Data type supported: F16/F32.
[in]outputDestination tensor info. Same as input
Returns
a status

Definition at line 57 of file NEFloor.cpp.

References CpuFloor::validate().

58 {
59  return cpu::CpuFloor::validate(input, output);
60 }
static Status validate(const ITensorInfo *src, const ITensorInfo *dst)
Static function to check if given info will lead to a valid configuration of CpuFloor.
Definition: CpuFloor.cpp:39

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