MCPcopy Create free account
hub / github.com/ARM-software/ComputeLibrary / prepare

Method prepare

src/core/NEON/kernels/NEStackLayerKernel.cpp:192–228  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

190}
191
192void NEStackLayerKernel::prepare()
193{
194 // Prepare calculates the window at runtime, in case there is padding being added after configure()
195 const ITensorInfo *input_info = _input[0]->info();
196 const int32_t num_dims = input_info->num_dimensions();
197 const int32_t num_tensors = _input.size();
198
199 // Check if there are any paddings in the input tensors
200 bool has_padding = false;
201 for (const ITensor *in : _input)
202 {
203 if (has_holes(*in->info(), num_dims - 1))
204 {
205 has_padding = true;
206 break;
207 }
208 }
209
210 has_padding = has_padding || has_holes(*_output->info(), num_dims);
211
212 Window win;
213 if (!has_padding)
214 {
215 _stack_fn = memcpy_stack;
216
217 // 2D execution window (X,Y): [Num_tensors, Dimensions >= axis]
218 win.set(Window::DimX, Window::Dimension(0, num_tensors, 1));
219 win.set(Window::DimY, Window::Dimension(0, input_info->tensor_shape().total_size_upper(_axis), 1));
220 }
221 else
222 {
223 _stack_fn = elementwise_stack;
224 win = calculate_max_window(*input_info);
225 }
226
227 INEKernel::configure(win);
228}
229
230void NEStackLayerKernel::run(const Window &window, const ThreadInfo &info)
231{

Callers

nothing calls this directly

Calls 8

has_holesFunction · 0.85
total_size_upperMethod · 0.80
DimensionClass · 0.50
calculate_max_windowFunction · 0.50
infoMethod · 0.45
num_dimensionsMethod · 0.45
sizeMethod · 0.45
setMethod · 0.45

Tested by

no test coverage detected