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

Function GetExecutor

src/backends/reference/workloads/Pooling3d.cpp:80–108  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

78 using Executor = std::function<void(float & accumulated, float kernelSize)>;
79
80 Executor GetExecutor(PoolingAlgorithm algorithm)
81 {
82 switch (algorithm)
83 {
84 case PoolingAlgorithm::Max:
85 {
86 return [](float & /*accumulated*/, float /*kernelSize*/) {};
87 }
88
89 case PoolingAlgorithm::Average:
90 {
91 return [](float & accumulated, float kernelSize) {
92 accumulated /= kernelSize;
93 };
94 }
95
96 case PoolingAlgorithm::L2:
97 {
98 return [](float & accumulated, float kernelSize) {
99 accumulated = sqrtf(accumulated / kernelSize);
100 };
101 }
102
103 default:
104 {
105 throw armnn::InvalidArgumentException("Unsupported pooling algorithm");
106 }
107 }
108 }
109
110 bool OnPaddingOnly(int start, int end, int maxRange)
111 {

Callers 1

Pooling3dFunction · 0.70

Calls 1

Tested by

no test coverage detected