Difference between revisions of "Example fbench"
m (→Usage Example: Fixed grammar.)
m (→A Note on Suspicious Systems: Fixed grammar.)
|Line 74:||Line 74:|
====A Note on Suspicious Systems====
====A Note on Suspicious Systems====
The default functionality as described above is for systems that
The default functionality as described above is for systems that can to be reliable. working with a system that issues<code>fbench</code> with <code>ACCURACY</code> defined. This will generate a version that executes as an infinite loop, performing the ray trace and checking the results on every pass. All incorrect results will be reported. It will keep running until it manually (using, , CTRL-C).
Revision as of 01:02, 10 December 2013
This is a guide to the
fbench C example project included in the EMAC OE SDK.
Test the speed and accuracy of a system's floating point operations. This project is a floating point benchmark and accuracy testing application that utilizes ray tracing algorithms and Fast Fourier Transforms to test your CPU and floating point library to its limits. It's also a good example of a method of processor performance comparison and compiler optimization testing. This project is an excerpt from the
fbench project by John Walker of Fourmilab. See John Walker's Floating Point Benchmarks project homepage for more information.
fbench project builds two executables:
fbench is a trigonometry intensive floating point benchmark. It is a complete optical design raytracing algorithm, shorn of its ui.
ffbench is a Fast Fourier Transform benchmark. It loops through a fast Fourier transform of a square matrix of complex numbers, reverses the transform and then checks the results.
Opening, Building and Uploading the Project Files
1. Open the C/C++ editing perspective.
2. Open the fbench project files.
3. Build the fbench project.
4. Upload the fbench and ffbench executables to the target system.
Usage and Behavior
fbench project is intended for use on C implementations that define
int as 32 bits or longer and permit allocation and direct addressing of arrays larger than one megabyte.
fbench program is executed from the console. It takes a single optional parameter.
Where <itercount> specifies the number of iterations to be performed, with 1,000 being the default.
For archival purposes you'll want to use a value slightly higher than 1,000.
root@som9g20:/tmp# ./fbench 2000 Ready to begin John Walker's floating point accuracy and performance benchmark. 2000 iterations will be made. Measured run time in seconds should be divided by 2 to normalise for reporting results. For archival results, adjust iteration count so the benchmark runs about five minutes. Press return to begin benchmark:
After fbench has finished it prompts the user to stop the timer (by pressing return).
Stop the timer:
No errors in results.
fbench reports that no errors were found in the floating point operations.
A Note on Suspicious Systems
The default functionality as described above is for systems that can be trusted to be reliable. When working with a system that is suspected of having issues,
fbench can be compiled with
ACCURACY defined. This will generate a version that executes as an infinite loop, performing the ray trace and checking the results on every pass. All incorrect results will be reported. It will keep running until it is stopped manually (using, for instance, CTRL-C).
The ffbench program is executed from the console. It takes no parameters.
root@som9g20:/tmp# ./ffbench 20 passes. No errors in results.
It runs until it is finished and reports what it discovered. In this case it performed 20 passes (the default, specified in code) and found no errors.
The time that it takes for this benchmark to run is of central significance of course, so if you are running it from a Bash shell you might want to time it thusly:
The fbench floating point benchmark C example tests the speed and accuracy of your floating point operations. It also provides an excellent example of code addressing processor performance comparison and compiler optimization. We hope this guide was informative.