Ask Question, Ask an Expert

+61-413 786 465

info@mywordsolution.com

Ask Computer Engineering Expert

Measure and compare the average performance of the following code (suppose as is large enough). Describe your method, justify why your method is reasonable, and attach your running code and experiment results. This idea is Loop unrolling for performance improvement.

1a) 

double ComputeSum(int numIterations) {

int i;

double sum = 0.0; for (i = 0; i < numIterations; i++) { sum += 1.0;

}

return sum;

}

1b) double ComputeSum (int numIterations) { double sum0, sum1, sum2, sum3, sum4, sum5, sum6, sum7; int i;

double sum = 0.0;

sum0 = sum1 = sum2 = sum3 = sum4 = sum5 = sum6 = sum7 = 0.0;

for (i = 0; (i+7) < numIterations; i += 8) { sum0 += 1.0; sum1 += 1.0; sum2 += 1.0; sum3 += 1.0; sum4 += 1.0;

sum5 += 1.0; sum6 += 1.0; sum7 += 1.0;

}

sum = sum0 + sum1 + sum2 + sum3 +sum4 +sum5 + sum6 + sum7; for (;i

}

return sum;

}

Computer Engineering, Engineering

  • Category:- Computer Engineering
  • Reference No.:- M92564824
  • Price:- $10

Priced at Now at $10, Verified Solution

Have any Question?


Related Questions in Computer Engineering

Calculate the probability of selecting a random sample of

Calculate the probability of selecting a random sample of 225 observations with a sample proportion of 0.54 or greater, if the sample population has a population proportion of 0.50.

Task allocation and deallocation of mono-dimensional and

Task Allocation and deallocation of mono-dimensional and bi-dimensional arrays represented by pointers a. Declare and implement a function CreateArray(...) that returns a pointer to an array of n integers. b. Declare and ...

There has been a substantial interest in predictability of

There has been a substantial interest in predictability of stock return in recent years. For example, DeBondt and Thaler (1985, 1987) report that long-term past losers (three- to five-years) outperform long-term past win ...

The chancellor of a university has commissioned a team to

The Chancellor of a university has commissioned a team to collect data on students' GPAs (M = 3.0; SD = 0.5) and the amount of time they spend bar hopping every week (measured in minutes: M = 720; SD = 240). They find a ...

Suppose that we have the following cities mudville horns

Suppose that we have the following cities: Mudville, Horns, Farm Town, Almira, Billows, Carmenovsk, Dantub. They are in a rural county and have no paved roads. Your county government decides to build a paved network of r ...

Review the creating a process driven organization at

Review the Creating a Process Driven Organization at AgCredit case study online, and answer the following questions. Discussion Question: Propose an organizational structure for the IT department that you feel would supp ...

Define risk and explain why this concept is important to

Define risk and explain why this concept is important to small business managers.

Assembly programs use 32 bits to address memory and can

Assembly programs use 32 bits to address memory and can access up to 4gb of memory. If an assembly code for a system uses 16 bits to address memory, how many bytes of memory can the program access? Is it as simple as 2^1 ...

Question project 1 involves the creation of a personal

Question: Project 1 involves the creation of a personal website for yourself - also known as a resume site or a CV site. All the files used in the website must be contained within a specific folder named "project_1" (exc ...

Suppose you are given a connected graph g with edge costs

Suppose you are given a connected graph G, with edge costs that are all distinct. Prove that G has a unique minimum spanning tree.

  • 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