| 114 | } |
| 115 | |
| 116 | void memcpy_stack(const std::vector<ITensor *> &input, ITensor *output, uint32_t axis, const Window &window) |
| 117 | { |
| 118 | const int32_t element_size = input[0]->info()->element_size(); |
| 119 | const int32_t chunk_size = input[0]->info()->tensor_shape().total_size_lower(axis) * element_size; |
| 120 | const int32_t num_tensors = input.size(); |
| 121 | const int32_t out_chunk_step = chunk_size * num_tensors; |
| 122 | |
| 123 | const int32_t start_x = window.x().start(); |
| 124 | const int32_t end_x = window.x().end(); |
| 125 | const int32_t start_y = window.y().start(); |
| 126 | const int32_t end_y = window.y().end(); |
| 127 | |
| 128 | uint8_t *out_ptr_base = output->buffer() + output->info()->offset_first_element_in_bytes() + start_x * chunk_size; |
| 129 | |
| 130 | for (int32_t x = start_x; x < end_x; ++x) |
| 131 | { |
| 132 | const uint8_t *in_ptr = |
| 133 | input[x]->buffer() + input[x]->info()->offset_first_element_in_bytes() + start_y * chunk_size; |
| 134 | uint8_t *out_ptr = out_ptr_base + start_y * out_chunk_step; |
| 135 | |
| 136 | for (int32_t y = start_y; y < end_y; ++y) |
| 137 | { |
| 138 | std::memcpy(out_ptr, in_ptr, chunk_size); |
| 139 | |
| 140 | in_ptr += chunk_size; |
| 141 | out_ptr += out_chunk_step; |
| 142 | } |
| 143 | |
| 144 | out_ptr_base += chunk_size; |
| 145 | } |
| 146 | } |
| 147 | |
| 148 | } // namespace |
| 149 |
nothing calls this directly
no test coverage detected