summaryrefslogtreecommitdiff
path: root/sc/source/core/opencl
diff options
context:
space:
mode:
authorLuboš Luňák <l.lunak@collabora.com>2018-12-04 12:58:11 +0100
committerLuboš Luňák <l.lunak@collabora.com>2018-12-05 11:02:24 +0100
commit581c7e4a0ec50aaa13112985c7e79cd66628f997 (patch)
tree20f9b38a523c1491c4ef9fa85da8b736fd49d237 /sc/source/core/opencl
parent866eb1c49d385f497aa1585284393343910098ab (diff)
OpenCL SQRT() error checking
Change-Id: I6208cf21f53d1a2a0eb4f08962c7bddcc372aab5 Reviewed-on: https://gerrit.libreoffice.org/64545 Tested-by: Jenkins Reviewed-by: Luboš Luňák <l.lunak@collabora.com>
Diffstat (limited to 'sc/source/core/opencl')
-rw-r--r--sc/source/core/opencl/op_math.cxx6
1 files changed, 6 insertions, 0 deletions
diff --git a/sc/source/core/opencl/op_math.cxx b/sc/source/core/opencl/op_math.cxx
index 224c6480c3b5..4b34df551426 100644
--- a/sc/source/core/opencl/op_math.cxx
+++ b/sc/source/core/opencl/op_math.cxx
@@ -1278,6 +1278,10 @@ void OpSqrt::GenSlidingWindowFunction(std::stringstream &ss,
ss << " arg0=";
ss << tmpCur->GetDouble() << ";\n";
}
+ else
+ {
+ throw Unhandled( __FILE__, __LINE__ );
+ }
}
else
{
@@ -1285,6 +1289,8 @@ void OpSqrt::GenSlidingWindowFunction(std::stringstream &ss,
ss << vSubArguments[0]->GenSlidingWindowDeclRef();
ss << ";\n";
}
+ ss << " if( arg0 < 0 )\n";
+ ss << " return CreateDoubleError(IllegalArgument);\n";
ss << " return sqrt(arg0);\n";
ss << "}";
}