Mercurial > cgi-bin > hgwebdir.cgi > PR > Applications > SSR > SSR__Blocked_Matrix_Mult__Bench
changeset 5:0a8667d13627
Moved zeroing out results array from results Pr to Divider
| author | Me |
|---|---|
| date | Mon, 08 Nov 2010 04:04:19 -0800 |
| parents | cbd8db6b8657 |
| children | 78d8bd6aadac |
| files | src/Application/SSR_Matrix_Mult/Divide_Pr.c src/Application/SSR_Matrix_Mult/Result_Pr.c src/Application/SSR_Matrix_Mult/subMatrix_Pr.c |
| diffstat | 3 files changed, 14 insertions(+), 11 deletions(-) [+] |
line diff
1.1 --- a/src/Application/SSR_Matrix_Mult/Divide_Pr.c Thu Nov 04 17:44:15 2010 -0700 1.2 +++ b/src/Application/SSR_Matrix_Mult/Divide_Pr.c Mon Nov 08 04:04:19 2010 -0800 1.3 @@ -9,6 +9,7 @@ 1.4 1.5 #include "SSR_Matrix_Mult.h" 1.6 #include <math.h> 1.7 +#include <string.h> 1.8 1.9 //The time to compute this many result values should equal the time to 1.10 // perform this division on a matrix of size gives that many result calcs 1.11 @@ -142,6 +143,9 @@ 1.12 numResRows = leftMatrix->numRows; 1.13 numResCols = rightMatrix->numCols; 1.14 resultArray = dividerParams->resultMatrix->array; 1.15 + 1.16 + //zero the result array 1.17 + memset( resultArray, 0, numResRows * numResCols * sizeof(float32) ); 1.18 1.19 //============== Do either sequential mult or do division ============== 1.20 1.21 @@ -153,9 +157,6 @@ 1.22 { 1.23 //====== Do sequential multiply on a single core 1.24 DEBUG( dbgAppFlow, "doing sequential") 1.25 - 1.26 - //zero the result array 1.27 - memset( resultArray, 0, numResRows * numResCols * sizeof(float32) ); 1.28 1.29 //transpose the right matrix 1.30 float32 *
2.1 --- a/src/Application/SSR_Matrix_Mult/Result_Pr.c Thu Nov 04 17:44:15 2010 -0700 2.2 +++ b/src/Application/SSR_Matrix_Mult/Result_Pr.c Mon Nov 08 04:04:19 2010 -0800 2.3 @@ -44,14 +44,6 @@ 2.4 2.5 resultArray = params->resultArray; 2.6 2.7 - //zero out the results array -- will be accumulating, so must start 0 2.8 - for( row = 0; row < numRows; row++ ) 2.9 - { 2.10 - for( col = 0; col < numCols; col++ ) 2.11 - { 2.12 - resultArray[ row * numCols + col ] = 0; 2.13 - } 2.14 - } 2.15 2.16 while( count < numSubMatrixPairs ) 2.17 {
3.1 --- a/src/Application/SSR_Matrix_Mult/subMatrix_Pr.c Thu Nov 04 17:44:15 2010 -0700 3.2 +++ b/src/Application/SSR_Matrix_Mult/subMatrix_Pr.c Mon Nov 08 04:04:19 2010 -0800 3.3 @@ -6,9 +6,12 @@ 3.4 * 3.5 */ 3.6 3.7 +#include <string.h> 3.8 + 3.9 #include "SSR_Matrix_Mult.h" 3.10 3.11 3.12 + 3.13 void inline 3.14 copyFromOrig( SubMatrix *subMatrix, VirtProcr *animPr ); 3.15 3.16 @@ -49,6 +52,10 @@ 3.17 SubMatrix *leftSubMatrix, *rightSubMatrix; 3.18 3.19 DEBUG1(dbgAppFlow, "start sub-matrix mult: %d\n", animatingPr->procrID) 3.20 + int32 subMatrixProbe = VMS__create_single_interval_probe( "subMtx", 3.21 + animatingPr); 3.22 + VMS__record_sched_choice_into_probe( subMatrixProbe, animatingPr ); 3.23 + VMS__record_interval_start_in_probe( subMatrixProbe ); 3.24 3.25 params = (SMPairParams *)data; 3.26 resultPr = params->resultPr; 3.27 @@ -81,6 +88,9 @@ 3.28 3.29 //send result to result processor 3.30 params->partialResultArray = resArray; 3.31 + 3.32 + VMS__record_interval_end_in_probe( subMatrixProbe ); 3.33 + 3.34 SSR__send_of_type_to( animatingPr, params, RESULTS_MSG, resultPr ); 3.35 SSR__dissipate_procr( animatingPr ); 3.36 }
