ArmNN
 22.08
armnn::ethosnref Namespace Reference

Functions

const TensorInfoGetTensorInfo (const ITensorHandle *tensorHandle)
 
template<typename DataType , typename PayloadType >
const DataTypeGetInputTensorData (unsigned int idx, const PayloadType &data)
 
template<typename DataType , typename PayloadType >
DataTypeGetOutputTensorData (unsigned int idx, const PayloadType &data)
 
uint32_t DivideRoundUp (uint32_t numerator, uint32_t denominator)
 
bool CheckDataType (DataType type, DataType inputType, DataType weightsType)
 

Function Documentation

◆ CheckDataType()

bool armnn::ethosnref::CheckDataType ( DataType  type,
DataType  inputType,
DataType  weightsType 
)
inline

Definition at line 56 of file EthosnRefWorkloadUtils.hpp.

Referenced by EthosnRefDepthwiseConvolution2dWorkload::Execute(), EthosnRefTransposeConvolution2dWorkload::Execute(), and EthosnRefConvolution2dWorkload::Execute().

57 {
58  return (inputType == type || weightsType == type);
59 }

◆ DivideRoundUp()

uint32_t armnn::ethosnref::DivideRoundUp ( uint32_t  numerator,
uint32_t  denominator 
)
inline

Definition at line 51 of file EthosnRefWorkloadUtils.hpp.

Referenced by EthosnRefConvolution2dWorkload::Execute().

52 {
53  return (numerator + denominator - 1) / denominator;
54 }

◆ GetInputTensorData()

const DataType* armnn::ethosnref::GetInputTensorData ( unsigned int  idx,
const PayloadType &  data 
)

Definition at line 38 of file EthosnRefWorkloadUtils.hpp.

References ITensorHandle::Map().

39 {
40  const ITensorHandle* tensorHandle = data.m_Inputs[idx];
41  return reinterpret_cast<const DataType*>(tensorHandle->Map());
42 }
DataType
Definition: Types.hpp:48

◆ GetOutputTensorData()

DataType* armnn::ethosnref::GetOutputTensorData ( unsigned int  idx,
const PayloadType &  data 
)

Definition at line 45 of file EthosnRefWorkloadUtils.hpp.

References ITensorHandle::Map().

46 {
47  ITensorHandle* tensorHandle = data.m_Outputs[idx];
48  return reinterpret_cast<DataType*>(tensorHandle->Map());
49 }
DataType
Definition: Types.hpp:48

◆ GetTensorInfo()

const TensorInfo& armnn::ethosnref::GetTensorInfo ( const ITensorHandle tensorHandle)
inline

Definition at line 29 of file EthosnRefWorkloadUtils.hpp.

References EthosnRefTensorHandle::GetTensorInfo().

Referenced by armnn::EthosnRefPooling2d(), and EthosnRefPooling2dWorkload::Execute().

30 {
31  // We know that ethosn workloads use EthosnRefTensorHandles for inputs and outputs
32  const EthosnRefTensorHandle* refTensorHandle =
33  PolymorphicDowncast<const EthosnRefTensorHandle*>(tensorHandle);
34  return refTensorHandle->GetTensorInfo();
35 }