diff options
author | I-Jui (Ray) Sung <ray@multicorewareinc.com> | 2013-11-25 01:10:04 -0600 |
---|---|---|
committer | I-Jui (Ray) Sung <ray@multicorewareinc.com> | 2013-11-25 01:19:45 -0600 |
commit | 01a977486f0999950bf61b2c8592426e26cfe4f8 (patch) | |
tree | 99a2e056cfa899f369179c4801d902aacabc3115 /sc/qa/unit | |
parent | 7e3d93e763770c7759555cfe7441573a97d276c1 (diff) |
GPU Calc: a test case for unrolling SumOfProduct
AMLOEXT-245 BUG
Change-Id: Ia8756af26c765820a04137a87f6681447dd18efd
Diffstat (limited to 'sc/qa/unit')
-rw-r--r-- | sc/qa/unit/data/xls/opencl/math/sumproductTest.xls | bin | 0 -> 112640 bytes | |||
-rw-r--r-- | sc/qa/unit/opencl-test.cxx | 26 |
2 files changed, 26 insertions, 0 deletions
diff --git a/sc/qa/unit/data/xls/opencl/math/sumproductTest.xls b/sc/qa/unit/data/xls/opencl/math/sumproductTest.xls Binary files differnew file mode 100644 index 000000000000..28eaebf8f545 --- /dev/null +++ b/sc/qa/unit/data/xls/opencl/math/sumproductTest.xls diff --git a/sc/qa/unit/opencl-test.cxx b/sc/qa/unit/opencl-test.cxx index faf2ddbbf9dd..833d9c0824a6 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 testMathFormulaSumProduct2(); void testStatisticalParallelCountBug(); CPPUNIT_TEST_SUITE(ScOpenclTest); CPPUNIT_TEST(testSharedFormulaXLS); @@ -416,6 +417,7 @@ public: CPPUNIT_TEST(testStatisticalFormulaCovar); CPPUNIT_TEST(testLogicalFormulaAnd); CPPUNIT_TEST(testMathFormulaSumProduct); + CPPUNIT_TEST(testMathFormulaSumProduct2); CPPUNIT_TEST(testStatisticalParallelCountBug); CPPUNIT_TEST_SUITE_END(); @@ -4792,6 +4794,30 @@ void ScOpenclTest::testMathFormulaSumProduct() xDocSh->DoClose(); xDocShRes->DoClose(); } +//[AMLOEXT-245] +void ScOpenclTest::testMathFormulaSumProduct2() +{ + if (!detectOpenCLDevice()) + return; + ScDocShellRef xDocSh = loadDoc("opencl/math/sumproductTest.", XLS); + ScDocument* pDoc = xDocSh->GetDocument(); + CPPUNIT_ASSERT(pDoc); + enableOpenCL(); + pDoc->CalcAll(); + ScDocShellRef xDocShRes = loadDoc("opencl/math/sumproductTest.", XLS); + ScDocument* pDocRes = xDocShRes->GetDocument(); + CPPUNIT_ASSERT(pDocRes); + // Check the results of formula cells in the shared formula range. + for (SCROW i = 2; i <= 12; ++i) + { + double fLibre = pDoc->GetValue(ScAddress(4,i,1)); + double fExcel = pDocRes->GetValue(ScAddress(4,i,1)); + CPPUNIT_ASSERT_DOUBLES_EQUAL(fExcel, fLibre, fabs(0.0001*fExcel)); + } + xDocSh->DoClose(); + xDocShRes->DoClose(); +} + //[AMLOEXT-217] void ScOpenclTest:: testLogicalFormulaAnd() { |