From 40373c87342b1574d9c33999552ba33fd36d149b Mon Sep 17 00:00:00 2001 From: sergesanspaille Date: Tue, 13 Oct 2020 19:03:42 +0000 Subject: [PATCH 1/2] llvm 11.0.0 - final release --- .gitignore | 1 + ...r-generation-and-floating-point-comp.patch | 147 ------------------ llvm-test-suite.spec | 8 +- sources | 2 +- 4 files changed, 7 insertions(+), 151 deletions(-) delete mode 100644 0001-Fix-random-number-generation-and-floating-point-comp.patch diff --git a/.gitignore b/.gitignore index 4ca0feb..8c96347 100644 --- a/.gitignore +++ b/.gitignore @@ -16,3 +16,4 @@ /test-suite-10.0.0rc6.src.fedora.tar.xz /test-suite-10.0.0.src.fedora.tar.xz /test-suite-11.0.0rc1.src.fedora.tar.xz +/test-suite-11.0.0.src.fedora.tar.xz diff --git a/0001-Fix-random-number-generation-and-floating-point-comp.patch b/0001-Fix-random-number-generation-and-floating-point-comp.patch deleted file mode 100644 index 51bba53..0000000 --- a/0001-Fix-random-number-generation-and-floating-point-comp.patch +++ /dev/null @@ -1,147 +0,0 @@ -From fdab65939511f946f457471100df4aac9257f677 Mon Sep 17 00:00:00 2001 -From: Jinsong Ji -Date: Thu, 16 Jul 2020 16:02:33 +0000 -Subject: [PATCH] Fix random number generation and floating point comparison in - matrix-types-spec.cpp - -The testsuite is failing on PowerPC buildbots due to https://reviews.llvm.org/D72770. -Looks like we are using wrong type generator for double. - -We are also using EXPECT_MATRIX_EQ to do binary comparision of -floating point values before and afer multiplication. And there might be -small differences but within tolerance allowance. - -Reviewed By: fhahn - -Differential Revision: https://reviews.llvm.org/D83910 - -(cherry picked from commit 4bdbe4ad9dd25b432d405d8a6ac6b7410da9b7a2) ---- - SingleSource/UnitTests/matrix-types-spec.cpp | 87 ++++++++++++++++---- - 1 file changed, 69 insertions(+), 18 deletions(-) - -diff --git a/SingleSource/UnitTests/matrix-types-spec.cpp b/SingleSource/UnitTests/matrix-types-spec.cpp -index 0bd5f9e3..549930df 100644 ---- a/SingleSource/UnitTests/matrix-types-spec.cpp -+++ b/SingleSource/UnitTests/matrix-types-spec.cpp -@@ -8,15 +8,54 @@ - #include - #include - --#define EXPECT_MATRIX_EQ(A, B, R, C) \ -- do { \ -- for (unsigned r = 0; r < R; r++) \ -- for (unsigned c = 0; c < C; c++) \ -- if (A[r + c * R] != B[r + c * R]) { \ -- std::cerr << "mismatch at " << r << ":" << c << "\n"; \ -- exit(1); \ -- } \ -- } while (false) -+#define ABSTOL 0.000001 -+#define RELTOL 0.00001 -+bool fpcmp(double V1, double V2, double AbsTolerance, double RelTolerance) { -+ // Check to see if these are inside the absolute tolerance -+ if (AbsTolerance < fabs(V1 - V2)) { -+ // Nope, check the relative tolerance... -+ double Diff; -+ if (V2) -+ Diff = fabs(V1 / V2 - 1.0); -+ else if (V1) -+ Diff = fabs(V2 / V1 - 1.0); -+ else -+ Diff = 0; // Both zero. -+ if (Diff > RelTolerance) { -+ return true; -+ } -+ } -+ return false; -+} -+ -+template ::value, int> = 0> -+void expectMatrixEQ(ElementTy *A, ElementTy *B, unsigned R, unsigned C) { -+ do { -+ for (unsigned r = 0; r < R; r++) -+ for (unsigned c = 0; c < C; c++) -+ if (A[r + c * R] != B[r + c * R]) { -+ std::cerr << "mismatch at " << r << ":" << c << "\n"; -+ exit(1); -+ } -+ } while (false); -+} -+ -+template ::value, -+ int> = 0> -+void expectMatrixEQ(ElementTy *A, ElementTy *B, unsigned R, -+ unsigned C) { -+ do { -+ for (unsigned r = 0; r < R; r++) -+ for (unsigned c = 0; c < C; c++) -+ if (fpcmp(A[r + c * R], B[r + c * R], ABSTOL, RELTOL)) { -+ std::cerr << "mismatch at " << r << ":" << c << "\n"; -+ exit(1); -+ } -+ } while (false); -+} -+ - - template - void zeroMatrix(EltTy *M, unsigned Rows, unsigned Cols) { -@@ -33,13 +72,25 @@ template void print(EltTy *X, unsigned Rows, unsigned Cols) { - } - } - --template void initRandom(Ty *A, unsigned Rows, unsigned Cols) { -+template ::value, -+ int> = 0> -+void initRandom(ElementTy *A, unsigned Rows, unsigned Cols) { -+ std::default_random_engine generator; -+ std::uniform_real_distribution distribution(-10.0, 10.0); -+ -+ for (unsigned i = 0; i < Rows * Cols; i++) -+ A[i] = distribution(generator); -+} -+ -+template ::value, int> = 0> -+void initRandom(ElementTy *A, unsigned Rows, unsigned Cols) { - std::default_random_engine generator; -- std::uniform_int_distribution distribution(-10.0, 10.0); -- auto random_double = std::bind(distribution, generator); -+ std::uniform_int_distribution distribution(-10, 10); - - for (unsigned i = 0; i < Rows * Cols; i++) -- A[i] = random_double(); -+ A[i] = distribution(generator); - } - - template -@@ -82,8 +133,8 @@ template void testTranspose() { - transposeSpec(ResSpec, X); - transposeBuiltin(ResBuiltin, X); - -- EXPECT_MATRIX_EQ(ResBase, ResBuiltin, R0, C0); -- EXPECT_MATRIX_EQ(ResBase, ResSpec, C0, R0); -+ expectMatrixEQ(ResBase, ResBuiltin, R0, C0); -+ expectMatrixEQ(ResBase, ResSpec, C0, R0); - } - - template -@@ -150,9 +201,9 @@ void testMultiply() { - multiplySpec(ResSpec, X, Y); - multiplyBuiltin(ResBuiltin, X, Y); - -- EXPECT_MATRIX_EQ(ResSpec, ResBuiltin, R0, C1); -- EXPECT_MATRIX_EQ(ResBase, ResBuiltin, R0, C1); -- EXPECT_MATRIX_EQ(ResBase, ResSpec, R0, C1); -+ expectMatrixEQ(ResSpec, ResBuiltin, R0, C1); -+ expectMatrixEQ(ResBase, ResBuiltin, R0, C1); -+ expectMatrixEQ(ResBase, ResSpec, R0, C1); - } - - int main(void) { --- -2.18.1 - diff --git a/llvm-test-suite.spec b/llvm-test-suite.spec index 55cc7b2..079c17a 100644 --- a/llvm-test-suite.spec +++ b/llvm-test-suite.spec @@ -1,7 +1,7 @@ %global _binaries_in_noarch_packages_terminate_build %{nil} -%global rc_ver 1 -%global baserelease 0.2 +#%%global rc_ver 1 +%global baserelease 0.3 %global test_suite_srcdir test-suite-%{version}%{?rc_ver:rc%{rc_ver}}.src.fedora Name: llvm-test-suite @@ -24,7 +24,6 @@ BuildArch: noarch Patch0: 0001-Fix-extra-Python3-print-statements.patch Patch1: 0001-CLAMR-Fix-build-with-newer-glibc.patch -Patch2: 0001-Fix-random-number-generation-and-floating-point-comp.patch # We need python3-devel for pathfix.py. BuildRequires: python3-devel @@ -76,6 +75,9 @@ cp -R %{_builddir}/%{test_suite_srcdir}/* %{buildroot}%{_datadir}/llvm-test-suit %changelog +* Tue Oct 13 2020 sguelton@redhat.com - 11.0.0-0.3 +- llvm 11.0.0 - final release + * Wed Aug 19 2020 Tom Stellard - 11.0.0-0.2.rc1 - Fix build failure with clang 11 diff --git a/sources b/sources index 7d86f48..24a7fbe 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -SHA512 (test-suite-11.0.0rc1.src.fedora.tar.xz) = 140460237e670dd8f1776ce1d278f40c5241b5fdaec0d753df8edd31d1f20b583baf43ec1bfbbcb8311620d1c8247ec07ad13dc338fab8b193771ae060ed1bc3 +SHA512 (test-suite-11.0.0.src.fedora.tar.xz) = fb53afd9b1fcae97f66611ec82ee9f6033494cf4965165d7a3b403f5301c62b8d32f7c289efc35526505bbfa209d1aafa1c59381766f5cf717e194cdaa452d81 From fdc2e2ffd56de142db7d26334b6e4835c7bc2bef Mon Sep 17 00:00:00 2001 From: sergesanspaille Date: Thu, 15 Oct 2020 06:01:10 +0000 Subject: [PATCH 2/2] Fix NVR --- llvm-test-suite.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/llvm-test-suite.spec b/llvm-test-suite.spec index 079c17a..ba0e3e1 100644 --- a/llvm-test-suite.spec +++ b/llvm-test-suite.spec @@ -1,7 +1,7 @@ %global _binaries_in_noarch_packages_terminate_build %{nil} #%%global rc_ver 1 -%global baserelease 0.3 +%global baserelease 1 %global test_suite_srcdir test-suite-%{version}%{?rc_ver:rc%{rc_ver}}.src.fedora Name: llvm-test-suite @@ -75,6 +75,9 @@ cp -R %{_builddir}/%{test_suite_srcdir}/* %{buildroot}%{_datadir}/llvm-test-suit %changelog +* Thu Oct 15 2020 sguelton@redhat.com - 11.0.0-1 +- Fix NVR + * Tue Oct 13 2020 sguelton@redhat.com - 11.0.0-0.3 - llvm 11.0.0 - final release