24.02
|
Go to the documentation of this file.
8 #include <arm_compute/runtime/NEON/functions/NECast.h>
16 static constexpr arm_compute::ConvertPolicy g_AclConvertPolicy = arm_compute::ConvertPolicy::SATURATE;
37 arm_compute::ITensor& input = PolymorphicDowncast<IAclTensorHandle*>(
m_Data.
m_Inputs[0])->GetTensor();
38 arm_compute::ITensor& output = PolymorphicDowncast<IAclTensorHandle*>(
m_Data.
m_Outputs[0])->GetTensor();
40 if (arm_compute::NECast::validate(input.info(), output.info(), g_AclConvertPolicy))
43 m_Cast.reset(
new arm_compute::NECast);
44 m_Cast->configure(&input, &output, g_AclConvertPolicy);
65 auto convertFunc = [](uint8_t* dst,
const uint8_t* src,
size_t size)
67 auto input =
reinterpret_cast<const float*
>(src);
68 auto output =
reinterpret_cast<Half*
>(dst);
69 size_t numElements = size/2;
73 for (
const auto& pair : m_TensorHandlePairs)
113 void NeonConvertFp32ToFp16Workload::Reconfigure()
void ReplaceOutputTensorHandle(ITensorHandle *tensorHandle, unsigned int slot) override
arm_compute::Status NeonConvertFp32ToFp16WorkloadValidate(const TensorInfo &input, const TensorInfo &output)
NeonConvertFp32ToFp16Workload(const ConvertFp32ToFp16QueueDescriptor &descriptor, const WorkloadInfo &info)
void ReplaceInputTensorHandle(ITensorHandle *tensorHandle, unsigned int slot) override
void ValidateInputsOutputs(const std::string &descName, unsigned int numExpectedIn, unsigned int numExpectedOut) const
virtual void Execute() const override
Contains information about TensorInfos of a layer.
void GatherTensorHandlePairs(const DescriptorType &descriptor, std::vector< std::pair< SrcTensorHandleType *, DstTensorHandleType * >> &tensorHandlePairs)
void CopyTensorContentsGeneric(const ITensorHandle *srcTensor, ITensorHandle *dstTensor, CopyFunc copy)
std::vector< ITensorHandle * > m_Outputs
static void ConvertFloat32To16(const float *srcFloat32Buffer, size_t numElements, void *dstFloat16Buffer)
Converts a buffer of FP32 values to FP16, and stores in the given dstFloat16Buffer.
void IgnoreUnused(Ts &&...)
Copyright (c) 2021 ARM Limited and Contributors.
#define ARMNN_SCOPED_PROFILING_EVENT_NEON_NAME_GUID(label)
Creates a profiling event that uses GetGuid() and GetName() from the calling class.
std::vector< ITensorHandle * > m_Inputs