Compute Library
 21.02
CPPTopKV Class Reference

Basic function to run CPPTopKVKernel. More...

#include <CPPTopKV.h>

Collaboration diagram for CPPTopKV:
[legend]

Public Member Functions

void configure (const ITensor *predictions, const ITensor *targets, ITensor *output, const unsigned int k)
 Set the input and output of the kernel. More...
 
- Public Member Functions inherited from ICPPSimpleFunction
 ICPPSimpleFunction ()
 Constructor. 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 *predictions, const ITensorInfo *targets, ITensorInfo *output, const unsigned int k)
 Static function to check if given info will lead to a valid configuration of CPPTopKVKernel. More...
 

Detailed Description

Basic function to run CPPTopKVKernel.

Definition at line 36 of file CPPTopKV.h.

Member Function Documentation

◆ configure()

void configure ( const ITensor predictions,
const ITensor targets,
ITensor output,
const unsigned int  k 
)

Set the input and output of the kernel.

Parameters
[in]predictionsA batch_size x classes tensor. Data types supported: F16/S32/F32/QASYMM8/QASYMM8_SIGNED
[in]targetsA batch_size 1D tensor of class ids. Data types supported: U32
[out]outputComputed precision at k as a bool 1D tensor. Data types supported: U8
[in]kNumber of top elements to look at for computing precision.

Definition at line 30 of file CPPTopKV.cpp.

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

31 {
32  auto kernel = std::make_unique<CPPTopKVKernel>();
33  kernel->configure(predictions, targets, output, k);
34  _kernel = std::move(kernel);
35 }

◆ validate()

Status validate ( const ITensorInfo predictions,
const ITensorInfo targets,
ITensorInfo output,
const unsigned int  k 
)
static

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

Parameters
[in]predictionsA batch_size x classes tensor info. Data types supported: F16/S32/F32/QASYMM8/QASYMM8_SIGNED
[in]targetsA batch_size 1D tensor info of class ids. Data types supported: U32
[in]outputComputed precision at k as a bool 1D tensor info. Data types supported: U8
[in]kNumber of top elements to look at for computing precision.
Returns
a status

Definition at line 37 of file CPPTopKV.cpp.

References CPPTopKVKernel::validate().

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

38 {
39  return CPPTopKVKernel::validate(predictions, targets, output, k);
40 }
static Status validate(const ITensorInfo *predictions, const ITensorInfo *targets, ITensorInfo *output, const unsigned int k)
Static function to check if given info will lead to a valid configuration of CPPTopKVKernel.

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