[Beignet] [PATCH] fix utest fail.

Yang, Rong R rong.r.yang at intel.com
Mon Aug 10 19:17:25 PDT 2015


LGTM, pushed, thanks.

> -----Original Message-----
> From: Beignet [mailto:beignet-bounces at lists.freedesktop.org] On Behalf Of
> xionghu.luo at intel.com
> Sent: Monday, August 10, 2015 16:03
> To: beignet at lists.freedesktop.org
> Cc: Luo, Xionghu
> Subject: [Beignet] [PATCH] fix utest fail.
> 
> From: Luo Xionghu <xionghu.luo at intel.com>
> 
> should use M_180_PI_F to improve the precision.
> Signed-off-by: Luo Xionghu <xionghu.luo at intel.com>
> ---
>  utests/compiler_degrees.cpp | 4 +++-
>  1 file changed, 3 insertions(+), 1 deletion(-)
> 
> diff --git a/utests/compiler_degrees.cpp b/utests/compiler_degrees.cpp
> index 7a17ca7..2079267 100644
> --- a/utests/compiler_degrees.cpp
> +++ b/utests/compiler_degrees.cpp
> @@ -1,5 +1,7 @@
>  #include "utest_helper.hpp"
> 
> +#define M_180_PI_F   57.295779513082321F
> +
>  void compiler_degrees(void)
>  {
>    const int n = 32;
> @@ -24,7 +26,7 @@ void compiler_degrees(void)
> 
>    OCL_MAP_BUFFER(1);
>    for (int i = 0; i < n; ++i) {
> -    OCL_ASSERT(((float *)buf_data[1])[i] == src[i] * (180 /
> 3.141592653589793F));
> +    OCL_ASSERT(((float *)buf_data[1])[i] == src[i] * M_180_PI_F);
>    }
>    OCL_UNMAP_BUFFER(1);
>  }
> --
> 1.9.1
> 
> _______________________________________________
> Beignet mailing list
> Beignet at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/beignet


More information about the Beignet mailing list