Write C console programs of the “axpy” algorithm for integer, and double precisi
ID: 3588258 • Letter: W
Question
Write C console programs of the “axpy” algorithm for integer, and double precision data types. Instrument and monitor and measure execution time as a function of problem size. For each of the 2 data types:
Write it as a straight forward, single processor, sequential execution program, which you can scale the size of the axpy computation for N = 1, 5, 10 , 50, 100, 500, 1000, 5000, 10000, 50000, 100000, 500000 and 1,000,000 vector elements . Use a random number generator to fill the vectors. Set the vector dimension using a DEFINE statement then recompile & execution each vector length.
Your program should print out the vector length, and wall clock execution time in the console window, and computation time per axpy vector for each vector length used in your program code, and the number of accuracy improvement loops you run the daxpy computation to improve accuracy.
Your console program should print out using formatted printf commands
Vector length(number of vector elements)
The number of accuracy improvement loops you run the daxpy computation to improve accuracy
Total computation time
Computation time per axpy vector
Computation time per vector element
Number of machine cycles per arithmetic operation
Explanation / Answer
hm1_cIter = hm1.begin ( );
// hm1.erase ( hm1_cIter );
hm1_cIter = hm1.begin( );
cout <<"The first element of hm1 is now "<<hm1_cIter -> first<<"."<<endl; return 0; }
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.