| 332 | } |
| 333 | |
| 334 | std::pair<int, int> scaled_dimensions_signed( |
| 335 | int width, int height, int kernel_width, int kernel_height, const PadStrideInfo &pad_stride_info) |
| 336 | { |
| 337 | const int pad_left = pad_stride_info.pad_left(); |
| 338 | const int pad_top = pad_stride_info.pad_top(); |
| 339 | const int pad_right = pad_stride_info.pad_right(); |
| 340 | const int pad_bottom = pad_stride_info.pad_bottom(); |
| 341 | const int stride_x = pad_stride_info.stride().first; |
| 342 | const int stride_y = pad_stride_info.stride().second; |
| 343 | int w = 0; |
| 344 | int h = 0; |
| 345 | switch (pad_stride_info.round()) |
| 346 | { |
| 347 | case DimensionRoundingType::FLOOR: |
| 348 | w = static_cast<int>( |
| 349 | std::floor((static_cast<float>(width + pad_left + pad_right - kernel_width) / stride_x) + 1)); |
| 350 | h = static_cast<int>( |
| 351 | std::floor((static_cast<float>(height + pad_top + pad_bottom - kernel_height) / stride_y) + 1)); |
| 352 | break; |
| 353 | case DimensionRoundingType::CEIL: |
| 354 | w = static_cast<int>( |
| 355 | std::ceil((static_cast<float>(width + pad_left + pad_right - kernel_width) / stride_x) + 1)); |
| 356 | h = static_cast<int>( |
| 357 | std::ceil((static_cast<float>(height + pad_top + pad_bottom - kernel_height) / stride_y) + 1)); |
| 358 | break; |
| 359 | default: |
| 360 | ARM_COMPUTE_ERROR("Unsupported rounding type"); |
| 361 | } |
| 362 | |
| 363 | return std::make_pair(static_cast<int>(w), static_cast<int>(h)); |
| 364 | } |
| 365 | |
| 366 | std::tuple<int, int, int> scaled_3d_dimensions_signed(int width, |
| 367 | int height, |
no test coverage detected