Compute Library
 19.08
NERange Class Reference

Basic function to run NERangeKernel. More...

#include <NERange.h>

Collaboration diagram for NERange:
[legend]

Public Member Functions

 NERange ()
 Default constructor. More...
 
void configure (ITensor *output, float start, float end, float step=1.f)
 Initialize the kernel's start, end, step and output tensor. 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 *output, float start, float end, float step=1.f)
 Static function to check if given info will lead to a valid configuration of NERange. More...
 

Detailed Description

Basic function to run NERangeKernel.

Note
The tensor data type for the output must be U8/S8/U16/S16/U32/S32/F16/F32.
The function performs generates a sequence with the given start, end and step.

Definition at line 40 of file NERange.h.

Constructor & Destructor Documentation

◆ NERange()

NERange ( )

Default constructor.

Definition at line 30 of file NERange.cpp.

31  : _kernel()
32 {
33 }

Member Function Documentation

◆ configure()

void configure ( ITensor output,
float  start,
float  end,
float  step = 1.f 
)

Initialize the kernel's start, end, step and output tensor.

Parameters
[out]outputOutput tensor. Data types supported: U8/S8/U16/S16/U32/S32/F16/F32.
[in]startThe starting value of the sequence.
[in]endThe ending (not including) value of the sequence.
[in]stepThe gap between each pair of values in the sequence. Default is 1.

Definition at line 35 of file NERange.cpp.

36 {
37  _kernel.configure(output, start, end, step);
38 }
void configure(ITensor *output, float start, float end, float step)
Initialize the kernel's output tensor, start, end and step of the sequence.

References NERangeKernel::configure(), and arm_compute::test::validation::step.

◆ 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 45 of file NERange.cpp.

46 {
48 }
static constexpr size_t DimX
Alias for dimension 0 also known as X dimension.
Definition: Window.h:43
virtual void schedule(ICPPKernel *kernel, const Hints &hints)=0
Runs the kernel in the same thread as the caller synchronously.
static IScheduler & get()
Access the scheduler singleton.
Definition: Scheduler.cpp:96

References Window::DimX, Scheduler::get(), and IScheduler::schedule().

◆ validate()

Status validate ( const ITensorInfo output,
float  start,
float  end,
float  step = 1.f 
)
static

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

Parameters
[in]outputOutput tensor info. Data types supported: U8/S8/U16/S16/U32/S32/F16/F32.
[in]startThe starting value of the sequence.
[in]endThe ending (not including) value of the sequence.
[in]stepThe gap between each pair of values in the sequence. Default is 1.
Returns
a status

Definition at line 40 of file NERange.cpp.

41 {
42  return NERangeKernel::validate(output, start, end, step);
43 }
static Status validate(const ITensorInfo *output, float start, float end, float step)
Static function to check if given info will lead to a valid configuration of NERangeKernel.

References arm_compute::test::validation::step, and NERangeKernel::validate().


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