Example fbench

From wiki.emacinc.com
Revision as of 15:46, 27 November 2013 by Jgreene (talk | contribs)
Jump to: navigation, search
TODO: {{#todo:InProgress(11.14.13-09:25->JG+)|Jgreene|oe 4,oe 5,jg,md,InProgress}}

This is a guide to the fbench C example project included in the EMAC OE SDK.

How fast is your machine? How accurate is your floating-point math library? Fbench is a tool for measuring just that!

FBench is actually a complete optical design raytracing algorithm. It is based on the Marinchip Interactive Lens Design System written by John Walker of Fourmilab. We chopped off the ui, however, so you won't be doing any optical design with it. We just use it because it's an extremely CPU-intensive algorithm. It's wonderful for testing your CPU to it's limits and determining if your floating-point library harbors bugs. Run it and regard it's output. A perusal of the source-comments will show you how your system stacks up against the competition.

It's also an nice C programming example.

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 binary to the target machine.


Usage and Behavior

This is a benchmarking program for determining floating point accuracy and performance. This project creates 2 programs : fbench and ffbench. fbench benchmarks using one algorithm, ffbench uses another. See project comments for details.

Usage for fbench:

fbench <itercount>
Where <itercount> is an optional specification for the number of iterations to be executed, 1000 being the default.
i.e. : ./fbench 123

It runs until it is finished and then outputs the results to the terminal. hey mike fbench appears to have a bug or something. It's supposed to finish and output some results but it just keeps running until you tell it to "stop the timer". It also gives me a funny message at one point "Measured run time in seconds should be divided by 0". Strange. maybe the board is just slow, I dunno. You want me to track down the problem in the code?

Usage for ffbench:

ffbench i.e. : ./ffbench

It runs until it is finished and then outputs to the terminal whether or not errors were detected in it's results.