[Beignet] [PATCH] Fix bug for bitcast test case because of long type.
Zhigang Gong
zhigang.gong at linux.intel.com
Wed Jan 21 15:56:27 PST 2015
LGTM, pushed, thanks.
On Wed, Jan 21, 2015 at 03:05:29PM +0800, junyan.he at inbox.com wrote:
> From: Junyan He <junyan.he at linux.intel.com>
>
> ulong and uint64_t have different size on i386 and
> i386_64, which cause the test case failure.
>
> Signed-off-by: Junyan He <junyan.he at linux.intel.com>
> ---
> utests/compiler_long_bitcast.cpp | 10 +++++-----
> 1 file changed, 5 insertions(+), 5 deletions(-)
>
> diff --git a/utests/compiler_long_bitcast.cpp b/utests/compiler_long_bitcast.cpp
> index 5bd962d..112363a 100644
> --- a/utests/compiler_long_bitcast.cpp
> +++ b/utests/compiler_long_bitcast.cpp
> @@ -43,7 +43,7 @@ void compiler_bitcast_long_to_char8(void)
> {
> const size_t n = 64;
> const int v = 8;
> - ulong src[n];
> + uint64_t src[n];
> char *dst = (char *)src;
>
> // Setup kernel and buffers
> @@ -92,7 +92,7 @@ void compiler_bitcast_int2_to_long(void)
> locals[0] = 16;
>
> for (int32_t i = 0; i < (int32_t) n*v; ++i) {
> - src[i] = (char)rand();
> + src[i] = (int)rand();
> }
>
> OCL_MAP_BUFFER(0);
> @@ -115,7 +115,7 @@ void compiler_bitcast_long_to_int2(void)
> {
> const size_t n = 64;
> const int v = 2;
> - ulong src[n];
> + uint64_t src[n];
> uint32_t *dst = (uint32_t *)src;
>
> // Setup kernel and buffers
> @@ -164,7 +164,7 @@ void compiler_bitcast_short4_to_long(void)
> locals[0] = 16;
>
> for (int32_t i = 0; i < (int32_t) n*v; ++i) {
> - src[i] = (char)rand();
> + src[i] = (short)rand();
> }
>
> OCL_MAP_BUFFER(0);
> @@ -187,7 +187,7 @@ void compiler_bitcast_long_to_short4(void)
> {
> const size_t n = 64;
> const int v = 4;
> - ulong src[n];
> + uint64_t src[n];
> uint16_t *dst = (uint16_t *)src;
>
> // Setup kernel and buffers
> --
> 1.7.9.5
>
> _______________________________________________
> Beignet mailing list
> Beignet at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/beignet
More information about the Beignet
mailing list