Skip to content

Releases: kimwalisch/primesieve

primesieve-12.7

02 Mar 19:21
Compare
Choose a tag to compare

This release adds ARM SVE runtime dispatching, it is enabled by default on Linux for ARM64 CPUs and it has also been implemented for Windows (but support in Microsoft's Windows.h is still missing). The C/C++ API and ABI of this release are fully backwards compatible with primesieve-12.*

  • multiarch_sve_arm.cmake: Improve ARM SVE detection.
  • src/arch/arm/sve.cpp: Detect ARM SVE on Linux and Windows.
  • EratBig.cpp: Simplify bucket handling.
  • Erat.cpp: Tune sieve size using FACTOR_SIEVESIZE.
  • README.md: Add Sponsors section.

Thanks to @AndrewVSutherland and @AlgoWin for being primesieve sponsors in this release cycle!

primesieve-12.6

18 Nov 16:07
Compare
Choose a tag to compare

This is a new maintenance release, it is fully backwards compatible with the previous release.

  • PreSieve.cpp: Added AVX512 and ARM SVE pre-sieving, up to 3% faster.
  • PreSieve.cpp: Increased pre-sieving to primes ≀ 163 (previously primes ≀ 100). Memory usage of pre-sieve lookup tables has been reduced from 210 kilobytes to 123 kilobytes and the pre-sieve lookup tables are now static (not generated at runtime anymore).
  • CpuInfo.cpp: More robust CPU cache size detection.

primesieve-12.5

25 Oct 16:37
Compare
Choose a tag to compare

This release improves the thread load balancing on CPUs with a large number of CPU cores. The worker threads now process smaller sieve intervals which improves the performance of short computations ≀10 seconds. On a 4th Gen AMD EPYC 9R14 CPU with 192 threads counting the primes up to 10^12 now runs 10% faster (in 1.187 secs) and counting the primes up to 10^11 runs 70% faster (in 0.115 secs).

ChangeLog

  • ParallelSieve.cpp: Tune thread load balancing.

primesieve-12.4

01 Aug 19:13
Compare
Choose a tag to compare

This is a maintenance release, the C/C++ API and ABI are fully backwards compatible with primesieve-12.*

ChangeLog

  • Move x86 CPUID code from cpuid.hpp to src/x86/cpuid.cpp.
  • multiarch_x86_popcnt.cmake: Detect x86 POPCNT support.
  • CMakeLists.txt: Use CMake list for all compile time definitions.
  • CMakeLists.txt: Use CMake list for all link libraries.

primesieve-12.3

18 Apr 17:50
Compare
Choose a tag to compare

This release adds runtime dispatching to AVX512 (for x64 CPUs that support it) for MinGW. For x64 CPUs, AVX512 runtime dispatching is now enabled by default when compiling using GCC and Clang on all operating systems.

  • Improve Windows multiarch support (now works with MinGW64).
  • Add runtime POPCNT detection using CPUID for x86 CPUs.
  • Improve GCC/Clang multiarch preprocessor logic.
  • CMakeLists.txt: Remove POPCNT/BMI check for x86 CPUs.

primesieve-12.1

10 Mar 10:22
Compare
Choose a tag to compare

This is a new maintenance release, it is fully backwards compatible with the previous release.

  • CMakeLists.txt: Fix undefined reference to pthread_create #146.
  • test/Riemann_R.cpp: Fix musl libc issue #147.
  • src/app/test.cpp: Fix -ffast-math failure.
  • test/count_primes2.cpp: Fix -ffast-math failure.
  • PrimeSieve.cpp: Improve status output.

primesieve-12.0

19 Feb 14:46
Compare
Choose a tag to compare

The C/C++ API and ABI of primesieve-12.0 are fully backwards compatible with primesieve-11.*

The stress test functionality is the main new feature of primesieve-12.0, it can be launched using the --stress-test[=MODE] option of the primesieve command-line application. The stress test option supports two modes: CPU (default) or RAM. The CPU mode uses little memory (< 5 MiB per thread) and puts the highest load on the CPU. The RAM mode uses much more memory (each thread uses about 1.16 GiB) than the CPU mode, but the CPU usually won't get as hot. Due to primesieve's function multi-versioning support, on x64 CPUs the stress test will run an AVX512 algorithm if your CPU supports it.

  • stressTest.cpp: New -S[=MODE] and --stress-test[=MODE] command-line options.
  • RiemannR.cpp: Faster Riemann R function implementation #144.
  • CmdOptions.cpp: New -R and --RiemannR command line options.
  • CmdOptions.cpp: New --RiemannR-inverse command line option.
  • CmdOptions.cpp: Add new --timeout option for stress testing.
  • main.cpp: Improve command-line option handling.

primesieve-11.2

10 Jan 17:13
Compare
Choose a tag to compare

This is a new maintenance release, it is fully backwards compatible with the previous release. This release contains one CMake bug fix, documentation improvements, tests have been ported to GitHub Actions and the nth prime code has been cleaned up.

  • nthPrime.cpp: Rewritten using more accurate nth prime approximation.
  • nthPrimeApprox.cpp: Added logarithmic integral and Riemann R function implementations.
  • cmake/libatomic.cmake: Fix failed to find libatomic #141.
  • .github/workflows/ci.yml: Port AppVeyor CI tests to GitHub Actions.
  • doc/C_API.md: Fix off by 1 error in OpenMP example #137.
  • doc/CPP_API.md: Fix off by 1 error in OpenMP example #137.
  • Vector.hpp: Rename pod_vector to Vector and pod_array to Array.
  • iterator.h: Improve documentation.
  • iterator.hpp: Improve documentation.
  • C_API.md: Add SIMD (vectorization) section.
  • CPP_API.md: Add SIMD (vectorization) section.
  • README.md: Add C & C++ API badges.

Thanks to @sethtroisi and Sven S. for being primesieve sponsors in this release cycle!

primesieve-11.1

13 May 07:47
Compare
Choose a tag to compare

When primesieve is distributed via distro package managers, it is often not compiled using the highest optimization level -O3. Because of this primesieve's pre-sieving algorithm was not auto-vectorized in many cases. As a workaround for this issue I have now manually vectorized the pre-sieving algorithm for x64 CPUs (using portable SSE2) and for ARM64 CPUs (using portable ARM NEON). This can improve performance by up to 40%.

  • PreSieve.cpp: Vectorize loop using x64 SSE2 & ARM NEON.
  • popcount.cpp: Add POPCNT algorithm for x64 & AArch64.
  • primesieve.h: Fix -Wstrict-prototypes warning.
  • examples/c/*.c: Fix -Wstrict-prototypes warning.
  • test/*.c: Fix -Wstrict-prototypes warning.
  • CMakeLists.txt: New WITH_AUTO_VECTORIZATION option (with default ON).
  • cmake/auto_vectorize.cmake: Enable auto-vectorization if the compiler supports it.
  • scripts/build_mingw64_x64.sh: Build primesieve x64 release binary.
  • scripts/build_mingw64_arm64.sh: Build primesieve arm64 release binary.

primesieve-11.0

06 Dec 17:56
Compare
Choose a tag to compare

This version fixes two annoying libprimesieve issues. Firstly, from now on the shared libprimesieve version (.so version) will match the primesieve version. This makes it easier to depend on libprimesieve and to update to the latest libprimesieve. Secondly, primesieve_jump_to() has been added to libprimesieve's API. The new primesieve_jump_to(iter, start, stop) includes the start number (generates primes β‰₯ start), whereas the old primesieve_skipto(iter, start, stop) excludes the start number (generates primes > start). In practice, the use of
primesieve_jump_to() requires up to 2x less start number corrections (e.g. start-1) compared to primesieve_skipto().

C API deprecations

The libprimesieve C API and ABI are backwards compatible with libprimesieve β‰₯ 10.0. However, the primesieve_skipto() function from the libprimesieve C API has been marked as deprecated, please use the new primesieve_jump_to() instead.

C++ API breaking changes

Unlike the C API, in the C++ API the primesieve::iterator::skipto() method has been replaced by primesieve::iterator::jump_to(). The new method includes the start number whereas the old method excluded the start number. The primesieve::iterator constructors now also include the start number while they previously excluded the start number. Please read the documentation for more information.

ChangeLog

  • CMakeLists.txt: Improve Emscripten WebAssembly support.
  • iterator.cpp: Add new primesieve::iterator::jump_to().
  • iterator.cpp: Fix use after free in primesieve::iterator::clear().
  • iterator-c.cpp: Add new primesieve_jump_to().
  • iterator-c.cpp: Mark primesieve_skipto() as deprecated.
  • iterator-c.cpp: Fix use after free in primesieve_iterator_clear().
  • pod_vector.hpp: Added support for types with destructors.
  • malloc_vector.hpp: Fix potential memory leak.
  • api.cpp: Support non power of 2 sieve sizes.
  • PrimeSieve.cpp: Support non power of 2 sieve sizes.
  • PreSieve.cpp: Use std::initializer_list instead of std::vector.
  • Erat.cpp: Improve documentation.
  • C_API.md: Improve next_prime() and prev_prime() documentation.
  • CPP_API.md: Improve next_prime() and prev_prime() documentation.

Acknowledgements

I would like to thank Philip Vetter for his detailed feedback on the libprimesieve API, which caused me to create the new primesieve_jump_to().