[Beignet] [PATCH] Add the missing function prototypes of any() and atom_add()

Zhigang Gong zhigang.gong at linux.intel.com
Tue Sep 9 22:54:58 PDT 2014


LGTM, pushed, thanks.

On Fri, Sep 05, 2014 at 04:54:16PM +0800, junyan.he at inbox.com wrote:
> From: Junyan He <junyan.he at linux.intel.com>
> 
> Signed-off-by: Junyan He <junyan.he at linux.intel.com>
> ---
>  backend/src/libocl/include/ocl_atom.h         |    1 +
>  backend/src/libocl/tmpl/ocl_relational.tmpl.h |   25 +++++++++++++++++++++++++
>  2 files changed, 26 insertions(+)
> 
> diff --git a/backend/src/libocl/include/ocl_atom.h b/backend/src/libocl/include/ocl_atom.h
> index b2cfcbf..95a6b36 100644
> --- a/backend/src/libocl/include/ocl_atom.h
> +++ b/backend/src/libocl/include/ocl_atom.h
> @@ -69,6 +69,7 @@ OVERLOADABLE int atomic_cmpxchg (volatile __local int *p, int cmp, int val);
>  
>  // XXX for conformance test
>  // The following atom_xxx api is on OpenCL spec 1.0.
> +#define atom_add atomic_add
>  #define atom_sub atomic_sub
>  #define atom_and atomic_and
>  #define atom_or atomic_or
> diff --git a/backend/src/libocl/tmpl/ocl_relational.tmpl.h b/backend/src/libocl/tmpl/ocl_relational.tmpl.h
> index 6d8157d..7d6d698 100644
> --- a/backend/src/libocl/tmpl/ocl_relational.tmpl.h
> +++ b/backend/src/libocl/tmpl/ocl_relational.tmpl.h
> @@ -22,7 +22,32 @@ OVERLOADABLE int isordered(float x, float y);
>  OVERLOADABLE int isunordered(float x, float y);
>  OVERLOADABLE int signbit(float x);
>  
> +// any
> +#define DEC1(type) OVERLOADABLE int any(type a);
> +#define DEC2(type) OVERLOADABLE int any(type a);
> +#define DEC3(type) OVERLOADABLE int any(type a);
> +#define DEC4(type) OVERLOADABLE int any(type a);
> +#define DEC8(type) OVERLOADABLE int any(type a);
> +#define DEC16(type) OVERLOADABLE int any(type a);
> +DEC1(char);
> +DEC1(short);
> +DEC1(int);
> +DEC1(long);
> +#define DEC(n) DEC##n(char##n); DEC##n(short##n); DEC##n(int##n); DEC##n(long##n);
> +DEC(2);
> +DEC(3);
> +DEC(4);
> +DEC(8);
> +DEC(16);
> +#undef DEC
> +#undef DEC1
> +#undef DEC2
> +#undef DEC3
> +#undef DEC4
> +#undef DEC8
> +#undef DEC16
>  
> +// all
>  #define DEC1(type) OVERLOADABLE int all(type a);
>  #define DEC2(type) OVERLOADABLE int all(type a);
>  #define DEC3(type) OVERLOADABLE int all(type a);
> -- 
> 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