Kaydet (Commit) 95b61096 authored tarafından hongyu zhong's avatar hongyu zhong Kaydeden (comit) I-Jui (Ray) Sung

GPU Calc: unit test cases for BETAINV

Turn  NO_FALLBACK_TO_SWINTERP on in  formulagroupcl.cxx for test

resolve compile warning in opbase.cxx

AMLOEXT-201 BUG

Change-Id: I82917b13c43c1bcaa01928b89210c8eb7495a167
Signed-off-by: 's avatarhaochen <haochen@multicorewareinc.com>
Signed-off-by: 's avatarI-Jui (Ray) Sung <ray@multicorewareinc.com>
üst 886c5551
...@@ -232,6 +232,7 @@ public: ...@@ -232,6 +232,7 @@ public:
void testStatisticalFormulaHypGeomDist(); void testStatisticalFormulaHypGeomDist();
void testArrayFormulaSumX2MY2(); void testArrayFormulaSumX2MY2();
void testArrayFormulaSumX2PY2(); void testArrayFormulaSumX2PY2();
void testStatisticalFormulaBetainv();
CPPUNIT_TEST_SUITE(ScOpenclTest); CPPUNIT_TEST_SUITE(ScOpenclTest);
CPPUNIT_TEST(testSharedFormulaXLS); CPPUNIT_TEST(testSharedFormulaXLS);
CPPUNIT_TEST(testFinacialFormula); CPPUNIT_TEST(testFinacialFormula);
...@@ -395,6 +396,7 @@ public: ...@@ -395,6 +396,7 @@ public:
CPPUNIT_TEST(testStatisticalFormulaHypGeomDist); CPPUNIT_TEST(testStatisticalFormulaHypGeomDist);
CPPUNIT_TEST(testArrayFormulaSumX2MY2); CPPUNIT_TEST(testArrayFormulaSumX2MY2);
CPPUNIT_TEST(testArrayFormulaSumX2PY2); CPPUNIT_TEST(testArrayFormulaSumX2PY2);
CPPUNIT_TEST(testStatisticalFormulaBetainv);
CPPUNIT_TEST_SUITE_END(); CPPUNIT_TEST_SUITE_END();
private: private:
...@@ -4522,6 +4524,29 @@ void ScOpenclTest:: testArrayFormulaSumX2PY2() ...@@ -4522,6 +4524,29 @@ void ScOpenclTest:: testArrayFormulaSumX2PY2()
xDocSh->DoClose(); xDocSh->DoClose();
xDocShRes->DoClose(); xDocShRes->DoClose();
} }
//[AMLOEXT-201]
void ScOpenclTest::testStatisticalFormulaBetainv()
{
if (!detectOpenCLDevice())
return;
ScDocShellRef xDocSh = loadDoc("opencl/statistical/Betainv.", XLS);
ScDocument* pDoc = xDocSh->GetDocument();
CPPUNIT_ASSERT(pDoc);
enableOpenCL();
pDoc->CalcAll();
ScDocShellRef xDocShRes = loadDoc("opencl/statistical/Betainv.", XLS);
ScDocument* pDocRes = xDocShRes->GetDocument();
CPPUNIT_ASSERT(pDocRes);
// Check the results of formula cells in the shared formula range.
for (SCROW i = 1; i <= 19; ++i)
{
double fLibre = pDoc->GetValue(ScAddress(5,i,0));
double fExcel = pDocRes->GetValue(ScAddress(5,i,0));
CPPUNIT_ASSERT_DOUBLES_EQUAL(fExcel, fLibre, fabs(0.0001*fExcel));
}
xDocSh->DoClose();
xDocShRes->DoClose();
}
ScOpenclTest::ScOpenclTest() ScOpenclTest::ScOpenclTest()
: ScBootstrapFixture( "/sc/qa/unit/data" ) : ScBootstrapFixture( "/sc/qa/unit/data" )
{ {
......
...@@ -2280,7 +2280,6 @@ bool FormulaGroupInterpreterOpenCL::interpret( ScDocument& rDoc, ...@@ -2280,7 +2280,6 @@ bool FormulaGroupInterpreterOpenCL::interpret( ScDocument& rDoc,
if (err != CL_SUCCESS) if (err != CL_SUCCESS)
throw OpenCLError(err); throw OpenCLError(err);
delete mpKernel; delete mpKernel;
return true;
} }
#undef NO_FALLBACK_TO_SWINTERP /* undef this for non-TDD runs */ #undef NO_FALLBACK_TO_SWINTERP /* undef this for non-TDD runs */
catch (const UnhandledToken &ut) { catch (const UnhandledToken &ut) {
...@@ -2312,6 +2311,7 @@ bool FormulaGroupInterpreterOpenCL::interpret( ScDocument& rDoc, ...@@ -2312,6 +2311,7 @@ bool FormulaGroupInterpreterOpenCL::interpret( ScDocument& rDoc,
return false; return false;
#endif #endif
} }
return true;
} // namespace opencl } // namespace opencl
}} // namespace sc }} // namespace sc
......
...@@ -183,8 +183,7 @@ void CheckVariables::CheckSubArgumentIsNan2( std::stringstream & ss, ...@@ -183,8 +183,7 @@ void CheckVariables::CheckSubArgumentIsNan2( std::stringstream & ss,
formula::svSingleVectorRef) formula::svSingleVectorRef)
ss<<"[get_group_id(1)]"; ss<<"[get_group_id(1)]";
ss<<", 0);\n"; ss<<", 0);\n";
return; #else
#endif
ss <<" tmp"; ss <<" tmp";
ss <<i; ss <<i;
ss << "="; ss << "=";
...@@ -197,6 +196,7 @@ void CheckVariables::CheckSubArgumentIsNan2( std::stringstream & ss, ...@@ -197,6 +196,7 @@ void CheckVariables::CheckSubArgumentIsNan2( std::stringstream & ss,
ss<<"[get_group_id(1)]"; ss<<"[get_group_id(1)]";
ss<<";\n"; ss<<";\n";
#endif
} }
void CheckVariables::CheckAllSubArgumentIsNan( void CheckVariables::CheckAllSubArgumentIsNan(
......
...@@ -1463,6 +1463,7 @@ void ScTokenArray::CheckToken( const FormulaToken& r ) ...@@ -1463,6 +1463,7 @@ void ScTokenArray::CheckToken( const FormulaToken& r )
case ocHypGeomDist: case ocHypGeomDist:
case ocSumX2MY2: case ocSumX2MY2:
case ocSumX2DY2: case ocSumX2DY2:
case ocBetaInv:
// Don't change the state. // Don't change the state.
break; break;
default: default:
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment