Commit 79c659b5 by liyinqiao

Update CheckData function.

parent b3ecba16
......@@ -43,7 +43,7 @@ bool IsFloatEqual(DTYPE a, DTYPE b, float absError, float relError)
>> num - number of data items
>> beg - where we start this in the data array of the tensor
*/
bool CheckData(const XTensor * tensor, const void * d, int num, int beg)
bool _CheckData(const XTensor * tensor, const void * d, int num, int beg)
{
if (tensor->data == NULL || d == NULL)
return false;
......@@ -68,7 +68,7 @@ bool CheckData(const XTensor * tensor, const void * d, int num, int beg)
}
/* check whether the data array is the same as the "answer" */
bool CheckData(const XTensor * tensor, const void * d, int num, float tolerance, int beg)
bool _CheckData(const XTensor * tensor, const void * d, int num, float tolerance, int beg)
{
if (tensor->data == NULL || d == NULL)
return false;
......
......@@ -27,10 +27,10 @@
namespace nts { // namespace nts(NiuTrans.Tensor)
/* check whether the data array is the same as the answer */
bool CheckData(const XTensor * tensor, const void * answer, int num, int beg = 0);
bool _CheckData(const XTensor * tensor, const void * answer, int num, int beg = 0);
/* check whether the data array is the same as the answer */
bool CheckData(const XTensor * tensor, const void * answer, int num, float tolerance, int beg = 0);
bool _CheckData(const XTensor * tensor, const void * answer, int num, float tolerance, int beg = 0);
} // namespace nts(NiuTrans.Tensor)
......
......@@ -67,7 +67,7 @@ bool TestAbsolute1()
bUser = Absolute(*a);
/* check results */
cpuTest = CheckData(b, answer, unitNum, 1e-4F) && CheckData(aMe, answer, unitNum, 1e-4F) && CheckData(&bUser, answer, unitNum, 1e-4F);
cpuTest = _CheckData(b, answer, unitNum, 1e-4F) && _CheckData(aMe, answer, unitNum, 1e-4F) && _CheckData(&bUser, answer, unitNum, 1e-4F);
#ifdef USE_CUDA
/* GPU test */
......@@ -89,7 +89,7 @@ bool TestAbsolute1()
bUserGPU = Absolute(*aGPU);
/* check results */
gpuTest = CheckData(bGPU, answer, unitNum, 1e-4F) && CheckData(aMeGPU, answer, unitNum, 1e-4F) && CheckData(&bUserGPU, answer, unitNum, 1e-4F);
gpuTest = _CheckData(bGPU, answer, unitNum, 1e-4F) && _CheckData(aMeGPU, answer, unitNum, 1e-4F) && _CheckData(&bUserGPU, answer, unitNum, 1e-4F);
/* destroy variables */
delete a;
......
......@@ -68,9 +68,9 @@ bool TestClip1()
bUser = Clip(*a, -1.0, 1.0);
/* check results */
cpuTest = CheckData(b, answer, aUnitNum, 1e-4F) &&
CheckData(aMe, answer, aUnitNum, 1e-4F) &&
CheckData(&bUser, answer, aUnitNum, 1e-4F);
cpuTest = _CheckData(b, answer, aUnitNum, 1e-4F) &&
_CheckData(aMe, answer, aUnitNum, 1e-4F) &&
_CheckData(&bUser, answer, aUnitNum, 1e-4F);
#ifdef USE_CUDA
/* GPU test */
......@@ -92,9 +92,9 @@ bool TestClip1()
bUserGPU = Clip(*aGPU, -1.0, 1.0);
/* check results */
gpuTest = CheckData(bGPU, answer, aUnitNum, 1e-4F) &&
CheckData(aMeGPU, answer, aUnitNum, 1e-4F) &&
CheckData(&bUserGPU, answer, aUnitNum, 1e-4F);
gpuTest = _CheckData(bGPU, answer, aUnitNum, 1e-4F) &&
_CheckData(aMeGPU, answer, aUnitNum, 1e-4F) &&
_CheckData(&bUserGPU, answer, aUnitNum, 1e-4F);
/* destroy variables */
delete a;
......
......@@ -68,9 +68,9 @@ bool TestCompare1()
bUser = Equal(*a, 1.0);
/* check results */
cpuTest = CheckData(b, answer, aUnitNum, 1e-4F) &&
CheckData(aMe, answer, aUnitNum, 1e-4F) &&
CheckData(&bUser, answer, aUnitNum, 1e-4F);
cpuTest = _CheckData(b, answer, aUnitNum, 1e-4F) &&
_CheckData(aMe, answer, aUnitNum, 1e-4F) &&
_CheckData(&bUser, answer, aUnitNum, 1e-4F);
#ifdef USE_CUDA
/* GPU test */
......@@ -92,9 +92,9 @@ bool TestCompare1()
bUserGPU = Equal(*aGPU, 1.0);
/* check results */
gpuTest = CheckData(bGPU, answer, aUnitNum, 1e-4F) &&
CheckData(aMeGPU, answer, aUnitNum, 1e-4F) &&
CheckData(&bUserGPU, answer, aUnitNum, 1e-4F);
gpuTest = _CheckData(bGPU, answer, aUnitNum, 1e-4F) &&
_CheckData(aMeGPU, answer, aUnitNum, 1e-4F) &&
_CheckData(&bUserGPU, answer, aUnitNum, 1e-4F);
/* destroy variables */
delete a;
......
......@@ -93,7 +93,7 @@ bool TestConcatenate1()
tUser = Concatenate(*sList, 1);
/* check results */
cpuTest = CheckData(t, answer, tUnitNum) && CheckData(&tUser, answer, tUnitNum);
cpuTest = _CheckData(t, answer, tUnitNum) && _CheckData(&tUser, answer, tUnitNum);
#ifdef USE_CUDA
/* GPU test */
......@@ -122,7 +122,7 @@ bool TestConcatenate1()
tUserGPU = Concatenate(*sList, 1);
/* check results */
gpuTest = CheckData(tGPU, answer, tUnitNum) && CheckData(&tUserGPU, answer, tUnitNum);
gpuTest = _CheckData(tGPU, answer, tUnitNum) && _CheckData(&tUserGPU, answer, tUnitNum);
/* destroy variables */
delete sList;
......@@ -222,7 +222,7 @@ bool TestConcatenate2()
tUser = Concatenate(*sList, 0);
/* check results */
cpuTest = CheckData(t, answer, tUnitNum) && CheckData(&tUser, answer, tUnitNum);
cpuTest = _CheckData(t, answer, tUnitNum) && _CheckData(&tUser, answer, tUnitNum);
#ifdef USE_CUDA
/* GPU test */
......@@ -251,7 +251,7 @@ bool TestConcatenate2()
tUserGPU = Concatenate(*sList, 0);
/* check results */
gpuTest = CheckData(tGPU, answer, tUnitNum) && CheckData(&tUserGPU, answer, tUnitNum);
gpuTest = _CheckData(tGPU, answer, tUnitNum) && _CheckData(&tUserGPU, answer, tUnitNum);
/* destroy variables */
delete sList;
......@@ -349,7 +349,7 @@ bool TestConcatenate3()
tUser = Concatenate(*sList, 1);
/* check results */
cpuTest = CheckData(t, answer, tUnitNum) && CheckData(&tUser, answer, tUnitNum);
cpuTest = _CheckData(t, answer, tUnitNum) && _CheckData(&tUser, answer, tUnitNum);
#ifdef USE_CUDA
/* GPU test */
......@@ -378,7 +378,7 @@ bool TestConcatenate3()
tUserGPU = Concatenate(*sList, 1);
/* check results */
gpuTest = CheckData(tGPU, answer, tUnitNum) && CheckData(&tUserGPU, answer, tUnitNum);
gpuTest = _CheckData(tGPU, answer, tUnitNum) && _CheckData(&tUserGPU, answer, tUnitNum);
/* destroy variables */
delete sList;
......@@ -469,7 +469,7 @@ bool TestConcatenate4()
tUser = Concatenate(*s1, *s2, 1);
/* check results */
cpuTest = CheckData(t, answer, tUnitNum) && CheckData(&tUser, answer, tUnitNum);
cpuTest = _CheckData(t, answer, tUnitNum) && _CheckData(&tUser, answer, tUnitNum);
#ifdef USE_CUDA
/* GPU test */
......@@ -491,7 +491,7 @@ bool TestConcatenate4()
tUserGPU = Concatenate(*sGPU1, *sGPU2, 1);
/* check results */
gpuTest = CheckData(tGPU, answer, tUnitNum) && CheckData(&tUserGPU, answer, tUnitNum);
gpuTest = _CheckData(tGPU, answer, tUnitNum) && _CheckData(&tUserGPU, answer, tUnitNum);
/* destroy variables */
delete s1;
......
......@@ -92,7 +92,7 @@ bool TestConcatenateSolely1()
_ConcatenateSolely(sList, t, 1);
/* check results */
cpuTest = CheckData(t, answer, tUnitNum);
cpuTest = _CheckData(t, answer, tUnitNum);
#ifdef USE_CUDA
/* GPU test */
......@@ -119,7 +119,7 @@ bool TestConcatenateSolely1()
_ConcatenateSolely(sList, tGPU, 1);
/* check results */
gpuTest = CheckData(tGPU, answer, tUnitNum);
gpuTest = _CheckData(tGPU, answer, tUnitNum);
/* destroy variables */
delete sList;
......@@ -217,7 +217,7 @@ bool TestConcatenateSolely2()
_ConcatenateSolely(sList, t, 0);
/* check results */
cpuTest = CheckData(t, answer, tUnitNum);
cpuTest = _CheckData(t, answer, tUnitNum);
#ifdef USE_CUDA
/* GPU test */
......@@ -244,7 +244,7 @@ bool TestConcatenateSolely2()
_ConcatenateSolely(sList, tGPU, 0);
/* check results */
gpuTest = CheckData(tGPU, answer, tUnitNum);
gpuTest = _CheckData(tGPU, answer, tUnitNum);
/* destroy variables */
delete sList;
......@@ -340,7 +340,7 @@ bool TestConcatenateSolely3()
_ConcatenateSolely(sList, t, 1);
/* check results */
cpuTest = CheckData(t, answer, tUnitNum);
cpuTest = _CheckData(t, answer, tUnitNum);
#ifdef USE_CUDA
/* GPU test */
......@@ -367,7 +367,7 @@ bool TestConcatenateSolely3()
_ConcatenateSolely(sList, tGPU, 1);
/* check results */
gpuTest = CheckData(tGPU, answer, tUnitNum);
gpuTest = _CheckData(tGPU, answer, tUnitNum);
/* destroy variables */
delete sList;
......
......@@ -64,7 +64,7 @@ bool TestConvertDataType1()
_ConvertDataType(a, b);
/* check results */
cpuTest = CheckData(b, answer, aUnitNum);
cpuTest = _CheckData(b, answer, aUnitNum);
#ifdef USE_CUDA
/* GPU test */
......@@ -81,7 +81,7 @@ bool TestConvertDataType1()
_ConvertDataType(aGPU, bGPU);
/* check results */
gpuTest = CheckData(bGPU, answer, aUnitNum);
gpuTest = _CheckData(bGPU, answer, aUnitNum);
/* destroy variables */
delete a;
......@@ -139,7 +139,7 @@ bool TestConvertDataType2()
_ConvertDataType(a, b);
/* check results */
cpuTest = CheckData(b, answer, aUnitNum, 1e-4F);
cpuTest = _CheckData(b, answer, aUnitNum, 1e-4F);
#ifdef USE_CUDA
/* GPU test */
......@@ -156,7 +156,7 @@ bool TestConvertDataType2()
_ConvertDataType(aGPU, bGPU);
/* check results */
gpuTest = CheckData(bGPU, answer, aUnitNum, 1e-4F);
gpuTest = _CheckData(bGPU, answer, aUnitNum, 1e-4F);
/* destroy variables */
delete a;
......@@ -238,7 +238,7 @@ bool TestConvertDataType3()
//_ConvertDataType(b, c);
/* check results */
//cpuTest = CheckData(a, data1, unitNum1, 1e-4F);
//cpuTest = _CheckData(a, data1, unitNum1, 1e-4F);
#ifdef USE_CUDA
/* GPU test */
......@@ -264,7 +264,7 @@ bool TestConvertDataType3()
_ConvertDataType(eGPU, fGPU);
/* check results */
gpuTest = CheckData(fGPU, answer, unitNum3, 1e-4F);
gpuTest = _CheckData(fGPU, answer, unitNum3, 1e-4F);
/* destroy variables */
delete a;
......
......@@ -105,9 +105,9 @@ bool TestCopyIndexed1()
tUser = CopyIndexed(*s, dim, *sIndex, *tIndex, copyNum);
/* check results */
cpuTest = CheckData(t1, answer, tUnitNum) &&
CheckData(t2, answer, tUnitNum) &&
CheckData(&tUser, answer, tUnitNum);
cpuTest = _CheckData(t1, answer, tUnitNum) &&
_CheckData(t2, answer, tUnitNum) &&
_CheckData(&tUser, answer, tUnitNum);
#ifdef USE_CUDA
/* GPU test */
......@@ -134,9 +134,9 @@ bool TestCopyIndexed1()
tUserGPU = CopyIndexed(*sGPU, dim, *sIndexGPU, *tIndexGPU, copyNum);
/* check results */
gpuTest = CheckData(tGPU1, answer, tUnitNum) &&
CheckData(tGPU2, answer, tUnitNum) &&
CheckData(&tUserGPU, answer, tUnitNum);
gpuTest = _CheckData(tGPU1, answer, tUnitNum) &&
_CheckData(tGPU2, answer, tUnitNum) &&
_CheckData(&tUserGPU, answer, tUnitNum);
/* destroy variables */
delete s;
......@@ -250,9 +250,9 @@ bool TestCopyIndexed2()
tUser = CopyIndexed(*s, dim, *sIndex, *tIndex);
/* check results */
cpuTest = CheckData(t1, answer, tUnitNum) &&
CheckData(t2, answer, tUnitNum) &&
CheckData(&tUser, answer, tUnitNum);
cpuTest = _CheckData(t1, answer, tUnitNum) &&
_CheckData(t2, answer, tUnitNum) &&
_CheckData(&tUser, answer, tUnitNum);
#ifdef USE_CUDA
/* GPU test */
......@@ -279,9 +279,9 @@ bool TestCopyIndexed2()
tUserGPU = CopyIndexed(*sGPU, dim, *sIndexGPU, *tIndexGPU, copyNum);
/* check results */
gpuTest = CheckData(tGPU1, answer, tUnitNum) &&
CheckData(tGPU2, answer, tUnitNum) &&
CheckData(&tUserGPU, answer, tUnitNum);
gpuTest = _CheckData(tGPU1, answer, tUnitNum) &&
_CheckData(tGPU2, answer, tUnitNum) &&
_CheckData(&tUserGPU, answer, tUnitNum);
/* destroy variables */
delete s;
......@@ -395,9 +395,9 @@ bool TestCopyIndexed3()
tUser = CopyIndexed(*s, dim, *sIndex, *tIndex, copyNum);
/* check results */
cpuTest = CheckData(t1, answer, tUnitNum) &&
CheckData(t2, answer, tUnitNum) &&
CheckData(&tUser, answer, tUnitNum);
cpuTest = _CheckData(t1, answer, tUnitNum) &&
_CheckData(t2, answer, tUnitNum) &&
_CheckData(&tUser, answer, tUnitNum);
#ifdef USE_CUDA
/* GPU test */
......@@ -424,9 +424,9 @@ bool TestCopyIndexed3()
tUserGPU = CopyIndexed(*sGPU, dim, *sIndexGPU, *tIndexGPU, copyNum);
/* check results */
gpuTest = CheckData(tGPU1, answer, tUnitNum) &&
CheckData(tGPU2, answer, tUnitNum) &&
CheckData(&tUserGPU, answer, tUnitNum);
gpuTest = _CheckData(tGPU1, answer, tUnitNum) &&
_CheckData(tGPU2, answer, tUnitNum) &&
_CheckData(&tUserGPU, answer, tUnitNum);
/* destroy variables */
delete s;
......@@ -540,9 +540,9 @@ bool TestCopyIndexed4()
tUser = CopyIndexed(*s, dim, *sIndex, *tIndex, copyNum);
/* check results */
cpuTest = CheckData(t1, answer, tUnitNum) &&
CheckData(t2, answer, tUnitNum) &&
CheckData(&tUser, answer, tUnitNum);
cpuTest = _CheckData(t1, answer, tUnitNum) &&
_CheckData(t2, answer, tUnitNum) &&
_CheckData(&tUser, answer, tUnitNum);
#ifdef USE_CUDA
/* GPU test */
......@@ -569,9 +569,9 @@ bool TestCopyIndexed4()
tUserGPU = CopyIndexed(*sGPU, dim, *sIndexGPU, *tIndexGPU, copyNum);
/* check results */
gpuTest = CheckData(tGPU1, answer, tUnitNum) &&
CheckData(tGPU2, answer, tUnitNum) &&
CheckData(&tUserGPU, answer, tUnitNum);
gpuTest = _CheckData(tGPU1, answer, tUnitNum) &&
_CheckData(tGPU2, answer, tUnitNum) &&
_CheckData(&tUserGPU, answer, tUnitNum);
/* destroy variables */
delete s;
......@@ -685,9 +685,9 @@ bool TestCopyIndexed5()
tUser = CopyIndexed(*s, dim, *sIndex, *tIndex, copyNum);
/* check results */
cpuTest = CheckData(t1, answer, tUnitNum) &&
CheckData(t2, answer, tUnitNum) &&
CheckData(&tUser, answer, tUnitNum);
cpuTest = _CheckData(t1, answer, tUnitNum) &&
_CheckData(t2, answer, tUnitNum) &&
_CheckData(&tUser, answer, tUnitNum);
#ifdef USE_CUDA
/* GPU test */
......@@ -714,9 +714,9 @@ bool TestCopyIndexed5()
tUserGPU = CopyIndexed(*sGPU, dim, *sIndexGPU, *tIndexGPU, copyNum);
/* check results */
gpuTest = CheckData(tGPU1, answer, tUnitNum) &&
CheckData(tGPU2, answer, tUnitNum) &&
CheckData(&tUserGPU, answer, tUnitNum);
gpuTest = _CheckData(tGPU1, answer, tUnitNum) &&
_CheckData(tGPU2, answer, tUnitNum) &&
_CheckData(&tUserGPU, answer, tUnitNum);
/* destroy variables */
delete s;
......
......@@ -58,7 +58,7 @@ bool TestCopyValues1()
tUser = CopyValues(*s);
/* check results */
cpuTest = CheckData(t, sData, sUnitNum) && CheckData(&tUser, sData, sUnitNum);
cpuTest = _CheckData(t, sData, sUnitNum) && _CheckData(&tUser, sData, sUnitNum);
#ifdef USE_CUDA
/* GPU test */
......@@ -78,7 +78,7 @@ bool TestCopyValues1()
tUserGPU = CopyValues(*sGPU);
/* check results */
gpuTest = CheckData(tGPU, sData, sUnitNum) && CheckData(&tUser, sData, sUnitNum);
gpuTest = _CheckData(tGPU, sData, sUnitNum) && _CheckData(&tUser, sData, sUnitNum);
/* destroy variables */
delete s;
......
......@@ -67,7 +67,7 @@ bool TestCos1()
bUser = Cos(*a);
/* check results */
cpuTest = CheckData(b, answer, unitNum, 1e-4F) && CheckData(aMe, answer, unitNum, 1e-4F) && CheckData(&bUser, answer, unitNum, 1e-4F);
cpuTest = _CheckData(b, answer, unitNum, 1e-4F) && _CheckData(aMe, answer, unitNum, 1e-4F) && _CheckData(&bUser, answer, unitNum, 1e-4F);
#ifdef USE_CUDA
/* GPU test */
......@@ -89,7 +89,7 @@ bool TestCos1()
bUserGPU = Cos(*aGPU);
/* check results */
gpuTest = CheckData(bGPU, answer, unitNum, 1e-4F) && CheckData(aMeGPU, answer, unitNum, 1e-4F) && CheckData(&bUserGPU, answer, unitNum, 1e-4F);
gpuTest = _CheckData(bGPU, answer, unitNum, 1e-4F) && _CheckData(aMeGPU, answer, unitNum, 1e-4F) && _CheckData(&bUserGPU, answer, unitNum, 1e-4F);
/* destroy variables */
delete a;
......
......@@ -277,7 +277,7 @@ bool TestCrossEntropy3()
_CrossEntropyFast(output, gold, loss, weight);
/* check results */
cpuTest = CheckData(loss, answer, 4, 1e-4F);
cpuTest = _CheckData(loss, answer, 4, 1e-4F);
#ifdef USE_CUDA
/* GPU test */
......@@ -302,7 +302,7 @@ bool TestCrossEntropy3()
_CrossEntropyFast(outputGPU, goldGPU, lossGPU, weightGPU);
/* check results */
gpuTest = CheckData(lossGPU, answer, 4, 1e-4F);
gpuTest = _CheckData(lossGPU, answer, 4, 1e-4F);
/* destroy variables */
delete output;
......
......@@ -90,9 +90,9 @@ bool TestDiv1()
tUser = Div(*s1, *s2, 0);
/* check results */
cpuTest = CheckData(t, answer, tUnitNum, 1e-4F) &&
CheckData(tMe, answer, tUnitNum, 1e-4F) &&
CheckData(&tUser, answer, tUnitNum, 1e-4F);
cpuTest = _CheckData(t, answer, tUnitNum, 1e-4F) &&
_CheckData(tMe, answer, tUnitNum, 1e-4F) &&
_CheckData(&tUser, answer, tUnitNum, 1e-4F);
#ifdef USE_CUDA
/* GPU test */
......@@ -117,9 +117,9 @@ bool TestDiv1()
tUserGPU = Div(*sGPU1, *sGPU2, 0);
/* check results */
gpuTest = CheckData(tGPU, answer, tUnitNum, 1e-4F) &&
CheckData(tMeGPU, answer, tUnitNum, 1e-4F) &&
CheckData(&tUserGPU, answer, tUnitNum, 1e-4F);
gpuTest = _CheckData(tGPU, answer, tUnitNum, 1e-4F) &&
_CheckData(tMeGPU, answer, tUnitNum, 1e-4F) &&
_CheckData(&tUserGPU, answer, tUnitNum, 1e-4F);
/* destroy variables */
delete s1;
......
......@@ -81,9 +81,9 @@ bool TestDivDim1()
cUser = DivDim(*a, *b, 0);
/* check results */
cpuTest = CheckData(c, answer, aUnitNum) &&
CheckData(cMe, answer, aUnitNum) &&
CheckData(&cUser, answer, aUnitNum);
cpuTest = _CheckData(c, answer, aUnitNum) &&
_CheckData(cMe, answer, aUnitNum) &&
_CheckData(&cUser, answer, aUnitNum);
#ifdef USE_CUDA
/* GPU test */
......@@ -108,9 +108,9 @@ bool TestDivDim1()
cUserGPU = DivDim(*aGPU, *bGPU, 0);
/* check results */
gpuTest = CheckData(cGPU, answer, aUnitNum) &&
CheckData(cMeGPU, answer, aUnitNum) &&
CheckData(&cUserGPU, answer, aUnitNum);
gpuTest = _CheckData(cGPU, answer, aUnitNum) &&
_CheckData(cMeGPU, answer, aUnitNum) &&
_CheckData(&cUserGPU, answer, aUnitNum);
/* destroy variables */
delete a;
......@@ -195,9 +195,9 @@ bool TestDivDim2()
cUser = DivDim(*a, *b, 1);
/* check results */
cpuTest = CheckData(c, answer, aUnitNum) &&
CheckData(cMe, answer, aUnitNum) &&
CheckData(&cUser, answer, aUnitNum);
cpuTest = _CheckData(c, answer, aUnitNum) &&
_CheckData(cMe, answer, aUnitNum) &&
_CheckData(&cUser, answer, aUnitNum);
#ifdef USE_CUDA
/* GPU test */
......@@ -222,9 +222,9 @@ bool TestDivDim2()
cUserGPU = DivDim(*aGPU, *bGPU, 1);
/* check results */
gpuTest = CheckData(cGPU, answer, aUnitNum) &&
CheckData(cMeGPU, answer, aUnitNum) &&
CheckData(&cUserGPU, answer, aUnitNum);
gpuTest = _CheckData(cGPU, answer, aUnitNum) &&
_CheckData(cMeGPU, answer, aUnitNum) &&
_CheckData(&cUserGPU, answer, aUnitNum);
/* destroy variables */
delete a;
......
......@@ -67,9 +67,9 @@ bool TestExp1()
bUser = Exp(*a);
/* check results */
cpuTest = CheckData(b, answer, unitNum, 1e-4F) &&
CheckData(aMe, answer, unitNum, 1e-4F) &&
CheckData(&bUser, answer, unitNum, 1e-4F);
cpuTest = _CheckData(b, answer, unitNum, 1e-4F) &&
_CheckData(aMe, answer, unitNum, 1e-4F) &&
_CheckData(&bUser, answer, unitNum, 1e-4F);
#ifdef USE_CUDA
/* GPU test */
......@@ -91,9 +91,9 @@ bool TestExp1()
bUserGPU = Exp(*aGPU);
/* check results */
gpuTest = CheckData(bGPU, answer, unitNum, 1e-4F) &&
CheckData(aMeGPU, answer, unitNum, 1e-4F) && \
CheckData(&bUserGPU, answer, unitNum, 1e-4F);
gpuTest = _CheckData(bGPU, answer, unitNum, 1e-4F) &&
_CheckData(aMeGPU, answer, unitNum, 1e-4F) && \
_CheckData(&bUserGPU, answer, unitNum, 1e-4F);
/* destroy variables */
delete a;
......
......@@ -90,8 +90,8 @@ bool TestGather1()
tUser = Gather(*s, *index);
/* check results */
cpuTest = CheckData(t, answer, tUnitNum) &&
CheckData(&tUser, answer, tUnitNum);
cpuTest = _CheckData(t, answer, tUnitNum) &&
_CheckData(&tUser, answer, tUnitNum);
#ifdef USE_CUDA
/* GPU test */
......@@ -113,8 +113,8 @@ bool TestGather1()
tUserGPU = Gather(*sGPU, *indexGPU);
/* check results */
gpuTest = CheckData(tGPU, answer, tUnitNum) &&
CheckData(&tUserGPU, answer, tUnitNum);
gpuTest = _CheckData(tGPU, answer, tUnitNum) &&
_CheckData(&tUserGPU, answer, tUnitNum);
/* destroy variables */
delete s;
......
......@@ -65,7 +65,7 @@ bool TestHardTanH1()
yUser = HardTanH(*x);
/* check results */
cpuTest = CheckData(y, answer, unitNum, 1e-4F) && CheckData(&yUser, answer, unitNum, 1e-4F);
cpuTest = _CheckData(y, answer, unitNum, 1e-4F) && _CheckData(&yUser, answer, unitNum, 1e-4F);
#ifdef USE_CUDA
/* GPU test */
......@@ -85,7 +85,7 @@ bool TestHardTanH1()
yUserGPU = HardTanH(*xGPU);
/* check results */
gpuTest = CheckData(yGPU, answer, unitNum, 1e-4F) && CheckData(&yUserGPU, answer, unitNum, 1e-4F);
gpuTest = _CheckData(yGPU, answer, unitNum, 1e-4F) && _CheckData(&yUserGPU, answer, unitNum, 1e-4F);
/* destroy variables */
delete x;
......@@ -159,8 +159,8 @@ bool TestHardTanH2()
_HardTanHBackward(y, x, dedy, dedx);
/* check results */
cpuTest = CheckData(y, yAnswer, unitNum, 1e-4F) &&
CheckData(dedx, dedxAnswer, unitNum, 1e-4F);
cpuTest = _CheckData(y, yAnswer, unitNum, 1e-4F) &&
_CheckData(dedx, dedxAnswer, unitNum, 1e-4F);
#ifdef USE_CUDA
/* GPU test */
......@@ -185,8 +185,8 @@ bool TestHardTanH2()
_HardTanHBackward(yGPU, xGPU, dedyGPU, dedxGPU);
/* check results */
gpuTest = CheckData(yGPU, yAnswer, unitNum, 1e-4F) &&
CheckData(dedxGPU, dedxAnswer, unitNum, 1e-4F);
gpuTest = _CheckData(yGPU, yAnswer, unitNum, 1e-4F) &&
_CheckData(dedxGPU, dedxAnswer, unitNum, 1e-4F);
/* destroy variables */
delete x;
......
......@@ -63,7 +63,7 @@ bool TestIdentity1()
yUser = Identity(*x);
/* check result */
cpuTest = CheckData(y, answer, unitNum, 1e-4F) && CheckData(&yUser, answer, unitNum, 1e-4F);
cpuTest = _CheckData(y, answer, unitNum, 1e-4F) && _CheckData(&yUser, answer, unitNum, 1e-4F);
#ifdef USE_CUDA
/* GPU test */
......@@ -83,7 +83,7 @@ bool TestIdentity1()
yUserGPU = Identity(*xGPU);
/* check result */
gpuTest = CheckData(yGPU, answer, unitNum, 1e-4F) && CheckData(&yUserGPU, answer, unitNum, 1e-4F);
gpuTest = _CheckData(yGPU, answer, unitNum, 1e-4F) && _CheckData(&yUserGPU, answer, unitNum, 1e-4F);
/* destroy variables */
delete x;
......@@ -147,8 +147,8 @@ bool TestIdentity2()
_IdentityBackward(y, x, dedy, dedx);
/* check result */
cpuTest = CheckData(y, yAnswer, unitNum, 1e-4F) &&
CheckData(dedx, dedxAnswer, unitNum, 1e-4F);
cpuTest = _CheckData(y, yAnswer, unitNum, 1e-4F) &&
_CheckData(dedx, dedxAnswer, unitNum, 1e-4F);
#ifdef USE_CUDA
/* GPU test */
......@@ -173,8 +173,8 @@ bool TestIdentity2()
_IdentityBackward(yGPU, xGPU, dedyGPU, dedxGPU);
/* check result */
gpuTest = CheckData(yGPU, yAnswer, unitNum, 1e-4F) &&
CheckData(dedxGPU, dedxAnswer, unitNum, 1e-4F);
gpuTest = _CheckData(yGPU, yAnswer, unitNum, 1e-4F) &&
_CheckData(dedxGPU, dedxAnswer, unitNum, 1e-4F);
/* destroy variables */
delete x;
......
......@@ -67,7 +67,7 @@ bool TestLog1()
bUser = Log(*a);
/* check results */
cpuTest = CheckData(b, answer, unitNum, 1e-4F) && CheckData(aMe, answer, unitNum, 1e-4F) && CheckData(&bUser, answer, unitNum, 1e-4F);
cpuTest = _CheckData(b, answer, unitNum, 1e-4F) && _CheckData(aMe, answer, unitNum, 1e-4F) && _CheckData(&bUser, answer, unitNum, 1e-4F);
#ifdef USE_CUDA
/* GPU test */
......@@ -89,7 +89,7 @@ bool TestLog1()
bUserGPU = Log(*aGPU);
/* check results */
gpuTest = CheckData(bGPU, answer, unitNum, 1e-4F) && CheckData(aMeGPU, answer, unitNum, 1e-4F) && CheckData(&bUserGPU, answer, unitNum, 1e-4F);
gpuTest = _CheckData(bGPU, answer, unitNum, 1e-4F) && _CheckData(aMeGPU, answer, unitNum, 1e-4F) && _CheckData(&bUserGPU, answer, unitNum, 1e-4F);
/* destroy variables */
delete a;
......
......@@ -63,7 +63,7 @@ bool TestLogSoftmax1()
yUser = LogSoftmax(*x, 1);
/* check result */
cpuTest = CheckData(y, answer, unitNum, 1e-4F) && CheckData(&yUser, answer, unitNum, 1e-4F);
cpuTest = _CheckData(y, answer, unitNum, 1e-4F) && _CheckData(&yUser, answer, unitNum, 1e-4F);
#ifdef USE_CUDA
/* GPU test */
......@@ -83,7 +83,7 @@ bool TestLogSoftmax1()
yUserGPU = LogSoftmax(*xGPU, 1);
/* check result */
gpuTest = CheckData(yGPU, answer, unitNum, 1e-4F) && CheckData(&yUserGPU, answer, unitNum, 1e-4F);
gpuTest = _CheckData(yGPU, answer, unitNum, 1e-4F) && _CheckData(&yUserGPU, answer, unitNum, 1e-4F);
/* destroy variables */
delete x;
......@@ -150,8 +150,8 @@ bool TestLogSoftmax2()
_LogSoftmaxBackward(g, y, x, dedy, dedx, NULL, 1, CROSSENTROPY);
/* check result */
cpuTest = CheckData(y, yAnswer, unitNum, 1e-4F)
&& CheckData(dedx, dedxAnswer, unitNum, 1e-4F);
cpuTest = _CheckData(y, yAnswer, unitNum, 1e-4F)
&& _CheckData(dedx, dedxAnswer, unitNum, 1e-4F);
#ifdef USE_CUDA
/* GPU test */
......@@ -178,7 +178,7 @@ bool TestLogSoftmax2()
_LogSoftmaxBackward(gGPU, yGPU, xGPU, dedyGPU, dedxGPU, NULL, 1, CROSSENTROPY);
/* check result */
gpuTest = CheckData(yGPU, yAnswer, unitNum, 1e-4F) && CheckData(dedxGPU, dedxAnswer, unitNum, 1e-4F);
gpuTest = _CheckData(yGPU, yAnswer, unitNum, 1e-4F) && _CheckData(dedxGPU, dedxAnswer, unitNum, 1e-4F);
/* destroy variables */
delete x;
......@@ -254,8 +254,8 @@ bool TestLogSoftmax3()
_LogSoftmaxBackward(g, y, x, dedy, dedx, NULL, 1, SQUAREDERROR);
/* check result */
cpuTest = CheckData(y, yAnswer, unitNum, 1e-4F)
&& CheckData(dedx, dedxAnswer, unitNum, 1e-4F);
cpuTest = _CheckData(y, yAnswer, unitNum, 1e-4F)
&& _CheckData(dedx, dedxAnswer, unitNum, 1e-4F);
#ifdef USE_CUDA
/* GPU test */
......@@ -282,8 +282,8 @@ bool TestLogSoftmax3()
_LogSoftmaxBackward(gGPU, yGPU, xGPU, dedyGPU, dedxGPU, NULL, 1, SQUAREDERROR);
/* check result */
gpuTest = CheckData(yGPU, yAnswer, unitNum, 1e-4F)
&& CheckData(dedxGPU, dedxAnswer, unitNum, 1e-3F);
gpuTest = _CheckData(yGPU, yAnswer, unitNum, 1e-4F)
&& _CheckData(dedxGPU, dedxAnswer, unitNum, 1e-3F);
/* destroy variables */
delete x;
......
......@@ -88,7 +88,7 @@ bool TestMatrixMul1()
tUser = MatrixMul(*s1, X_NOTRANS, *s2, X_NOTRANS);
/* check results */
cpuTest = CheckData(t, answer, tUnitNum) && CheckData(&tUser, answer, tUnitNum);
cpuTest = _CheckData(t, answer, tUnitNum) && _CheckData(&tUser, answer, tUnitNum);
#ifdef USE_CUDA
/* GPU test */
......@@ -110,7 +110,7 @@ bool TestMatrixMul1()
tUserGPU = MatrixMul(*sGPU1, X_NOTRANS, *sGPU2, X_NOTRANS);
/* check results */
gpuTest = CheckData(tGPU, answer, tUnitNum) && CheckData(&tUserGPU, answer, tUnitNum);
gpuTest = _CheckData(tGPU, answer, tUnitNum) && _CheckData(&tUserGPU, answer, tUnitNum);
/* destroy variables */
delete s1;
......@@ -202,7 +202,7 @@ bool TestMatrixMul2()
tUser = MatrixMul(*s1, X_TRANS, *s2, X_NOTRANS);
/* check results */
cpuTest = CheckData(t, answer, tUnitNum) && CheckData(&tUser, answer, tUnitNum);
cpuTest = _CheckData(t, answer, tUnitNum) && _CheckData(&tUser, answer, tUnitNum);
#ifdef USE_CUDA
/* GPU test */
......@@ -224,7 +224,7 @@ bool TestMatrixMul2()
tUserGPU = MatrixMul(*sGPU1, X_TRANS, *sGPU2, X_NOTRANS);
/* check results */
gpuTest = CheckData(tGPU, answer, tUnitNum) && CheckData(&tUserGPU, answer, tUnitNum);
gpuTest = _CheckData(tGPU, answer, tUnitNum) && _CheckData(&tUserGPU, answer, tUnitNum);
/* destroy variables */
delete s1;
......@@ -336,7 +336,7 @@ bool TestMatrixMul3()
tUser = MatrixMul(*s1, X_NOTRANS, *s2, X_NOTRANS);
/* check results */
cpuTest = CheckData(t, answer, tUnitNum) && CheckData(&tUser, answer, tUnitNum);
cpuTest = _CheckData(t, answer, tUnitNum) && _CheckData(&tUser, answer, tUnitNum);
#ifdef USE_CUDA
/* GPU test */
......@@ -358,7 +358,7 @@ bool TestMatrixMul3()
tUserGPU = MatrixMul(*sGPU1, X_NOTRANS, *sGPU2, X_NOTRANS);
/* check results */
gpuTest = CheckData(tGPU, answer, tUnitNum) && CheckData(&tUserGPU, answer, tUnitNum);
gpuTest = _CheckData(tGPU, answer, tUnitNum) && _CheckData(&tUserGPU, answer, tUnitNum);
/* destroy variables */
delete s1;
......@@ -459,7 +459,7 @@ bool TestMatrixMul4()
tUser = MatrixMul(*s1, X_NOTRANS, *s2, X_NOTRANS);
/* check results */
cpuTest = CheckData(t, answer, tUnitNum) && CheckData(&tUser, answer, tUnitNum);
cpuTest = _CheckData(t, answer, tUnitNum) && _CheckData(&tUser, answer, tUnitNum);
#ifdef USE_CUDA
/* GPU test */
......@@ -481,7 +481,7 @@ bool TestMatrixMul4()
tUserGPU = MatrixMul(*sGPU1, X_NOTRANS, *sGPU2, X_NOTRANS);
/* check results */
gpuTest = CheckData(tGPU, answer, tUnitNum) && CheckData(&tUserGPU, answer, tUnitNum);
gpuTest = _CheckData(tGPU, answer, tUnitNum) && _CheckData(&tUserGPU, answer, tUnitNum);
/* destroy variables */
delete s1;
......
......@@ -86,7 +86,7 @@ bool TestMatrixMul2D1()
_MatrixMul2D(s1, X_NOTRANS, s2, X_NOTRANS, t);
/* check results */
cpuTest = CheckData(t, answer, tUnitNum);
cpuTest = _CheckData(t, answer, tUnitNum);
#ifdef USE_CUDA
/* GPU test */
......@@ -106,7 +106,7 @@ bool TestMatrixMul2D1()
_MatrixMul2D(sGPU1, X_NOTRANS, sGPU2, X_NOTRANS, tGPU);
/* check results */
gpuTest = CheckData(tGPU, answer, tUnitNum);
gpuTest = _CheckData(tGPU, answer, tUnitNum);
/* destroy variables */
delete s1;
......@@ -196,7 +196,7 @@ bool TestMatrixMul2D2()
_MatrixMul2D(s1, X_TRANS, s2, X_NOTRANS, t);
/* check results */
cpuTest = CheckData(t, answer, tUnitNum);
cpuTest = _CheckData(t, answer, tUnitNum);
#ifdef USE_CUDA
/* GPU test */
......@@ -216,7 +216,7 @@ bool TestMatrixMul2D2()
_MatrixMul2D(sGPU1, X_TRANS, sGPU2, X_NOTRANS, tGPU);
/* check results */
gpuTest = CheckData(tGPU, answer, tUnitNum);
gpuTest = _CheckData(tGPU, answer, tUnitNum);
/* destroy variables */
delete s1;
......
......@@ -86,7 +86,7 @@ bool TestMatrixMul2DParallel1()
_MatrixMul2DParallel(s1, X_NOTRANS, s2, X_NOTRANS, t);
/* check results */
cpuTest = CheckData(t, answer, tUnitNum);
cpuTest = _CheckData(t, answer, tUnitNum);
/* destroy variables */
delete s1;
......@@ -162,7 +162,7 @@ bool TestMatrixMul2DParallel2()
_MatrixMul2DParallel(s1, X_TRANS, s2, X_NOTRANS, t);
/* check results */
cpuTest = CheckData(t, answer, tUnitNum);
cpuTest = _CheckData(t, answer, tUnitNum);
/* destroy variables */
delete s1;
......
......@@ -88,7 +88,7 @@ bool TestMatrixMulBatched1()
tUser = MatrixMulBatched(*s1, X_NOTRANS, *s2, X_NOTRANS);
/* check results */
cpuTest = CheckData(t, answer, tUnitNum) && CheckData(&tUser, answer, tUnitNum);
cpuTest = _CheckData(t, answer, tUnitNum) && _CheckData(&tUser, answer, tUnitNum);
#ifdef USE_CUDA
/* GPU test */
......@@ -110,7 +110,7 @@ bool TestMatrixMulBatched1()
tUserGPU = MatrixMulBatched(*sGPU1, X_NOTRANS, *sGPU2, X_NOTRANS);
/* check results */
gpuTest = CheckData(tGPU, answer, tUnitNum) && CheckData(&tUserGPU, answer, tUnitNum);
gpuTest = _CheckData(tGPU, answer, tUnitNum) && _CheckData(&tUserGPU, answer, tUnitNum);
/* destroy variables */
delete s1;
......@@ -210,7 +210,7 @@ bool TestMatrixMulBatched2()
tUser = MatrixMulBatched(*s1, X_NOTRANS, *s2, X_NOTRANS);
/* check results */
cpuTest = CheckData(t, answer, tUnitNum) && CheckData(&tUser, answer, tUnitNum);
cpuTest = _CheckData(t, answer, tUnitNum) && _CheckData(&tUser, answer, tUnitNum);
#ifdef USE_CUDA
/* GPU test */
......@@ -232,7 +232,7 @@ bool TestMatrixMulBatched2()
tUserGPU = MatrixMulBatched(*sGPU1, X_NOTRANS, *sGPU2, X_NOTRANS);
/* check results */
gpuTest = CheckData(tGPU, answer, tUnitNum) && CheckData(&tUserGPU, answer, tUnitNum);
gpuTest = _CheckData(tGPU, answer, tUnitNum) && _CheckData(&tUserGPU, answer, tUnitNum);
/* destroy variables */
delete s1;
......
......@@ -72,7 +72,7 @@ bool TestMerge1()
tUser = Merge(*s, 1, 0);
/* check results */
cpuTest = CheckData(t, answer, tUnitNum) && CheckData(&tUser, answer, tUnitNum);
cpuTest = _CheckData(t, answer, tUnitNum) && _CheckData(&tUser, answer, tUnitNum);
#ifdef USE_CUDA
/* GPU test */
......@@ -92,7 +92,7 @@ bool TestMerge1()
tUserGPU = Merge(*sGPU, 1, 0);
/* check results */
gpuTest = CheckData(tGPU, answer, tUnitNum) && CheckData(&tUserGPU, answer, tUnitNum);
gpuTest = _CheckData(tGPU, answer, tUnitNum) && _CheckData(&tUserGPU, answer, tUnitNum);
/* destroy variables */
delete s;
......@@ -186,8 +186,8 @@ bool TestMerge2()
tUser2 = Merge(*s, 2, 0);
/* check results */
cpuTest = CheckData(t1, answer1, tUnitNum1) && CheckData(&tUser1, answer1, tUnitNum1)
&& CheckData(t2, answer2, tUnitNum2) && CheckData(&tUser2, answer2, tUnitNum2);
cpuTest = _CheckData(t1, answer1, tUnitNum1) && _CheckData(&tUser1, answer1, tUnitNum1)
&& _CheckData(t2, answer2, tUnitNum2) && _CheckData(&tUser2, answer2, tUnitNum2);
#ifdef USE_CUDA
/* GPU test */
......@@ -212,8 +212,8 @@ bool TestMerge2()
tUserGPU2 = Merge(*sGPU, 2, 0);
/* check results */
gpuTest = CheckData(tGPU1, answer1, tUnitNum1) && CheckData(&tUserGPU1, answer1, tUnitNum1)
&& CheckData(tGPU2, answer2, tUnitNum2) && CheckData(&tUserGPU2, answer2, tUnitNum2);
gpuTest = _CheckData(tGPU1, answer1, tUnitNum1) && _CheckData(&tUserGPU1, answer1, tUnitNum1)
&& _CheckData(tGPU2, answer2, tUnitNum2) && _CheckData(&tUserGPU2, answer2, tUnitNum2);
/* destroy variables */
delete s;
......@@ -302,7 +302,7 @@ bool TestMerge3()
tUser = Merge(*smallList, 0);
/* check results */
cpuTest = CheckData(t, answer, tUnitNum) && CheckData(&tUser, answer, tUnitNum);
cpuTest = _CheckData(t, answer, tUnitNum) && _CheckData(&tUser, answer, tUnitNum);
#ifdef USE_CUDA
/* GPU test */
......@@ -331,7 +331,7 @@ bool TestMerge3()
tUserGPU = Merge(*smallList, 0);
/* check results */
gpuTest = CheckData(tGPU, answer, tUnitNum) && CheckData(&tUserGPU, answer, tUnitNum);
gpuTest = _CheckData(tGPU, answer, tUnitNum) && _CheckData(&tUserGPU, answer, tUnitNum);
/* destroy variables */
delete s1;
......@@ -418,7 +418,7 @@ bool TestMerge4()
tUser = Merge(*smallList, 1);
/* check results */
cpuTest = CheckData(t, answer, tUnitNum) && CheckData(&tUser, answer, tUnitNum);
cpuTest = _CheckData(t, answer, tUnitNum) && _CheckData(&tUser, answer, tUnitNum);
#ifdef USE_CUDA
/* GPU test */
......@@ -447,7 +447,7 @@ bool TestMerge4()
tUserGPU = Merge(*smallList, 1);
/* check results */
gpuTest = CheckData(tGPU, answer, tUnitNum) && CheckData(&tUserGPU, answer, tUnitNum);
gpuTest = _CheckData(tGPU, answer, tUnitNum) && _CheckData(&tUserGPU, answer, tUnitNum);
/* destroy variables */
delete s1;
......
......@@ -90,9 +90,9 @@ bool TestMultiply1()
tUser = Multiply(*s1, *s2, 0);
/* check results */
cpuTest = CheckData(t, answer, tUnitNum) &&
CheckData(tMe, answer, tUnitNum) &&
CheckData(&tUser, answer, tUnitNum);
cpuTest = _CheckData(t, answer, tUnitNum) &&
_CheckData(tMe, answer, tUnitNum) &&
_CheckData(&tUser, answer, tUnitNum);
#ifdef USE_CUDA
/* GPU test */
......@@ -117,9 +117,9 @@ bool TestMultiply1()
tUserGPU = Multiply(*sGPU1, *sGPU2, 0);
/* check results */
gpuTest = CheckData(tGPU, answer, tUnitNum) &&
CheckData(tMeGPU, answer, tUnitNum) &&
CheckData(&tUserGPU, answer, tUnitNum);
gpuTest = _CheckData(tGPU, answer, tUnitNum) &&
_CheckData(tMeGPU, answer, tUnitNum) &&
_CheckData(&tUserGPU, answer, tUnitNum);
/* destroy variables */
delete s1;
......
......@@ -80,9 +80,9 @@ bool TestMultiplyDim1()
cUser = MultiplyDim(*a, *b, 0);
/* check results */
cpuTest = CheckData(c, answer, aUnitNum) &&
CheckData(cMe, answer, aUnitNum) &&
CheckData(&cUser, answer, aUnitNum);
cpuTest = _CheckData(c, answer, aUnitNum) &&
_CheckData(cMe, answer, aUnitNum) &&
_CheckData(&cUser, answer, aUnitNum);
#ifdef USE_CUDA
/* GPU test */
......@@ -107,9 +107,9 @@ bool TestMultiplyDim1()
cUserGPU = MultiplyDim(*aGPU, *bGPU, 0);
/* check results */
gpuTest = CheckData(cGPU, answer, aUnitNum) &&
CheckData(cMeGPU, answer, aUnitNum) &&
CheckData(&cUserGPU, answer, aUnitNum);
gpuTest = _CheckData(cGPU, answer, aUnitNum) &&
_CheckData(cMeGPU, answer, aUnitNum) &&
_CheckData(&cUserGPU, answer, aUnitNum);
/* destroy variables */
delete a;
......@@ -192,9 +192,9 @@ bool TestMultiplyDim2()
cUser = MultiplyDim(*a, *b, 1);
/* check results */
cpuTest = CheckData(c, answer, aUnitNum) &&
CheckData(cMe, answer, aUnitNum) &&
CheckData(&cUser, answer, aUnitNum);
cpuTest = _CheckData(c, answer, aUnitNum) &&
_CheckData(cMe, answer, aUnitNum) &&
_CheckData(&cUser, answer, aUnitNum);
#ifdef USE_CUDA
/* GPU test */
......@@ -219,9 +219,9 @@ bool TestMultiplyDim2()
cUserGPU = MultiplyDim(*aGPU, *bGPU, 1);
/* check results */
gpuTest = CheckData(cGPU, answer, aUnitNum) &&
CheckData(cMeGPU, answer, aUnitNum) &&
CheckData(&cUserGPU, answer, aUnitNum);
gpuTest = _CheckData(cGPU, answer, aUnitNum) &&
_CheckData(cMeGPU, answer, aUnitNum) &&
_CheckData(&cUserGPU, answer, aUnitNum);
/* destroy variables */
delete a;
......
......@@ -63,7 +63,7 @@ bool TestNegate1()
bUser = Negate(*a);
/* check results */
cpuTest = CheckData(b, answer, aUnitNum, 1e-4F) && CheckData(aMe, answer, aUnitNum, 1e-4F) && CheckData(&bUser, answer, aUnitNum, 1e-4F);
cpuTest = _CheckData(b, answer, aUnitNum, 1e-4F) && _CheckData(aMe, answer, aUnitNum, 1e-4F) && _CheckData(&bUser, answer, aUnitNum, 1e-4F);
#ifdef USE_CUDA
/* GPU test */
......@@ -85,7 +85,7 @@ bool TestNegate1()
bUserGPU = Negate(*aGPU);
/* check results */
gpuTest = CheckData(bGPU, answer, aUnitNum, 1e-4F) && CheckData(aMeGPU, answer, aUnitNum, 1e-4F) && CheckData(&bUserGPU, answer, aUnitNum, 1e-4F);
gpuTest = _CheckData(bGPU, answer, aUnitNum, 1e-4F) && _CheckData(aMeGPU, answer, aUnitNum, 1e-4F) && _CheckData(&bUserGPU, answer, aUnitNum, 1e-4F);
/* destroy variables */
delete a;
......@@ -147,7 +147,7 @@ bool TestNegate2()
bUser = Negate(*a);
/* check results */
cpuTest = CheckData(b, answer, aUnitNum, 1e-4F) && CheckData(aMe, answer, aUnitNum, 1e-4F) && CheckData(&bUser, answer, aUnitNum, 1e-4F);
cpuTest = _CheckData(b, answer, aUnitNum, 1e-4F) && _CheckData(aMe, answer, aUnitNum, 1e-4F) && _CheckData(&bUser, answer, aUnitNum, 1e-4F);
#ifdef USE_CUDA
/* GPU test */
......@@ -169,7 +169,7 @@ bool TestNegate2()
bUserGPU = Negate(*aGPU);
/* check results */
gpuTest = CheckData(bGPU, answer, aUnitNum, 1e-4F) && CheckData(aMeGPU, answer, aUnitNum, 1e-4F) && CheckData(&bUserGPU, answer, aUnitNum, 1e-4F);
gpuTest = _CheckData(bGPU, answer, aUnitNum, 1e-4F) && _CheckData(aMeGPU, answer, aUnitNum, 1e-4F) && _CheckData(&bUserGPU, answer, aUnitNum, 1e-4F);
/* destroy variables */
delete a;
......
......@@ -127,8 +127,8 @@ bool TestNormalize1()
tUser = Normalize(*s, 0, *mean, *var, *a, *b, 0.0F);
/* check results */
cpuTest = CheckData(t, answer, tUnitNum, 1e-4F)
&& CheckData(tMe, answer, tUnitNum, 1e-4F) && CheckData(&tUser, answer, tUnitNum, 1e-4F);
cpuTest = _CheckData(t, answer, tUnitNum, 1e-4F)
&& _CheckData(tMe, answer, tUnitNum, 1e-4F) && _CheckData(&tUser, answer, tUnitNum, 1e-4F);
#ifdef USE_CUDA
/* GPU test */
......@@ -159,8 +159,8 @@ bool TestNormalize1()
tUserGPU = Normalize(*sGPU, 0, *meanGPU, *varGPU, *aGPU, *bGPU, 0.0F);
/* check results */
gpuTest = CheckData(tGPU, answer, tUnitNum, 1e-4F)
&& CheckData(tMeGPU, answer, tUnitNum, 1e-4F) && CheckData(&tUserGPU, answer, tUnitNum, 1e-4F);
gpuTest = _CheckData(tGPU, answer, tUnitNum, 1e-4F)
&& _CheckData(tMeGPU, answer, tUnitNum, 1e-4F) && _CheckData(&tUserGPU, answer, tUnitNum, 1e-4F);
/* destroy variables */
delete s;
......
......@@ -68,9 +68,9 @@ bool TestPower1()
bUser = Power(*a, 2.0F);
/* check results */
cpuTest = CheckData(b, answer, aUnitNum, 1e-4F) &&
CheckData(aMe, answer, aUnitNum, 1e-4F) &&
CheckData(&bUser, answer, aUnitNum, 1e-4F);
cpuTest = _CheckData(b, answer, aUnitNum, 1e-4F) &&
_CheckData(aMe, answer, aUnitNum, 1e-4F) &&
_CheckData(&bUser, answer, aUnitNum, 1e-4F);
#ifdef USE_CUDA
/* GPU test */
......@@ -92,9 +92,9 @@ bool TestPower1()
bUserGPU = Power(*aGPU, 2.0F);
/* check results */
gpuTest = CheckData(bGPU, answer, aUnitNum, 1e-4F) &&
CheckData(aMeGPU, answer, aUnitNum, 1e-4F) &&
CheckData(&bUserGPU, answer, aUnitNum, 1e-4F);
gpuTest = _CheckData(bGPU, answer, aUnitNum, 1e-4F) &&
_CheckData(aMeGPU, answer, aUnitNum, 1e-4F) &&
_CheckData(&bUserGPU, answer, aUnitNum, 1e-4F);
/* destroy variables */
delete a;
......@@ -159,9 +159,9 @@ bool TestPower2()
bUser = Power(*a, 1.0F);
/* check results */
cpuTest = CheckData(b, answer, aUnitNum, 1e-4F) &&
CheckData(aMe, answer, aUnitNum, 1e-4F) &&
CheckData(&bUser, answer, aUnitNum, 1e-4F);
cpuTest = _CheckData(b, answer, aUnitNum, 1e-4F) &&
_CheckData(aMe, answer, aUnitNum, 1e-4F) &&
_CheckData(&bUser, answer, aUnitNum, 1e-4F);
#ifdef USE_CUDA
/* GPU test */
......@@ -183,9 +183,9 @@ bool TestPower2()
bUserGPU = Power(*aGPU, 1.0F);
/* check results */
gpuTest = CheckData(bGPU, answer, aUnitNum, 1e-4F) &&
CheckData(aMeGPU, answer, aUnitNum, 1e-4F) &&
CheckData(&bUserGPU, answer, aUnitNum, 1e-4F);
gpuTest = _CheckData(bGPU, answer, aUnitNum, 1e-4F) &&
_CheckData(aMeGPU, answer, aUnitNum, 1e-4F) &&
_CheckData(&bUserGPU, answer, aUnitNum, 1e-4F);
/* destroy variables */
delete a;
......@@ -250,9 +250,9 @@ bool TestPower3()
bUser = Power(*a, 0.0F);
/* check results */
cpuTest = CheckData(b, answer, aUnitNum, 1e-4F) &&
CheckData(aMe, answer, aUnitNum, 1e-4F) &&
CheckData(&bUser, answer, aUnitNum, 1e-4F);
cpuTest = _CheckData(b, answer, aUnitNum, 1e-4F) &&
_CheckData(aMe, answer, aUnitNum, 1e-4F) &&
_CheckData(&bUser, answer, aUnitNum, 1e-4F);
#ifdef USE_CUDA
/* GPU test */
......@@ -274,9 +274,9 @@ bool TestPower3()
bUserGPU = Power(*aGPU, 0.0F);
/* check results */
gpuTest = CheckData(bGPU, answer, aUnitNum, 1e-4F) &&
CheckData(aMeGPU, answer, aUnitNum, 1e-4F) &&
CheckData(&bUserGPU, answer, aUnitNum, 1e-4F);
gpuTest = _CheckData(bGPU, answer, aUnitNum, 1e-4F) &&
_CheckData(aMeGPU, answer, aUnitNum, 1e-4F) &&
_CheckData(&bUserGPU, answer, aUnitNum, 1e-4F);
/* destroy variables */
delete a;
......
......@@ -62,7 +62,7 @@ bool TestRectify1()
yUser = Rectify(*x);
/* check results */
cpuTest = CheckData(y, answer, unitNum, 1e-4F) && CheckData(&yUser, answer, unitNum, 1e-4F);
cpuTest = _CheckData(y, answer, unitNum, 1e-4F) && _CheckData(&yUser, answer, unitNum, 1e-4F);
#ifdef USE_CUDA
/* GPU test */
......@@ -82,7 +82,7 @@ bool TestRectify1()
yUserGPU = Rectify(*xGPU);
/* check results */
gpuTest = CheckData(yGPU, answer, unitNum, 1e-4F) && CheckData(&yUserGPU, answer, unitNum, 1e-4F);
gpuTest = _CheckData(yGPU, answer, unitNum, 1e-4F) && _CheckData(&yUserGPU, answer, unitNum, 1e-4F);
/* destroy variables */
delete x;
......@@ -150,7 +150,7 @@ bool TestRectify2()
_RectifyBackward(y, x, dedy, dedx);
/* check results */
cpuTest = CheckData(dedx, dedxAnswer, unitNum, 1e-4F);
cpuTest = _CheckData(dedx, dedxAnswer, unitNum, 1e-4F);
#ifdef USE_CUDA
/* GPU test */
......@@ -174,7 +174,7 @@ bool TestRectify2()
_RectifyBackward(yGPU, xGPU, dedyGPU, dedxGPU);
/* check results */
gpuTest = CheckData(dedxGPU, dedxAnswer, unitNum, 1e-4F);
gpuTest = _CheckData(dedxGPU, dedxAnswer, unitNum, 1e-4F);
/* destroy variables */
delete x;
......
......@@ -87,8 +87,8 @@ bool TestReduceMax1()
tUser2 = ReduceMax(*s, 1);
/* check results */
cpuTest = CheckData(t1, answer1, tUnitNum1) && CheckData(&tUser1, answer1, tUnitNum1)
&& CheckData(t2, answer2, tUnitNum2) && CheckData(&tUser2, answer2, tUnitNum2);
cpuTest = _CheckData(t1, answer1, tUnitNum1) && _CheckData(&tUser1, answer1, tUnitNum1)
&& _CheckData(t2, answer2, tUnitNum2) && _CheckData(&tUser2, answer2, tUnitNum2);
#ifdef USE_CUDA
/* GPU test */
......@@ -113,8 +113,8 @@ bool TestReduceMax1()
tUserGPU2 = ReduceMax(*sGPU, 1);
/* check results */
gpuTest = CheckData(tGPU1, answer1, tUnitNum1) && CheckData(&tUserGPU1, answer1, tUnitNum1)
&& CheckData(tGPU2, answer2, tUnitNum2) && CheckData(&tUserGPU2, answer2, tUnitNum2);
gpuTest = _CheckData(tGPU1, answer1, tUnitNum1) && _CheckData(&tUserGPU1, answer1, tUnitNum1)
&& _CheckData(tGPU2, answer2, tUnitNum2) && _CheckData(&tUserGPU2, answer2, tUnitNum2);
/* destroy variables */
delete s;
......
......@@ -82,8 +82,8 @@ bool TestReduceMean1()
tUser2 = ReduceMean(*s, 1);
/* check results */
cpuTest = CheckData(t1, answer1, tUnitNum1) && CheckData(&tUser1, answer1, tUnitNum1)
&& CheckData(t2, answer2, tUnitNum2) && CheckData(&tUser2, answer2, tUnitNum2);
cpuTest = _CheckData(t1, answer1, tUnitNum1) && _CheckData(&tUser1, answer1, tUnitNum1)
&& _CheckData(t2, answer2, tUnitNum2) && _CheckData(&tUser2, answer2, tUnitNum2);
#ifdef USE_CUDA
/* GPU test */
......@@ -108,8 +108,8 @@ bool TestReduceMean1()
tUserGPU2 = ReduceMean(*sGPU, 1);
/* check results */
gpuTest = CheckData(tGPU1, answer1, tUnitNum1) && CheckData(&tUserGPU1, answer1, tUnitNum1)
&& CheckData(tGPU2, answer2, tUnitNum2) && CheckData(&tUserGPU2, answer2, tUnitNum2);
gpuTest = _CheckData(tGPU1, answer1, tUnitNum1) && _CheckData(&tUserGPU1, answer1, tUnitNum1)
&& _CheckData(tGPU2, answer2, tUnitNum2) && _CheckData(&tUserGPU2, answer2, tUnitNum2);
/* destroy variables */
delete s;
......
......@@ -93,8 +93,8 @@ bool TestReduceSum1()
tUser2 = ReduceSum(*s, 1, *shift2);
/* check results */
cpuTest = CheckData(t1, answer1, tUnitNum1) && CheckData(&tUser1, answer1, tUnitNum1) &&
CheckData(t2, answer2, tUnitNum2) && CheckData(&tUser2, answer2, tUnitNum2);
cpuTest = _CheckData(t1, answer1, tUnitNum1) && _CheckData(&tUser1, answer1, tUnitNum1) &&
_CheckData(t2, answer2, tUnitNum2) && _CheckData(&tUser2, answer2, tUnitNum2);
#ifdef USE_CUDA
/* GPU test */
......@@ -123,8 +123,8 @@ bool TestReduceSum1()
tUserGPU2 = ReduceSum(*sGPU, 1, *shiftGPU2);
/* check results */
gpuTest = CheckData(tGPU1, answer1, tUnitNum1) && CheckData(&tUserGPU1, answer1, tUnitNum1) &&
CheckData(tGPU2, answer2, tUnitNum2) && CheckData(&tUserGPU2, answer2, tUnitNum2);
gpuTest = _CheckData(tGPU1, answer1, tUnitNum1) && _CheckData(&tUserGPU1, answer1, tUnitNum1) &&
_CheckData(tGPU2, answer2, tUnitNum2) && _CheckData(&tUserGPU2, answer2, tUnitNum2);
/* destroy variables */
delete s;
......@@ -203,7 +203,7 @@ bool TestReduceSum2()
tUser = ReduceSum(*s, 1);
/* check results */
cpuTest = CheckData(t, answer->data, tUnitNum) && CheckData(&tUser, answer->data, tUnitNum);
cpuTest = _CheckData(t, answer->data, tUnitNum) && _CheckData(&tUser, answer->data, tUnitNum);
#ifdef USE_CUDA
/* GPU test */
......@@ -222,7 +222,7 @@ bool TestReduceSum2()
tUserGPU = ReduceSum(*sGPU, 1);
/* check results */
gpuTest = CheckData(tGPU, answer->data, tUnitNum) && CheckData(&tUserGPU, answer->data, tUnitNum);
gpuTest = _CheckData(tGPU, answer->data, tUnitNum) && _CheckData(&tUserGPU, answer->data, tUnitNum);
/* destroy variables */
delete s;
......@@ -292,7 +292,7 @@ bool TestReduceSum3()
tUser = ReduceSum(*s, 1);
/* check results */
cpuTest = CheckData(t, answer->data, tUnitNum) && CheckData(&tUser, answer->data, tUnitNum);
cpuTest = _CheckData(t, answer->data, tUnitNum) && _CheckData(&tUser, answer->data, tUnitNum);
#ifdef USE_CUDA
/* GPU test */
......@@ -311,7 +311,7 @@ bool TestReduceSum3()
tUserGPU = ReduceSum(*sGPU, 1);
/* check results */
gpuTest = CheckData(tGPU, answer->data, tUnitNum) && CheckData(&tUserGPU, answer->data, tUnitNum);
gpuTest = _CheckData(tGPU, answer->data, tUnitNum) && _CheckData(&tUserGPU, answer->data, tUnitNum);
/* destroy variables */
delete s;
......@@ -381,7 +381,7 @@ bool TestReduceSum4()
tUser = ReduceSum(*s, 1);
/* check results */
cpuTest = CheckData(t, answer->data, tUnitNum) && CheckData(&tUser, answer->data, tUnitNum);
cpuTest = _CheckData(t, answer->data, tUnitNum) && _CheckData(&tUser, answer->data, tUnitNum);
#ifdef USE_CUDA
/* GPU test */
......@@ -400,7 +400,7 @@ bool TestReduceSum4()
tUserGPU = ReduceSum(*sGPU, 1);
/* check results */
gpuTest = CheckData(tGPU, answer->data, tUnitNum) && CheckData(&tUserGPU, answer->data, tUnitNum);
gpuTest = _CheckData(tGPU, answer->data, tUnitNum) && _CheckData(&tUserGPU, answer->data, tUnitNum);
/* destroy variables */
delete s;
......@@ -472,7 +472,7 @@ bool TestReduceSum5()
tUser = ReduceSum(*s, 1);
/* check results */
cpuTest = CheckData(t, answer->data, tUnitNum) && CheckData(&tUser, answer->data, tUnitNum);
cpuTest = _CheckData(t, answer->data, tUnitNum) && _CheckData(&tUser, answer->data, tUnitNum);
#ifdef USE_CUDA
/* GPU test */
......@@ -491,7 +491,7 @@ bool TestReduceSum5()
tUserGPU = ReduceSum(*sGPU, 1);
/* check results */
gpuTest = CheckData(tGPU, answer->data, tUnitNum) && CheckData(&tUserGPU, answer->data, tUnitNum);
gpuTest = _CheckData(tGPU, answer->data, tUnitNum) && _CheckData(&tUserGPU, answer->data, tUnitNum);
/* destroy variables */
delete s;
......@@ -564,7 +564,7 @@ bool TestReduceSum6()
tUser = ReduceSum(*s, 1);
/* check results */
cpuTest = CheckData(t, answer->data, tUnitNum) && CheckData(&tUser, answer->data, tUnitNum);
cpuTest = _CheckData(t, answer->data, tUnitNum) && _CheckData(&tUser, answer->data, tUnitNum);
#ifdef USE_CUDA
/* GPU test */
......@@ -583,7 +583,7 @@ bool TestReduceSum6()
tUserGPU = ReduceSum(*sGPU, 1);
/* check results */
gpuTest = CheckData(tGPU, answer->data, tUnitNum) && CheckData(&tUserGPU, answer->data, tUnitNum);
gpuTest = _CheckData(tGPU, answer->data, tUnitNum) && _CheckData(&tUserGPU, answer->data, tUnitNum);
/* destroy variables */
delete s;
......
......@@ -83,7 +83,7 @@ bool TestReduceSumSquared1()
tUser = ReduceSumSquared(*s, 0, *shift);
/* check results */
cpuTest = CheckData(t, answer, tUnitNum) && CheckData(&tUser, answer, tUnitNum);
cpuTest = _CheckData(t, answer, tUnitNum) && _CheckData(&tUser, answer, tUnitNum);
#ifdef USE_CUDA
/* GPU test */
......@@ -105,7 +105,7 @@ bool TestReduceSumSquared1()
tUserGPU = ReduceSumSquared(*sGPU, 0, *shiftGPU);
/* check results */
gpuTest = CheckData(tGPU, answer, tUnitNum) && CheckData(&tUserGPU, answer, tUnitNum);
gpuTest = _CheckData(tGPU, answer, tUnitNum) && _CheckData(&tUserGPU, answer, tUnitNum);
/* destroy variables */
delete s;
......@@ -191,7 +191,7 @@ bool TestReduceSumSquared2()
tUser = ReduceSumSquared(*s, 1, *shift);
/* check results */
cpuTest = CheckData(t, answer, tUnitNum) && CheckData(&tUser, answer, tUnitNum);
cpuTest = _CheckData(t, answer, tUnitNum) && _CheckData(&tUser, answer, tUnitNum);
#ifdef USE_CUDA
/* GPU test */
......@@ -213,7 +213,7 @@ bool TestReduceSumSquared2()
tUserGPU = ReduceSumSquared(*sGPU, 1, *shiftGPU);
/* check results */
gpuTest = CheckData(tGPU, answer, tUnitNum) && CheckData(&tUserGPU, answer, tUnitNum);
gpuTest = _CheckData(tGPU, answer, tUnitNum) && _CheckData(&tUserGPU, answer, tUnitNum);
/* destroy variables */
delete s;
......
......@@ -83,7 +83,7 @@ bool TestReduceVariance1()
tUser = ReduceVariance(*s, 0, *mean);
/* check results */
cpuTest = CheckData(t, answer, tUnitNum) && CheckData(&tUser, answer, tUnitNum);
cpuTest = _CheckData(t, answer, tUnitNum) && _CheckData(&tUser, answer, tUnitNum);
#ifdef USE_CUDA
/* GPU test */
......@@ -105,7 +105,7 @@ bool TestReduceVariance1()
tUserGPU = ReduceVariance(*sGPU, 0, *meanGPU);
/* check results */
gpuTest = CheckData(tGPU, answer, tUnitNum) && CheckData(&tUserGPU, answer, tUnitNum);
gpuTest = _CheckData(tGPU, answer, tUnitNum) && _CheckData(&tUserGPU, answer, tUnitNum);
/* destroy variables */
delete s;
......
......@@ -69,9 +69,9 @@ bool TestRound1()
//bUser = Round(*a);
/* check results */
cpuTest = CheckData(b, answer, unitNum, 1e-4F) &&
CheckData(aMe, answer, unitNum, 1e-4F) &&
CheckData(&bUser, answer, unitNum, 1e-4F);
cpuTest = _CheckData(b, answer, unitNum, 1e-4F) &&
_CheckData(aMe, answer, unitNum, 1e-4F) &&
_CheckData(&bUser, answer, unitNum, 1e-4F);
#ifdef USE_CUDA
/* GPU test */
......@@ -93,9 +93,9 @@ bool TestRound1()
//bUserGPU = Round(*aGPU);
/* check results */
gpuTest = CheckData(bGPU, answer, unitNum, 1e-4F) &&
CheckData(aMeGPU, answer, unitNum, 1e-4F) &&
CheckData(&bUserGPU, answer, unitNum, 1e-4F);
gpuTest = _CheckData(bGPU, answer, unitNum, 1e-4F) &&
_CheckData(aMeGPU, answer, unitNum, 1e-4F) &&
_CheckData(&bUserGPU, answer, unitNum, 1e-4F);
/* destroy variables */
delete a;
......
......@@ -67,8 +67,8 @@ bool TestScaleAndShift1()
tUser = ScaleAndShift(*s, scaleFactor, shiftFactor);
/* check results */
cpuTest = CheckData(t, answer, sUnitNum) &&
CheckData(tMe, answer, sUnitNum) && CheckData(&tUser, answer, sUnitNum);
cpuTest = _CheckData(t, answer, sUnitNum) &&
_CheckData(tMe, answer, sUnitNum) && _CheckData(&tUser, answer, sUnitNum);
#ifdef USE_CUDA
/* GPU test */
......@@ -90,8 +90,8 @@ bool TestScaleAndShift1()
tUserGPU = ScaleAndShift(*sGPU, scaleFactor, shiftFactor);
/* check results */
gpuTest = CheckData(tGPU, answer, sUnitNum) &&
CheckData(tMeGPU, answer, sUnitNum) && CheckData(&tUserGPU, answer, sUnitNum);
gpuTest = _CheckData(tGPU, answer, sUnitNum) &&
_CheckData(tMeGPU, answer, sUnitNum) && _CheckData(&tUserGPU, answer, sUnitNum);
/* destroy variables */
delete s;
......
......@@ -79,7 +79,7 @@ bool TestSelect1()
tUser = SelectRange(*s, 2, 1, 3);
/* check results */
cpuTest = CheckData(t, answer, tUnitNum) && CheckData(&tUser, answer, tUnitNum);
cpuTest = _CheckData(t, answer, tUnitNum) && _CheckData(&tUser, answer, tUnitNum);
#ifdef USE_CUDA
/* GPU test */
......@@ -99,7 +99,7 @@ bool TestSelect1()
tUserGPU = SelectRange(*sGPU, 2, 1, 3);
/* check results */
gpuTest = CheckData(tGPU, answer, tUnitNum) && CheckData(&tUserGPU, answer, tUnitNum);
gpuTest = _CheckData(tGPU, answer, tUnitNum) && _CheckData(&tUserGPU, answer, tUnitNum);
/* destroy variables */
delete s;
......
......@@ -53,7 +53,7 @@ bool TestSetAscendingOrder1()
s->SetAscendingOrder(1);
/* check results */
cpuTest = CheckData(s, answer, sUnitNum);
cpuTest = _CheckData(s, answer, sUnitNum);
#ifdef USE_CUDA
/* GPU test */
......@@ -69,7 +69,7 @@ bool TestSetAscendingOrder1()
sGPU->SetAscendingOrder(1);
/* check results */
gpuTest = CheckData(sGPU, answer, sUnitNum);
gpuTest = _CheckData(sGPU, answer, sUnitNum);
/* destroy variables */
delete s;
......
......@@ -53,7 +53,7 @@ bool TestSetData1()
s->SetDataRand(0.0, 1.0);
/* check results */
cpuTest = CheckData(s, answer, sUnitNum, 1.0F);
cpuTest = _CheckData(s, answer, sUnitNum, 1.0F);
#ifdef USE_CUDA
/* GPU test */
......@@ -65,7 +65,7 @@ bool TestSetData1()
/* call SetDataRand function */
sGPU->SetDataRand(0.0, 1.0);
gpuTest = CheckData(sGPU, answer, sUnitNum, 1.0F);
gpuTest = _CheckData(sGPU, answer, sUnitNum, 1.0F);
/* destroy variables */
delete s;
......@@ -126,7 +126,7 @@ bool TestSetData2()
_SetDataIndexed(s, modify, 0, 1);
/* check results */
cpuTest = CheckData(s, answer, sUnitNum, 1e-5F);
cpuTest = _CheckData(s, answer, sUnitNum, 1e-5F);
#ifdef USE_CUDA
/* GPU test */
......@@ -143,7 +143,7 @@ bool TestSetData2()
/* call SetDataIndexed function */
_SetDataIndexed(sGPU, modifyGPU, 0, 1);
gpuTest = CheckData(sGPU, answer, sUnitNum, 1e-5F);
gpuTest = _CheckData(sGPU, answer, sUnitNum, 1e-5F);
/* destroy variables */
delete s;
......@@ -220,7 +220,7 @@ bool TestSetData3()
_SetDataIndexed(s, modify, 1, 1);
/* check results */
cpuTest = CheckData(s, answer, sUnitNum, 1e-5F);
cpuTest = _CheckData(s, answer, sUnitNum, 1e-5F);
#ifdef USE_CUDA
/* GPU test */
......@@ -237,7 +237,7 @@ bool TestSetData3()
/* call SetDataIndexed function */
_SetDataIndexed(sGPU, modifyGPU, 1, 1);
gpuTest = CheckData(sGPU, answer, sUnitNum, 1e-5F);
gpuTest = _CheckData(sGPU, answer, sUnitNum, 1e-5F);
/* destroy variables */
delete s;
......@@ -295,7 +295,7 @@ bool TestSetData4()
_SetDataDim(s, 1, 1, 0, 0);
/* check results */
cpuTest = CheckData(s, answer, unitNum, 1e-4F);
cpuTest = _CheckData(s, answer, unitNum, 1e-4F);
#ifdef USE_CUDA
/* GPU test */
......@@ -310,7 +310,7 @@ bool TestSetData4()
/* call _SetDataDim function */
_SetDataDim(sGPU, 1, 1, 0, 0);
gpuTest = CheckData(sGPU, answer, unitNum, 1e-4F);
gpuTest = _CheckData(sGPU, answer, unitNum, 1e-4F);
/* destroy variables */
delete s;
......@@ -375,7 +375,7 @@ bool TestSetData5()
_SetDataDim(s, 2, 1, 1, 5.0F);
/* check results */
cpuTest = CheckData(s, answer, unitNum, 1e-4F);
cpuTest = _CheckData(s, answer, unitNum, 1e-4F);
#ifdef USE_CUDA
/* GPU test */
......@@ -390,7 +390,7 @@ bool TestSetData5()
/* call _SetDataDim function */
_SetDataDim(sGPU, 2, 1, 1, 5.0F);
gpuTest = CheckData(sGPU, answer, unitNum, 1e-4F);
gpuTest = _CheckData(sGPU, answer, unitNum, 1e-4F);
/* destroy variables */
delete s;
......@@ -437,7 +437,7 @@ bool TestSetData6()
_SetDataRange(s, 5.2, -3.2, -2);
/* check results */
cpuTest = CheckData(s, answer, unitNum, 1e-4F);
cpuTest = _CheckData(s, answer, unitNum, 1e-4F);
#ifdef USE_CUDA
/* GPU test */
......@@ -452,7 +452,7 @@ bool TestSetData6()
/* call _SetDataRange function */
_SetDataRange(sGPU, 5.2, -3.2, -2);
gpuTest = CheckData(sGPU, answer, unitNum, 1e-4F);
gpuTest = _CheckData(sGPU, answer, unitNum, 1e-4F);
/* destroy variables */
delete s;
......
......@@ -60,8 +60,8 @@ bool TestSigmoid1()
yUser = Sigmoid(*x);
/* check result */
cpuTest = CheckData(y, answer, unitNum, 1e-4F) &&
CheckData(&yUser, answer, unitNum, 1e-4F);
cpuTest = _CheckData(y, answer, unitNum, 1e-4F) &&
_CheckData(&yUser, answer, unitNum, 1e-4F);
#ifdef USE_CUDA
/* GPU test */
......@@ -81,8 +81,8 @@ bool TestSigmoid1()
yUserGPU = Sigmoid(*xGPU);
/* check result */
gpuTest = CheckData(yGPU, answer, unitNum, 1e-4F) &&
CheckData(&yUserGPU, answer, unitNum, 1e-4F);
gpuTest = _CheckData(yGPU, answer, unitNum, 1e-4F) &&
_CheckData(&yUserGPU, answer, unitNum, 1e-4F);
/* destroy variables */
delete x;
......@@ -148,8 +148,8 @@ bool TestSigmoid2()
_SigmoidBackward(y, x, dedy, dedx);
/* check result */
cpuTest = CheckData(y, yAnswer, unitNum, 1e-4F) &&
CheckData(dedx, dedxAnswer, unitNum, 1e-4F);
cpuTest = _CheckData(y, yAnswer, unitNum, 1e-4F) &&
_CheckData(dedx, dedxAnswer, unitNum, 1e-4F);
#ifdef USE_CUDA
/* GPU test */
......@@ -174,8 +174,8 @@ bool TestSigmoid2()
_SigmoidBackward(yGPU, xGPU, dedyGPU, dedxGPU);
/* check result */
gpuTest = CheckData(yGPU, yAnswer, unitNum, 1e-4F) &&
CheckData(dedxGPU, dedxAnswer, unitNum, 1e-4F);
gpuTest = _CheckData(yGPU, yAnswer, unitNum, 1e-4F) &&
_CheckData(dedxGPU, dedxAnswer, unitNum, 1e-4F);
/* destroy variables */
delete x;
......
......@@ -66,7 +66,7 @@ bool TestSign1()
bUser = Sign(*a);
/* check results */
cpuTest = CheckData(b, answer, aUnitNum, 1e-4F) && CheckData(aMe, answer, aUnitNum, 1e-4F) && CheckData(&bUser, answer, aUnitNum, 1e-4F);
cpuTest = _CheckData(b, answer, aUnitNum, 1e-4F) && _CheckData(aMe, answer, aUnitNum, 1e-4F) && _CheckData(&bUser, answer, aUnitNum, 1e-4F);
#ifdef USE_CUDA
/* GPU test */
......@@ -88,7 +88,7 @@ bool TestSign1()
bUserGPU = Sign(*aGPU);
/* check results */
gpuTest = CheckData(bGPU, answer, aUnitNum, 1e-4F) && CheckData(aMeGPU, answer, aUnitNum, 1e-4F) && CheckData(&bUserGPU, answer, aUnitNum, 1e-4F);
gpuTest = _CheckData(bGPU, answer, aUnitNum, 1e-4F) && _CheckData(aMeGPU, answer, aUnitNum, 1e-4F) && _CheckData(&bUserGPU, answer, aUnitNum, 1e-4F);
/* destroy variables */
delete a;
delete b;
......
......@@ -67,7 +67,7 @@ bool TestSin1()
bUser = Sin(*a);
/* check results */
cpuTest = CheckData(b, answer, unitNum, 1e-4F) && CheckData(aMe, answer, unitNum, 1e-4F) && CheckData(&bUser, answer, unitNum, 1e-4F);
cpuTest = _CheckData(b, answer, unitNum, 1e-4F) && _CheckData(aMe, answer, unitNum, 1e-4F) && _CheckData(&bUser, answer, unitNum, 1e-4F);
#ifdef USE_CUDA
/* GPU test */
......@@ -89,7 +89,7 @@ bool TestSin1()
bUserGPU = Sin(*aGPU);
/* check results */
gpuTest = CheckData(bGPU, answer, unitNum, 1e-4F) && CheckData(aMeGPU, answer, unitNum, 1e-4F) && CheckData(&bUserGPU, answer, unitNum, 1e-4F);
gpuTest = _CheckData(bGPU, answer, unitNum, 1e-4F) && _CheckData(aMeGPU, answer, unitNum, 1e-4F) && _CheckData(&bUserGPU, answer, unitNum, 1e-4F);
/* destroy variables */
delete a;
......
......@@ -64,7 +64,7 @@ bool TestSoftmax1()
yUser = Softmax(*x, 1);
/* check result */
cpuTest = CheckData(y, answer, unitNum, 1e-4F) && CheckData(&yUser, answer, unitNum, 1e-4F);
cpuTest = _CheckData(y, answer, unitNum, 1e-4F) && _CheckData(&yUser, answer, unitNum, 1e-4F);
#ifdef USE_CUDA
/* GPU test */
......@@ -84,7 +84,7 @@ bool TestSoftmax1()
yUserGPU = Softmax(*xGPU, 1);
/* check result */
gpuTest = CheckData(yGPU, answer, unitNum, 1e-4F) && CheckData(&yUserGPU, answer, unitNum, 1e-4F);
gpuTest = _CheckData(yGPU, answer, unitNum, 1e-4F) && _CheckData(&yUserGPU, answer, unitNum, 1e-4F);
/* destroy variables */
delete x;
......@@ -150,8 +150,8 @@ bool TestSoftmax2()
_SoftmaxBackward(g, y, x, dedy, dedx, NULL, 1, CROSSENTROPY);
/* check result */
cpuTest = CheckData(y, yAnswer, unitNum, 1e-4F)
&& CheckData(dedx, dedxAnswer, unitNum, 1e-4F);
cpuTest = _CheckData(y, yAnswer, unitNum, 1e-4F)
&& _CheckData(dedx, dedxAnswer, unitNum, 1e-4F);
#ifdef USE_CUDA
/* GPU test */
......@@ -178,8 +178,8 @@ bool TestSoftmax2()
_SoftmaxBackward(gGPU, yGPU, xGPU, dedyGPU, dedxGPU, NULL, 1, CROSSENTROPY);
/* check result */
gpuTest = CheckData(yGPU, yAnswer, unitNum, 1e-4F)
&& CheckData(dedxGPU, dedxAnswer, unitNum, 1e-4F);
gpuTest = _CheckData(yGPU, yAnswer, unitNum, 1e-4F)
&& _CheckData(dedxGPU, dedxAnswer, unitNum, 1e-4F);
/* destroy variables */
delete x;
......
......@@ -62,9 +62,9 @@ bool TestSort1()
_SortMe(aMe, index, 0);
Sort(*a, bUser, *index, 0);
cpuTest = CheckData(b, answer, unitNum) &&
CheckData(aMe, answer, unitNum) &&
CheckData(&bUser, answer, unitNum);
cpuTest = _CheckData(b, answer, unitNum) &&
_CheckData(aMe, answer, unitNum) &&
_CheckData(&bUser, answer, unitNum);
#ifdef USE_CUDA
/* GPU test */
......@@ -88,9 +88,9 @@ bool TestSort1()
Sort(*aGPU, bUserGPU, *indexGPU, 0);
/* check results */
gpuTest = CheckData(bGPU, answer, unitNum) &&
CheckData(aMeGPU, answer, unitNum) &&
CheckData(&bUserGPU, answer, unitNum);
gpuTest = _CheckData(bGPU, answer, unitNum) &&
_CheckData(aMeGPU, answer, unitNum) &&
_CheckData(&bUserGPU, answer, unitNum);
/* destroy variables */
delete a;
......@@ -154,9 +154,9 @@ bool TestSort2()
Sort(*a, bUser, *index, 1);
/* check results */
cpuTest = CheckData(b, answer, unitNum) &&
CheckData(aMe, answer, unitNum) &&
CheckData(&bUser, answer, unitNum);
cpuTest = _CheckData(b, answer, unitNum) &&
_CheckData(aMe, answer, unitNum) &&
_CheckData(&bUser, answer, unitNum);
#ifdef USE_CUDA
/* GPU test */
......@@ -180,9 +180,9 @@ bool TestSort2()
Sort(*aGPU, bUserGPU, *indexGPU, 1);
/* check results */
gpuTest = CheckData(bGPU, answer, unitNum) &&
CheckData(aMeGPU, answer, unitNum) &&
CheckData(&bUserGPU, answer, unitNum);
gpuTest = _CheckData(bGPU, answer, unitNum) &&
_CheckData(aMeGPU, answer, unitNum) &&
_CheckData(&bUserGPU, answer, unitNum);
/* destroy variables */
delete a;
......
......@@ -77,7 +77,7 @@ bool TestSplit1()
tUser = Split(*s, 0, 2);
/* check results */
cpuTest = CheckData(t, answer, tUnitNum) && CheckData(&tUser, answer, tUnitNum);
cpuTest = _CheckData(t, answer, tUnitNum) && _CheckData(&tUser, answer, tUnitNum);
#ifdef USE_CUDA
/* GPU test */
......@@ -97,7 +97,7 @@ bool TestSplit1()
tUserGPU = Split(*sGPU, 0, 2);
/* check results */
gpuTest = CheckData(tGPU, answer, tUnitNum) && CheckData(&tUserGPU, answer, tUnitNum);
gpuTest = _CheckData(tGPU, answer, tUnitNum) && _CheckData(&tUserGPU, answer, tUnitNum);
/* destroy variables */
delete s;
......@@ -173,7 +173,7 @@ bool TestSplit2()
tUser = Split(*s, 1, 2);
/* check results */
cpuTest = CheckData(t, answer, tUnitNum) && CheckData(&tUser, answer, tUnitNum);
cpuTest = _CheckData(t, answer, tUnitNum) && _CheckData(&tUser, answer, tUnitNum);
#ifdef USE_CUDA
......@@ -194,7 +194,7 @@ bool TestSplit2()
tUserGPU = Split(*sGPU, 1, 2);
/* check results */
gpuTest = CheckData(tGPU, answer, tUnitNum) && CheckData(&tUserGPU, answer, tUnitNum);
gpuTest = _CheckData(tGPU, answer, tUnitNum) && _CheckData(&tUserGPU, answer, tUnitNum);
/* destroy variables */
delete s;
......@@ -293,8 +293,8 @@ bool TestSplit3()
Split(*s, tUserList, 1, 2);
/* check results */
cpuTest = CheckData(t1, answer1, tUnitNum1) && CheckData((XTensor *)tUserList.Get(0), answer1, tUnitNum1) &&
CheckData(t2, answer2, tUnitNum2) && CheckData((XTensor *)tUserList.Get(1), answer2, tUnitNum2);
cpuTest = _CheckData(t1, answer1, tUnitNum1) && _CheckData((XTensor *)tUserList.Get(0), answer1, tUnitNum1) &&
_CheckData(t2, answer2, tUnitNum2) && _CheckData((XTensor *)tUserList.Get(1), answer2, tUnitNum2);
#ifdef USE_CUDA
/* GPU test */
......@@ -328,8 +328,8 @@ bool TestSplit3()
Split(*sGPU, tUserList, 1, 2);
/* check results */
gpuTest = CheckData(tGPU1, answer1, tUnitNum1) && CheckData((XTensor *)tUserList.Get(0), answer1, tUnitNum1) &&
CheckData(tGPU2, answer2, tUnitNum2) && CheckData((XTensor *)tUserList.Get(1), answer2, tUnitNum2);
gpuTest = _CheckData(tGPU1, answer1, tUnitNum1) && _CheckData((XTensor *)tUserList.Get(0), answer1, tUnitNum1) &&
_CheckData(tGPU2, answer2, tUnitNum2) && _CheckData((XTensor *)tUserList.Get(1), answer2, tUnitNum2);
/* destroy variables */
delete s;
......
......@@ -98,7 +98,7 @@ bool TestSpread1()
_Spread(s, modify, 0, srcIndex, 2, tgtIndex);
/* check results */
cpuTest = CheckData(s, answer, sUnitNum, 1e-5F);
cpuTest = _CheckData(s, answer, sUnitNum, 1e-5F);
#ifdef USE_CUDA
/* GPU test */
......@@ -115,7 +115,7 @@ bool TestSpread1()
/* call _Spread function */
_Spread(sGPU, modifyGPU, 0, srcIndex, 2, tgtIndex);
gpuTest = CheckData(sGPU, answer, sUnitNum, 1e-5F);
gpuTest = _CheckData(sGPU, answer, sUnitNum, 1e-5F);
/* destroy variables */
delete s;
......@@ -207,8 +207,8 @@ bool TestSpread2()
_SpreadForGather(s2, t, sIndex);
/* check results */
cpuTest = CheckData(s1, answer, sUnitNum) &&
CheckData(s2, answer, sUnitNum);
cpuTest = _CheckData(s1, answer, sUnitNum) &&
_CheckData(s2, answer, sUnitNum);
#ifdef USE_CUDA
/* GPU test */
......@@ -233,8 +233,8 @@ bool TestSpread2()
_SpreadForGather(sGPU2, tGPU, sIndexGPU);
/* check results */
gpuTest = CheckData(sGPU1, answer, sUnitNum) &&
CheckData(sGPU2, answer, sUnitNum);
gpuTest = _CheckData(sGPU1, answer, sUnitNum) &&
_CheckData(sGPU2, answer, sUnitNum);
/* destroy variables */
delete s1;
......@@ -342,8 +342,8 @@ bool TestSpread3()
_SpreadForCopyIndexed(s2, t, dim, sIndex, tIndex, 1);
/* check results */
cpuTest = CheckData(s1, answer, sUnitNum) &&
CheckData(s2, answer, sUnitNum);
cpuTest = _CheckData(s1, answer, sUnitNum) &&
_CheckData(s2, answer, sUnitNum);
#ifdef USE_CUDA
/* GPU test */
......@@ -368,8 +368,8 @@ bool TestSpread3()
_SpreadForCopyIndexed(sGPU2, tGPU, dim, sIndexGPU, tIndexGPU, 1);
/* check results */
gpuTest = CheckData(sGPU1, answer, sUnitNum) &&
CheckData(sGPU2, answer, sUnitNum);
gpuTest = _CheckData(sGPU1, answer, sUnitNum) &&
_CheckData(sGPU2, answer, sUnitNum);
/* destroy variables */
delete s1;
......
......@@ -66,8 +66,8 @@ bool TestSub1()
cUser = Sub(*a, *b);
/* check results */
cpuTest = CheckData(c, answer, unitNum)
&& CheckData(cMe, answer, unitNum) && CheckData(&cUser, answer, unitNum);
cpuTest = _CheckData(c, answer, unitNum)
&& _CheckData(cMe, answer, unitNum) && _CheckData(&cUser, answer, unitNum);
#ifdef USE_CUDA
/* GPU test */
......@@ -92,8 +92,8 @@ bool TestSub1()
cUserGPU = Sub(*aGPU, *bGPU);
/* check results */
gpuTest = CheckData(cGPU, answer, unitNum, 1e-4F)
&& CheckData(cMeGPU, answer, unitNum, 1e-4F) && CheckData(&cUserGPU, answer, unitNum, 1e-4F);
gpuTest = _CheckData(cGPU, answer, unitNum, 1e-4F)
&& _CheckData(cMeGPU, answer, unitNum, 1e-4F) && _CheckData(&cUserGPU, answer, unitNum, 1e-4F);
/* destroy variables */
delete a;
......@@ -162,8 +162,8 @@ bool TestSub2()
cUser = Sub(*a, *b, beta);
/* check results */
cpuTest = CheckData(c, answer, unitNum)
&& CheckData(cMe, answer, unitNum) && CheckData(&cUser, answer, unitNum);
cpuTest = _CheckData(c, answer, unitNum)
&& _CheckData(cMe, answer, unitNum) && _CheckData(&cUser, answer, unitNum);
#ifdef USE_CUDA
/* GPU test */
......@@ -188,8 +188,8 @@ bool TestSub2()
cUserGPU = Sub(*aGPU, *bGPU, beta);
/* check results */
gpuTest = CheckData(cGPU, answer, unitNum, 1e-4F)
&& CheckData(cMeGPU, answer, unitNum, 1e-4F) && CheckData(&cUserGPU, answer, unitNum, 1e-4F);
gpuTest = _CheckData(cGPU, answer, unitNum, 1e-4F)
&& _CheckData(cMeGPU, answer, unitNum, 1e-4F) && _CheckData(&cUserGPU, answer, unitNum, 1e-4F);
/* destroy variables */
delete a;
......
......@@ -80,9 +80,9 @@ bool TestSubDim1()
cUser = SubDim(*a, *b, 0);
/* check results */
cpuTest = CheckData(c, answer, aUnitNum) &&
CheckData(cMe, answer, aUnitNum) &&
CheckData(&cUser, answer, aUnitNum);
cpuTest = _CheckData(c, answer, aUnitNum) &&
_CheckData(cMe, answer, aUnitNum) &&
_CheckData(&cUser, answer, aUnitNum);
#ifdef USE_CUDA
/* GPU test */
......@@ -107,9 +107,9 @@ bool TestSubDim1()
cUserGPU = SubDim(*aGPU, *bGPU, 0);
/* check results */
gpuTest = CheckData(cGPU, answer, aUnitNum) &&
CheckData(cMeGPU, answer, aUnitNum) &&
CheckData(&cUserGPU, answer, aUnitNum);
gpuTest = _CheckData(cGPU, answer, aUnitNum) &&
_CheckData(cMeGPU, answer, aUnitNum) &&
_CheckData(&cUserGPU, answer, aUnitNum);
/* destroy variables */
delete a;
......@@ -193,9 +193,9 @@ bool TestSubDim2()
cUser = SubDim(*a, *b, 1);
/* check results */
cpuTest = CheckData(c, answer, aUnitNum) &&
CheckData(cMe, answer, aUnitNum) &&
CheckData(&cUser, answer, aUnitNum);
cpuTest = _CheckData(c, answer, aUnitNum) &&
_CheckData(cMe, answer, aUnitNum) &&
_CheckData(&cUser, answer, aUnitNum);
#ifdef USE_CUDA
/* GPU test */
......@@ -220,9 +220,9 @@ bool TestSubDim2()
cUserGPU = SubDim(*aGPU, *bGPU, 1);
/* check results */
gpuTest = CheckData(cGPU, answer, aUnitNum) &&
CheckData(cMeGPU, answer, aUnitNum) &&
CheckData(&cUserGPU, answer, aUnitNum);
gpuTest = _CheckData(cGPU, answer, aUnitNum) &&
_CheckData(cMeGPU, answer, aUnitNum) &&
_CheckData(&cUserGPU, answer, aUnitNum);
/* destroy variables */
delete a;
......
......@@ -66,8 +66,8 @@ bool TestSum1()
cUser = Sum(*a, *b);
/* check results */
cpuTest = CheckData(c, answer, unitNum)
&& CheckData(cMe, answer, unitNum) && CheckData(&cUser, answer, unitNum);
cpuTest = _CheckData(c, answer, unitNum)
&& _CheckData(cMe, answer, unitNum) && _CheckData(&cUser, answer, unitNum);
#ifdef USE_CUDA
/* GPU test */
......@@ -92,8 +92,8 @@ bool TestSum1()
cUserGPU = Sum(*aGPU, *bGPU);
/* check results */
gpuTest = CheckData(cGPU, answer, unitNum)
&& CheckData(cMeGPU, answer, unitNum) && CheckData(&cUserGPU, answer, unitNum);
gpuTest = _CheckData(cGPU, answer, unitNum)
&& _CheckData(cMeGPU, answer, unitNum) && _CheckData(&cUserGPU, answer, unitNum);
/* destroy variables */
delete a;
......@@ -162,8 +162,8 @@ bool TestSum2()
cUser = Sum(*a, *b, beta);
/* check results */
cpuTest = CheckData(c, answer, unitNum)
&& CheckData(cMe, answer, unitNum) && CheckData(&cUser, answer, unitNum);
cpuTest = _CheckData(c, answer, unitNum)
&& _CheckData(cMe, answer, unitNum) && _CheckData(&cUser, answer, unitNum);
#ifdef USE_CUDA
/* GPU test */
......@@ -188,8 +188,8 @@ bool TestSum2()
cUserGPU = Sum(*aGPU, *bGPU, beta);
/* check results */
gpuTest = CheckData(cGPU, answer, unitNum)
&& CheckData(cMeGPU, answer, unitNum) && CheckData(&cUserGPU, answer, unitNum);
gpuTest = _CheckData(cGPU, answer, unitNum)
&& _CheckData(cMeGPU, answer, unitNum) && _CheckData(&cUserGPU, answer, unitNum);
/* destroy variables */
delete a;
......
......@@ -82,9 +82,9 @@ bool TestSumDim1()
cUser = SumDim(*a, *b, 0);
/* check results */
cpuTest = CheckData(c, answer, aUnitNum) &&
CheckData(cMe, answer, aUnitNum) &&
CheckData(&cUser, answer, aUnitNum);
cpuTest = _CheckData(c, answer, aUnitNum) &&
_CheckData(cMe, answer, aUnitNum) &&
_CheckData(&cUser, answer, aUnitNum);
#ifdef USE_CUDA
/* GPU test */
......@@ -109,9 +109,9 @@ bool TestSumDim1()
cUserGPU = SumDim(*aGPU, *bGPU, 0);
/* check results */
gpuTest = CheckData(cGPU, answer, aUnitNum) &&
CheckData(cMeGPU, answer, aUnitNum) &&
CheckData(&cUserGPU, answer, aUnitNum);
gpuTest = _CheckData(cGPU, answer, aUnitNum) &&
_CheckData(cMeGPU, answer, aUnitNum) &&
_CheckData(&cUserGPU, answer, aUnitNum);
/* destroy variables */
delete a;
......@@ -196,9 +196,9 @@ bool TestSumDim2()
cUser = SumDim(*a, *b, 1);
/* check results */
cpuTest = CheckData(c, answer, aUnitNum) &&
CheckData(cMe, answer, aUnitNum) &&
CheckData(&cUser, answer, aUnitNum);
cpuTest = _CheckData(c, answer, aUnitNum) &&
_CheckData(cMe, answer, aUnitNum) &&
_CheckData(&cUser, answer, aUnitNum);
#ifdef USE_CUDA
/* GPU test */
......@@ -223,9 +223,9 @@ bool TestSumDim2()
cUserGPU = SumDim(*aGPU, *bGPU, 1);
/* check results */
gpuTest = CheckData(cGPU, answer, aUnitNum) &&
CheckData(cMeGPU, answer, aUnitNum) &&
CheckData(&cUserGPU, answer, aUnitNum);
gpuTest = _CheckData(cGPU, answer, aUnitNum) &&
_CheckData(cMeGPU, answer, aUnitNum) &&
_CheckData(&cUserGPU, answer, aUnitNum);
/* destroy variables */
delete a;
......@@ -305,9 +305,9 @@ bool TestSumDim3()
cUser = SumDim(*a, *b, 1);
/* check results */
cpuTest = CheckData(c, answer->data, aUnitNum) &&
CheckData(cMe, answer->data, aUnitNum) &&
CheckData(&cUser, answer->data, aUnitNum);
cpuTest = _CheckData(c, answer->data, aUnitNum) &&
_CheckData(cMe, answer->data, aUnitNum) &&
_CheckData(&cUser, answer->data, aUnitNum);
#ifdef USE_CUDA
/* GPU test */
......@@ -331,9 +331,9 @@ bool TestSumDim3()
cUserGPU = SumDim(*aGPU, *bGPU, 1);
/* check results */
gpuTest = CheckData(cGPU, answer->data, aUnitNum) &&
CheckData(cMeGPU, answer->data, aUnitNum) &&
CheckData(&cUserGPU, answer->data, aUnitNum);
gpuTest = _CheckData(cGPU, answer->data, aUnitNum) &&
_CheckData(cMeGPU, answer->data, aUnitNum) &&
_CheckData(&cUserGPU, answer->data, aUnitNum);
/* destroy variables */
delete a;
......@@ -414,9 +414,9 @@ bool TestSumDim4()
cUser = SumDim(*a, *b, 1);
/* check results */
cpuTest = CheckData(c, answer->data, aUnitNum) &&
CheckData(cMe, answer->data, aUnitNum) &&
CheckData(&cUser, answer->data, aUnitNum);
cpuTest = _CheckData(c, answer->data, aUnitNum) &&
_CheckData(cMe, answer->data, aUnitNum) &&
_CheckData(&cUser, answer->data, aUnitNum);
#ifdef USE_CUDA
/* GPU test */
......@@ -440,9 +440,9 @@ bool TestSumDim4()
cUserGPU = SumDim(*aGPU, *bGPU, 1);
/* check results */
gpuTest = CheckData(cGPU, answer->data, aUnitNum) &&
CheckData(cMeGPU, answer->data, aUnitNum) &&
CheckData(&cUserGPU, answer->data, aUnitNum);
gpuTest = _CheckData(cGPU, answer->data, aUnitNum) &&
_CheckData(cMeGPU, answer->data, aUnitNum) &&
_CheckData(&cUserGPU, answer->data, aUnitNum);
/* destroy variables */
delete a;
......
......@@ -67,7 +67,7 @@ bool TestTan1()
bUser = Tan(*a);
/* check results */
cpuTest = CheckData(b, answer, unitNum, 1e-4F) && CheckData(aMe, answer, unitNum, 1e-4F) && CheckData(&bUser, answer, unitNum, 1e-4F);
cpuTest = _CheckData(b, answer, unitNum, 1e-4F) && _CheckData(aMe, answer, unitNum, 1e-4F) && _CheckData(&bUser, answer, unitNum, 1e-4F);
#ifdef USE_CUDA
/* GPU test */
......@@ -89,7 +89,7 @@ bool TestTan1()
bUserGPU = Tan(*aGPU);
/* check results */
gpuTest = CheckData(bGPU, answer, unitNum, 1e-4F) && CheckData(aMeGPU, answer, unitNum, 1e-4F) && CheckData(&bUserGPU, answer, unitNum, 1e-4F);
gpuTest = _CheckData(bGPU, answer, unitNum, 1e-4F) && _CheckData(aMeGPU, answer, unitNum, 1e-4F) && _CheckData(&bUserGPU, answer, unitNum, 1e-4F);
/* destroy variables */
delete a;
......
......@@ -73,8 +73,8 @@ bool TestTranspose1()
bUser = Transpose(*a, 0, 1);
/* check results */
cpuTest = CheckData(b, answer, aUnitNum, 1e-4F)
&& CheckData(&bUser, answer, aUnitNum, 1e-4F);
cpuTest = _CheckData(b, answer, aUnitNum, 1e-4F)
&& _CheckData(&bUser, answer, aUnitNum, 1e-4F);
#ifdef USE_CUDA
/* GPU test */
......@@ -93,8 +93,8 @@ bool TestTranspose1()
bUserGPU = Transpose(*aGPU, 0, 1);
/* check results */
gpuTest = CheckData(bGPU, answer, aUnitNum, 1e-4F)
&& CheckData(&bUserGPU, answer, aUnitNum, 1e-4F);
gpuTest = _CheckData(bGPU, answer, aUnitNum, 1e-4F)
&& _CheckData(&bUserGPU, answer, aUnitNum, 1e-4F);
/* destroy variables */
delete a;
......@@ -179,8 +179,8 @@ bool TestTranspose2()
bUser = Transpose(*a, 0, 2);
/* check results */
cpuTest = CheckData(b, answer, aUnitNum, 1e-4F)
&& CheckData(&bUser, answer, aUnitNum, 1e-4F);
cpuTest = _CheckData(b, answer, aUnitNum, 1e-4F)
&& _CheckData(&bUser, answer, aUnitNum, 1e-4F);
#ifdef USE_CUDA
/* GPU test */
......@@ -199,8 +199,8 @@ bool TestTranspose2()
bUserGPU = Transpose(*aGPU, 0, 2);
/* check results */
gpuTest = CheckData(bGPU, answer, aUnitNum, 1e-4F)
&& CheckData(&bUserGPU, answer, aUnitNum, 1e-4F);
gpuTest = _CheckData(bGPU, answer, aUnitNum, 1e-4F)
&& _CheckData(&bUserGPU, answer, aUnitNum, 1e-4F);
/* destroy variables */
delete a;
......
......@@ -100,8 +100,8 @@ bool TestUnsqueeze1()
tUser2 = Unsqueeze(*s, 2, 2);
/* check results */
cpuTest = CheckData(t1, answer1, tUnitNum1) && CheckData(&tUser1, answer1, tUnitNum1) &&
CheckData(t2, answer2, tUnitNum2) && CheckData(&tUser2, answer2, tUnitNum2);
cpuTest = _CheckData(t1, answer1, tUnitNum1) && _CheckData(&tUser1, answer1, tUnitNum1) &&
_CheckData(t2, answer2, tUnitNum2) && _CheckData(&tUser2, answer2, tUnitNum2);
#ifdef USE_CUDA
/* GPU test */
......@@ -126,8 +126,8 @@ bool TestUnsqueeze1()
tUserGPU2 = Unsqueeze(*sGPU, 2, 2);
/* check results */
gpuTest = CheckData(tGPU1, answer1, tUnitNum1) && CheckData(&tUserGPU1, answer1, tUnitNum1)
&& CheckData(tGPU2, answer2, tUnitNum2) && CheckData(&tUserGPU2, answer2, tUnitNum2);
gpuTest = _CheckData(tGPU1, answer1, tUnitNum1) && _CheckData(&tUserGPU1, answer1, tUnitNum1)
&& _CheckData(tGPU2, answer2, tUnitNum2) && _CheckData(&tUserGPU2, answer2, tUnitNum2);
/* destroy variables */
delete s;
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论