47 const unsigned int width =
src.shape()[0];
48 const unsigned int height =
src.shape()[1];
49 const unsigned int depth =
src.shape()[2];
52 const int rank =
src.shape().num_dimensions();
54 std::array<bool, 4> to_reverse = { {
false,
false,
false,
false } };
60 if((axis_i < -rank) || (axis_i >= rank))
62 ARM_COMPUTE_ERROR(
"the values of the axis tensor must be within [-rank, rank-1].");
68 axis_i = rank + axis_i;
74 axis_i = (rank - 1) - axis_i;
77 to_reverse[axis_i] =
true;
80 const uint32_t num_elements =
src.num_elements();
83 #pragma omp parallel for
85 for(uint32_t i = 0; i < num_elements; ++i)
88 const unsigned int dst_x = to_reverse[0] ? width - src_coord[0] - 1 : src_coord[0];
89 const unsigned int dst_y = to_reverse[1] ? height - src_coord[1] - 1 : src_coord[1];
90 const unsigned int dst_z = to_reverse[2] ? depth - src_coord[2] - 1 : src_coord[2];
91 const unsigned int dst_w = to_reverse[3] ?
batches - src_coord[3] - 1 : src_coord[3];