[Libreoffice-commits] core.git: Branch 'feature/calc-group-interpreter-4' - 2 commits - sc/source
I-Jui Sung (Ray)
ray at multicorewareinc.com
Fri Nov 15 15:42:34 PST 2013
sc/source/core/opencl/formulagroupcl.cxx | 4 ++--
sc/source/core/opencl/op_math.cxx | 5 +++--
2 files changed, 5 insertions(+), 4 deletions(-)
New commits:
commit e56fdb8c2f925bccf3bd0f9be3248ed58bf7863e
Author: I-Jui (Ray) Sung <ray at multicorewareinc.com>
Date: Fri Nov 15 13:37:22 2013 -0600
GPU Calc: fix compilation error in using sprintf
Change-Id: Iea316f3355a9105702391aa7b76268cdfc8831ef
diff --git a/sc/source/core/opencl/op_math.cxx b/sc/source/core/opencl/op_math.cxx
index 8383321..aac8661 100644
--- a/sc/source/core/opencl/op_math.cxx
+++ b/sc/source/core/opencl/op_math.cxx
@@ -1927,10 +1927,11 @@ void OpProduct::GenSlidingWindowFunction(std::stringstream &ss,
ss << " int gid0 = get_global_id(0);\n";
ss << " int i = 0;\n";
ss << " double product=0.0;\n\n";
- char sArgNoI[5];
for (unsigned i = 0; i < vSubArguments.size(); i++)
{
- sprintf(sArgNoI,"%d",i);
+ std::stringstream ssArgNoI;
+ ssArgNoI << i;
+ std::string sArgNoI = ssArgNoI.str();
ss << std::string(" double arg")+sArgNoI+";\n";
FormulaToken *pCur = vSubArguments[i]->GetFormulaToken();
assert(pCur);
commit 2a6c451098b32b17bd72323b5bc1170f216a6d47
Author: I-Jui (Ray) Sung <ray at multicorewareinc.com>
Date: Fri Nov 15 14:16:40 2013 -0600
GPU Calc: revert back to OpenCL fmin and fmax
When generating code for MIN and MAX an integer version (min/max) isn't
correct.
Change-Id: I4bf1e774e37e0ce30924178f022156e0e43f4c06
diff --git a/sc/source/core/opencl/formulagroupcl.cxx b/sc/source/core/opencl/formulagroupcl.cxx
index 0b1cd4f..6d442fc 100644
--- a/sc/source/core/opencl/formulagroupcl.cxx
+++ b/sc/source/core/opencl/formulagroupcl.cxx
@@ -775,7 +775,7 @@ public:
virtual std::string GetBottom(void) { return "MAXFLOAT"; }
virtual std::string Gen2(const std::string &lhs, const std::string &rhs) const
{
- return "min("+lhs + "," + rhs +")";
+ return "fmin("+lhs + "," + rhs +")";
}
virtual std::string BinFuncName(void) const { return "min"; }
};
@@ -785,7 +785,7 @@ public:
virtual std::string GetBottom(void) { return "-MAXFLOAT"; }
virtual std::string Gen2(const std::string &lhs, const std::string &rhs) const
{
- return "max("+lhs + "," + rhs +")";
+ return "fmax("+lhs + "," + rhs +")";
}
virtual std::string BinFuncName(void) const { return "max"; }
};
More information about the Libreoffice-commits
mailing list