From 33b103b8ad1b063ddf909a2c2027e25ef46c0d88 Mon Sep 17 00:00:00 2001 From: Giorgio Arena Date: Fri, 8 Jan 2021 10:37:15 +0000 Subject: Resolve merge conflicts between new fills and new fp16 generator Resolves: COMPMID-4083 Change-Id: Ia1b595d972854ede7ff4104183d014ac6afe30d1 Signed-off-by: Giorgio Arena Reviewed-on: https://review.mlplatform.org/c/ml/ComputeLibrary/+/4782 Reviewed-by: Georgios Pinitas Comments-Addressed: Arm Jenkins Tested-by: Arm Jenkins --- tests/AssetsLibrary.h | 4 ++-- tests/validate_examples/cl_gemm.cpp | 4 ++-- .../validation/fixtures/ArithmeticDivisionFixture.h | 4 ++-- .../fixtures/BatchNormalizationLayerFixture.h | 4 ++-- .../fixtures/BatchNormalizationLayerFusionFixture.h | 4 ++-- tests/validation/fixtures/BatchToSpaceLayerFixture.h | 4 ++-- tests/validation/fixtures/DepthToSpaceLayerFixture.h | 4 ++-- .../DirectConvolutionLayerTensorShiftFixture.h | 2 +- tests/validation/fixtures/ElementWiseUnaryFixture.h | 2 +- tests/validation/fixtures/FlattenLayerFixture.h | 4 ++-- .../validation/fixtures/FullyConnectedLayerFixture.h | 4 ++-- tests/validation/fixtures/GEMMFixture.h | 20 ++++++++++---------- .../fixtures/InstanceNormalizationLayerFixture.h | 4 ++-- tests/validation/fixtures/L2NormalizeLayerFixture.h | 4 ++-- tests/validation/fixtures/LSTMLayerFixture.h | 6 +++--- tests/validation/fixtures/MaxUnpoolingLayerFixture.h | 4 ++-- tests/validation/fixtures/MeanStdDevFixture.h | 4 ++-- .../fixtures/MeanStdDevNormalizationLayerFixture.h | 4 ++-- .../validation/fixtures/NormalizationLayerFixture.h | 4 ++-- .../fixtures/NormalizePlanarYUVLayerFixture.h | 4 ++-- tests/validation/fixtures/PoolingLayerFixture.h | 4 ++-- tests/validation/fixtures/RNNLayerFixture.h | 4 ++-- tests/validation/fixtures/ReduceMeanFixture.h | 4 ++-- .../validation/fixtures/ReductionOperationFixture.h | 4 ++-- tests/validation/fixtures/ScaleFixture.h | 4 ++-- tests/validation/fixtures/SoftmaxLayerFixture.h | 4 ++-- tests/validation/fixtures/SpaceToDepthFixture.h | 4 ++-- .../fixtures/UNIT/WeightsRetentionFixture.h | 4 ++-- .../fixtures/WinogradConvolutionLayerFixture.h | 6 +++--- utils/GraphUtils.cpp | 4 ++-- 30 files changed, 68 insertions(+), 68 deletions(-) diff --git a/tests/AssetsLibrary.h b/tests/AssetsLibrary.h index 5e34365692..f465577372 100644 --- a/tests/AssetsLibrary.h +++ b/tests/AssetsLibrary.h @@ -778,7 +778,7 @@ void AssetsLibrary::fill_tensor_uniform(T &&tensor, std::random_device::result_t case DataType::BFLOAT16: { // It doesn't make sense to check [-inf, inf], so hard code it to a big number - arm_compute::utils::uniform_real_distribution_16bit distribution_bf16(-1000.f, 1000.f); + arm_compute::utils::uniform_real_distribution_16bit distribution_bf16{ -1000.f, 1000.f }; fill(tensor, distribution_bf16, seed_offset); break; } @@ -976,7 +976,7 @@ void AssetsLibrary::fill_tensor_uniform(T &&tensor, std::random_device::result_t } case DataType::BFLOAT16: { - arm_compute::utils::uniform_real_distribution_16bit distribution_bf16(low, high); + arm_compute::utils::uniform_real_distribution_16bit distribution_bf16{ float(low), float(high) }; fill(tensor, distribution_bf16, seed_offset); break; } diff --git a/tests/validate_examples/cl_gemm.cpp b/tests/validate_examples/cl_gemm.cpp index 56e3451edc..717ba77e17 100644 --- a/tests/validate_examples/cl_gemm.cpp +++ b/tests/validate_examples/cl_gemm.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2017-2020 Arm Limited. + * Copyright (c) 2017-2021 Arm Limited. * * SPDX-License-Identifier: MIT * @@ -346,7 +346,7 @@ private: { case DataType::F16: { - arm_compute::utils::uniform_real_distribution_fp16 distribution{ half(-1.0f), half(1.0f) }; + arm_compute::utils::uniform_real_distribution_16bit distribution{ -1.0f, 1.0f }; library->fill(tensor, distribution, i); break; } diff --git a/tests/validation/fixtures/ArithmeticDivisionFixture.h b/tests/validation/fixtures/ArithmeticDivisionFixture.h index 60adbfd4b5..782939a960 100644 --- a/tests/validation/fixtures/ArithmeticDivisionFixture.h +++ b/tests/validation/fixtures/ArithmeticDivisionFixture.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018-2020 Arm Limited. + * Copyright (c) 2018-2021 Arm Limited. * * SPDX-License-Identifier: MIT * @@ -56,7 +56,7 @@ protected: void fill(U &&tensor, int i) { static_assert(std::is_floating_point::value || std::is_same::value, "Only floating point data types supported."); - using DistributionType = typename std::conditional::value, arm_compute::utils::uniform_real_distribution_fp16, std::uniform_real_distribution>::type; + using DistributionType = typename std::conditional::value, arm_compute::utils::uniform_real_distribution_16bit, std::uniform_real_distribution>::type; DistributionType distribution{ T(1.0f), T(5.0f) }; library->fill(tensor, distribution, i); diff --git a/tests/validation/fixtures/BatchNormalizationLayerFixture.h b/tests/validation/fixtures/BatchNormalizationLayerFixture.h index 8685543ee1..f5a5420df3 100644 --- a/tests/validation/fixtures/BatchNormalizationLayerFixture.h +++ b/tests/validation/fixtures/BatchNormalizationLayerFixture.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2017-2020 Arm Limited. + * Copyright (c) 2017-2021 Arm Limited. * * SPDX-License-Identifier: MIT * @@ -60,7 +60,7 @@ protected: void fill(U &&src_tensor, U &&mean_tensor, U &&var_tensor, U &&beta_tensor, U &&gamma_tensor) { static_assert(std::is_floating_point::value || std::is_same::value, "Only floating point data types supported."); - using DistributionType = typename std::conditional::value, arm_compute::utils::uniform_real_distribution_fp16, std::uniform_real_distribution>::type; + using DistributionType = typename std::conditional::value, arm_compute::utils::uniform_real_distribution_16bit, std::uniform_real_distribution>::type; const T min_bound = T(-1.f); const T max_bound = T(1.f); diff --git a/tests/validation/fixtures/BatchNormalizationLayerFusionFixture.h b/tests/validation/fixtures/BatchNormalizationLayerFusionFixture.h index 3f7f97a29c..ccacfeb062 100644 --- a/tests/validation/fixtures/BatchNormalizationLayerFusionFixture.h +++ b/tests/validation/fixtures/BatchNormalizationLayerFusionFixture.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018-2020 Arm Limited. + * Copyright (c) 2018-2021 Arm Limited. * * SPDX-License-Identifier: MIT * @@ -66,7 +66,7 @@ protected: void fill(U &&src, U &&w_tensor, U &&b_tensor, U &&mean_tensor, U &&var_tensor, U &&beta_tensor, U &&gamma_tensor) { static_assert(std::is_floating_point::value || std::is_same::value, "Only floating point data types supported."); - using DistributionType = typename std::conditional::value, arm_compute::utils::uniform_real_distribution_fp16, std::uniform_real_distribution>::type; + using DistributionType = typename std::conditional::value, arm_compute::utils::uniform_real_distribution_16bit, std::uniform_real_distribution>::type; DistributionType distribution{ T(-1.f), T(1.f) }; DistributionType distribution_gz{ T(0.f), T(1.f) }; diff --git a/tests/validation/fixtures/BatchToSpaceLayerFixture.h b/tests/validation/fixtures/BatchToSpaceLayerFixture.h index a8d132753c..796afd1c5d 100644 --- a/tests/validation/fixtures/BatchToSpaceLayerFixture.h +++ b/tests/validation/fixtures/BatchToSpaceLayerFixture.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018-2020 Arm Limited. + * Copyright (c) 2018-2021 Arm Limited. * * SPDX-License-Identifier: MIT * @@ -51,7 +51,7 @@ protected: void fill(U &&tensor, int i) { static_assert(std::is_floating_point::value || std::is_same::value, "Only floating point data types supported."); - using DistributionType = typename std::conditional::value, arm_compute::utils::uniform_real_distribution_fp16, std::uniform_real_distribution>::type; + using DistributionType = typename std::conditional::value, arm_compute::utils::uniform_real_distribution_16bit, std::uniform_real_distribution>::type; DistributionType distribution{ T(-1.0f), T(1.0f) }; library->fill(tensor, distribution, i); diff --git a/tests/validation/fixtures/DepthToSpaceLayerFixture.h b/tests/validation/fixtures/DepthToSpaceLayerFixture.h index bc9954a0bd..a254ba4322 100644 --- a/tests/validation/fixtures/DepthToSpaceLayerFixture.h +++ b/tests/validation/fixtures/DepthToSpaceLayerFixture.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019-2020 Arm Limited. + * Copyright (c) 2019-2021 Arm Limited. * * SPDX-License-Identifier: MIT * @@ -51,7 +51,7 @@ protected: void fill(U &&tensor, int i) { static_assert(std::is_floating_point::value || std::is_same::value, "Only floating point data types supported."); - using DistributionType = typename std::conditional::value, arm_compute::utils::uniform_real_distribution_fp16, std::uniform_real_distribution>::type; + using DistributionType = typename std::conditional::value, arm_compute::utils::uniform_real_distribution_16bit, std::uniform_real_distribution>::type; DistributionType distribution{ T(-1.0f), T(1.0f) }; library->fill(tensor, distribution, i); diff --git a/tests/validation/fixtures/DirectConvolutionLayerTensorShiftFixture.h b/tests/validation/fixtures/DirectConvolutionLayerTensorShiftFixture.h index f39595f0de..44edc91231 100644 --- a/tests/validation/fixtures/DirectConvolutionLayerTensorShiftFixture.h +++ b/tests/validation/fixtures/DirectConvolutionLayerTensorShiftFixture.h @@ -94,7 +94,7 @@ protected: } case DataType::F16: { - arm_compute::utils::uniform_real_distribution_16bit distribution{ float(-1.0f), float(1.0f) }; + arm_compute::utils::uniform_real_distribution_16bit distribution{ -1.0f, 1.0f }; library->fill(tensor, distribution, i); break; } diff --git a/tests/validation/fixtures/ElementWiseUnaryFixture.h b/tests/validation/fixtures/ElementWiseUnaryFixture.h index f8e0dfa75e..8cffef48f6 100644 --- a/tests/validation/fixtures/ElementWiseUnaryFixture.h +++ b/tests/validation/fixtures/ElementWiseUnaryFixture.h @@ -56,7 +56,7 @@ protected: void fill(U &&tensor, int i, DataType data_type) { using FloatType = typename std::conditional < std::is_same::value || std::is_floating_point::value, T, float >::type; - using FloatDistributionType = typename std::conditional::value, arm_compute::utils::uniform_real_distribution_fp16, std::uniform_real_distribution>::type; + using FloatDistributionType = typename std::conditional::value, arm_compute::utils::uniform_real_distribution_16bit, std::uniform_real_distribution>::type; switch(_op) { diff --git a/tests/validation/fixtures/FlattenLayerFixture.h b/tests/validation/fixtures/FlattenLayerFixture.h index d8480ed8d0..67c4d2a2b1 100644 --- a/tests/validation/fixtures/FlattenLayerFixture.h +++ b/tests/validation/fixtures/FlattenLayerFixture.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2017-2020 Arm Limited. + * Copyright (c) 2017-2021 Arm Limited. * * SPDX-License-Identifier: MIT * @@ -67,7 +67,7 @@ protected: void fill(U &&tensor) { static_assert(std::is_floating_point::value || std::is_same::value, "Only floating point data types supported."); - using DistributionType = typename std::conditional::value, arm_compute::utils::uniform_real_distribution_fp16, std::uniform_real_distribution>::type; + using DistributionType = typename std::conditional::value, arm_compute::utils::uniform_real_distribution_16bit, std::uniform_real_distribution>::type; DistributionType distribution{ T(-1.0f), T(1.0f) }; library->fill(tensor, distribution, 0); diff --git a/tests/validation/fixtures/FullyConnectedLayerFixture.h b/tests/validation/fixtures/FullyConnectedLayerFixture.h index 3e2fb0bfbe..3760cfb8b7 100644 --- a/tests/validation/fixtures/FullyConnectedLayerFixture.h +++ b/tests/validation/fixtures/FullyConnectedLayerFixture.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2017-2020 Arm Limited. + * Copyright (c) 2017-2021 Arm Limited. * * SPDX-License-Identifier: MIT * @@ -91,7 +91,7 @@ protected: } else if(_data_type == DataType::F16) { - arm_compute::utils::uniform_real_distribution_fp16 distribution(half(-1.0f), half(1.0f)); + arm_compute::utils::uniform_real_distribution_16bit distribution(-1.0f, 1.0f); library->fill(tensor, distribution, i); } else if(_data_type == DataType::F32) diff --git a/tests/validation/fixtures/GEMMFixture.h b/tests/validation/fixtures/GEMMFixture.h index 1dc2af2687..500e094e18 100644 --- a/tests/validation/fixtures/GEMMFixture.h +++ b/tests/validation/fixtures/GEMMFixture.h @@ -197,7 +197,7 @@ protected: void fill(U &&tensor, int i) { static_assert(std::is_floating_point::value || std::is_same::value, "Only floating point data types supported."); - using DistributionType = typename std::conditional::value, arm_compute::utils::uniform_real_distribution_fp16, std::uniform_real_distribution>::type; + using DistributionType = typename std::conditional::value, arm_compute::utils::uniform_real_distribution_16bit, std::uniform_real_distribution>::type; DistributionType distribution{ T(-1.0f), T(1.0f) }; library->fill(tensor, distribution, i); @@ -317,7 +317,7 @@ protected: void fill(U &&tensor, int i) { static_assert(std::is_floating_point::value || std::is_same::value, "Only floating point data types supported."); - using DistributionType = typename std::conditional::value, arm_compute::utils::uniform_real_distribution_fp16, std::uniform_real_distribution>::type; + using DistributionType = typename std::conditional::value, arm_compute::utils::uniform_real_distribution_16bit, std::uniform_real_distribution>::type; DistributionType distribution{ T(-1.0f), T(1.0f) }; library->fill(tensor, distribution, i); @@ -443,7 +443,7 @@ protected: void fill(U &&tensor, int i) { static_assert(std::is_floating_point::value || std::is_same::value, "Only floating point data types supported."); - using DistributionType = typename std::conditional::value, arm_compute::utils::uniform_real_distribution_fp16, std::uniform_real_distribution>::type; + using DistributionType = typename std::conditional::value, arm_compute::utils::uniform_real_distribution_16bit, std::uniform_real_distribution>::type; DistributionType distribution{ T(-1.0f), T(1.0f) }; library->fill(tensor, distribution, i); @@ -589,7 +589,7 @@ protected: void fill(U &&tensor, int i) { static_assert(std::is_floating_point::value || std::is_same::value, "Only floating point data types supported."); - using DistributionType = typename std::conditional::value, arm_compute::utils::uniform_real_distribution_fp16, std::uniform_real_distribution>::type; + using DistributionType = typename std::conditional::value, arm_compute::utils::uniform_real_distribution_16bit, std::uniform_real_distribution>::type; DistributionType distribution{ T(-1.0f), T(1.0f) }; library->fill(tensor, distribution, i); @@ -731,7 +731,7 @@ protected: void fill(U &&tensor, int i) { static_assert(std::is_floating_point::value || std::is_same::value, "Only floating point data types supported."); - using DistributionType = typename std::conditional::value, arm_compute::utils::uniform_real_distribution_fp16, std::uniform_real_distribution>::type; + using DistributionType = typename std::conditional::value, arm_compute::utils::uniform_real_distribution_16bit, std::uniform_real_distribution>::type; DistributionType distribution{ T(-1.0f), T(1.0f) }; library->fill(tensor, distribution, i); @@ -903,7 +903,7 @@ protected: void fill(U &&tensor, int i) { static_assert(std::is_floating_point::value || std::is_same::value, "Only floating point data types supported."); - using DistributionType = typename std::conditional::value, arm_compute::utils::uniform_real_distribution_fp16, std::uniform_real_distribution>::type; + using DistributionType = typename std::conditional::value, arm_compute::utils::uniform_real_distribution_16bit, std::uniform_real_distribution>::type; DistributionType distribution{ T(-1.0f), T(1.0f) }; library->fill(tensor, distribution, i); @@ -1066,7 +1066,7 @@ protected: void fill(U &&tensor, int i) { static_assert(std::is_floating_point::value || std::is_same::value, "Only floating point data types supported."); - using DistributionType = typename std::conditional::value, arm_compute::utils::uniform_real_distribution_fp16, std::uniform_real_distribution>::type; + using DistributionType = typename std::conditional::value, arm_compute::utils::uniform_real_distribution_16bit, std::uniform_real_distribution>::type; DistributionType distribution{ T(-1.0f), T(1.0f) }; library->fill(tensor, distribution, i); @@ -1221,7 +1221,7 @@ protected: void fill(U &&tensor, int i) { static_assert(std::is_floating_point::value || std::is_same::value, "Only floating point data types supported."); - using DistributionType = typename std::conditional::value, arm_compute::utils::uniform_real_distribution_fp16, std::uniform_real_distribution>::type; + using DistributionType = typename std::conditional::value, arm_compute::utils::uniform_real_distribution_16bit, std::uniform_real_distribution>::type; DistributionType distribution{ T(-1.0f), T(1.0f) }; library->fill(tensor, distribution, i); @@ -1371,7 +1371,7 @@ protected: void fill(U &&tensor, int i) { static_assert(std::is_floating_point::value || std::is_same::value, "Only floating point data types supported."); - using DistributionType = typename std::conditional::value, arm_compute::utils::uniform_real_distribution_fp16, std::uniform_real_distribution>::type; + using DistributionType = typename std::conditional::value, arm_compute::utils::uniform_real_distribution_16bit, std::uniform_real_distribution>::type; DistributionType distribution{ T(-1.0f), T(1.0f) }; library->fill(tensor, distribution, i); @@ -1502,7 +1502,7 @@ protected: void fill(U &&tensor, int i) { static_assert(std::is_floating_point::value || std::is_same::value, "Only floating point data types supported."); - using DistributionType = typename std::conditional::value, arm_compute::utils::uniform_real_distribution_fp16, std::uniform_real_distribution>::type; + using DistributionType = typename std::conditional::value, arm_compute::utils::uniform_real_distribution_16bit, std::uniform_real_distribution>::type; DistributionType distribution{ T(-1.0f), T(1.0f) }; library->fill(tensor, distribution, i); diff --git a/tests/validation/fixtures/InstanceNormalizationLayerFixture.h b/tests/validation/fixtures/InstanceNormalizationLayerFixture.h index 3f2853dece..611d9aae5b 100644 --- a/tests/validation/fixtures/InstanceNormalizationLayerFixture.h +++ b/tests/validation/fixtures/InstanceNormalizationLayerFixture.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019-2020 Arm Limited. + * Copyright (c) 2019-2021 Arm Limited. * * SPDX-License-Identifier: MIT * @@ -56,7 +56,7 @@ protected: void fill(U &&tensor) { static_assert(std::is_floating_point::value || std::is_same::value, "Only floating point data types supported."); - using DistributionType = typename std::conditional::value, arm_compute::utils::uniform_real_distribution_fp16, std::uniform_real_distribution>::type; + using DistributionType = typename std::conditional::value, arm_compute::utils::uniform_real_distribution_16bit, std::uniform_real_distribution>::type; DistributionType distribution{ T(1.0f), T(2.0f) }; library->fill(tensor, distribution, 0); diff --git a/tests/validation/fixtures/L2NormalizeLayerFixture.h b/tests/validation/fixtures/L2NormalizeLayerFixture.h index c3692b3096..349c0904eb 100644 --- a/tests/validation/fixtures/L2NormalizeLayerFixture.h +++ b/tests/validation/fixtures/L2NormalizeLayerFixture.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2017-2020 Arm Limited. + * Copyright (c) 2017-2021 Arm Limited. * * SPDX-License-Identifier: MIT * @@ -60,7 +60,7 @@ protected: void fill(U &&tensor) { static_assert(std::is_floating_point::value || std::is_same::value, "Only floating point data types supported."); - using DistributionType = typename std::conditional::value, arm_compute::utils::uniform_real_distribution_fp16, std::uniform_real_distribution>::type; + using DistributionType = typename std::conditional::value, arm_compute::utils::uniform_real_distribution_16bit, std::uniform_real_distribution>::type; DistributionType distribution{ T(1.0f), T(2.0f) }; library->fill(tensor, distribution, 0); diff --git a/tests/validation/fixtures/LSTMLayerFixture.h b/tests/validation/fixtures/LSTMLayerFixture.h index 2b321f5405..366d050039 100644 --- a/tests/validation/fixtures/LSTMLayerFixture.h +++ b/tests/validation/fixtures/LSTMLayerFixture.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018-2020 Arm Limited. + * Copyright (c) 2018-2021 Arm Limited. * * SPDX-License-Identifier: MIT * @@ -62,7 +62,7 @@ protected: void fill(U &&tensor, int i) { static_assert(std::is_floating_point::value || std::is_same::value, "Only floating point data types supported."); - using DistributionType = typename std::conditional::value, arm_compute::utils::uniform_real_distribution_fp16, std::uniform_real_distribution>::type; + using DistributionType = typename std::conditional::value, arm_compute::utils::uniform_real_distribution_16bit, std::uniform_real_distribution>::type; DistributionType distribution{ T(-1.0f), T(1.0f) }; library->fill(tensor, distribution, i); @@ -71,7 +71,7 @@ protected: void fill_custom_val(U &&tensor, float num, int i) { static_assert(std::is_floating_point::value || std::is_same::value, "Only floating point data types supported."); - using DistributionType = typename std::conditional::value, arm_compute::utils::uniform_real_distribution_fp16, std::uniform_real_distribution>::type; + using DistributionType = typename std::conditional::value, arm_compute::utils::uniform_real_distribution_16bit, std::uniform_real_distribution>::type; DistributionType distribution{ T(num), T(num) }; library->fill(tensor, distribution, i); diff --git a/tests/validation/fixtures/MaxUnpoolingLayerFixture.h b/tests/validation/fixtures/MaxUnpoolingLayerFixture.h index 49b4c4b525..7c118da319 100644 --- a/tests/validation/fixtures/MaxUnpoolingLayerFixture.h +++ b/tests/validation/fixtures/MaxUnpoolingLayerFixture.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2020 Arm Limited. + * Copyright (c) 2020-2021 Arm Limited. * * SPDX-License-Identifier: MIT * @@ -72,7 +72,7 @@ protected: } else if(tensor.data_type() == DataType::F16) { - arm_compute::utils::uniform_real_distribution_fp16 distribution{ half(-1.0f), half(1.0f) }; + arm_compute::utils::uniform_real_distribution_16bit distribution{ -1.0f, 1.0f }; library->fill(tensor, distribution, 0); } else // data type is quantized_asymmetric diff --git a/tests/validation/fixtures/MeanStdDevFixture.h b/tests/validation/fixtures/MeanStdDevFixture.h index c76d7af5b9..f3facc50de 100644 --- a/tests/validation/fixtures/MeanStdDevFixture.h +++ b/tests/validation/fixtures/MeanStdDevFixture.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2017-2020 Arm Limited. + * Copyright (c) 2017-2021 Arm Limited. * * SPDX-License-Identifier: MIT * @@ -57,7 +57,7 @@ protected: } else if(tensor.data_type() == DataType::F16) { - arm_compute::utils::uniform_real_distribution_fp16 distribution{ half(-1.0f), half(1.0f) }; + arm_compute::utils::uniform_real_distribution_16bit distribution{ -1.0f, 1.0f }; library->fill(tensor, distribution, 0); } else diff --git a/tests/validation/fixtures/MeanStdDevNormalizationLayerFixture.h b/tests/validation/fixtures/MeanStdDevNormalizationLayerFixture.h index 1f1e924ce9..5d11d1f8e2 100644 --- a/tests/validation/fixtures/MeanStdDevNormalizationLayerFixture.h +++ b/tests/validation/fixtures/MeanStdDevNormalizationLayerFixture.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019-2020 Arm Limited. + * Copyright (c) 2019-2021 Arm Limited. * * SPDX-License-Identifier: MIT * @@ -57,7 +57,7 @@ protected: void fill(U &&src_tensor) { static_assert(std::is_floating_point::value || std::is_same::value, "Only floating point data types supported."); - using DistributionType = typename std::conditional::value, arm_compute::utils::uniform_real_distribution_fp16, std::uniform_real_distribution>::type; + using DistributionType = typename std::conditional::value, arm_compute::utils::uniform_real_distribution_16bit, std::uniform_real_distribution>::type; DistributionType distribution{ T(-1.0f), T(1.0f) }; library->fill(src_tensor, distribution, 0); diff --git a/tests/validation/fixtures/NormalizationLayerFixture.h b/tests/validation/fixtures/NormalizationLayerFixture.h index 765e93e62b..54570de64f 100644 --- a/tests/validation/fixtures/NormalizationLayerFixture.h +++ b/tests/validation/fixtures/NormalizationLayerFixture.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2017-2020 Arm Limited. + * Copyright (c) 2017-2021 Arm Limited. * * SPDX-License-Identifier: MIT * @@ -60,7 +60,7 @@ protected: void fill(U &&tensor) { static_assert(std::is_floating_point::value || std::is_same::value, "Only floating point data types supported."); - using DistributionType = typename std::conditional::value, arm_compute::utils::uniform_real_distribution_fp16, std::uniform_real_distribution>::type; + using DistributionType = typename std::conditional::value, arm_compute::utils::uniform_real_distribution_16bit, std::uniform_real_distribution>::type; DistributionType distribution{ T(-1.0f), T(1.0f) }; library->fill(tensor, distribution, 0); diff --git a/tests/validation/fixtures/NormalizePlanarYUVLayerFixture.h b/tests/validation/fixtures/NormalizePlanarYUVLayerFixture.h index 0189261949..3249ccc4bb 100644 --- a/tests/validation/fixtures/NormalizePlanarYUVLayerFixture.h +++ b/tests/validation/fixtures/NormalizePlanarYUVLayerFixture.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2017-2020 Arm Limited. + * Copyright (c) 2017-2021 Arm Limited. * * SPDX-License-Identifier: MIT * @@ -56,7 +56,7 @@ protected: template void fill(U &&src_tensor, U &&mean_tensor, U &&std_tensor) { - using FloatDistributionType = typename std::conditional::value, arm_compute::utils::uniform_real_distribution_fp16, std::uniform_real_distribution>::type; + using FloatDistributionType = typename std::conditional::value, arm_compute::utils::uniform_real_distribution_16bit, std::uniform_real_distribution>::type; if(is_data_type_float(_data_type)) { diff --git a/tests/validation/fixtures/PoolingLayerFixture.h b/tests/validation/fixtures/PoolingLayerFixture.h index 3653de789a..09054aa845 100644 --- a/tests/validation/fixtures/PoolingLayerFixture.h +++ b/tests/validation/fixtures/PoolingLayerFixture.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2017-2020 Arm Limited. + * Copyright (c) 2017-2021 Arm Limited. * * SPDX-License-Identifier: MIT * @@ -72,7 +72,7 @@ protected: } else if(tensor.data_type() == DataType::F16) { - arm_compute::utils::uniform_real_distribution_fp16 distribution{ half(-1.0f), half(1.0f) }; + arm_compute::utils::uniform_real_distribution_16bit distribution{ -1.0f, 1.0f }; library->fill(tensor, distribution, 0); } else // data type is quantized_asymmetric diff --git a/tests/validation/fixtures/RNNLayerFixture.h b/tests/validation/fixtures/RNNLayerFixture.h index f1d0d69218..394d91cd6f 100644 --- a/tests/validation/fixtures/RNNLayerFixture.h +++ b/tests/validation/fixtures/RNNLayerFixture.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018-2020 Arm Limited. + * Copyright (c) 2018-2021 Arm Limited. * * SPDX-License-Identifier: MIT * @@ -55,7 +55,7 @@ protected: void fill(U &&tensor, int i) { static_assert(std::is_floating_point::value || std::is_same::value, "Only floating point data types supported."); - using DistributionType = typename std::conditional::value, arm_compute::utils::uniform_real_distribution_fp16, std::uniform_real_distribution>::type; + using DistributionType = typename std::conditional::value, arm_compute::utils::uniform_real_distribution_16bit, std::uniform_real_distribution>::type; DistributionType distribution{ T(-1.0f), T(1.0f) }; library->fill(tensor, distribution, i); diff --git a/tests/validation/fixtures/ReduceMeanFixture.h b/tests/validation/fixtures/ReduceMeanFixture.h index b7ba942be4..36bf14b27e 100644 --- a/tests/validation/fixtures/ReduceMeanFixture.h +++ b/tests/validation/fixtures/ReduceMeanFixture.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018-2020 Arm Limited. + * Copyright (c) 2018-2021 Arm Limited. * * SPDX-License-Identifier: MIT * @@ -65,7 +65,7 @@ protected: } else if(tensor.data_type() == DataType::F16) { - arm_compute::utils::uniform_real_distribution_fp16 distribution{ half(-1.0f), half(1.0f) }; + arm_compute::utils::uniform_real_distribution_16bit distribution{ -1.0f, 1.0f }; library->fill(tensor, distribution, 0); } else if(is_data_type_quantized(tensor.data_type())) diff --git a/tests/validation/fixtures/ReductionOperationFixture.h b/tests/validation/fixtures/ReductionOperationFixture.h index a8dff1ba30..f3d653e6dc 100644 --- a/tests/validation/fixtures/ReductionOperationFixture.h +++ b/tests/validation/fixtures/ReductionOperationFixture.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2017-2020 Arm Limited. + * Copyright (c) 2017-2021 Arm Limited. * * SPDX-License-Identifier: MIT * @@ -68,7 +68,7 @@ protected: } else if(tensor.data_type() == DataType::F16) { - arm_compute::utils::uniform_real_distribution_fp16 distribution{ half(-1.0f), half(1.0f) }; + arm_compute::utils::uniform_real_distribution_16bit distribution{ -1.0f, 1.0f }; library->fill(tensor, distribution, 0); } else if(is_data_type_quantized(tensor.data_type())) diff --git a/tests/validation/fixtures/ScaleFixture.h b/tests/validation/fixtures/ScaleFixture.h index fc09c8f23c..dd521470e6 100644 --- a/tests/validation/fixtures/ScaleFixture.h +++ b/tests/validation/fixtures/ScaleFixture.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2017-2020 Arm Limited. + * Copyright (c) 2017-2021 Arm Limited. * * SPDX-License-Identifier: MIT * @@ -105,7 +105,7 @@ protected: } else if(tensor.data_type() == DataType::F16) { - arm_compute::utils::uniform_real_distribution_fp16 distribution{ half(-5.0f), half(5.0f) }; + arm_compute::utils::uniform_real_distribution_16bit distribution{ -5.0f, 5.0f }; library->fill(tensor, distribution, 0); } else if(is_data_type_quantized(tensor.data_type())) diff --git a/tests/validation/fixtures/SoftmaxLayerFixture.h b/tests/validation/fixtures/SoftmaxLayerFixture.h index ff5003d32f..c39ab740cd 100644 --- a/tests/validation/fixtures/SoftmaxLayerFixture.h +++ b/tests/validation/fixtures/SoftmaxLayerFixture.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2017-2020 Arm Limited. + * Copyright (c) 2017-2021 Arm Limited. * * SPDX-License-Identifier: MIT * @@ -66,7 +66,7 @@ protected: } else if(tensor.data_type() == DataType::F16) { - arm_compute::utils::uniform_real_distribution_fp16 distribution{ half(-10.0f), half(10.0f) }; + arm_compute::utils::uniform_real_distribution_16bit distribution{ -10.0f, 10.0f }; library->fill(tensor, distribution, 0); } else if(!is_data_type_quantized(tensor.data_type())) diff --git a/tests/validation/fixtures/SpaceToDepthFixture.h b/tests/validation/fixtures/SpaceToDepthFixture.h index b261fd5426..45ea34b0f5 100644 --- a/tests/validation/fixtures/SpaceToDepthFixture.h +++ b/tests/validation/fixtures/SpaceToDepthFixture.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019-2020 Arm Limited. + * Copyright (c) 2019-2021 Arm Limited. * * SPDX-License-Identifier: MIT * @@ -51,7 +51,7 @@ protected: void fill(U &&tensor, int i) { static_assert(std::is_floating_point::value || std::is_same::value, "Only floating point data types supported."); - using DistributionType = typename std::conditional::value, arm_compute::utils::uniform_real_distribution_fp16, std::uniform_real_distribution>::type; + using DistributionType = typename std::conditional::value, arm_compute::utils::uniform_real_distribution_16bit, std::uniform_real_distribution>::type; DistributionType distribution{ T(-1.0f), T(1.0f) }; library->fill(tensor, distribution, i); diff --git a/tests/validation/fixtures/UNIT/WeightsRetentionFixture.h b/tests/validation/fixtures/UNIT/WeightsRetentionFixture.h index 845614170e..af9f776ebc 100644 --- a/tests/validation/fixtures/UNIT/WeightsRetentionFixture.h +++ b/tests/validation/fixtures/UNIT/WeightsRetentionFixture.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2017-2020 Arm Limited. + * Copyright (c) 2017-2021 Arm Limited. * * SPDX-License-Identifier: MIT * @@ -65,7 +65,7 @@ protected: void fill(U &&tensor, int i) { static_assert(std::is_floating_point::value || std::is_same::value, "Only floating point data types supported."); - using DistributionType = typename std::conditional::value, arm_compute::utils::uniform_real_distribution_fp16, std::uniform_real_distribution>::type; + using DistributionType = typename std::conditional::value, arm_compute::utils::uniform_real_distribution_16bit, std::uniform_real_distribution>::type; DistributionType distribution{ T(0.5f), T(1.0f) }; library->fill(tensor, distribution, i); diff --git a/tests/validation/fixtures/WinogradConvolutionLayerFixture.h b/tests/validation/fixtures/WinogradConvolutionLayerFixture.h index 1061fd00ab..03ec920c4e 100644 --- a/tests/validation/fixtures/WinogradConvolutionLayerFixture.h +++ b/tests/validation/fixtures/WinogradConvolutionLayerFixture.h @@ -73,7 +73,7 @@ protected: { case DataType::F16: { - arm_compute::utils::uniform_real_distribution_fp16 distribution{ half(min), half(max) }; + arm_compute::utils::uniform_real_distribution_16bit distribution{ float(min), float(max) }; library->fill(tensor, distribution, i); break; } @@ -344,7 +344,7 @@ protected: { case DataType::F16: { - arm_compute::utils::uniform_real_distribution_fp16 distribution{ half(min), half(max) }; + arm_compute::utils::uniform_real_distribution_16bit distribution{ float(min), float(max) }; library->fill(tensor, distribution, i); break; } @@ -431,7 +431,7 @@ protected: { case DataType::F16: { - arm_compute::utils::uniform_real_distribution_fp16 distribution{ half(min), half(max) }; + arm_compute::utils::uniform_real_distribution_16bit distribution{ float(min), float(max) }; library->fill(tensor, distribution, i); break; } diff --git a/utils/GraphUtils.cpp b/utils/GraphUtils.cpp index 6d714d8944..bfa28df880 100644 --- a/utils/GraphUtils.cpp +++ b/utils/GraphUtils.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2017-2020 Arm Limited. + * Copyright (c) 2017-2021 Arm Limited. * * SPDX-License-Identifier: MIT * @@ -743,7 +743,7 @@ bool RandomAccessor::access_tensor(ITensor &tensor) } case DataType::F16: { - arm_compute::utils::uniform_real_distribution_fp16 distribution_f16(_lower.get(), _upper.get()); + arm_compute::utils::uniform_real_distribution_16bit distribution_f16(_lower.get(), _upper.get()); fill(tensor, distribution_f16); break; } -- cgit v1.2.1