aboutsummaryrefslogtreecommitdiff
path: root/tests/validation/Helpers.h
diff options
context:
space:
mode:
authorGeorgios Pinitas <georgios.pinitas@arm.com>2017-07-05 17:02:25 +0100
committerAnthony Barbier <anthony.barbier@arm.com>2018-09-17 14:15:39 +0100
commitac4e873dad6aa6291fc36aff62047a896db04f6a (patch)
tree2c5397c6c04b97cedb88ff809f5d40cbe7dc79c9 /tests/validation/Helpers.h
parentdf24618b53cffed1c574e11e9fd4ba7740f8c009 (diff)
downloadComputeLibrary-ac4e873dad6aa6291fc36aff62047a896db04f6a.tar.gz
COMPMID-417: Port DepthConcatenate to QS8/QS16 for NEON/CL.
Change-Id: I3dddae63043c7aa18d908a4fc8abacf3c64f98ca Reviewed-on: http://mpd-gerrit.cambridge.arm.com/80081 Tested-by: Kaizen <jeremy.johnson+kaizengerrit@arm.com> Reviewed-by: Steven Niu <steven.niu@arm.com>
Diffstat (limited to 'tests/validation/Helpers.h')
-rw-r--r--tests/validation/Helpers.h28
1 files changed, 28 insertions, 0 deletions
diff --git a/tests/validation/Helpers.h b/tests/validation/Helpers.h
index a551da731e..cae1976bd6 100644
--- a/tests/validation/Helpers.h
+++ b/tests/validation/Helpers.h
@@ -172,6 +172,34 @@ inline void fill_mask_from_pattern(uint8_t *mask, int cols, int rows, MatrixPatt
}
}
+/** Calculate output tensor shape give a vector of input tensor to concatenate
+ *
+ * @param[in] input_shapes Shapes of the tensors to concatenate across depth.
+ *
+ * @return The shape of output concatenated tensor.
+ */
+inline TensorShape calculate_depth_concatenate_shape(std::vector<TensorShape> input_shapes)
+{
+ TensorShape out_shape = input_shapes.at(0);
+
+ unsigned int max_x = 0;
+ unsigned int max_y = 0;
+ unsigned int depth = 0;
+
+ for(auto const &shape : input_shapes)
+ {
+ max_x = std::max<unsigned int>(shape.x(), max_x);
+ max_y = std::max<unsigned int>(shape.y(), max_y);
+ depth += shape.z();
+ }
+
+ out_shape.set(0, max_x);
+ out_shape.set(1, max_y);
+ out_shape.set(2, depth);
+
+ return out_shape;
+}
+
/** Create a vector of random ROIs.
*
* @param[in] shape The shape of the input tensor.