Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Benchmarking ( 3 0 points ) [ 5 Points ] Write a C code for addition of two 1 D matrices with the Number of
Benchmarking points
Points Write a C code for addition of two D matrices with the Number of elements in an array N equal to You will be rewriting this C code.
Hint: You may need to use dynamic memory allocation function malloc
Allocate host memory
a floatmallocsizeoffloat N;
Points Write an equivalent python code.
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?
Points Apply Numba JIT Just in Time decorator in Python Code scriptand compare the performance between two python codes. Benchmarking Contd
Points Employ OpenACC pragma to optimize the C code matrixvector addition you wrote earlier and compare its performance with serial implementation.
Points Implement the C code matrix addition in CUDA using single and multiple cudaGPU threads and compare the performance.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started