[Libreoffice-commits] core.git: Branch 'feature/calc-group-interpreter-4' - 3 commits - sc/qa sc/source

I-Jui Sung (Ray) ray at multicorewareinc.com
Fri Nov 22 09:51:03 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 
 sc/source/core/opencl/formulagroupcl_public.hxx                   |    2 
 4 files changed, 30 insertions(+), 2 deletions(-)

New commits:
commit c5014f8ffe182065aca3252cc3dd2160028f733a
Author: I-Jui (Ray) Sung <ray at multicorewareinc.com>
Date:   Fri Nov 22 11:48:14 2013 -0600

    GPU Calc: using intrinsic isnan()
    
    Change-Id: Ic714074a22847fbe4ac39cd035d4924fb0525efd

diff --git a/sc/source/core/opencl/formulagroupcl_public.hxx b/sc/source/core/opencl/formulagroupcl_public.hxx
index d001a06..eaf4227 100644
--- a/sc/source/core/opencl/formulagroupcl_public.hxx
+++ b/sc/source/core/opencl/formulagroupcl_public.hxx
@@ -11,7 +11,7 @@
 #define SC_OPENCL_FORMULAGROUPCL_PUBLIC_HXX
 
 const char* publicFunc =
- "int isNan(double a) { return a != a; }\n"
+ "int isNan(double a) { return isnan(a); }\n"
  "double fsum_count(double a, double b, __private int *p) {\n"
  "    bool t = isNan(a);\n"
  "    (*p) += t?0:1;\n"
commit 76ec9bb5bdd3169203d232431e8cff2e923f3678
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 86a73b0..6fabd98 100644
--- a/sc/qa/unit/opencl-test.cxx
+++ b/sc/qa/unit/opencl-test.cxx
@@ -244,6 +244,7 @@ public:
     void testStatisticalFormulaCovar();
     void testLogicalFormulaAnd();
     void testMathFormulaSumProduct();
+    void testStatisticalParallelCountBug();
     CPPUNIT_TEST_SUITE(ScOpenclTest);
     CPPUNIT_TEST(testSharedFormulaXLS);
     CPPUNIT_TEST(testFinacialFormula);
@@ -417,6 +418,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 1d16cbb10f02a79d23eb7e08c42a860e15767ce8
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 44584b8..2c795cc 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