www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1997/02/07/06:19:21

Date: Fri, 7 Feb 1997 13:09:05 +0200 (IST)
From: Eli Zaretskii <eliz AT is DOT elta DOT co DOT il>
To: "Mr. Fuju" <kapieckiel AT harding DOT edu>
cc: djgpp AT delorie DOT com
Subject: Re: flops...
In-Reply-To: <Pine.SOL.3.94.970206191432.20961C-100000@taz>
Message-ID: <Pine.SUN.3.91.970207124923.7639F-100000@is>
MIME-Version: 1.0

On Thu, 6 Feb 1997, Mr. Fuju wrote:

> When designers measure computer speed, they measure it in flops...
> mega-flops, tera-flops, etcs.   What program do they use to come up with
> those numbers?  Could someone here write something that is comperable?

A flop is a floating-point multiplication followed by a floating-point 
addition:

	double a, b, c;
	double d = a * b + c;

Speed is measured in flops (or mega-flops, or tera-flops) PER SECOND, not 
in flops.

So the simplest benchmark that measures raw flops would be a loop that, 
say, multiplies two vectors to get their scalar product:

	double a[10], b[10], c = 0.0;
	int i;

	for (i = 0; i < 10; i++)
	  c += a[i] * b[i];

This is basically a 10-flop loop.  If you measure the time it runs, you 
can compute the speed of your machine in flops per second.

However, the real FP benchmarks (such as Whetstone) are much more complex
and sophisticated.  They need to cope with such factors as on-chip cache 
(which make benchmarks seem to be extremely fast until the size of the 
arrays overflows the cache) and other calamities.

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019