| 99 | } |
| 100 | |
| 101 | inline std::tuple<int64_t, int64_t, int64_t> CalcPadCopyExtents(int64_t anchor, |
| 102 | int64_t in_extent, |
| 103 | int64_t out_extent) { |
| 104 | int64_t pad_before = std::min(out_extent, std::max<int64_t>(0, -anchor)); |
| 105 | int64_t to_copy = std::max<int64_t>( |
| 106 | 0, std::min(in_extent - std::max<int64_t>(0, anchor), out_extent - pad_before)); |
| 107 | int64_t pad_after = out_extent - pad_before - to_copy; |
| 108 | return std::tuple<int64_t, int64_t, int64_t>{pad_before, to_copy, pad_after}; |
| 109 | } |
| 110 | |
| 111 | |
| 112 | template <typename OutputType, typename InputType, int Dims> |
no test coverage detected