| 357 | } |
| 358 | |
| 359 | Status CpuPool2dKernel::validate(const ITensorInfo *src, |
| 360 | const ITensorInfo *dst, |
| 361 | const PoolingLayerInfo &pool_info, |
| 362 | const ITensorInfo *indices) |
| 363 | { |
| 364 | ARM_COMPUTE_TRACE_EVENT(ARM_COMPUTE_PROF_CAT_CPU, ARM_COMPUTE_PROF_LVL_CPU, "CpuPool2dKernel::validate"); |
| 365 | ARM_COMPUTE_RETURN_ERROR_ON_NULLPTR(src); |
| 366 | |
| 367 | unsigned int num_elems_processed_per_iteration = 0; |
| 368 | |
| 369 | const bool is_global_pooling = pool_info.is_global_pooling; |
| 370 | |
| 371 | // Get data layout |
| 372 | const auto data_layout = pool_info.data_layout == DataLayout::UNKNOWN ? src->data_layout() : pool_info.data_layout; |
| 373 | const int idx_width = get_data_layout_dimension_index(data_layout, DataLayoutDimension::WIDTH); |
| 374 | const int idx_height = get_data_layout_dimension_index(data_layout, DataLayoutDimension::HEIGHT); |
| 375 | |
| 376 | unsigned int pool_size_x = is_global_pooling ? src->dimension(idx_width) : pool_info.pool_size.width; |
| 377 | unsigned int pool_size_y = is_global_pooling ? src->dimension(idx_height) : pool_info.pool_size.height; |
| 378 | |
| 379 | ARM_COMPUTE_RETURN_ON_ERROR(validate_arguments(src, dst, pool_info, indices, Size2D(pool_size_x, pool_size_y))); |
| 380 | ARM_COMPUTE_RETURN_ON_ERROR(validate_and_configure_window(src->clone().get(), dst->clone().get(), |
| 381 | (indices) ? indices->clone().get() : nullptr, pool_info, |
| 382 | num_elems_processed_per_iteration, pool_size_x, |
| 383 | pool_size_y) |
| 384 | .first); |
| 385 | |
| 386 | return Status{}; |
| 387 | } |
| 388 | |
| 389 | void CpuPool2dKernel::run_op(ITensorPack &tensors, const Window &window, const ThreadInfo &info) |
| 390 | { |
nothing calls this directly
no test coverage detected