Question: Benchmarking ( 3 0 points ) [ 5 Points ] Write a C code for addition of two 1 D matrices with the Number of

Benchmarking (30 points)
[5 Points] Write a C code for addition of two 1D matrices with the Number of elements in an array (N) equal to 10000000. You will be rewriting this C code.
Hint: You may need to use dynamic memory allocation function malloc()
// Allocate host memory
a =(float*)malloc(sizeof(float)* N);
[5 Points] Write an equivalent python code.
[5 Points] Compile the C code and Compare the performance between C and python codes. Which code performs better and why? Also, without dynamic allocation, report the error if any while running the C code. Whats the eason behind that error?
[5 Points] Apply Numba JIT (Just in Time) decorator in Python Code script)and compare the performance between two python codes. Benchmarking Contd
[5 Points] Employ OpenACC pragma to optimize the C code (matrix/vector addition) you wrote earlier and compare its performance with serial implementation.
[5 Points] Implement the C code (matrix addition) in CUDA using single and multiple cuda/GPU threads and compare the performance.
 Benchmarking (30 points) [5 Points] Write a C code for addition

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!