summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormingli <mingli@multicorewareinc.com>2013-12-31 12:42:07 +0800
committerI-Jui (Ray) Sung <ray@multicorewareinc.com>2013-12-31 17:20:03 -0600
commit076a2d991a59ffb2d22bb056010c8f3dcc3007f1 (patch)
tree97feb0be19458879336c82a0dcb826a16a4cb9e5
parent165e22397d237245fbda17d265ee3e75ed472ed6 (diff)
GPU Calc: Fix Not support multiple data types of HARMEAN
AMLOEXT-401 FIX Change-Id: If398e6abfb7eec11033290fb7e9c87c26829ef90 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>
-rw-r--r--sc/source/core/opencl/op_statistical.cxx17
1 files changed, 10 insertions, 7 deletions
diff --git a/sc/source/core/opencl/op_statistical.cxx b/sc/source/core/opencl/op_statistical.cxx
index b1ccacaea6d2..54ec99cf0d80 100644
--- a/sc/source/core/opencl/op_statistical.cxx
+++ b/sc/source/core/opencl/op_statistical.cxx
@@ -4428,26 +4428,29 @@ vSubArguments)
}
else if (pCur->GetType() == formula::svSingleVectorRef)
{
- ss << " double arg0 = ";
+ ss << " tmp = ";
ss << vSubArguments[i]->GenSlidingWindowDeclRef();
ss << ";\n";
#ifdef ISNAN
- ss << " if(isNan(arg0))\n";
+ ss << " if(!isNan(tmp))\n";
ss << " {\n";
- ss << " continue;\n";
+ ss << " nVal += (1.0 * pow( tmp,-1));\n";
+ ss << " totallength +=1;\n";
ss << " }\n";
#endif
- ss << " nVal += (1.0 * pow( arg0,-1));\n";
- ss << " totallength +=1;\n";
}
else if (pCur->GetType() == formula::svDouble)
{
- ss << " double arg0 = ";
+ ss << " tmp = ";
ss << vSubArguments[i]->GenSlidingWindowDeclRef();
ss << ";\n";
- ss << " nVal += (1.0 *pow( arg0,-1));\n";
+ ss << " nVal += (1.0 *pow( tmp,-1));\n";
ss << " totallength +=1;\n";
}
+ else
+ {
+ ss << " return DBL_MIN;\n";
+ }
}
ss << " tmp = totallength*pow(nVal,-1);\n";
ss << " return tmp;\n";