From 2c350181118ec9eca864432c5bd78a0cfc3ebc32 Mon Sep 17 00:00:00 2001 From: Ioan-Cristian Szabo Date: Wed, 20 Dec 2017 16:27:37 +0000 Subject: COMPMID-761: Add CL/NEON Magnitude benchmark tests Change-Id: I9ed3718679d4bc96300a23ce8063d5e12c201bf9 Reviewed-on: https://eu-gerrit-1.euhpc.arm.com/114166 Tested-by: Jenkins Reviewed-by: Anthony Barbier --- tests/Utils.h | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) (limited to 'tests/Utils.h') diff --git a/tests/Utils.h b/tests/Utils.h index bee30af2e8..d5c0a36ba2 100644 --- a/tests/Utils.h +++ b/tests/Utils.h @@ -476,6 +476,24 @@ inline T create_tensor(const TensorShape &shape, DataType data_type, int num_cha return tensor; } +/** Create and initialize a tensor of the given type. + * + * @param[in] shape Tensor shape. + * @param[in] format Format type. + * + * @return Initialized tensor of given type. + */ +template +inline T create_tensor(const TensorShape &shape, Format format) +{ + TensorInfo info(shape, format); + + T tensor; + tensor.allocator()->init(info); + + return tensor; +} + /** Create a vector of random ROIs. * * @param[in] shape The shape of the input tensor. -- cgit v1.2.1