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

junyan.he at inbox.com junyan.he at inbox.com
Tue Jan 14 23:34:12 PST 2014


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



More information about the Beignet mailing list