Difference between revisions of "Example fbench"

From wiki.emacinc.com
Jump to: navigation, search
Line 2: Line 2:
 
This is a guide to the '''fbench''' C example project included in the EMAC OE SDK.
 
This is a guide to the '''fbench''' C example project included in the EMAC OE SDK.
  
How fast does your machine execute floating point operations? How accurate are those operations? This project is a floating point benchmark and accuracy testing application that utilizes ray tracing algorithms. It is provided here mainly as an example of a method of processor performance comparison and compiler optimization testing. It's an excerpt from the '''fbench''' project by John Walker of Fourmilab. See [http://www.fourmilab.ch/fbench/ John Walker's '''Floating Point Benchmarks''' project homepage] for more information.
+
How fast does your machine execute floating point operations? How accurate are those operations? This project is a floating point benchmark and accuracy testing application that utilizes ray tracing algorithms. It's also a good example of a method of processor performance comparison and compiler optimization testing. It's an excerpt from the '''fbench''' project by John Walker of Fourmilab. See [http://www.fourmilab.ch/fbench/ John Walker's '''Floating Point Benchmarks''' project homepage] for more information.
  
 
The '''fbench''' project builds two executables: '''fbench''' and '''ffbench'''.
 
The '''fbench''' project builds two executables: '''fbench''' and '''ffbench'''.
Line 41: Line 41:
  
 
Where <itercount> specifies the number of iterations to be performed, 1000 being the default.<br />
 
Where <itercount> specifies the number of iterations to be performed, 1000 being the default.<br />
 +
For archival purposes you'll want to use a value slightly higher than 1000
  
 
===Usage Example===
 
===Usage Example===
  
 
<syntaxhighlight lang="console">
 
<syntaxhighlight lang="console">
root@som9g20:/tmp# ./fbench 123
+
root@som9g20:/tmp# ./fbench 2000
 
Ready to begin John Walker's floating point accuracy
 
Ready to begin John Walker's floating point accuracy
and performance benchmark.  123 iterations will be made.
+
and performance benchmark.  2000 iterations will be made.
  
  
Measured run time in seconds should be divided by 0
+
Measured run time in seconds should be divided by 2
 
to normalise for reporting results.  For archival results,
 
to normalise for reporting results.  For archival results,
 
adjust iteration count so the benchmark runs about five minutes.
 
adjust iteration count so the benchmark runs about five minutes.
Line 57: Line 58:
 
</syntaxhighlight>
 
</syntaxhighlight>
  
i.e. : ./fbench 123
+
After '''fbench''' is finished it prompts us to stop the timer (by pressing return).
 +
<syntaxhighlight lang="console">
 +
Stop the timer:
 +
</syntaxhighlight>
 +
 
 +
So we press return...
 +
 
 +
<syntaxhighlight lang="console">
 +
No errors in results.
 +
</syntaxhighlight>
 +
 
 +
...and '''fbench''' reports that no errors were found in our floating point operations. Hurrah!
 +
 
 +
===Using ffbench===
 +
 
 +
The '''ffbench''' program is executed from the console. It takes no parameters.
  
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?'''
+
./ffbench
  
'''Usage for ffbench:'''
+
===Usage Example===
  
ffbench
+
<syntaxhighlight lang="console">
i.e. : ./ffbench
+
root@som9g20:/tmp# ./ffbench
 +
20 passes. No errors in results.
 +
</syntaxhighlight>
  
It runs until it is finished and then outputs to the terminal whether or not errors were detected in it's results.
+
It runs until it is finished (30 seconds or so, depending on the speed of your machine). It performed 20 iterations of our ''Fast Fourier Transform'' dance and discovered no errors.

Revision as of 14:07, 3 December 2013

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 does your machine execute floating point operations? How accurate are those operations? This project is a floating point benchmark and accuracy testing application that utilizes ray tracing algorithms. It's also a good example of a method of processor performance comparison and compiler optimization testing. It's an excerpt from the fbench project by John Walker of Fourmilab. See John Walker's Floating Point Benchmarks project homepage for more information.

The fbench project builds two executables: fbench and ffbench.

fbench is a floating point benchmark. It's actually a complete optical design raytracing algorithm based on the Marinchip Interactive Lens Design System. See John Walker's fbench project homepage for more information.

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. See John Walker's ffbench project homepage for more information.

Opening, Building and Uploading the Project Files

1. Open the C/C++ editing perspective.

stub

2. Open the fbench project files.

stub

3. Build the fbench project.

stub

4. Upload the fbench and ffbench executables to the target machine.

stub

Usage and Behavior

Hardware Requirements

The 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. If your target does not meet these requirements then you're going to have a bad time.

Using fbench

The fbench program is executed from the console. It takes a single optional parameter.

./fbench <itercount>

Where <itercount> specifies the number of iterations to be performed, 1000 being the default.
For archival purposes you'll want to use a value slightly higher than 1000

Usage Example

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 is finished it prompts us to stop the timer (by pressing return).

Stop the timer:

So we press return...

No errors in results.

...and fbench reports that no errors were found in our floating point operations. Hurrah!

Using ffbench

The ffbench program is executed from the console. It takes no parameters.

./ffbench

Usage Example

root@som9g20:/tmp# ./ffbench
20 passes.  No errors in results.

It runs until it is finished (30 seconds or so, depending on the speed of your machine). It performed 20 iterations of our Fast Fourier Transform dance and discovered no errors.