[Libreoffice-commits] core.git: Branch 'libreoffice-4-2' - 2 commits - sc/qa sc/source
I-Jui Sung (Ray)
ray at multicorewareinc.com
Fri Nov 22 12:35:52 PST 2013
sc/qa/unit/data/ods/opencl/statistical/parallel_count_bug_243.ods |binary
sc/qa/unit/opencl-test.cxx | 28 ++++++++++
sc/source/core/opencl/formulagroupcl.cxx | 2
3 files changed, 29 insertions(+), 1 deletion(-)
New commits:
commit 3621f1952d129892d14ab57a123c6c3e181cae49
Author: I-Jui (Ray) Sung <ray at multicorewareinc.com>
Date: Fri Nov 22 11:38:21 2013 -0600
GPU Calc: test case for parallel count()
AMLOEXT-243 BUG
Change-Id: I97e2dab35b40f4f7fcd4975ae7c5907e97e19fd9
diff --git a/sc/qa/unit/data/ods/opencl/statistical/parallel_count_bug_243.ods b/sc/qa/unit/data/ods/opencl/statistical/parallel_count_bug_243.ods
new file mode 100644
index 0000000..4a8d5f9
Binary files /dev/null and b/sc/qa/unit/data/ods/opencl/statistical/parallel_count_bug_243.ods differ
diff --git a/sc/qa/unit/opencl-test.cxx b/sc/qa/unit/opencl-test.cxx
index 3f02d9b..faf2ddb 100644
--- a/sc/qa/unit/opencl-test.cxx
+++ b/sc/qa/unit/opencl-test.cxx
@@ -242,6 +242,7 @@ public:
void testStatisticalFormulaCovar();
void testLogicalFormulaAnd();
void testMathFormulaSumProduct();
+ void testStatisticalParallelCountBug();
CPPUNIT_TEST_SUITE(ScOpenclTest);
CPPUNIT_TEST(testSharedFormulaXLS);
CPPUNIT_TEST(testFinacialFormula);
@@ -415,6 +416,7 @@ public:
CPPUNIT_TEST(testStatisticalFormulaCovar);
CPPUNIT_TEST(testLogicalFormulaAnd);
CPPUNIT_TEST(testMathFormulaSumProduct);
+ CPPUNIT_TEST(testStatisticalParallelCountBug);
CPPUNIT_TEST_SUITE_END();
private:
@@ -4818,6 +4820,32 @@ void ScOpenclTest:: testLogicalFormulaAnd()
xDocSh->DoClose();
xDocShRes->DoClose();
}
+
+//[AMLOEXT-243]
+void ScOpenclTest:: testStatisticalParallelCountBug()
+{
+ if (!detectOpenCLDevice())
+ return;
+ ScDocShellRef xDocSh =
+ loadDoc("opencl/statistical/parallel_count_bug_243.", ODS);
+ ScDocument *pDoc = xDocSh->GetDocument();
+ CPPUNIT_ASSERT(pDoc);
+ enableOpenCL();
+ pDoc->CalcAll();
+ ScDocShellRef xDocShRes =
+ loadDoc("opencl/statistical/parallel_count_bug_243.", ODS);
+ ScDocument *pDocRes = xDocShRes->GetDocument();
+ CPPUNIT_ASSERT(pDocRes);
+ for (SCROW i = 0; i < 13; ++i)
+ {
+ double fLibre = pDoc->GetValue(ScAddress(2, i, 0));
+ double fExcel = pDocRes->GetValue(ScAddress(2, i, 0));
+ CPPUNIT_ASSERT_DOUBLES_EQUAL(fExcel, fLibre, fabs(0.0001*fExcel));
+ }
+ xDocSh->DoClose();
+ xDocShRes->DoClose();
+}
+
ScOpenclTest::ScOpenclTest()
: ScBootstrapFixture( "/sc/qa/unit/data" )
{
commit 80e98f2b73a0fde51c0cb0d2da097b57c4c71223
Author: I-Jui (Ray) Sung <ray at multicorewareinc.com>
Date: Fri Nov 22 11:42:14 2013 -0600
GPU Calc: fix a parallel COUNT() problem when input vector size > 512
AMLOEXT-243 FIX
Change-Id: I1a356f9a591c1f5a99d2675065b63a7673217ac6
diff --git a/sc/source/core/opencl/formulagroupcl.cxx b/sc/source/core/opencl/formulagroupcl.cxx
index 7843748..b0bb011 100644
--- a/sc/source/core/opencl/formulagroupcl.cxx
+++ b/sc/source/core/opencl/formulagroupcl.cxx
@@ -695,7 +695,7 @@ public:
ss << " if (lidx == 0)\n";
ss << " current_result =";
if (dynamic_cast<OpCount*>(mpCodeGen.get()))
- ss << "shm_buf[0]";
+ ss << "current_result + shm_buf[0]";
else
ss << mpCodeGen->Gen2("current_result", "shm_buf[0]");
ss << ";\n";
More information about the Libreoffice-commits
mailing list