Compute Library
 21.02
CLFloor Class Reference

Basic function to run opencl::kernels::ClFloorKernel. More...

#include <CLFloor.h>

Collaboration diagram for CLFloor:
[legend]

Public Member Functions

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

Detailed Description

Basic function to run opencl::kernels::ClFloorKernel.

Definition at line 40 of file CLFloor.h.

Constructor & Destructor Documentation

◆ CLFloor() [1/3]

CLFloor ( )

Constructor.

Definition at line 42 of file CLFloor.cpp.

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

43  : _impl(std::make_unique<Impl>())
44 {
45 }

◆ ~CLFloor()

~CLFloor ( )
default

Destructor.

Referenced by CLFloor::CLFloor().

◆ CLFloor() [2/3]

CLFloor ( const CLFloor )
delete

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

◆ CLFloor() [3/3]

CLFloor ( CLFloor &&  )
default

Default move constructor.

Member Function Documentation

◆ configure() [1/2]

void configure ( const ICLTensor input,
ICLTensor 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 50 of file CLFloor.cpp.

References CLKernelLibrary::get().

51 {
52  configure(CLKernelLibrary::get().get_compile_context(), input, output);
53 }
static CLKernelLibrary & get()
Access the KernelLibrary singleton.
void configure(const ICLTensor *input, ICLTensor *output)
Set the source, destination of the kernel.
Definition: CLFloor.cpp:50

◆ configure() [2/2]

void configure ( const CLCompileContext compile_context,
const ICLTensor input,
ICLTensor output 
)

Set the source, destination of the kernel.

Parameters
[in]compile_contextThe compile context to be used.
[in]inputSource tensor. Data type supported: F16/F32.
[out]outputDestination tensor. Same as input

Definition at line 55 of file CLFloor.cpp.

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

56 {
58 
59  _impl->src = input;
60  _impl->dst = output;
61 
62  _impl->op = std::make_unique<opencl::ClFloor>();
63  _impl->op->configure(compile_context, _impl->src->info(), _impl->dst->info());
64 }
#define ARM_COMPUTE_ERROR_ON_NULLPTR(...)
Definition: Validate.h:161

◆ operator=() [1/2]

CLFloor& operator= ( const CLFloor )
delete

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

Referenced by CLFloor::CLFloor().

◆ operator=() [2/2]

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

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

72 {
73  ITensorPack pack;
74  pack.add_tensor(TensorType::ACL_SRC, _impl->src);
75  pack.add_tensor(TensorType::ACL_DST, _impl->dst);
76  _impl->op->run(pack);
77 }

◆ validate()

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

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

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

Definition at line 66 of file CLFloor.cpp.

References ClFloor::validate().

Referenced by arm_compute::test::validation::DATA_TEST_CASE().

67 {
68  return opencl::ClFloor::validate(input, output);
69 }
static Status validate(const ITensorInfo *src, const ITensorInfo *dst)
Static function to check if given info will lead to a valid configuration of ClFloor.
Definition: ClFloor.cpp:40

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