Mercurial > cgi-bin > hgwebdir.cgi > PR > Applications > SSR > SSR__Blocked_Matrix_Mult__Bench
diff Matrix_Mult.h @ 10:387f3084d9bb
Changed dir structure to new project structure
| author | Me@portablequad |
|---|---|
| date | Tue, 07 Feb 2012 14:07:38 -0800 |
| parents | |
| children | ca572fdc9a80 |
line diff
1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/Matrix_Mult.h Tue Feb 07 14:07:38 2012 -0800 1.3 @@ -0,0 +1,77 @@ 1.4 +/* 1.5 + * Copyright Oct 24, 2009 OpenSourceStewardshipFoundation.org 1.6 + * Licensed under GNU General Public License version 2 1.7 + */ 1.8 + 1.9 +#ifndef MATRIX_MULT_H_ 1.10 +#define MATRIX_MULT_H_ 1.11 + 1.12 +#include <stdio.h> 1.13 +#include <unistd.h> 1.14 +#include <malloc.h> 1.15 + 1.16 +#include "../SSR_lib/VMS/VMS_primitive_data_types.h" 1.17 +#include "ParamHelper/Param.h" 1.18 + 1.19 +//============================== Structures ============================== 1.20 + 1.21 +typedef 1.22 +struct 1.23 + { int32 numRows; 1.24 + int32 numCols; 1.25 + float32 *array; //2D, but dynamically sized, so use addr arith 1.26 + } 1.27 +Matrix; 1.28 + 1.29 +/* This is the "appSpecificPiece" that is carried inside a DKUPiece. 1.30 + * In the DKUPiece data struc it is declared to be of type "void *". This 1.31 + * allows the application to define any data structure it wants and put it 1.32 + * into a DKUPiece. 1.33 + * When the app specific info is used, it is in app code, so it is cast to 1.34 + * the correct type to tell the compiler how to access fields. 1.35 + * This keeps all app-specific things out of the DKU directory, as per the 1.36 + * DKU standard. */ 1.37 +typedef 1.38 +struct 1.39 + { 1.40 + // pointers to shared data.. the result matrix must be created when the 1.41 + // left and right matrices are put into the root ancestor DKUPiece. 1.42 + Matrix * leftMatrix; 1.43 + Matrix * rightMatrix; 1.44 + Matrix * resultMatrix; 1.45 + 1.46 + // define the starting and ending boundaries for this piece of the 1.47 + // result matrix. These are derivable from the left and right 1.48 + // matrices, but included them for readability of code. 1.49 + int prodStartRow, prodEndRow; 1.50 + int prodStartCol, prodEndCol; 1.51 + // Start and end of the portion of the left matrix that contributes to 1.52 + // this piece of the product 1.53 + int leftStartRow, leftEndRow; 1.54 + int leftStartCol, leftEndCol; 1.55 + // Start and end of the portion of the right matrix that contributes to 1.56 + // this piece of the product 1.57 + int rightStartRow, rightEndRow; 1.58 + int rightStartCol, rightEndCol; 1.59 + } 1.60 +MatrixProdPiece; 1.61 + 1.62 +//============================== Functions ================================ 1.63 +void readFile(); 1.64 + 1.65 +Matrix *makeMatrix( int32 numRows, int32 numCols ); 1.66 +Matrix *makeMatrix_Flat( int32 numRows, int32 numCols ); 1.67 +Matrix *makeMatrix_WithResMat( int32 numRows, int32 numCols ); 1.68 +void freeMatrix_Flat( Matrix * matrix ); 1.69 +void freeMatrix( Matrix * matrix ); 1.70 +void printMatrix( Matrix *matrix ); 1.71 + 1.72 +void read_Matrix_From_File( Matrix *matrixStruc, char *matrixFileName ); 1.73 + 1.74 +void 1.75 +initialize_Input_Matrices_Via( Matrix **leftMatrix, Matrix **rightMatrix, 1.76 + ParamBag *paramBag ); 1.77 + 1.78 +//=========================================================================== 1.79 + 1.80 +#endif /*MATRIX_MULT_H_*/
