aboutsummaryrefslogtreecommitdiff
path: root/src/backends/reference/workloads/RefResizeBilinearUint8Workload.cpp
blob: 67ab039ef3bc8082caef9b17d9e03509d4ec04de (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
//
// Copyright © 2017 Arm Ltd. All rights reserved.
// SPDX-License-Identifier: MIT
//

#include "RefResizeBilinearUint8Workload.hpp"

#include "RefWorkloadUtils.hpp"
#include "ResizeBilinear.hpp"

#include "Profiling.hpp"

#include <vector>

namespace armnn
{

void RefResizeBilinearUint8Workload::Execute() const
{
    ARMNN_SCOPED_PROFILING_EVENT(Compute::CpuRef, "RefResizeBilinearUint8Workload_Execute");

    const TensorInfo& inputInfo = GetTensorInfo(m_Data.m_Inputs[0]);
    const TensorInfo& outputInfo = GetTensorInfo(m_Data.m_Outputs[0]);

    auto dequant = Dequantize(GetInputTensorDataU8(0, m_Data), inputInfo);

    std::vector<float> results(outputInfo.GetNumElements());
    ResizeBilinear(dequant.data(), inputInfo, results.data(), outputInfo);

    Quantize(GetOutputTensorDataU8(0, m_Data), results.data(), outputInfo);
}

} //namespace armnn