Compute Library
 20.02.1
CLSplit Class Reference

Basic function to split a tensor along a given axis. More...

#include <CLSplit.h>

Collaboration diagram for CLSplit:
[legend]

Public Member Functions

void run () override
 Run the kernels contained in the function. More...
 
- Public Member Functions inherited from CPPSplit< CLSlice, ICLTensor >
 CPPSplit ()
 
void configure (const ICLTensor *input, const std::vector< ICLTensor * > &outputs, unsigned int axis)
 Initialise the kernel's input and outputs. More...
 
- Public Member Functions inherited from IFunction
virtual ~IFunction ()=default
 Destructor. More...
 
virtual void prepare ()
 Prepare the function for executing. More...
 

Additional Inherited Members

- Static Public Member Functions inherited from CPPSplit< CLSlice, ICLTensor >
static Status validate (const ITensorInfo *input, const std::vector< ITensorInfo * > &outputs, unsigned int axis)
 Static function to check if given info will lead to a valid configuration of CPPSplit. More...
 

Detailed Description

Basic function to split a tensor along a given axis.

Definition at line 40 of file CLSplit.h.

Member Function Documentation

◆ 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 37 of file CLSplit.cpp.

38 {
39  cl::CommandQueue q = CLScheduler::get().queue();
40 
41  for(unsigned i = 0; i < _num_outputs; ++i)
42  {
43  _slice_functions[i].run();
44  }
45 }
static CLScheduler & get()
Access the scheduler singleton.
Definition: CLScheduler.cpp:99
cl::CommandQueue & queue()
Accessor for the associated CL command queue.
Definition: CLScheduler.cpp:41

References CLScheduler::get(), and CLScheduler::queue().


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