// // Copyright © 2017 Arm Ltd. All rights reserved. // See LICENSE file in the project root for full license information. // #pragma once #include "RefWorkloadUtils.hpp" #include "backends/WorkloadData.hpp" #include namespace armnn { template void Merger(const MergerQueueDescriptor& data) { const TensorInfo& outputInfo0 = GetTensorInfo(data.m_Outputs[0]); for (unsigned int index = 0 ; index < outputInfo0.GetNumElements(); ++index) { unsigned int indices[MaxNumOfTensorDimensions]; unsigned int indexRemainder = index; unsigned int dimensionStride = outputInfo0.GetNumElements(); for (unsigned int i=0; i= view.m_Origin[i] + inputInfo.GetShape()[i]) { insideView = false; } } if (insideView) { unsigned int inIndex = 0; unsigned int dimensionStride = 1; for (unsigned int i = inputInfo.GetNumDimensions(); i-- > 0;) { inIndex += dimensionStride * (indices[i] - view.m_Origin[i]); dimensionStride *= inputInfo.GetShape()[i]; } //we are within the view, copy input data to the output corresponding to this view (GetOutputTensorData(0, data))[index] = (GetInputTensorData(viewIdx, data))[inIndex]; //what should we do if input views overlap on the output tensor? //we could error, take the average, or shm else... //for now just stop after finding first view (input) that matches. break; } } } } } //namespace armnn