diff --git a/0001-Update-casts-for-NEON.patch b/0001-Update-casts-for-NEON.patch index d9f2cc5..d833473 100644 --- a/0001-Update-casts-for-NEON.patch +++ b/0001-Update-casts-for-NEON.patch @@ -1,4 +1,4 @@ -From 4346f6cdb02192edad480c323e7ab34d0f00a6e5 Mon Sep 17 00:00:00 2001 +From 1f178940dc55dc50bcc6ddf1a1b1b50d0e385c0b Mon Sep 17 00:00:00 2001 From: Elliott Sales de Andrade Date: Fri, 20 Jul 2018 16:46:43 -0400 Subject: [PATCH 1/5] Update casts for NEON. @@ -92,5 +92,5 @@ index d7f5b42..ba5c83e 100644 SIMDi xc = SIMDi_SUB(SIMDi_CONVERT_TO_INT(x), SIMDi_NUM(1));\ SIMDi ycBase = SIMDi_SUB(SIMDi_CONVERT_TO_INT(y), SIMDi_NUM(1));\ -- -2.20.1 +2.29.2 diff --git a/0002-Use-fallback-for-PPC64-and-S390x.patch b/0002-Use-fallback-for-PPC64-and-S390x.patch index d7bc795..21568d8 100644 --- a/0002-Use-fallback-for-PPC64-and-S390x.patch +++ b/0002-Use-fallback-for-PPC64-and-S390x.patch @@ -1,4 +1,4 @@ -From cde6cd59345e6a950d10f77a911895840e680488 Mon Sep 17 00:00:00 2001 +From 07d1911206aabc493fa32267446d699bc72deca8 Mon Sep 17 00:00:00 2001 From: Elliott Sales de Andrade Date: Fri, 20 Jul 2018 05:50:13 -0400 Subject: [PATCH 2/5] Use fallback for PPC64 and S390x. @@ -64,5 +64,5 @@ index 9554384..6fff8bf 100644 #endif -- -2.20.1 +2.29.2 diff --git a/0003-Add-platform-specific-flags-for-NEON.patch b/0003-Add-platform-specific-flags-for-NEON.patch index bd227cf..9ba6776 100644 --- a/0003-Add-platform-specific-flags-for-NEON.patch +++ b/0003-Add-platform-specific-flags-for-NEON.patch @@ -1,4 +1,4 @@ -From 329df8d668477934f9fd5d1b587a8f7ac66414d1 Mon Sep 17 00:00:00 2001 +From cbf9fddeb533534de4e17cb0a67f6c45d5598dd7 Mon Sep 17 00:00:00 2001 From: Elliott Sales de Andrade Date: Fri, 20 Jul 2018 21:14:19 -0400 Subject: [PATCH 3/5] Add platform-specific flags for NEON. @@ -9,7 +9,7 @@ Signed-off-by: Elliott Sales de Andrade 1 file changed, 26 insertions(+), 1 deletion(-) diff --git a/setup.py b/setup.py -index 552fdfb..9c7bd4e 100644 +index 5c54cc0..bd14ca4 100644 --- a/setup.py +++ b/setup.py @@ -44,7 +44,6 @@ open('pyfastnoisesimd/version.py', 'w').write('__version__ = "%s"\n' % VERSION) @@ -89,5 +89,5 @@ index 552fdfb..9c7bd4e 100644 for name, lib in self.distribution.libraries: -- -2.20.1 +2.29.2 diff --git a/0004-Use-getauxval-to-check-for-NEON-on-Linux.patch b/0004-Use-getauxval-to-check-for-NEON-on-Linux.patch index 1bfdcf8..d17e370 100644 --- a/0004-Use-getauxval-to-check-for-NEON-on-Linux.patch +++ b/0004-Use-getauxval-to-check-for-NEON-on-Linux.patch @@ -1,4 +1,4 @@ -From 4e731ae8a88e5275033c3561926ac53032e41f05 Mon Sep 17 00:00:00 2001 +From 0c4c170a740b9cd288ee8f43b6ed26a74554aa12 Mon Sep 17 00:00:00 2001 From: Elliott Sales de Andrade Date: Fri, 20 Jul 2018 23:17:13 -0400 Subject: [PATCH 4/5] Use getauxval to check for NEON on Linux. @@ -47,5 +47,5 @@ index 6da16c4..389b3b3 100644 #else -- -2.20.1 +2.29.2 diff --git a/0005-Fix-alignment-on-non-optimized-systems-in-tests.patch b/0005-Fix-alignment-on-non-optimized-systems-in-tests.patch new file mode 100644 index 0000000..5cc8c9f --- /dev/null +++ b/0005-Fix-alignment-on-non-optimized-systems-in-tests.patch @@ -0,0 +1,30 @@ +From 512df2384299b7cc58468f0354d846b794dc8ed0 Mon Sep 17 00:00:00 2001 +From: Elliott Sales de Andrade +Date: Thu, 1 Apr 2021 03:56:11 -0400 +Subject: [PATCH 5/5] Fix alignment on non-optimized systems in tests. + +This is the corollary of 003b2231ba0d9d3922054a3a4cc8a03ffb8148ab for +the new similar line in tests. + +Signed-off-by: Elliott Sales de Andrade +--- + pyfastnoisesimd/test_fns.py | 3 ++- + 1 file changed, 2 insertions(+), 1 deletion(-) + +diff --git a/pyfastnoisesimd/test_fns.py b/pyfastnoisesimd/test_fns.py +index 7553278..5eeb34f 100644 +--- a/pyfastnoisesimd/test_fns.py ++++ b/pyfastnoisesimd/test_fns.py +@@ -16,7 +16,8 @@ log = Logger(__name__) + # X is block size. + # For AVX512, if we want to have 4 workers we should have at least 16 x 4 + # blocks. +-SIMD_LEN= fns.extension.SIMD_ALIGNMENT // np.dtype(np.float32).itemsize ++SIMD_LEN = max( ++ fns.extension.SIMD_ALIGNMENT // np.dtype(np.float32).itemsize, 1) + CHUNK = fns.helpers._MIN_CHUNK_SIZE + CHUNK2 = int(np.ceil(np.sqrt(CHUNK) / SIMD_LEN) * SIMD_LEN) + CHUNK3 = int(np.ceil(np.cbrt(CHUNK) / SIMD_LEN) * SIMD_LEN) +-- +2.29.2 + diff --git a/python-pyfastnoisesimd.spec b/python-pyfastnoisesimd.spec index 223e802..a69baf6 100644 --- a/python-pyfastnoisesimd.spec +++ b/python-pyfastnoisesimd.spec @@ -20,6 +20,8 @@ Patch0002: 0002-Use-fallback-for-PPC64-and-S390x.patch Patch0003: 0003-Add-platform-specific-flags-for-NEON.patch # https://github.com/Auburns/FastNoiseSIMD/pull/32 Patch0004: 0004-Use-getauxval-to-check-for-NEON-on-Linux.patch +# https://github.com/robbmcleod/pyfastnoisesimd/pull/25 +Patch0005: 0005-Fix-alignment-on-non-optimized-systems-in-tests.patch # gcc seems to enable SSE2 even when not requested. ExcludeArch: %{ix86}