diff --git a/tests/check_reduction.c b/tests/check_reduction.c index 6a1e8c6a97..60411ead57 100644 --- a/tests/check_reduction.c +++ b/tests/check_reduction.c @@ -68,13 +68,16 @@ static double pcgRand01(void){ */ START_TEST(test_maxandargmax_reduction){ - pcgSeed(1); - /** * We test here a reduction of some random 3D tensor on the first and * third dimensions. */ - + + GpuArray gaS0; + GpuArray gaD0; + GpuArray gaD1; + GpuReductionAttr* grAttr; + GpuReduction* gr; size_t errCnt = 0; size_t i,j,k; size_t dims[3] = {32,50,79}; @@ -93,7 +96,8 @@ START_TEST(test_maxandargmax_reduction){ /** * Initialize source data. */ - + + pcgSeed(1); for(i=0;i= TOL){ errCnt++; if(errCnt <= MAXERRPRINT){ @@ -2305,13 +2273,15 @@ START_TEST(test_sum_reduction){ }END_TEST START_TEST(test_sum_veryhighrank){ - pcgSeed(1); - /** * Here we test a reduction of a random 8D tensor on four dimensions. */ - size_t errCnt = 0; + GpuArray gaS0; + GpuArray gaD0; + GpuReductionAttr* grAttr; + GpuReduction* gr; + size_t errCnt = 0, dstIdx; size_t i,j,k,l,m,n,o,p; size_t dims [8] = {1171,373,2,1,2,1,2,1}; size_t prodDims = dims[0]*dims[1]*dims[2]*dims[3]*dims[4]*dims[5]*dims[6]*dims[7]; @@ -2331,6 +2301,7 @@ START_TEST(test_sum_veryhighrank){ * Initialize source data. */ + pcgSeed(1); for(i=0;i= TOL){ errCnt++; if(errCnt <= MAXERRPRINT){ @@ -2414,18 +2380,21 @@ START_TEST(test_sum_veryhighrank){ }END_TEST START_TEST(test_sum_alldimsreduced){ - pcgSeed(1); - /** * We test here a reduction of some random 3D tensor on all dimensions. */ + GpuArray gaS0; + GpuArray gaD0; + GpuReductionAttr* grAttr; + GpuReduction* gr; size_t errCnt = 0; size_t i,j,k; size_t dims[3] = {32,50,79}; size_t prodDims = dims[0]*dims[1]*dims[2]; const int reduxList[] = {0,1,2}; const float TOL = 1e-4; + float gtD0; float* pS0 = calloc(1, sizeof(*pS0) * dims[0]*dims[1]*dims[2]); float* pD0 = calloc(1, sizeof(*pD0) ); @@ -2438,6 +2407,7 @@ START_TEST(test_sum_alldimsreduced){ * Initialize source data. */ + pcgSeed(1); for(i=0;i= TOL){ errCnt++; if(errCnt <= MAXERRPRINT){ @@ -2692,13 +2654,15 @@ START_TEST(test_prod_reduction){ }END_TEST START_TEST(test_prod_veryhighrank){ - pcgSeed(1); - /** * Here we test a reduction of a random 8D tensor on four dimensions. */ - size_t errCnt = 0; + GpuArray gaS0; + GpuArray gaD0; + GpuReductionAttr* grAttr; + GpuReduction* gr; + size_t errCnt = 0, dstIdx; size_t i,j,k,l,m,n,o,p; size_t dims [8] = {1171,373,2,1,2,1,2,1}; size_t prodDims = dims[0]*dims[1]*dims[2]*dims[3]*dims[4]*dims[5]*dims[6]*dims[7]; @@ -2718,6 +2682,7 @@ START_TEST(test_prod_veryhighrank){ * Initialize source data. */ + pcgSeed(1); for(i=0;i= TOL){ errCnt++; if(errCnt <= MAXERRPRINT){ @@ -2801,18 +2761,21 @@ START_TEST(test_prod_veryhighrank){ }END_TEST START_TEST(test_prod_alldimsreduced){ - pcgSeed(1); - /** * We test here a reduction of some random 3D tensor on all dimensions. */ + GpuArray gaS0; + GpuArray gaD0; + GpuReductionAttr* grAttr; + GpuReduction* gr; size_t errCnt = 0; size_t i,j,k; size_t dims[3] = {32,50,79}; size_t prodDims = dims[0]*dims[1]*dims[2]; const int reduxList[] = {0,1,2}; const float TOL = 1e-4; + float gtD0; float* pS0 = calloc(1, sizeof(*pS0) * dims[0]*dims[1]*dims[2]); float* pD0 = calloc(1, sizeof(*pD0) ); @@ -2825,6 +2788,7 @@ START_TEST(test_prod_alldimsreduced){ * Initialize source data. */ + pcgSeed(1); for(i=0;i= TOL){ errCnt++; if(errCnt <= MAXERRPRINT){ @@ -2993,13 +2950,15 @@ START_TEST(test_prodnz_reduction){ }END_TEST START_TEST(test_prodnz_veryhighrank){ - pcgSeed(1); - /** * Here we test a reduction of a random 8D tensor on four dimensions. */ - size_t errCnt = 0; + GpuArray gaS0; + GpuArray gaD0; + GpuReductionAttr* grAttr; + GpuReduction* gr; + size_t errCnt = 0, dstIdx; size_t i,j,k,l,m,n,o,p; size_t dims [8] = {1171,373,2,1,2,1,2,1}; size_t prodDims = dims[0]*dims[1]*dims[2]*dims[3]*dims[4]*dims[5]*dims[6]*dims[7]; @@ -3019,6 +2978,7 @@ START_TEST(test_prodnz_veryhighrank){ * Initialize source data. */ + pcgSeed(1); for(i=0;i= TOL){ errCnt++; if(errCnt <= MAXERRPRINT){ @@ -3105,18 +3060,21 @@ START_TEST(test_prodnz_veryhighrank){ }END_TEST START_TEST(test_prodnz_alldimsreduced){ - pcgSeed(1); - /** * We test here a reduction of some random 3D tensor on all dimensions. */ + GpuArray gaS0; + GpuArray gaD0; + GpuReductionAttr* grAttr; + GpuReduction* gr; size_t errCnt = 0; size_t i,j,k; size_t dims[3] = {32,50,79}; size_t prodDims = dims[0]*dims[1]*dims[2]; const int reduxList[] = {0,1,2}; const float TOL = 1e-4; + float gtD0; float* pS0 = calloc(1, sizeof(*pS0) * dims[0]*dims[1]*dims[2]); float* pD0 = calloc(1, sizeof(*pD0) ); @@ -3129,6 +3087,7 @@ START_TEST(test_prodnz_alldimsreduced){ * Initialize source data. */ + pcgSeed(1); for(i=0;i