Not very elgant but does work. Pushed, thanks.
On Fri, Sep 05, 2014 at 04:54:27PM +0800, [email protected] wrote: > From: Junyan He <[email protected]> > > Signed-off-by: Junyan He <[email protected]> > --- > backend/src/backend/program.cpp | 15 ++++++++++++++- > 1 file changed, 14 insertions(+), 1 deletion(-) > > diff --git a/backend/src/backend/program.cpp b/backend/src/backend/program.cpp > index 092398c..30e7a0b 100644 > --- a/backend/src/backend/program.cpp > +++ b/backend/src/backend/program.cpp > @@ -629,6 +629,7 @@ namespace gbe { > std::istringstream idirs(dirs); > std::string pchFileName; > bool findPCH = false; > + bool invalidPCH = false; > size_t start = 0, end = 0; > > std::string hdirs = OCL_HEADER_FILE_DIR; > @@ -653,6 +654,10 @@ namespace gbe { > std::string optionStr(str); > const std::string unsupportedOptions("-cl-denorms-are-zero, > -cl-strict-aliasing, -cl-opt-disable," > "-cl-no-signed-zeros, > -cl-fp32-correctly-rounded-divide-sqrt"); > + > + const std::string uncompatiblePCHOptions = > ("-cl-single-precision-constant, -cl-fast-relaxed-math"); > + const std::string fastMathOption = ("-cl-fast-relaxed-math"); > + > while (end != std::string::npos) { > end = optionStr.find(' ', start); > std::string str = optionStr.substr(start, end - start); > @@ -663,6 +668,14 @@ namespace gbe { > if(unsupportedOptions.find(str) != std::string::npos) > continue; > > + if (uncompatiblePCHOptions.find(str) != std::string::npos) > + invalidPCH = true; > + > + if (fastMathOption.find(str) != std::string::npos) { > + clOpt.push_back("-D"); > + clOpt.push_back("__FAST_RELAXED_MATH__=1"); > + } > + > clOpt.push_back(str); > } > free(str); > @@ -688,7 +701,7 @@ namespace gbe { > FILE *clFile = fdopen(clFd, "w"); > FATAL_IF(clFile == NULL, "Failed to open temporary file"); > > - if (!findPCH) { > + if (!findPCH || invalidPCH) { > clOpt.push_back("-include"); > clOpt.push_back("ocl.h"); > } else { > -- > 1.7.9.5 > > _______________________________________________ > Beignet mailing list > [email protected] > http://lists.freedesktop.org/mailman/listinfo/beignet _______________________________________________ Beignet mailing list [email protected] http://lists.freedesktop.org/mailman/listinfo/beignet
