MCPcopy Create free account
hub / github.com/ARM-software/armnn / NextIndex

Function NextIndex

src/backends/reference/workloads/Reduce.cpp:19–38  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

17{
18
19bool NextIndex(const unsigned int numDims, const armnn::TensorShape& dims, std::vector<unsigned int>& current)
20{
21 unsigned int carry = 1;
22
23 for (unsigned int idx = numDims; idx-- > 0; )
24 {
25 unsigned int current_val = current[idx] + carry;
26 if (dims[idx] == current_val)
27 {
28 current[idx] = 0;
29 }
30 else
31 {
32 current[idx] = current_val;
33 carry = 0;
34 break;
35 }
36 }
37 return (carry == 0);
38}
39
40unsigned int ReducedOutputOffset(const unsigned int numDims,
41 const armnn::TensorShape& dims,

Callers 1

ReduceFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected