Answered step by step
Verified Expert Solution
Link Copied!

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 (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.
image text in transcribed

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Data Management Databases And Organizations

Authors: Watson Watson

5th Edition

0471715360, 978-0471715368

More Books

Students also viewed these Databases questions

Question

What are the core functions of the universitys HRM department?

Answered: 1 week ago

Question

Identify a set of competencies for tenured faculty

Answered: 1 week ago