summaryrefslogtreecommitdiff
path: root/sc
diff options
context:
space:
mode:
authorhaochen <haochen@multicorewareinc.com>2013-12-31 16:36:53 +0800
committerI-Jui (Ray) Sung <ray@multicorewareinc.com>2013-12-31 17:20:07 -0600
commitaf31ebe82a294ff08bb6c3e46becb29830864f14 (patch)
tree2d0b6f0cccf90b2b5a8fae342c174af435269849 /sc
parent45211c27c464309f01c7a4bb56c73d829966c4b1 (diff)
GPU Calc: Remove unnecessary 'std::cerr'
And add 'exception catching' for return to CPU caculate Change-Id: I640894d677eaf73367bb51dec51c8baeb412bca6 Signed-off-by: haochen <haochen@multicorewareinc.com> Signed-off-by: Wei Wei <weiwei@multicorewareinc.com> Signed-off-by: I-Jui (Ray) Sung <ray@multicorewareinc.com>
Diffstat (limited to 'sc')
-rw-r--r--sc/source/core/opencl/formulagroupcl.cxx10
-rw-r--r--sc/source/core/opencl/op_math.hxx2
2 files changed, 8 insertions, 4 deletions
diff --git a/sc/source/core/opencl/formulagroupcl.cxx b/sc/source/core/opencl/formulagroupcl.cxx
index 4ae6fef41d0e..38c91a9f2fb6 100644
--- a/sc/source/core/opencl/formulagroupcl.cxx
+++ b/sc/source/core/opencl/formulagroupcl.cxx
@@ -1930,7 +1930,8 @@ DynamicKernelSoPArguments::DynamicKernelSoPArguments(
mvSubArguments.push_back(
SubArgument(new DynamicKernelConstantArgument(ts,
ft->Children[i])));
- } else if (pChild->GetType() == formula::svString) {
+ } else if (pChild->GetType() == formula::svString
+ && pCodeGen->takeString()) {
mvSubArguments.push_back(
SubArgument(new ConstStringArgument(ts,
ft->Children[i])));
@@ -3040,19 +3041,16 @@ void DynamicKernel::CreateKernel(void)
std::string KernelHash = mKernelSignature+GetMD5();
if (lastOneKernelHash == KernelHash && lastOneProgram)
{
- std::cerr<<"cl_program cache hit: "<< KernelHash << "\n";
mpProgram = lastOneProgram;
}
else if(lastSecondKernelHash == KernelHash && lastSecondProgram)
{
- std::cerr<<"cl_program cache hit: "<< KernelHash << "\n";
mpProgram = lastSecondProgram;
}
else
{ // doesn't match the last compiled formula.
if (lastSecondProgram) {
- std::cerr<<"Freeing lastsecond program: "<< GetMD5() << "\n";
clReleaseProgram(lastSecondProgram);
}
if (OpenclDevice::buildProgramFromBinary("",
@@ -3240,6 +3238,10 @@ DynamicKernel* DynamicKernel::create(ScDocument& /* rDoc */,
return NULL;
#endif
}
+ catch (...) {
+ std::cerr << "Dynamic formula compiler: unhandled compiler error\n";
+ return NULL;
+ }
return pDynamicKernel;
}
diff --git a/sc/source/core/opencl/op_math.hxx b/sc/source/core/opencl/op_math.hxx
index 80b3a8ebbabd..29214bc4223e 100644
--- a/sc/source/core/opencl/op_math.hxx
+++ b/sc/source/core/opencl/op_math.hxx
@@ -364,6 +364,8 @@ public:
virtual void GenSlidingWindowFunction(std::stringstream &ss,
const std::string sSymName, SubArguments &vSubArguments);
virtual std::string BinFuncName(void) const { return "Convert"; }
+ virtual bool takeString() const { return true; }
+
};
class OpEven: public Normal
{