CS194-15 Assignment 1: Measuring CPU Performance solution

$25.00

Original Work ?

Download Details:

  • Name: Assignment1-ca11ap.zip
  • Type: zip
  • Size: 432.40 KB

Category: You will Instantly receive a download link upon Payment||Click Original Work Button for Custom work

Description

5/5 - (1 vote)

Measuring Execution

Time In this part we will be writing a simple C program to measure the amount of time required to compute the sum of the integers from 0 to 10000. The Linux performance tools library allows us to accurately count the number of cycles it takes to execute a chunk of code.

Two files are given to you, counters.h and counters.cpp, which take care of setting up and reading the hardware performance counters.

1.1 C Skeleton The following code snippet shows how to use the provided counter library. This code shows how to initalize a hardware counter, and also how to retrieve the current time in cycles. 1 #i n cl u d e #i n cl u d e #i n cl u d e #i n cl u d e