From a8e2aeb7d2d46a7ab0e9523de145af9920fc1fa3 Mon Sep 17 00:00:00 2001 From: Giorgio Arena Date: Wed, 6 Jan 2021 11:34:57 +0000 Subject: Generalize custom uniform generator for floating point data types with 16 bits - Change name of uniform_real_distribution_fp16 to uniform_real_distribution_16bit, and make it also accept bfloat16 data type Resolves: COMPMID-4057 Signed-off-by: Giorgio Arena Change-Id: Id2f1a84b9c9f09cb260a0785add4fc5954d5853a Reviewed-on: https://review.mlplatform.org/c/ml/ComputeLibrary/+/4768 Reviewed-by: Michele Di Giorgio Comments-Addressed: Arm Jenkins Tested-by: Arm Jenkins --- support/Random.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'support') diff --git a/support/Random.h b/support/Random.h index d5d372dc82..7658e6d529 100644 --- a/support/Random.h +++ b/support/Random.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019-2020 Arm Limited. + * Copyright (c) 2019-2021 Arm Limited. * * SPDX-License-Identifier: MIT * @@ -44,10 +44,10 @@ template class RangedUniformDistribution { public: - static constexpr bool is_half = std::is_same::value; - static constexpr bool is_integral = std::is_integral::value && !is_half; + static constexpr bool is_fp_16bit = std::is_same::value || std::is_same::value; + static constexpr bool is_integral = std::is_integral::value && !is_fp_16bit; - using fp_dist = typename std::conditional>::type; + using fp_dist = typename std::conditional, std::uniform_real_distribution>::type; using DT = typename std::conditional, fp_dist>::type; using result_type = T; using range_pair = std::pair; -- cgit v1.2.1