diff options
author | Ioan-Cristian Szabo <ioan-cristian.szabo@arm.com> | 2017-12-20 16:27:37 +0000 |
---|---|---|
committer | Anthony Barbier <anthony.barbier@arm.com> | 2018-11-02 16:42:33 +0000 |
commit | 2c350181118ec9eca864432c5bd78a0cfc3ebc32 (patch) | |
tree | 8c65ff5200d3936b45cb4505cd94ab08b6134627 /tests/Utils.h | |
parent | 1250a5a259962514d31bb5f8148f1d0f0a82b946 (diff) | |
download | ComputeLibrary-2c350181118ec9eca864432c5bd78a0cfc3ebc32.tar.gz |
COMPMID-761: Add CL/NEON Magnitude benchmark tests
Change-Id: I9ed3718679d4bc96300a23ce8063d5e12c201bf9
Reviewed-on: https://eu-gerrit-1.euhpc.arm.com/114166
Tested-by: Jenkins <bsgcomp@arm.com>
Reviewed-by: Anthony Barbier <anthony.barbier@arm.com>
Diffstat (limited to 'tests/Utils.h')
-rw-r--r-- | tests/Utils.h | 18 |
1 files changed, 18 insertions, 0 deletions
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 <typename T> +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. |