| 130 | } |
| 131 | |
| 132 | void NECropResize::run() |
| 133 | { |
| 134 | ARM_COMPUTE_TRACE_EVENT(ARM_COMPUTE_PROF_CAT_CPU, ARM_COMPUTE_PROF_LVL_CPU, "NECropResize::run"); |
| 135 | ARM_COMPUTE_ERROR_ON_MSG(_output == nullptr, "Unconfigured function"); |
| 136 | |
| 137 | for (unsigned int i = 0; i < _num_boxes; ++i) |
| 138 | { |
| 139 | // Size of the crop box in _boxes and thus the shape of _crop_results[i] |
| 140 | // may not be known until run-time and so the kernels cannot be configured until then. |
| 141 | _crop[i]->configure_output_shape(); |
| 142 | _crop_results[i]->allocator()->allocate(); |
| 143 | NEScheduler::get().schedule(_crop[i].get(), Window::DimZ); |
| 144 | |
| 145 | // Scale the cropped image. |
| 146 | _scale[i]->configure(_crop_results[i].get(), _scaled_results[i].get(), |
| 147 | ScaleKernelInfo{_method, BorderMode::CONSTANT, PixelValue(_extrapolation_value), |
| 148 | SamplingPolicy::TOP_LEFT, false}); |
| 149 | _scaled_results[i]->allocator()->allocate(); |
| 150 | _scale[i]->run(); |
| 151 | |
| 152 | // Copy scaled image into output. |
| 153 | std::copy_n(_scaled_results[i]->buffer(), _scaled_results[i]->info()->total_size(), |
| 154 | _output->ptr_to_element(Coordinates(0, 0, 0, i))); |
| 155 | } |
| 156 | } |
| 157 | } // namespace arm_compute |
nothing calls this directly
no test coverage detected