Write a cpu side function that takes and rgb image

Assignment Help Other Subject
Reference no: EM13852293

Q 1. In your own words describe the four stages of a machine cycle in Von Neumann Architecture.

Q 2. In your own words discuss what resource sharing is and how it may benefit/deteriorate the performance of a parallel architecture

Q 3. Explain the following terminologies and discuss them in terms of Flynn's taxonomy: a. Task-based parallelism b. Data-based parallelism

Q 4. What is double buffering and which CUDA compute level introduced this mechanism?

Q 5. Discuss the following items in your own terms and give an example of an application which targets to optimize each (in computing). a. Latency b. Throughput

Q 6. Explain in your own terms what the Map communication pattern is and discuss at least two of its properties. Give two example applications for utilizing this pattern for parallelization.

Problem Question: P 1.

Suppose that we have an application in image processing. We can use two platforms: platform A has one CPU with 1 core and Platform B which has a GPU with up to 10,000 cores.

We have a video of colored images and would like to convert the frames in the video to grayscale. We know the following information about our CPU and GPU:

• It take the CPU core 1 microsecond (10-6 sec) to convert one pixel of the image from RGB color to gray scale.

• It takes each GPU kernel 0.5 millisecond (0.5*10-3 sec) to convert one pixel of the image from RGB to gray scale.

• Using the Map operations we can pass 10,000 pixels to the GPU to process in parallel without affecting per-pixel performance. That is, we can run 10,000 threads in parallel in appropriate sized blocks and grids.

a. Calculate the latency of CPU and GPU. (HINT: Latency unit is time)

b. Calculate the throughput of the CPU and GPU. (HINT: Throughput unit is No. of items)

c. Suppose that the video frames are 600x800. Can CPU code run a live streaming of the converted video (30 fps)? How about GPU code?

HINT: calculate the frame rates of the CPU and GPU codes for 600x800 images.

d. Calculate the maximum frame size for a video that can be processed by CPU in real time.

e. Calculate the maximum frame size for a video that can be processed by GPU in real time.

Programming Question: PA 1.

Write a program that takes an input image in RGB and converts its pixel RGB value to gray scale. In openCV the image data is stored in the "data" pointer. If the location of a pixel is calculated at "index" then R=image.data[index], G= image,data[index+1], and B= image.data[index+2];

To convert a pixel from RGB to gray scale all you need to do is to calculate the average of the three RGB values and store it to the output. output.data[outIndex] = (input.data[index]+ input.data[index+1]+ input.data[index+2])/3.0f;

a. Write a CPU side function that takes and RGB image (called input) and converts it to gray scale.

b. Write your code for the GPU that does the color conversion from RGB to gray scale.

Reference no: EM13852293

Questions Cloud

In free-fall the acceleration is always : Given Statement: "In free-fall the acceleration is always g and always straight downward regardless of the motion." Three Objections:(a) If I drop a balloon or a feather, it doesn't fall nearly as fast as a brick.
Discuss what legal and ethical issues arise in this case : In a 1400-word analysis, discuss what legal and ethical issues arise in this case, and what legal and ethical principles guide this decision? What choice would you make and why
A moving cart of mass m in elastically collides : What fraction of energy will be lost when a moving cart of mass m inelastically collides with a stationary cart of mass 2m?
Two cars with different masses are taking a left : Two cars with different masses are taking a left turn in a flat road. Which of those cars will experience a bigger (a) centripetal force? (b) centripetal acceleration?
Write a cpu side function that takes and rgb image : Write a CPU side function that takes and RGB image (called input) and converts it to gray scale.
What is the shortest distance to an object : Radar uses radio waves of a wavelength of 2.3m. The time interval for one radiation pulse is 100 times larger than the time of one oscillation; the time between pulses is 10 times larger than the time of one pulse. What is the shortest distance to an..
Discuss the differences between nonionizing radiation : Discuss the differences between nonionizing radiation and ionizing radiation. Describe common sources of exposure, general position on the EM spectrum, biological effects of excessive exposures, control methods for occupational exposures, etc
How do you respond to the notice of charge : The owner, now quite shocked as she has been a "feminist for many years", asks you to investigate and prepare a response to the EEOC claims. She "knows" that the terminated employee is the one who contracted the EEOC. How do you respond to the Not..
How supply chain management could use to improve efficiency : Explain how Supply Chain Management (SCM) and Customer Relationship Management(CRM) systems could be used to improve the efficiency and effectiveness of thecompany's supply network.

Reviews

Write a Review

Other Subject Questions & Answers

  An unannounced osha inspection

An OSHA inspector arrives at your worksite requesting to talk with you about an inspection based on the health and safety complaints of a worker. You are in your office and the OSHA inspector is at the reception office.

  What is the tangential velocity of the wrist

An individuals arm segment is 0.15m long and has an angular velocity of 123 degrees per second. What is the tangential velocity of the wrist?

  Would brain teasers fall under fluid

Would brain teasers fall under fluid? And would things like unscrambling words or short term memory problems fall under crystallized?

  Frank sibleys aesthetic and nonaesthetic concepts

I'm doing a report on Frank Sibley's Aesthetic and Nonaesthetic Concepts, and I dont even know what he's trying to say and I'm supposed to criticize it.

  Zincblende crystal structure

Gallium arsenide (GaAs) and indium arsenide (InAs) both have the zincblende crystal structure and are soluble in each other at all concentrations.

  Create annotated bibliography of your research include the

when the constitution was completed in the summer of 1787 approval by representatives from nine of the thirteen states

  Martin luther kings speech contains other allusions in

martin luther kings speech contains other allusions in addition to the one with which he opens his speech. find an

  League of nations'' investigation

In response to the League of Nations' investigation into Japan's invasion and occupation of Manchuria,

  Explain the advantages and disadvantages of your chosen

write a 3-5 page paper evaluating two of the commonly used volunteer training programs described in this weeks

  Resurgence of islamic fundamentalism

There has been a resurgence of Islamic Fundamentalism (or revivalism) in Afghanistan, Iran and other parts of the Muslim world. Explain what you feel is the cause of this resurgence and whether you believe liberal democracy requires secularization of..

  Identify the critical issues in the scenario

You are a general manager with a service company. You are hearing comments from your sales group that customers are unhappy with your company.

  Part 1nbspq1 answer each of the questions in this section

part 1nbspq1 answer each of the questions in this section. choose the one statement which is the most appropriate

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd