Lines Matching refs:max_pooling_op
66 xnn_operator_t max_pooling_op = NULL; in create_max_pooling2d_nhwc() local
154 max_pooling_op = xnn_allocate_zero_simd_memory(sizeof(struct xnn_operator)); in create_max_pooling2d_nhwc()
155 if (max_pooling_op == NULL) { in create_max_pooling2d_nhwc()
162 max_pooling_op->padding_top = input_padding_top; in create_max_pooling2d_nhwc()
163 max_pooling_op->padding_right = input_padding_right; in create_max_pooling2d_nhwc()
164 max_pooling_op->padding_bottom = input_padding_bottom; in create_max_pooling2d_nhwc()
165 max_pooling_op->padding_left = input_padding_left; in create_max_pooling2d_nhwc()
167 max_pooling_op->kernel_height = pooling_height; in create_max_pooling2d_nhwc()
168 max_pooling_op->kernel_width = pooling_width; in create_max_pooling2d_nhwc()
169 max_pooling_op->stride_height = stride_height; in create_max_pooling2d_nhwc()
170 max_pooling_op->stride_width = stride_width; in create_max_pooling2d_nhwc()
171 max_pooling_op->dilation_height = dilation_height; in create_max_pooling2d_nhwc()
172 max_pooling_op->dilation_width = dilation_width; in create_max_pooling2d_nhwc()
173 max_pooling_op->channels = channels; in create_max_pooling2d_nhwc()
174 max_pooling_op->input_pixel_stride = input_pixel_stride; in create_max_pooling2d_nhwc()
175 max_pooling_op->output_pixel_stride = output_pixel_stride; in create_max_pooling2d_nhwc()
177 memcpy(&max_pooling_op->params, params, params_size); in create_max_pooling2d_nhwc()
178 max_pooling_op->type = operator_type; in create_max_pooling2d_nhwc()
179 max_pooling_op->flags = flags; in create_max_pooling2d_nhwc()
181 max_pooling_op->state = xnn_run_state_invalid; in create_max_pooling2d_nhwc()
183 *max_pooling_op_out = max_pooling_op; in create_max_pooling2d_nhwc()
187 xnn_delete_operator(max_pooling_op); in create_max_pooling2d_nhwc()
192 xnn_operator_t max_pooling_op, in setup_max_pooling2d_nhwc() argument
205 max_pooling_op->state = xnn_run_state_invalid; in setup_max_pooling2d_nhwc()
210 xnn_operator_type_to_string(max_pooling_op->type)); in setup_max_pooling2d_nhwc()
217 xnn_operator_type_to_string(max_pooling_op->type), input_width, input_height); in setup_max_pooling2d_nhwc()
222 max_pooling_op->state = xnn_run_state_skip; in setup_max_pooling2d_nhwc()
226 max_pooling_op->input_height = input_height; in setup_max_pooling2d_nhwc()
227 max_pooling_op->input_width = input_width; in setup_max_pooling2d_nhwc()
228 max_pooling_op->input = input; in setup_max_pooling2d_nhwc()
230 if (max_pooling_op->flags & XNN_FLAG_TENSORFLOW_SAME_PADDING) { in setup_max_pooling2d_nhwc()
231 max_pooling_op->output_height = compute_output_dimension_with_tf_same_padding( in setup_max_pooling2d_nhwc()
232 input_height, max_pooling_op->stride_height); in setup_max_pooling2d_nhwc()
233 max_pooling_op->output_width = compute_output_dimension_with_tf_same_padding( in setup_max_pooling2d_nhwc()
234 input_width, max_pooling_op->stride_width); in setup_max_pooling2d_nhwc()
236 …const uint32_t effective_kernel_height = (max_pooling_op->kernel_height - 1) * max_pooling_op->dil… in setup_max_pooling2d_nhwc()
237 …const uint32_t effective_kernel_width = (max_pooling_op->kernel_width - 1) * max_pooling_op->dilat… in setup_max_pooling2d_nhwc()
239 …doz((max_pooling_op->output_height - 1) * max_pooling_op->stride_height + effective_kernel_height,… in setup_max_pooling2d_nhwc()
241 …doz((max_pooling_op->output_width - 1) * max_pooling_op->stride_width + effective_kernel_width, in… in setup_max_pooling2d_nhwc()
242 max_pooling_op->padding_top = total_padding_height / 2; in setup_max_pooling2d_nhwc()
243 max_pooling_op->padding_left = total_padding_width / 2; in setup_max_pooling2d_nhwc()
244 max_pooling_op->padding_bottom = total_padding_height - max_pooling_op->padding_top; in setup_max_pooling2d_nhwc()
245 max_pooling_op->padding_right = total_padding_width - max_pooling_op->padding_left; in setup_max_pooling2d_nhwc()
247 max_pooling_op->output_height = compute_output_dimension( in setup_max_pooling2d_nhwc()
248 max_pooling_op->padding_top + input_height + max_pooling_op->padding_bottom, in setup_max_pooling2d_nhwc()
249 max_pooling_op->kernel_height, in setup_max_pooling2d_nhwc()
250 max_pooling_op->dilation_height, in setup_max_pooling2d_nhwc()
251 max_pooling_op->stride_height); in setup_max_pooling2d_nhwc()
252 max_pooling_op->output_width = compute_output_dimension( in setup_max_pooling2d_nhwc()
253 max_pooling_op->padding_left + input_width + max_pooling_op->padding_right, in setup_max_pooling2d_nhwc()
254 max_pooling_op->kernel_width, in setup_max_pooling2d_nhwc()
255 max_pooling_op->dilation_width, in setup_max_pooling2d_nhwc()
256 max_pooling_op->stride_width); in setup_max_pooling2d_nhwc()
259 const size_t pooling_height = max_pooling_op->kernel_height; in setup_max_pooling2d_nhwc()
260 const size_t pooling_width = max_pooling_op->kernel_width; in setup_max_pooling2d_nhwc()
262 const size_t output_height = max_pooling_op->output_height; in setup_max_pooling2d_nhwc()
263 const size_t output_width = max_pooling_op->output_width; in setup_max_pooling2d_nhwc()
267 …max_pooling_op->dilation_width > 1 ? pooling_width : min(max_pooling_op->stride_width, pooling_wid… in setup_max_pooling2d_nhwc()
270 if (input_height != max_pooling_op->last_input_height || in setup_max_pooling2d_nhwc()
271 input_width != max_pooling_op->last_input_width) in setup_max_pooling2d_nhwc()
276 … (const void**) xnn_reallocate_memory(max_pooling_op->indirection_buffer, indirection_buffer_size); in setup_max_pooling2d_nhwc()
281 max_pooling_op->indirection_buffer = indirection_buffer; in setup_max_pooling2d_nhwc()
283 … xnn_indirection_init_maxpool2d(max_pooling_op, step_height, step_width, log2_input_element_size); in setup_max_pooling2d_nhwc()
285 max_pooling_op->last_input = input; in setup_max_pooling2d_nhwc()
286 max_pooling_op->last_input_height = input_height; in setup_max_pooling2d_nhwc()
287 max_pooling_op->last_input_width = input_width; in setup_max_pooling2d_nhwc()
291 const size_t channels = max_pooling_op->channels; in setup_max_pooling2d_nhwc()
294 …const size_t output_width_stride = max_pooling_op->output_pixel_stride << log2_output_element_size; in setup_max_pooling2d_nhwc()
298 max_pooling_op->context.max_pooling = (struct max_pooling_context) { in setup_max_pooling2d_nhwc()
299 .indirect_input = max_pooling_op->indirection_buffer, in setup_max_pooling2d_nhwc()
301 .input_offset = (size_t) ((uintptr_t) input - (uintptr_t) max_pooling_op->last_input), in setup_max_pooling2d_nhwc()
302 ….input_batch_stride = (input_height * input_width * max_pooling_op->input_pixel_stride) << log2_in… in setup_max_pooling2d_nhwc()
313 memcpy(&max_pooling_op->context.max_pooling.params, params, params_size); in setup_max_pooling2d_nhwc()
315 max_pooling_op->compute.type = xnn_parallelization_type_2d; in setup_max_pooling2d_nhwc()
316 max_pooling_op->compute.task_2d = (pthreadpool_task_2d_t) xnn_compute_max_pooling; in setup_max_pooling2d_nhwc()
317 max_pooling_op->compute.range[0] = batch_size; in setup_max_pooling2d_nhwc()
318 max_pooling_op->compute.range[1] = output_height; in setup_max_pooling2d_nhwc()
319 max_pooling_op->state = xnn_run_state_ready; in setup_max_pooling2d_nhwc()
417 xnn_operator_t max_pooling_op, in xnn_setup_max_pooling2d_nhwc_u8() argument
425 if (max_pooling_op->type != xnn_operator_type_max_pooling_nhwc_u8) { in xnn_setup_max_pooling2d_nhwc_u8()
428 xnn_operator_type_to_string(max_pooling_op->type)); in xnn_setup_max_pooling2d_nhwc_u8()
433 max_pooling_op, in xnn_setup_max_pooling2d_nhwc_u8()
439 &max_pooling_op->params.u8_minmax, sizeof(max_pooling_op->params.u8_minmax), in xnn_setup_max_pooling2d_nhwc_u8()
444 xnn_operator_t max_pooling_op, in xnn_setup_max_pooling2d_nhwc_f32() argument
452 if (max_pooling_op->type != xnn_operator_type_max_pooling_nhwc_f32) { in xnn_setup_max_pooling2d_nhwc_f32()
455 xnn_operator_type_to_string(max_pooling_op->type)); in xnn_setup_max_pooling2d_nhwc_f32()
460 max_pooling_op, in xnn_setup_max_pooling2d_nhwc_f32()
466 &max_pooling_op->params.f32_minmax, sizeof(max_pooling_op->params.f32_minmax), in xnn_setup_max_pooling2d_nhwc_f32()