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 a2972f7d8c5037acb278d9f9fb6e51cef479de1a Author: I-Jui (Ray) Sung <r...@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 1869c062c4fe8267323764e2cc9e7367e1ec3674 Author: I-Jui (Ray) Sung <r...@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 8b9c106064b6899e4bb4a86efb8906eef758c5bf Author: I-Jui (Ray) Sung <r...@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"; _______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits