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

Method validate

src/cpu/kernels/CpuPool2dKernel.cpp:359–387  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

357}
358
359Status 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
389void CpuPool2dKernel::run_op(ITensorPack &tensors, const Window &window, const ThreadInfo &info)
390{

Callers

nothing calls this directly

Calls 7

Size2DClass · 0.85
validate_argumentsFunction · 0.70
data_layoutMethod · 0.45
dimensionMethod · 0.45
getMethod · 0.45
cloneMethod · 0.45

Tested by

no test coverage detected