[Beignet] [PATCH V2] Add -cl-fast-relaxed-math into incompatible opts and fix the PreprocessorOptions bug

Zhigang Gong zhigang.gong at linux.intel.com
Wed Jan 15 18:41:13 PST 2014


LGTM, pushed, thanks.

On Wed, Jan 15, 2014 at 03:34:12PM +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/backend/program.cpp |    7 ++++++-
>  1 file changed, 6 insertions(+), 1 deletion(-)
> 
> diff --git a/backend/src/backend/program.cpp b/backend/src/backend/program.cpp
> index 3ab1bc2..728fa5f 100644
> --- a/backend/src/backend/program.cpp
> +++ b/backend/src/backend/program.cpp
> @@ -563,7 +563,7 @@ namespace gbe {
>      clang::LangOptions & lang_opts = Clang.getLangOpts();
>      lang_opts.OpenCL = 1;
>  
> -    clang::PreprocessorOptions prep_opt = Clang.getPreprocessorOpts();
> +    clang::PreprocessorOptions& prep_opt = Clang.getPreprocessorOpts();
>      prep_opt.DisablePCHValidation = 1;
>  
>      //llvm flags need command line parsing to take effect
> @@ -694,9 +694,14 @@ namespace gbe {
>  
>      if(options) {
>        char *p;
> +      /* FIXME: Though we can disable the pch valid check, and load pch successfully,
> +         but these language opts and pre-defined macro will still generate the diag msg
> +         to the diag engine of the Clang and cause the Clang to report error.
> +         We filter them all here to avoid these. */
>        const char * incompatible_opts[] = {
>            "-cl-single-precision-constant",
>  //        "-cl-denorms-are-zero",
> +          "-cl-fast-relaxed-math",
>            "-cl-std=",
>        };
>        const char * incompatible_defs[] = {
> -- 
> 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