[PATCH] D25346: [test-suite] [Polybench] run tests twice with -ffp-contract=on/off

Sebastian Pop via llvm-commits llvm-commits at lists.llvm.org
Thu Oct 6 13:58:36 PDT 2016


sebpop created this revision.
sebpop added reviewers: grosser, rengolin, MatzeB.
sebpop added subscribers: llvm-commits, Abe.

This patch implements the idea that I posted as a reply to Matthias on https://reviews.llvm.org/D25277:
On Wed, Oct 5, 2016 at 5:33 PM, Matthias Braun <matze at braunis.de> wrote:

> I was mainly wondering here whether there may be a sensible generic mechanism to combine a list of floatingpoint numbers

For all the tests in the polybench, I think we can do bisimulation.
What I mean by bisimulation is that we would copy the kernel()
function of each polybench/test.c and name it kernelNoFP() and add
flag attributes "-fno-fast-math -ffp-contract=off" (can be split
compilation if flag attributes do not work.)
main() will call kernel() and kernelNoFP() and compare their output
with FP_TOLERANCE.
Only the execution of kernel() will be timed for benchmark performance result.
main() will only print the output from kernelNoFP() that will be
hashed and compared against the reference hash (as we currently expect
exact match of the output hash.)

The good things:

- no modifications to CMake and Makefiles
- no extra space to store the extra reference output
- tests both user CFLAGS specified mode and fast-math and fp-contraction=off.

The bad things: (because of the extra reference run of kernelNoFP())

- compilation time will double: e.g., Polly will optimize both kernels,
- memory requirements on the device will almost double: added one

extra output array, input arrays are not modified, so no need to
duplicate them,

- compute time on the device will more than double: running the kernel

twice, plus an extra loop over both outputs to compare with
FP_TOLERANCE.


https://reviews.llvm.org/D25346

Files:
  SingleSource/Benchmarks/Polybench/linear-algebra/kernels/2mm/2mm.c

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D25346.73849.patch
Type: text/x-patch
Size: 3998 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20161006/038a4628/attachment.bin>


More information about the llvm-commits mailing list