diff --git a/MicroBenchmarks/ImageProcessing/BilateralFiltering/CMakeLists.txt b/MicroBenchmarks/ImageProcessing/BilateralFiltering/CMakeLists.txt --- a/MicroBenchmarks/ImageProcessing/BilateralFiltering/CMakeLists.txt +++ b/MicroBenchmarks/ImageProcessing/BilateralFiltering/CMakeLists.txt @@ -2,6 +2,12 @@ list(APPEND CPPFLAGS -I ${CMAKE_SOURCE_DIR}/${IMAGEPROC_UTILS}) list(APPEND LDFLAGS -lm) +if(ARCH STREQUAL "x86") + # Floating point contraction must be suppressed due to accuracy issues + list(APPEND CXXFLAGS -ffp-contract=off -DFMA_DISABLED=1) + list(APPEND CFLAGS -ffp-contract=off -DFMA_DISABLED=1) +endif() + llvm_test_verify_hash_program_output(bilateralFilterOutput.txt) llvm_test_verify(WORKDIR ${CMAKE_CURRENT_BINARY_DIR} ${FPCMP} bilateralFilter.reference_output bilateralFilterOutput.txt diff --git a/MicroBenchmarks/ImageProcessing/Blur/CMakeLists.txt b/MicroBenchmarks/ImageProcessing/Blur/CMakeLists.txt --- a/MicroBenchmarks/ImageProcessing/Blur/CMakeLists.txt +++ b/MicroBenchmarks/ImageProcessing/Blur/CMakeLists.txt @@ -3,6 +3,12 @@ list(APPEND CPPFLAGS -I ${CMAKE_SOURCE_DIR}/${IMAGEPROC_UTILS}) list(APPEND LDFLAGS -lm) +if(ARCH STREQUAL "x86") + # Floating point contraction must be suppressed due to accuracy issues + list(APPEND CXXFLAGS -ffp-contract=off -DFMA_DISABLED=1) + list(APPEND CFLAGS -ffp-contract=off -DFMA_DISABLED=1) +endif() + llvm_test_verify_hash_program_output(boxBlurOutput.txt) llvm_test_verify(WORKDIR ${CMAKE_CURRENT_BINARY_DIR} ${FPCMP} boxBlur.reference_output boxBlurOutput.txt diff --git a/MultiSource/Applications/oggenc/CMakeLists.txt b/MultiSource/Applications/oggenc/CMakeLists.txt --- a/MultiSource/Applications/oggenc/CMakeLists.txt +++ b/MultiSource/Applications/oggenc/CMakeLists.txt @@ -1,4 +1,10 @@ list(APPEND CFLAGS -fno-strict-aliasing) +if(ARCH STREQUAL "x86") + # Floating point contraction must be suppressed due to accuracy issues + list(APPEND CXXFLAGS -ffp-contract=off -DFMA_DISABLED=1) + list(APPEND CFLAGS -ffp-contract=off -DFMA_DISABLED=1) +endif() + list(APPEND LDFLAGS -lm) set(RUN_OPTIONS -Q -s 901820 - < tune) llvm_multisource(oggenc) diff --git a/MultiSource/Benchmarks/DOE-ProxyApps-C++/CLAMR/CMakeLists.txt b/MultiSource/Benchmarks/DOE-ProxyApps-C++/CLAMR/CMakeLists.txt --- a/MultiSource/Benchmarks/DOE-ProxyApps-C++/CLAMR/CMakeLists.txt +++ b/MultiSource/Benchmarks/DOE-ProxyApps-C++/CLAMR/CMakeLists.txt @@ -1,2 +1,8 @@ set(RUN_OPTIONS -n 64 -t 1000) +if(ARCH STREQUAL "x86") + # Floating point contraction must be suppressed due to accuracy issues + list(APPEND CXXFLAGS -ffp-contract=off -DFMA_DISABLED=1) + list(APPEND CFLAGS -ffp-contract=off -DFMA_DISABLED=1) +endif() + llvm_multisource(CLAMR) diff --git a/MultiSource/Benchmarks/DOE-ProxyApps-C++/HPCCG/CMakeLists.txt b/MultiSource/Benchmarks/DOE-ProxyApps-C++/HPCCG/CMakeLists.txt --- a/MultiSource/Benchmarks/DOE-ProxyApps-C++/HPCCG/CMakeLists.txt +++ b/MultiSource/Benchmarks/DOE-ProxyApps-C++/HPCCG/CMakeLists.txt @@ -1,4 +1,10 @@ list(APPEND CXXFLAGS -DREDSTORM) # -DREDSTORM for mkdir +if(ARCH STREQUAL "x86") + # Floating point contraction must be suppressed due to accuracy issues + list(APPEND CXXFLAGS -ffp-contract=off -DFMA_DISABLED=1) + list(APPEND CFLAGS -ffp-contract=off -DFMA_DISABLED=1) +endif() + list(APPEND LDFLAGS -lm) set(RUN_OPTIONS 50 50 50) llvm_multisource(HPCCG) diff --git a/MultiSource/Benchmarks/DOE-ProxyApps-C++/miniFE/CMakeLists.txt b/MultiSource/Benchmarks/DOE-ProxyApps-C++/miniFE/CMakeLists.txt --- a/MultiSource/Benchmarks/DOE-ProxyApps-C++/miniFE/CMakeLists.txt +++ b/MultiSource/Benchmarks/DOE-ProxyApps-C++/miniFE/CMakeLists.txt @@ -6,6 +6,12 @@ if(CMAKE_SYSTEM_NAME STREQUAL "AIX") list(APPEND CXXFLAGS -D_XOPEN_SOURCE=700 -DUseTimes) endif() +if(ARCH STREQUAL "x86") + # Floating point contraction must be suppressed due to accuracy issues + list(APPEND CXXFLAGS -ffp-contract=off -DFMA_DISABLED=1) + list(APPEND CFLAGS -ffp-contract=off -DFMA_DISABLED=1) +endif() + list(APPEND LDFLAGS -lm) set(RUN_OPTIONS -nx 64 -ny 64 -nz 64) llvm_multisource(miniFE) diff --git a/MultiSource/Benchmarks/Rodinia/srad/CMakeLists.txt b/MultiSource/Benchmarks/Rodinia/srad/CMakeLists.txt --- a/MultiSource/Benchmarks/Rodinia/srad/CMakeLists.txt +++ b/MultiSource/Benchmarks/Rodinia/srad/CMakeLists.txt @@ -1,6 +1,12 @@ list(APPEND LDFLAGS -lm) set(FP_ABSTOLERANCE 0.00001) list(APPEND CFLAGS -I${CMAKE_CURRENT_SOURCE_DIR}/../Common) +if(ARCH STREQUAL "x86") + # Floating point contraction must be suppressed due to accuracy issues + list(APPEND CXXFLAGS -ffp-contract=off -DFMA_DISABLED=1) + list(APPEND CFLAGS -ffp-contract=off -DFMA_DISABLED=1) +endif() + llvm_multisource(srad main.c sradKernel.c diff --git a/SingleSource/Benchmarks/Linpack/CMakeLists.txt b/SingleSource/Benchmarks/Linpack/CMakeLists.txt --- a/SingleSource/Benchmarks/Linpack/CMakeLists.txt +++ b/SingleSource/Benchmarks/Linpack/CMakeLists.txt @@ -1,3 +1,9 @@ list(APPEND LDFLAGS -lm) set(FP_TOLERANCE 0.0001) +if(ARCH STREQUAL "x86") + # Floating point contraction must be suppressed due to accuracy issues + list(APPEND CXXFLAGS -ffp-contract=off -DFMA_DISABLED=1) + list(APPEND CFLAGS -ffp-contract=off -DFMA_DISABLED=1) +endif() + llvm_singlesource() diff --git a/SingleSource/Benchmarks/Misc-C++/Large/CMakeLists.txt b/SingleSource/Benchmarks/Misc-C++/Large/CMakeLists.txt --- a/SingleSource/Benchmarks/Misc-C++/Large/CMakeLists.txt +++ b/SingleSource/Benchmarks/Misc-C++/Large/CMakeLists.txt @@ -1,4 +1,10 @@ list(APPEND LDFLAGS -lm) set(FP_ABSTOLERANCE 0.01) set(HASH_PROGRAM_OUTPUT 1) +if(ARCH STREQUAL "x86") + # Floating point contraction must be suppressed due to accuracy issues + list(APPEND CXXFLAGS -ffp-contract=off -DFMA_DISABLED=1) + list(APPEND CFLAGS -ffp-contract=off -DFMA_DISABLED=1) +endif() + llvm_singlesource() diff --git a/SingleSource/Benchmarks/Polybench/datamining/correlation/CMakeLists.txt b/SingleSource/Benchmarks/Polybench/datamining/correlation/CMakeLists.txt --- a/SingleSource/Benchmarks/Polybench/datamining/correlation/CMakeLists.txt +++ b/SingleSource/Benchmarks/Polybench/datamining/correlation/CMakeLists.txt @@ -3,6 +3,12 @@ if(SMALL_PROBLEM_SIZE) list(APPEND CFLAGS -DSMALL_DATASET) endif() +if(ARCH STREQUAL "x86") + # Floating point contraction must be suppressed due to accuracy issues + list(APPEND CXXFLAGS -ffp-contract=off -DFMA_DISABLED=1) + list(APPEND CFLAGS -ffp-contract=off -DFMA_DISABLED=1) +endif() + set(HASH_PROGRAM_OUTPUT 1) add_definitions(-DFP_ABSTOLERANCE=1e-5) llvm_singlesource() diff --git a/SingleSource/Benchmarks/Polybench/datamining/correlation/correlation.c b/SingleSource/Benchmarks/Polybench/datamining/correlation/correlation.c --- a/SingleSource/Benchmarks/Polybench/datamining/correlation/correlation.c +++ b/SingleSource/Benchmarks/Polybench/datamining/correlation/correlation.c @@ -121,6 +121,10 @@ } +#if !FMA_DISABLED +// NOTE: FMA_DISABLED is true for targets where FMA contraction causes +// discrepancies which cause the accuracy checks to fail. +// In this case, the test runs with the option -ffp-contract=off static void kernel_correlation_StrictFP(int m, int n, DATA_TYPE float_n, @@ -181,6 +185,7 @@ } symmat[_PB_M-1][_PB_M-1] = 1.0; } +#endif /* Return 0 when one of the elements of arrays A and B do not match within the allowed FP_ABSTOLERANCE. Return 1 when all elements match. */ @@ -217,7 +222,9 @@ DATA_TYPE float_n; POLYBENCH_2D_ARRAY_DECL(data,DATA_TYPE,M,N,m,n); POLYBENCH_2D_ARRAY_DECL(symmat,DATA_TYPE,M,M,m,m); +#if !FMA_DISABLED POLYBENCH_2D_ARRAY_DECL(symmat_StrictFP,DATA_TYPE,M,M,m,m); +#endif POLYBENCH_1D_ARRAY_DECL(mean,DATA_TYPE,M,m); POLYBENCH_1D_ARRAY_DECL(stddev,DATA_TYPE,M,m); @@ -238,6 +245,7 @@ polybench_stop_instruments; polybench_print_instruments; +#if !FMA_DISABLED init_array (m, n, &float_n, POLYBENCH_ARRAY(data)); kernel_correlation (m, n, float_n, POLYBENCH_ARRAY(data), @@ -250,11 +258,14 @@ /* Prevent dead-code elimination. All live-out data must be printed by the function call in argument. */ polybench_prevent_dce(print_array(m, POLYBENCH_ARRAY(symmat_StrictFP))); +#endif /* Be clean. */ POLYBENCH_FREE_ARRAY(data); POLYBENCH_FREE_ARRAY(symmat); +#if !FMA_DISABLED POLYBENCH_FREE_ARRAY(symmat_StrictFP); +#endif POLYBENCH_FREE_ARRAY(mean); POLYBENCH_FREE_ARRAY(stddev); diff --git a/SingleSource/Benchmarks/Polybench/datamining/covariance/CMakeLists.txt b/SingleSource/Benchmarks/Polybench/datamining/covariance/CMakeLists.txt --- a/SingleSource/Benchmarks/Polybench/datamining/covariance/CMakeLists.txt +++ b/SingleSource/Benchmarks/Polybench/datamining/covariance/CMakeLists.txt @@ -3,6 +3,12 @@ if(SMALL_PROBLEM_SIZE) list(APPEND CFLAGS -DSMALL_DATASET) endif() +if(ARCH STREQUAL "x86") + # Floating point contraction must be suppressed due to accuracy issues + list(APPEND CXXFLAGS -ffp-contract=off -DFMA_DISABLED=1) + list(APPEND CFLAGS -ffp-contract=off -DFMA_DISABLED=1) +endif() + set(HASH_PROGRAM_OUTPUT 1) add_definitions(-DFP_ABSTOLERANCE=1e-5) llvm_singlesource() diff --git a/SingleSource/Benchmarks/Polybench/datamining/covariance/covariance.c b/SingleSource/Benchmarks/Polybench/datamining/covariance/covariance.c --- a/SingleSource/Benchmarks/Polybench/datamining/covariance/covariance.c +++ b/SingleSource/Benchmarks/Polybench/datamining/covariance/covariance.c @@ -93,6 +93,10 @@ } +#if !FMA_DISABLED +// NOTE: FMA_DISABLED is true for targets where FMA contraction causes +// discrepancies which cause the accuracy checks to fail. +// In this case, the test runs with the option -ffp-contract=off static void kernel_covariance_StrictFP(int m, int n, DATA_TYPE float_n, @@ -127,6 +131,7 @@ symmat[j2][j1] = symmat[j1][j2]; } } +#endif /* Return 0 when one of the elements of arrays A and B do not match within the allowed FP_ABSTOLERANCE. Return 1 when all elements match. */ @@ -163,7 +168,9 @@ DATA_TYPE float_n; POLYBENCH_2D_ARRAY_DECL(data,DATA_TYPE,M,N,m,n); POLYBENCH_2D_ARRAY_DECL(symmat,DATA_TYPE,M,M,m,m); +#if !FMA_DISABLED POLYBENCH_2D_ARRAY_DECL(symmat_StrictFP,DATA_TYPE,M,M,m,m); +#endif POLYBENCH_1D_ARRAY_DECL(mean,DATA_TYPE,M,m); @@ -183,6 +190,7 @@ polybench_stop_instruments; polybench_print_instruments; +#if !FMA_DISABLED init_array (m, n, &float_n, POLYBENCH_ARRAY(data)); kernel_covariance (m, n, float_n, POLYBENCH_ARRAY(data), @@ -194,11 +202,14 @@ /* Prevent dead-code elimination. All live-out data must be printed by the function call in argument. */ polybench_prevent_dce(print_array(m, POLYBENCH_ARRAY(symmat_StrictFP))); +#endif /* Be clean. */ POLYBENCH_FREE_ARRAY(data); POLYBENCH_FREE_ARRAY(symmat); +#if !FMA_DISABLED POLYBENCH_FREE_ARRAY(symmat_StrictFP); +#endif POLYBENCH_FREE_ARRAY(mean); return 0; diff --git a/SingleSource/Benchmarks/Polybench/linear-algebra/kernels/2mm/2mm.c b/SingleSource/Benchmarks/Polybench/linear-algebra/kernels/2mm/2mm.c --- a/SingleSource/Benchmarks/Polybench/linear-algebra/kernels/2mm/2mm.c +++ b/SingleSource/Benchmarks/Polybench/linear-algebra/kernels/2mm/2mm.c @@ -26,8 +26,11 @@ DATA_TYPE POLYBENCH_2D(A,NI,NK,ni,nl), DATA_TYPE POLYBENCH_2D(B,NK,NJ,nk,nj), DATA_TYPE POLYBENCH_2D(C,NL,NJ,nl,nj), - DATA_TYPE POLYBENCH_2D(D,NI,NL,ni,nl), - DATA_TYPE POLYBENCH_2D(D_StrictFP,NI,NL,ni,nl)) + DATA_TYPE POLYBENCH_2D(D,NI,NL,ni,nl) +#if !FMA_DISABLED + , DATA_TYPE POLYBENCH_2D(D_StrictFP,NI,NL,ni,nl) +#endif + ) { #pragma STDC FP_CONTRACT OFF int i, j; @@ -43,9 +46,11 @@ for (i = 0; i < nl; i++) for (j = 0; j < nj; j++) C[i][j] = ((DATA_TYPE) i*(j+3)) / nl; +#if !FMA_DISABLED for (i = 0; i < ni; i++) for (j = 0; j < nl; j++) D_StrictFP[i][j] = D[i][j] = ((DATA_TYPE) i*(j+2)) / nk; +#endif } @@ -101,6 +106,10 @@ } +#if !FMA_DISABLED +// NOTE: FMA_DISABLED is true for targets where FMA contraction causes +// discrepancies which cause the accuracy checks to fail. +// In this case, the test runs with the option -ffp-contract=off static void kernel_2mm_StrictFP(int ni, int nj, int nk, int nl, DATA_TYPE alpha, @@ -130,6 +139,7 @@ D[i][j] += tmp[i][k] * C[k][j]; } } +#endif /* Return 0 when one of the elements of arrays A and B do not match within the allowed FP_ABSTOLERANCE. Return 1 when all elements match. */ @@ -172,7 +182,9 @@ POLYBENCH_2D_ARRAY_DECL(B,DATA_TYPE,NK,NJ,nk,nj); POLYBENCH_2D_ARRAY_DECL(C,DATA_TYPE,NL,NJ,nl,nj); POLYBENCH_2D_ARRAY_DECL(D,DATA_TYPE,NI,NL,ni,nl); +#if !FMA_DISABLED POLYBENCH_2D_ARRAY_DECL(D_StrictFP,DATA_TYPE,NI,NL,ni,nl); +#endif /* Initialize array(s). */ init_array (ni, nj, nk, nl, &alpha, &beta, @@ -198,6 +210,7 @@ polybench_stop_instruments; polybench_print_instruments; +#if !FMA_DISABLED kernel_2mm_StrictFP(ni, nj, nk, nl, alpha, beta, POLYBENCH_ARRAY(tmp), @@ -212,6 +225,7 @@ /* Prevent dead-code elimination. All live-out data must be printed by the function call in argument. */ polybench_prevent_dce(print_array(ni, nl, POLYBENCH_ARRAY(D_StrictFP))); +#endif /* Be clean. */ POLYBENCH_FREE_ARRAY(tmp); @@ -219,7 +233,9 @@ POLYBENCH_FREE_ARRAY(B); POLYBENCH_FREE_ARRAY(C); POLYBENCH_FREE_ARRAY(D); +#if !FMA_DISABLED POLYBENCH_FREE_ARRAY(D_StrictFP); +#endif return 0; } diff --git a/SingleSource/Benchmarks/Polybench/linear-algebra/kernels/atax/CMakeLists.txt b/SingleSource/Benchmarks/Polybench/linear-algebra/kernels/atax/CMakeLists.txt --- a/SingleSource/Benchmarks/Polybench/linear-algebra/kernels/atax/CMakeLists.txt +++ b/SingleSource/Benchmarks/Polybench/linear-algebra/kernels/atax/CMakeLists.txt @@ -2,4 +2,10 @@ list(APPEND CFLAGS -I ${CMAKE_SOURCE_DIR}/${POLYBENCH_UTILS} -DPOLYBENCH_DUMP_ARRAYS) set(HASH_PROGRAM_OUTPUT 1) add_definitions(-DFP_ABSTOLERANCE=1e-5) +if(ARCH STREQUAL "x86") + # Floating point contraction must be suppressed due to accuracy issues + list(APPEND CXXFLAGS -ffp-contract=off -DFMA_DISABLED=1) + list(APPEND CFLAGS -ffp-contract=off -DFMA_DISABLED=1) +endif() + llvm_singlesource() diff --git a/SingleSource/Benchmarks/Polybench/linear-algebra/kernels/bicg/CMakeLists.txt b/SingleSource/Benchmarks/Polybench/linear-algebra/kernels/bicg/CMakeLists.txt --- a/SingleSource/Benchmarks/Polybench/linear-algebra/kernels/bicg/CMakeLists.txt +++ b/SingleSource/Benchmarks/Polybench/linear-algebra/kernels/bicg/CMakeLists.txt @@ -2,4 +2,10 @@ list(APPEND CFLAGS -I ${CMAKE_SOURCE_DIR}/${POLYBENCH_UTILS} -DPOLYBENCH_DUMP_ARRAYS) set(HASH_PROGRAM_OUTPUT 1) add_definitions(-DFP_ABSTOLERANCE=1e-5) +if(ARCH STREQUAL "x86") + # Floating point contraction must be suppressed due to accuracy issues + list(APPEND CXXFLAGS -ffp-contract=off -DFMA_DISABLED=1) + list(APPEND CFLAGS -ffp-contract=off -DFMA_DISABLED=1) +endif() + llvm_singlesource() diff --git a/SingleSource/Benchmarks/Polybench/linear-algebra/kernels/gemver/CMakeLists.txt b/SingleSource/Benchmarks/Polybench/linear-algebra/kernels/gemver/CMakeLists.txt --- a/SingleSource/Benchmarks/Polybench/linear-algebra/kernels/gemver/CMakeLists.txt +++ b/SingleSource/Benchmarks/Polybench/linear-algebra/kernels/gemver/CMakeLists.txt @@ -2,4 +2,10 @@ list(APPEND CFLAGS -I ${CMAKE_SOURCE_DIR}/${POLYBENCH_UTILS} -DPOLYBENCH_DUMP_ARRAYS) set(HASH_PROGRAM_OUTPUT 1) add_definitions(-DFP_ABSTOLERANCE=1e-5) +if(ARCH STREQUAL "x86") + # Floating point contraction must be suppressed due to accuracy issues + list(APPEND CXXFLAGS -ffp-contract=off -DFMA_DISABLED=1) + list(APPEND CFLAGS -ffp-contract=off -DFMA_DISABLED=1) +endif() + llvm_singlesource() diff --git a/SingleSource/Benchmarks/Polybench/linear-algebra/kernels/gesummv/CMakeLists.txt b/SingleSource/Benchmarks/Polybench/linear-algebra/kernels/gesummv/CMakeLists.txt --- a/SingleSource/Benchmarks/Polybench/linear-algebra/kernels/gesummv/CMakeLists.txt +++ b/SingleSource/Benchmarks/Polybench/linear-algebra/kernels/gesummv/CMakeLists.txt @@ -3,6 +3,12 @@ if(SMALL_PROBLEM_SIZE) list(APPEND CFLAGS -DSMALL_DATASET) endif() +if(ARCH STREQUAL "x86") + # Floating point contraction must be suppressed due to accuracy issues + list(APPEND CXXFLAGS -ffp-contract=off -DFMA_DISABLED=1) + list(APPEND CFLAGS -ffp-contract=off -DFMA_DISABLED=1) +endif() + set(HASH_PROGRAM_OUTPUT 1) add_definitions(-DFP_ABSTOLERANCE=1e-5) llvm_singlesource() diff --git a/SingleSource/Benchmarks/Polybench/linear-algebra/kernels/symm/CMakeLists.txt b/SingleSource/Benchmarks/Polybench/linear-algebra/kernels/symm/CMakeLists.txt --- a/SingleSource/Benchmarks/Polybench/linear-algebra/kernels/symm/CMakeLists.txt +++ b/SingleSource/Benchmarks/Polybench/linear-algebra/kernels/symm/CMakeLists.txt @@ -3,6 +3,12 @@ if(SMALL_PROBLEM_SIZE) list(APPEND CFLAGS -DSMALL_DATASET) endif() +if(ARCH STREQUAL "x86") + # Floating point contraction must be suppressed due to accuracy issues + list(APPEND CXXFLAGS -ffp-contract=off -DFMA_DISABLED=1) + list(APPEND CFLAGS -ffp-contract=off -DFMA_DISABLED=1) +endif() + set(HASH_PROGRAM_OUTPUT 1) add_definitions(-DFP_ABSTOLERANCE=1e-5) llvm_singlesource() diff --git a/SingleSource/Benchmarks/Polybench/linear-algebra/kernels/trisolv/CMakeLists.txt b/SingleSource/Benchmarks/Polybench/linear-algebra/kernels/trisolv/CMakeLists.txt --- a/SingleSource/Benchmarks/Polybench/linear-algebra/kernels/trisolv/CMakeLists.txt +++ b/SingleSource/Benchmarks/Polybench/linear-algebra/kernels/trisolv/CMakeLists.txt @@ -1,5 +1,11 @@ set(POLYBENCH_UTILS SingleSource/Benchmarks/Polybench/utilities ) list(APPEND CFLAGS -I ${CMAKE_SOURCE_DIR}/${POLYBENCH_UTILS} -DPOLYBENCH_DUMP_ARRAYS) set(HASH_PROGRAM_OUTPUT 1) +if(ARCH STREQUAL "x86") + # Floating point contraction must be suppressed due to accuracy issues + list(APPEND CXXFLAGS -ffp-contract=off -DFMA_DISABLED=1) + list(APPEND CFLAGS -ffp-contract=off -DFMA_DISABLED=1) +endif() + add_definitions(-DFP_ABSTOLERANCE=1e-5) llvm_singlesource() diff --git a/SingleSource/Benchmarks/Polybench/linear-algebra/kernels/trmm/CMakeLists.txt b/SingleSource/Benchmarks/Polybench/linear-algebra/kernels/trmm/CMakeLists.txt --- a/SingleSource/Benchmarks/Polybench/linear-algebra/kernels/trmm/CMakeLists.txt +++ b/SingleSource/Benchmarks/Polybench/linear-algebra/kernels/trmm/CMakeLists.txt @@ -3,6 +3,12 @@ if(SMALL_PROBLEM_SIZE) list(APPEND CFLAGS -DSMALL_DATASET) endif() +if(ARCH STREQUAL "x86") + # Floating point contraction must be suppressed due to accuracy issues + list(APPEND CXXFLAGS -ffp-contract=off -DFMA_DISABLED=1) + list(APPEND CFLAGS -ffp-contract=off -DFMA_DISABLED=1) +endif() + set(HASH_PROGRAM_OUTPUT 1) add_definitions(-DFP_ABSTOLERANCE=1e-5) llvm_singlesource() diff --git a/SingleSource/Benchmarks/Polybench/linear-algebra/solvers/gramschmidt/CMakeLists.txt b/SingleSource/Benchmarks/Polybench/linear-algebra/solvers/gramschmidt/CMakeLists.txt --- a/SingleSource/Benchmarks/Polybench/linear-algebra/solvers/gramschmidt/CMakeLists.txt +++ b/SingleSource/Benchmarks/Polybench/linear-algebra/solvers/gramschmidt/CMakeLists.txt @@ -3,6 +3,12 @@ if(SMALL_PROBLEM_SIZE) list(APPEND CFLAGS -DSMALL_DATASET) endif() +if(ARCH STREQUAL "x86") + # Floating point contraction must be suppressed due to accuracy issues + list(APPEND CXXFLAGS -ffp-contract=off -DFMA_DISABLED=1) + list(APPEND CFLAGS -ffp-contract=off -DFMA_DISABLED=1) +endif() + set(HASH_PROGRAM_OUTPUT 1) add_definitions(-DFP_ABSTOLERANCE=1e-5) llvm_singlesource() diff --git a/SingleSource/Benchmarks/Polybench/stencils/adi/CMakeLists.txt b/SingleSource/Benchmarks/Polybench/stencils/adi/CMakeLists.txt --- a/SingleSource/Benchmarks/Polybench/stencils/adi/CMakeLists.txt +++ b/SingleSource/Benchmarks/Polybench/stencils/adi/CMakeLists.txt @@ -3,6 +3,12 @@ if(SMALL_PROBLEM_SIZE) list(APPEND CFLAGS -DSMALL_DATASET) endif() +if(ARCH STREQUAL "x86") + # Floating point contraction must be suppressed due to accuracy issues + list(APPEND CXXFLAGS -ffp-contract=off -DFMA_DISABLED=1) + list(APPEND CFLAGS -ffp-contract=off -DFMA_DISABLED=1) +endif() + set(HASH_PROGRAM_OUTPUT 1) add_definitions(-DFP_ABSTOLERANCE=1e-5) llvm_singlesource()