This preview shows page 1. Sign up to view the full content.
Unformatted text preview: al-time performance constraints, actual run times are more important. ¯ 9.8 Life in the Real World: An Implementation of the Scheme Ã -Best Measurement We have created a library function fcyc that uses the Ã -best scheme to measure the number of clock cycles required by a function f. 9.9. SUMMARY
#include "clock.h" #include "fcyc.h" typedef void (*test funct)(int *); double fcyc(test funct f, int *params); 481 Returns: number of cycles used by f running params The parameter params is a pointer to an integer. In general, it can point to an array of integers that form the parameters of the function being measured. For example, when measuring the lower-case conversion functions lower1 and lower2, we pass as a parameter a pointer to a single int, which is the length of the string to be converted. When generating the memory mountain (Chapter 6, we pass a pointer to an array of size two containing the size and the stride. There are a number of parameters that control the measurement, such as the values of Ã , ¯, and Å , and whether or not to clear...
View Full Document
- Spring '10
- The American