Compute Library
 21.02
CLGather Class Reference

Basic function to run CLGatherKernel. More...

#include <CLGather.h>

Collaboration diagram for CLGather:
[legend]

Public Member Functions

void configure (const ICLTensor *input, const ICLTensor *indices, ICLTensor *output, int axis=0)
 Initialise the kernel's inputs and outputs. More...
 
void configure (const CLCompileContext &compile_context, const ICLTensor *input, const ICLTensor *indices, ICLTensor *output, int axis=0)
 Initialise the kernel's inputs and outputs. More...
 
- Public Member Functions inherited from ICLSimpleFunction
 ICLSimpleFunction (CLRuntimeContext *ctx=nullptr)
 Constructor. More...
 
 ICLSimpleFunction (const ICLSimpleFunction &)=delete
 Prevent instances of this class from being copied (As this class contains pointers) More...
 
 ICLSimpleFunction (ICLSimpleFunction &&)=default
 Default move constructor. More...
 
ICLSimpleFunctionoperator= (const ICLSimpleFunction &)=delete
 Prevent instances of this class from being copied (As this class contains pointers) More...
 
ICLSimpleFunctionoperator= (ICLSimpleFunction &&)=default
 Default move assignment operator. More...
 
 ~ICLSimpleFunction ()
 Default destructor. More...
 
void run () override final
 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 *indices, const ITensorInfo *output, int axis=0)
 Static function to check if given info will lead to a valid configuration of CLGatherKernel. More...
 

Detailed Description

Basic function to run CLGatherKernel.

Definition at line 38 of file CLGather.h.

Member Function Documentation

◆ configure() [1/2]

void configure ( const ICLTensor input,
const ICLTensor indices,
ICLTensor output,
int  axis = 0 
)

Initialise the kernel's inputs and outputs.

Parameters
[in]inputSource tensor. Supported tensor rank: up to 4. Data type supported: All.
[in]indicesIndices tensor. Supported tensor rank: up to 1. Must be one of the following types: U32/S32. Each value must be in range [0, input.shape[axis])
[out]outputDestination tensor. Data type supported: Same as input
[in]axis(Optional) The axis in input to gather indices from. Defaults to 0

Definition at line 31 of file CLGather.cpp.

References CLKernelLibrary::get().

32 {
33  configure(CLKernelLibrary::get().get_compile_context(), input, indices, output, axis);
34 }
static CLKernelLibrary & get()
Access the KernelLibrary singleton.
void configure(const ICLTensor *input, const ICLTensor *indices, ICLTensor *output, int axis=0)
Initialise the kernel&#39;s inputs and outputs.
Definition: CLGather.cpp:31

◆ configure() [2/2]

void configure ( const CLCompileContext compile_context,
const ICLTensor input,
const ICLTensor indices,
ICLTensor output,
int  axis = 0 
)

Initialise the kernel's inputs and outputs.

Parameters
[in]compile_contextThe compile context to be used.
[in]inputSource tensor. Supported tensor rank: up to 4. Data type supported: All.
[in]indicesIndices tensor. Supported tensor rank: up to 1. Must be one of the following types: U32/S32. Each value must be in range [0, input.shape[axis])
[out]outputDestination tensor. Data type supported: Same as input
[in]axis(Optional) The axis in input to gather indices from. Defaults to 0

Definition at line 36 of file CLGather.cpp.

37 {
38  auto k = std::make_unique<CLGatherKernel>();
39  k->configure(compile_context, input, indices, output, axis);
40  _kernel = std::move(k);
41 }

◆ validate()

Status validate ( const ITensorInfo input,
const ITensorInfo indices,
const ITensorInfo output,
int  axis = 0 
)
static

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

Parameters
[in]inputSource tensor info. Supported tensor rank: up to 4. Data type supported: All.
[in]indicesIndices tensor info. Supported tensor rank: up to 4. Must be one of the following types: U32/S32. Each value must be in range [0, input.shape[axis])
[in]outputDestination tensor info. Data type supported: Same as input
[in]axis(Optional) The axis in input to gather indices from. Defaults to 0
Returns
a status

Definition at line 43 of file CLGather.cpp.

References CLGatherKernel::validate().

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

44 {
45  return CLGatherKernel::validate(input, indices, output, axis);
46 }
static Status validate(const ITensorInfo *input, const ITensorInfo *indices, const ITensorInfo *output, int axis=0)
Static function to check if given info will lead to a valid configuration of CLGatherKernel.

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