[Beignet] [PATCH 3/3] Change constant unit test to cover 4 byte data type.
Zhigang Gong
zhigang.gong at linux.intel.com
Tue Sep 3 19:45:03 PDT 2013
LGTM, will pusb it latter. Thanks.
On Tue, Sep 03, 2013 at 03:42:37PM +0800, Ruiling Song wrote:
> Signed-off-by: Ruiling Song <ruiling.song at intel.com>
> ---
> kernels/compiler_function_constant0.cl | 2 +-
> utests/compiler_function_constant0.cpp | 4 ++--
> 2 files changed, 3 insertions(+), 3 deletions(-)
>
> diff --git a/kernels/compiler_function_constant0.cl b/kernels/compiler_function_constant0.cl
> index 363d84e..5340352 100644
> --- a/kernels/compiler_function_constant0.cl
> +++ b/kernels/compiler_function_constant0.cl
> @@ -1,5 +1,5 @@
> __kernel void
> -compiler_function_constant0(__constant short *c0, __constant char *c1, __global int *dst, int value)
> +compiler_function_constant0(__constant int *c0, __constant char *c1, __global int *dst, int value)
> {
> int id = (int)get_global_id(0);
> dst[id] = value + c0[id%69] + c1[0];
> diff --git a/utests/compiler_function_constant0.cpp b/utests/compiler_function_constant0.cpp
> index c0a8a9d..6fbbd30 100644
> --- a/utests/compiler_function_constant0.cpp
> +++ b/utests/compiler_function_constant0.cpp
> @@ -7,7 +7,7 @@ void compiler_function_constant0(void)
>
> // Setup kernel and buffers
> OCL_CREATE_KERNEL("compiler_function_constant0");
> - OCL_CREATE_BUFFER(buf[0], 0, 75 * sizeof(short), NULL);
> + OCL_CREATE_BUFFER(buf[0], 0, 75 * sizeof(int32_t), NULL);
> OCL_CREATE_BUFFER(buf[1], 0, 1 * sizeof(char), NULL);
> OCL_CREATE_BUFFER(buf[2], 0, n * sizeof(uint32_t), NULL);
> OCL_SET_ARG(0, sizeof(cl_mem), &buf[0]);
> @@ -17,7 +17,7 @@ void compiler_function_constant0(void)
>
> OCL_MAP_BUFFER(0);
> for(uint32_t i = 0; i < 69; ++i)
> - ((short *)buf_data[0])[i] = i;
> + ((int32_t *)buf_data[0])[i] = i;
> OCL_UNMAP_BUFFER(0);
>
> OCL_MAP_BUFFER(1);
> --
> 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