| 196 | |
| 197 | template <typename T> |
| 198 | void transpose_matrix(const SimpleTensor<T> &in, SimpleTensor<T> &out) |
| 199 | { |
| 200 | ARM_COMPUTE_ERROR_ON((in.shape()[0] != out.shape()[1]) || (in.shape()[1] != out.shape()[0])); |
| 201 | |
| 202 | const int width = in.shape()[0]; |
| 203 | const int height = in.shape()[1]; |
| 204 | |
| 205 | #if defined(_OPENMP) |
| 206 | #pragma omp parallel for collapse(2) |
| 207 | #endif /* _OPENMP */ |
| 208 | for (int y = 0; y < height; ++y) |
| 209 | { |
| 210 | for (int x = 0; x < width; ++x) |
| 211 | { |
| 212 | const T val = in[x + y * width]; |
| 213 | |
| 214 | out[x * height + y] = val; |
| 215 | } |
| 216 | } |
| 217 | } |
| 218 | |
| 219 | template <typename T> |
| 220 | void get_tile(const SimpleTensor<T> &in, SimpleTensor<T> &tile, const Coordinates &coord) |