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:
void testStatisticalFormulaHypGeomDist();
void testArrayFormulaSumX2MY2();
void testArrayFormulaSumX2PY2();
void testStatisticalFormulaBetainv();
CPPUNIT_TEST_SUITE(ScOpenclTest);
CPPUNIT_TEST(testSharedFormulaXLS);
CPPUNIT_TEST(testFinacialFormula);
......@@ -395,6 +396,7 @@ public:
CPPUNIT_TEST(testStatisticalFormulaHypGeomDist);
CPPUNIT_TEST(testArrayFormulaSumX2MY2);
CPPUNIT_TEST(testArrayFormulaSumX2PY2);
CPPUNIT_TEST(testStatisticalFormulaBetainv);
CPPUNIT_TEST_SUITE_END();
private:
......@@ -4522,6 +4524,29 @@ void ScOpenclTest:: testArrayFormulaSumX2PY2()
xDocSh->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()
: ScBootstrapFixture( "/sc/qa/unit/data" )
{
......
......@@ -2280,7 +2280,6 @@ bool FormulaGroupInterpreterOpenCL::interpret( ScDocument& rDoc,
if (err != CL_SUCCESS)
throw OpenCLError(err);
delete mpKernel;
return true;
}
#undef NO_FALLBACK_TO_SWINTERP /* undef this for non-TDD runs */
catch (const UnhandledToken &ut) {
......@@ -2312,6 +2311,7 @@ bool FormulaGroupInterpreterOpenCL::interpret( ScDocument& rDoc,
return false;
#endif
}
return true;
} // namespace opencl
}} // namespace sc
......
......@@ -183,8 +183,7 @@ void CheckVariables::CheckSubArgumentIsNan2( std::stringstream & ss,
formula::svSingleVectorRef)
ss<<"[get_group_id(1)]";
ss<<", 0);\n";
return;
#endif
#else
ss <<" tmp";
ss <<i;
ss << "=";
......@@ -197,6 +196,7 @@ void CheckVariables::CheckSubArgumentIsNan2( std::stringstream & ss,
ss<<"[get_group_id(1)]";
ss<<";\n";
#endif
}
void CheckVariables::CheckAllSubArgumentIsNan(
......
......@@ -1463,6 +1463,7 @@ void ScTokenArray::CheckToken( const FormulaToken& r )
case ocHypGeomDist:
case ocSumX2MY2:
case ocSumX2DY2:
case ocBetaInv:
// Don't change the state.
break;
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