[Beignet] [PATCH] libocl: define NULL to zero
Zhigang Gong
zhigang.gong at linux.intel.com
Wed Feb 25 00:05:02 PST 2015
LGTM, will push latter, thanks.
On Sun, Feb 15, 2015 at 04:18:15PM +0800, Ruiling Song wrote:
> using (void*)0 could not pass compilation in clang 3.6.
> It will be treated as private address space pointer, if you compare
> a global pointer with NULL, that is a private and global pointer
> comparison, this is not allowed by OpenCL spec. But zero is allowed
> as it is a pointer and integer comparison.
>
> Detailed discussion, please read:
> http://lists.cs.uiuc.edu/pipermail/cfe-dev/2015-February/041429.html
>
> Signed-off-by: Ruiling Song <ruiling.song at intel.com>
> ---
> backend/src/libocl/include/ocl_types.h | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/backend/src/libocl/include/ocl_types.h b/backend/src/libocl/include/ocl_types.h
> index 3b4ce97..487fe68 100644
> --- a/backend/src/libocl/include/ocl_types.h
> +++ b/backend/src/libocl/include/ocl_types.h
> @@ -21,7 +21,7 @@
> #pragma OPENCL EXTENSION cl_khr_fp64 : enable
> #include "ocl_defines.h"
>
> -#define NULL ((void*)0)
> +#define NULL 0
>
> /////////////////////////////////////////////////////////////////////////////
> // OpenCL Common Defines
> --
> 1.7.10.4
>
> _______________________________________________
> Beignet mailing list
> Beignet at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/beignet
More information about the Beignet
mailing list