[Beignet] [PATCH] utests:add subnormal check by fpclassify.
Zhigang Gong
zhigang.gong at linux.intel.com
Thu Feb 20 19:14:41 PST 2014
LGTM, will push latter, thanks.
On Wed, Feb 19, 2014 at 02:09:59PM +0800, Yi Sun wrote:
> From: Shui yangwei <yangweix.shui at intel.com>
>
> Signed-off-by: Yi Sun <yi.sun at intel.com>
> Signed-off-by: Shui yangwei <yangweix.shui at intel.com>
> ---
> utests/utest_generator.py | 3 +++
> 1 file changed, 3 insertions(+)
>
> diff --git a/utests/utest_generator.py b/utests/utest_generator.py
> index 626ac96..4b29ba2 100644
> --- a/utests/utest_generator.py
> +++ b/utests/utest_generator.py
> @@ -298,7 +298,10 @@ static void %s_%s(void)
>
> #funcdiff = " diff = fabs((gpu_data[index]-cpu_data[index])"
> #funcdiff += (self.retType(index) == "int") and ');' or '/(cpu_data[index]>1?cpu_data[index]:1));'
> + valuejudge = " if (std::fpclassify(gpu_data[index]) == FP_SUBNORMAL){ gpu_data[index] = 0; }\n"
> + valuejudge += " if (std::fpclassify(cpu_data[index]) == FP_SUBNORMAL){ cpu_data[index] = 0; }\n"
> funcdiff = " diff = fabs((gpu_data[index]-cpu_data[index]));"
> + funcline += [ valuejudge ]
> funcline += [ funcdiff ]
> funcline += [ funcsprintfa + funcsprintfb ]
>
> --
> 1.7.10.1
>
> _______________________________________________
> Beignet mailing list
> Beignet at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/beignet
More information about the Beignet
mailing list