Ask Question, Ask an Expert

+61-413 786 465

info@mywordsolution.com

Ask Computer Engineering Expert

Topics: Compiling C program with CUDA enabled on Windows using MS Visual Studio. In this session, we are going to learn to write parallel program using C language.

Outcome

CO 1 Design parallel code to solve a given problem, determine computational bottlenecks and optimize the performance of the code.
CO 2 Describe different parallel architectures, programming models, and algorithms for parallel programming.
CO 3 Analyze the time complexity of parallel algorithms as a function of the problem size and number of processors.
CO 4 Implement parallel solutions using Pthreads, OpenMP, MPI, Hybrid or GPU.

Activity 1, Question 1
How many block will be created in this program?

Activity 1, Question 2
How many thread will be created in each block?

ACTIVITY2 : EXTEND PROBLEM
Modify the source code in Activity 1 to meet the following criteria:

1.Create a new array.

2.The value of each element in this array (1) should be the current array index + 10.

3.The array created in (1) should be passed during the kernellauncher too.

4.The addKernel function should receive one (1)more value,which is the array created in (1).

5.Perform addition between each element of the both arrays.

ACTIVITY3: MULTIPLE BLOCKS

Modify the source code in Activity 2 to meet the following criteria:

1. Increase the elements of array to 1000.

2. Assume that we are using the old version of GPU.

3.Based on our data size, determine:
a.How many block should be created?
b.How many threads should be created in each block?

4.To access data in each index for multiple blocks and threads, you need to use this formula:

int i = threadIdx.x + blockIdx.x * blockDim.x;

5. Modify your source code to meet the new array size and its elements, the number of block, and thread.

ACTIVITY4: INCREASE DATA

Modify the source code in Activity 2 to meet the following criteria:

1. Increase the elements of array to 30000.

2. Assume that we are using the new version of GPU.

3. Based on our data size, determine:
a. How many block should be created?
b. How many threads should be created in each block?

4. Modify your source code to meet the new array size and its elements, the number of block, and thread.

Attachment:- Lab.pdf

Computer Engineering, Engineering

  • Category:- Computer Engineering
  • Reference No.:- M92574285
  • Price:- $25

Priced at Now at $25, Verified Solution

Have any Question?


Related Questions in Computer Engineering

Sorting program note make sure you use c programmingfor

Sorting Program Note: Make sure you use c++ programming For this assignment, you are to write a comparative algorithm that will compare the efficiency of three sorting routines. Here is the approach you should use: 1. Wr ...

Analyse two of the three technologies provided focus

Analyse two of the three technologies provided (focus virtualisation, cloud computing and green computing). Summarise what each of your two selected technologies is, and what the technology does. Explain what improvement ...

1 write code in the method linearsearch in

1. Write code in the method linearSearch() in "SearchMethods"class which finds the element in an array using linear search approach and returns its index to the calling main method, otherwise it returns -1. 2. Write code ...

What does smokeping do and why is that functionality

What does Smokeping do, and why is that functionality important in a datacenter? When setting up Smokeping, how do you add systems in to be monitored? How do you go about adding an alert (both setting up a new alert and ...

Question suppose you are designing a database for a library

Question : Suppose you are designing a database for a library, the library system contains information about people who borrow. Each person is uniquely identified. People can search and borrow books. A book has book ID. ...

Question suppose that in n a particular implementation of

Question : Suppose that in n a particular implementation of the MIPS single-cycle design, the lw instruction takes the longest amount of physical time to execute at 3.5 ns. What would be the theoretical maximum clock rat ...

Technology certainly does play a large role in our lives

Technology certainly does play a large role in our lives and this has happened in a very short period of time. It has impacted the way we activities professionally, personally, and academically. For example, online educa ...

Recently the discovery of a new data structure wonder heap

Recently, the discovery of a new data structure WONDER HEAP was announced. A WONDER HEAP has the same functionality and worst case behaviour as a binary heap except for DELETE MAX, which is implemented in O(log log n) (i ...

How is the study of how firms decisions about prices and

How is the study of how firms' decisions about prices and quantities depend on the market conditions they face, the field of industrial organization, and the cost of production.

Question suppose we decide to add a new operation to our

Question : Suppose we decide to add a new operation to our Stack ADT called sizeIs, which returns avalue of primitive type int equal to the number of items on stack. The method signature for sizeIs is public int sizeIs() ...

  • 4,153,160 Questions Asked
  • 13,132 Experts
  • 2,558,936 Questions Answered

Ask Experts for help!!

Looking for Assignment Help?

Start excelling in your Courses, Get help with Assignment

Write us your full requirement for evaluation and you will receive response within 20 minutes turnaround time.

Ask Now Help with Problems, Get a Best Answer

Why might a bank avoid the use of interest rate swaps even

Why might a bank avoid the use of interest rate swaps, even when the institution is exposed to significant interest rate

Describe the difference between zero coupon bonds and

Describe the difference between zero coupon bonds and coupon bonds. Under what conditions will a coupon bond sell at a p

Compute the present value of an annuity of 880 per year

Compute the present value of an annuity of $ 880 per year for 16 years, given a discount rate of 6 percent per annum. As

Compute the present value of an 1150 payment made in ten

Compute the present value of an $1,150 payment made in ten years when the discount rate is 12 percent. (Do not round int

Compute the present value of an annuity of 699 per year

Compute the present value of an annuity of $ 699 per year for 19 years, given a discount rate of 6 percent per annum. As