Compute Library
 19.08
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
[in]targetsA batch_size 1D tensor of class ids. Data types supported: S32
[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 31 of file CPPTopKV.cpp.

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

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

◆ 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
[in]targetsA batch_size 1D tensor info of class ids. Data types supported: S32
[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 38 of file CPPTopKV.cpp.

39 {
40  return CPPTopKVKernel::validate(predictions, targets, output, k);
41 }
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.

References CPPTopKVKernel::validate().


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