diff options
author | fengzeng <fengzeng@multicorewareinc.com> | 2013-11-11 11:37:50 +0800 |
---|---|---|
committer | I-Jui (Ray) Sung <ray@multicorewareinc.com> | 2013-11-14 20:30:55 -0600 |
commit | d7867b28623e4220f62b8ed9259bed5d8878a3b3 (patch) | |
tree | 3df99f1c0e06261879ee366e78390dd063813219 /sc/qa | |
parent | 6eceefc23748c92d29fb5da8f84fcb54cb78bca4 (diff) |
GPU Calc: unit test cases for SQRTPI
Need to turn on NO_FALLBACK_TO_SWINTERP in formulagroupcl.cxx for test
AMLOEXT-182 BUG
Change-Id: I314e4b8cc4434d20346c908a7eb2f274838e0d11
Signed-off-by: haochen <haochen@multicorewareinc.com>
Signed-off-by: I-Jui (Ray) Sung <ray@multicorewareinc.com>
Diffstat (limited to 'sc/qa')
-rw-r--r-- | sc/qa/unit/data/xls/opencl/math/sqrtpi.xls | bin | 0 -> 24576 bytes | |||
-rw-r--r-- | sc/qa/unit/opencl-test.cxx | 24 |
2 files changed, 24 insertions, 0 deletions
diff --git a/sc/qa/unit/data/xls/opencl/math/sqrtpi.xls b/sc/qa/unit/data/xls/opencl/math/sqrtpi.xls Binary files differnew file mode 100644 index 000000000000..2acf5b282a2a --- /dev/null +++ b/sc/qa/unit/data/xls/opencl/math/sqrtpi.xls diff --git a/sc/qa/unit/opencl-test.cxx b/sc/qa/unit/opencl-test.cxx index 648b2bc14461..b00d1e299b55 100644 --- a/sc/qa/unit/opencl-test.cxx +++ b/sc/qa/unit/opencl-test.cxx @@ -215,6 +215,7 @@ public: void testStatisticalFormulaPoisson(); void testMathFormulaSumSQ(); void testStatisticalFormulaSkewp(); + void testMathFormulaSqrtPi(); CPPUNIT_TEST_SUITE(ScOpenclTest); CPPUNIT_TEST(testSharedFormulaXLS); CPPUNIT_TEST(testFinacialFormula); @@ -361,6 +362,7 @@ public: CPPUNIT_TEST(testStatisticalFormulaPoisson); CPPUNIT_TEST(testMathFormulaSumSQ); CPPUNIT_TEST(testStatisticalFormulaSkewp); + CPPUNIT_TEST(testMathFormulaSqrtPi); CPPUNIT_TEST_SUITE_END(); private: @@ -4077,6 +4079,28 @@ void ScOpenclTest::testMathFormulaCombina() xDocSh->DoClose(); xDocShRes->DoClose(); } +//[AMLOEXT-182] +void ScOpenclTest::testMathFormulaSqrtPi() +{ + if (!detectOpenCLDevice()) + return; + ScDocShellRef xDocSh = loadDoc("opencl/math/sqrtpi.", XLS); + ScDocument* pDoc = xDocSh->GetDocument(); + CPPUNIT_ASSERT(pDoc); + enableOpenCL(); + pDoc->CalcAll(); + ScDocShellRef xDocShRes = loadDoc("opencl/math/sqrtpi.", XLS); + ScDocument* pDocRes = xDocShRes->GetDocument(); + CPPUNIT_ASSERT(pDocRes); + for (SCROW i = 0; i < 20; ++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" ) { |