[Beignet] [PATCH] GBE: don't enable double by default.

Yang, Rong R rong.r.yang at intel.com
Thu Sep 11 01:25:32 PDT 2014


LGTM, thanks.

> -----Original Message-----
> From: Beignet [mailto:beignet-bounces at lists.freedesktop.org] On Behalf Of
> Zhigang Gong
> Sent: Thursday, September 11, 2014 3:31 PM
> To: beignet at lists.freedesktop.org
> Cc: Gong, Zhigang
> Subject: [Beignet] [PATCH] GBE: don't enable double by default.
> 
> Actually, we don't support double completely currently.
> Let's disable it now. This bring a little incompatible point with the 1.2 spec
> which doesn't require the kernel to use the following pragma to enable fp64.
>  #pragma OPENCL EXTENSION cl_khr_fp64 : enable
> 
> If the application wants to try the partially supported double with beignet
> under opencl 1.2, the application will still need to add the above pragma.
> 
> Signed-off-by: Zhigang Gong <zhigang.gong at intel.com>
> ---
>  backend/src/backend/program.cpp | 6 +++++-
>  1 file changed, 5 insertions(+), 1 deletion(-)
> 
> diff --git a/backend/src/backend/program.cpp
> b/backend/src/backend/program.cpp index 06c22ac..be83108 100644
> --- a/backend/src/backend/program.cpp
> +++ b/backend/src/backend/program.cpp
> @@ -723,10 +723,14 @@ namespace gbe {
> 
>      FILE *clFile = fdopen(clFd, "w");
>      FATAL_IF(clFile == NULL, "Failed to open temporary file");
> -
> +    // XXX enable cl_khr_fp64 may cause some potential bugs.
> +    // we may need to revisit here latter when we want to support fp64
> completely.
> +    // For now, as we don't support fp64 actually, just disable it by default.
> +#if 0
>      #define ENABLE_CL_KHR_FP64_STR "#pragma OPENCL EXTENSION
> cl_khr_fp64 : enable\n"
>      if (options && !strstr(const_cast<char *>(options), "-cl-std=CL1.1"))
>        fwrite(ENABLE_CL_KHR_FP64_STR,
> strlen(ENABLE_CL_KHR_FP64_STR), 1, clFile);
> +#endif
> 
>      if (!findPCH || invalidPCH) {
>        clOpt.push_back("-include");
> --
> 1.8.3.2
> 
> _______________________________________________
> Beignet mailing list
> Beignet at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/beignet


More information about the Beignet mailing list