aboutsummaryrefslogtreecommitdiff
path: root/tests/validation/fixtures/MeanStdDevFixture.h
diff options
context:
space:
mode:
authorMichalis Spyrou <michalis.spyrou@arm.com>2018-06-15 16:15:26 +0100
committerAnthony Barbier <anthony.barbier@arm.com>2018-11-02 16:54:54 +0000
commitd1794ebfa10d05af7d2458c5d506152fd38068d3 (patch)
treee3f286aaba86b1f0bcda3390ad4d8af96b965fc7 /tests/validation/fixtures/MeanStdDevFixture.h
parent7777b1aa865d3c17dcef31573d44fae421176109 (diff)
downloadComputeLibrary-d1794ebfa10d05af7d2458c5d506152fd38068d3.tar.gz
COMPMID-1226 Extend CLMeanStdDev to support FP32 / FP16
- Extend support for FP16 in CLReduction. - For F16/F32 MeanStdDev we perform one reduction operation for mean and one for stddev and we calculate the final result in the host CPU. Change-Id: Iad2099f26c0ba7969737d22f00c6c275634d875c Reviewed-on: https://eu-gerrit-1.euhpc.arm.com/135870 Tested-by: Jenkins <bsgcomp@arm.com> Reviewed-by: Georgios Pinitas <georgios.pinitas@arm.com>
Diffstat (limited to 'tests/validation/fixtures/MeanStdDevFixture.h')
-rw-r--r--tests/validation/fixtures/MeanStdDevFixture.h12
1 files changed, 10 insertions, 2 deletions
diff --git a/tests/validation/fixtures/MeanStdDevFixture.h b/tests/validation/fixtures/MeanStdDevFixture.h
index 17dfe78dbd..58d4644069 100644
--- a/tests/validation/fixtures/MeanStdDevFixture.h
+++ b/tests/validation/fixtures/MeanStdDevFixture.h
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2017 ARM Limited.
+ * Copyright (c) 2017-2018 ARM Limited.
*
* SPDX-License-Identifier: MIT
*
@@ -50,7 +50,15 @@ protected:
template <typename U>
void fill(U &&tensor)
{
- library->fill_tensor_uniform(tensor, 0);
+ if(is_data_type_float(tensor.data_type()))
+ {
+ std::uniform_real_distribution<> distribution(-1.0f, 1.0f);
+ library->fill(tensor, distribution, 0);
+ }
+ else
+ {
+ library->fill_tensor_uniform(tensor, 0);
+ }
}
std::pair<float, float> compute_target(const TensorShape &shape, DataType data_type)