From 5d12d47c332a16cbcc32fbc0f7b0b32fd9c2a8a9 Mon Sep 17 00:00:00 2001 From: Ian Cosden Date: Tue, 10 Jul 2018 20:59:29 -0400 Subject: [PATCH] Clean up comments in matmul_test.cpp --- example_code/matmul_test.cpp | 84 ++++++++++++++++++------------------ 1 file changed, 43 insertions(+), 41 deletions(-) diff --git a/example_code/matmul_test.cpp b/example_code/matmul_test.cpp index f31a270..8976785 100644 --- a/example_code/matmul_test.cpp +++ b/example_code/matmul_test.cpp @@ -5,36 +5,38 @@ Princeton University icosden@princeton.edu - Sample Matrix-Matrix multiplication code for CoDaS-HEP Summer School + Sample Matrix-Matrix multiplication code for CoDaS-HEP Summer School - Purpose: - To use as a example to profile with performance tuning tools such as VTune. The code does - not do anything useful and is for illustrative/educational use only. It is not meant to be - exhaustive or demonstrating optimal matrix-matrix multiplication techniques. + Purpose: + To use as a example to profile with performance tuning tools such as VTune. + The code does not do anything useful and is for illustrative/educational + use only. It is not meant to be exhaustive or demonstrating optimal + matrix-matrix multiplication techniques. Description: - Code generates two matrices with random numbers. They are stored in 2D arrays (named A and B) as - well as 1D arrays (a and b). There are 4 functions that multiply A and B and store the result in - matrix C (or c in the 1D case). It is possible to set the percentage of time each function is - called via the command line. + Code generates two matrices with random numbers. They are stored in 2D + arrays (named A and B) as well as 1D arrays (a and b). There are 4 + functions that multiply A and B and store the result in matrix C (or c in + the 1D case). It is possible to set the percentage of time each function + is called via the command line. - Command line arguments: + Command line arguments: N - + N: size of NxN matrix **optional**: - thresholds: 4 functions are distributed between 0 and 1. + thresholds: 4 functions are distributed between 0 and 1. mm1 is called between 0 and mm2 is called between and mm3 is called between and mm4 is called between and 1. - + Example: to call only mm1 use 1.0 0 0 to call only mm2 use 0 1.0 1.0 to call only mm3 use 0 0 1.0 to call only mm4 use 0 0 0 - + *******************************************************************************************************/ #include "mm.h" @@ -42,10 +44,10 @@ int main(int argc, char *argv[]) { - + int matrix_size; //N*N matrix double thresh_1, thresh_2, thresh_3; - + //read command line input //set various paramaters if(argc<2) { @@ -55,46 +57,46 @@ int main(int argc, char *argv[]) else { matrix_size=atoi(argv[1]); } - + if(argc<5) { thresh_1=0.1; - thresh_2=0.3; + thresh_2=0.3; thresh_3=0.6; cout<<"Using default thresholds: "; } else { - thresh_1=atof(argv[2]); - thresh_2=atof(argv[3]); - thresh_3=atof(argv[4]); + thresh_1=atof(argv[2]); + thresh_2=atof(argv[3]); + thresh_3=atof(argv[4]); cout<<"Using user supplied thresholds: "; } - + cout<