Download the CUDA Toolkit and SDK from http://www.nvidia.com/object/ cuda_get.html. Make sure to use the ?emurelease? (Emulation Mode)

Question:

Download the CUDA Toolkit and SDK from http://www.nvidia.com/object/ cuda_get.html. Make sure to use the ?emurelease? (Emulation Mode) version of the code (you will not need actual NVIDIA hardware for this assignment). Build the example programs provided in the SDK, and confirm that they run on the emulator

1. Using the ?template? SDK sample as a starting point, write a CUDA program to perform the following vector operations:

1)?a???b?(vector-vector subtraction)

2) a???b (vector dot product)

The dot product of two vectors?a?= [a1,?a2, ? ,?an] and?b?= [b1,?b2, ? ,?bn] is defined as:

image

Submit code for each program that demonstrates each operation and verifies the correctness of the results.

2. If you have GPU hardware available, complete a performance analysis your program, examining the computation time for the GPU and a CPU version of your program for a range of vector sizes. Explain any results you see.

Fantastic news! We've Found the answer you've been seeking!

Step by Step Answer:

Related Book For  answer-question
Question Posted: