| 122 | } //namespace |
| 123 | |
| 124 | void CpuPool3dKernel::configure(const ITensorInfo *src, ITensorInfo *dst, const Pooling3dLayerInfo &pool_info) |
| 125 | { |
| 126 | ARM_COMPUTE_TRACE_EVENT(ARM_COMPUTE_PROF_CAT_CPU, ARM_COMPUTE_PROF_LVL_CPU, "CpuPool3dKernel::configure"); |
| 127 | ARM_COMPUTE_ERROR_ON_NULLPTR(src, dst); |
| 128 | |
| 129 | // Perform validation step |
| 130 | ARM_COMPUTE_ERROR_THROW_ON(validate_arguments(src, dst, pool_info)); |
| 131 | |
| 132 | // dst auto inizialitation if not yet initialized |
| 133 | auto_init_if_empty(*dst, src->clone()->set_tensor_shape(compute_pool3d_shape(src->tensor_shape(), pool_info))); |
| 134 | |
| 135 | // Get data layout |
| 136 | const auto data_layout = src->data_layout(); |
| 137 | const int idx_width = get_data_layout_dimension_index(data_layout, DataLayoutDimension::WIDTH); |
| 138 | const int idx_height = get_data_layout_dimension_index(data_layout, DataLayoutDimension::HEIGHT); |
| 139 | const int idx_depth = get_data_layout_dimension_index(data_layout, DataLayoutDimension::DEPTH); |
| 140 | |
| 141 | // Update pool size in case of global pooling |
| 142 | const bool is_global_pooling = pool_info.is_global_pooling; |
| 143 | const Size3D pool_size(is_global_pooling ? src->dimension(idx_width) : pool_info.pool_size.width, |
| 144 | is_global_pooling ? src->dimension(idx_height) : pool_info.pool_size.height, |
| 145 | is_global_pooling ? src->dimension(idx_depth) : pool_info.pool_size.depth); |
| 146 | |
| 147 | const auto *uk = |
| 148 | CpuPool3dKernel::get_implementation(DataTypeISASelectorData{src->data_type(), CPUInfo::get().get_isa()}); |
| 149 | ARM_COMPUTE_ERROR_ON(uk == nullptr); |
| 150 | |
| 151 | // Set instance variables |
| 152 | _pool_info = pool_info; |
| 153 | _run_method = uk->ukernel; |
| 154 | _name = std::string("CpuPool3dKernel").append("/").append(uk->name); |
| 155 | |
| 156 | // Configure kernel window |
| 157 | Window win = calculate_max_window(*dst, Steps()); |
| 158 | ICpuKernel::configure(win); |
| 159 | } |
| 160 | |
| 161 | Status CpuPool3dKernel::validate(const ITensorInfo *src, const ITensorInfo *dst, const Pooling3dLayerInfo &pool_info) |
| 162 | { |
nothing calls this directly
no test coverage detected