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

Method run

src/core/CL/kernels/CLArgMinMaxLayerKernel.cpp:175–260  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

173}
174
175void CLArgMinMaxLayerKernel::run(const Window &window, cl::CommandQueue &queue)
176{
177 ARM_COMPUTE_ERROR_ON_UNCONFIGURED_KERNEL(this);
178 ARM_COMPUTE_ERROR_ON_INVALID_SUBWINDOW(IKernel::window(), window);
179
180 switch (_reduction_axis)
181 {
182 case 0:
183 {
184 // Set out window
185 Window out_window(window);
186 Window in_window(window);
187 out_window.set(Window::DimX, Window::Dimension(0, 0, 0));
188 in_window.set(Window::DimX,
189 Window::Dimension(0, _input->info()->dimension(0), _input->info()->dimension(0)));
190 in_window.set(Window::DimY, Window::Dimension(0, _input->info()->dimension(1), 1u));
191
192 // Get first input and output slices
193 Window in_slice = in_window.first_slice_window_2D();
194 Window out_slice = out_window.first_slice_window_2D();
195 do
196 {
197 unsigned int idx = 0;
198 add_2D_tensor_argument(idx, _input, in_slice);
199 add_2D_tensor_argument(idx, _output, out_slice);
200 enqueue(queue, *this, in_slice, lws_hint());
201 } while (in_window.slide_window_slice_2D(in_slice) && out_window.slide_window_slice_2D(out_slice));
202 }
203 break;
204 case 1:
205 {
206 // Get first input and output slices
207 Window window_in{window};
208 window_in.set(Window::DimY,
209 Window::Dimension(0, _input->info()->dimension(1), _input->info()->dimension(1)));
210 Window in_slice = window_in.first_slice_window_2D();
211 Window out_slice = window.first_slice_window_2D();
212
213 do
214 {
215 unsigned int idx = 0;
216 add_2D_tensor_argument(idx, _input, in_slice);
217 add_2D_tensor_argument(idx, _output, out_slice);
218 enqueue(queue, *this, in_slice, lws_hint());
219 } while (window_in.slide_window_slice_2D(in_slice) && window.slide_window_slice_2D(out_slice));
220 }
221 break;
222 case 2:
223 {
224 // Get first input and output slices
225 Window window_in{window};
226 window_in.set(Window::DimZ,
227 Window::Dimension(0, _input->info()->dimension(2), _input->info()->dimension(2)));
228 Window in_slice = window_in.first_slice_window_3D();
229 Window out_slice = window.first_slice_window_3D();
230
231 do
232 {

Callers

nothing calls this directly

Calls 10

first_slice_window_2DMethod · 0.80
slide_window_slice_2DMethod · 0.80
first_slice_window_3DMethod · 0.80
slide_window_slice_3DMethod · 0.80
first_slice_window_4DMethod · 0.80
slide_window_slice_4DMethod · 0.80
DimensionClass · 0.50
setMethod · 0.45
dimensionMethod · 0.45
infoMethod · 0.45

Tested by

no test coverage detected