Commit Graph
43 Commits
Author SHA1 Message Date
mlemanczyk f7dbc017a9 Modulo operators replaced with steppers, where possible. 2025-12-08 20:57:47 +01:00
mlemanczyk 941733905b Hybrid device mode implemented as the current --mersenne=bydivisor CPU execution path. CPU path is now limited to CPU calculations, only. 2025-12-01 03:45:39 +01:00
mlemanczyk c311b27dcc Prime testing using divisor tables depending on the last digit separated to its own class. PrimeTester switched back to standard endings. 2025-11-27 16:45:02 +01:00
mlemanczyk 13498dc460 Most device buffers integrated into PrimeOrderCalculatorAccelerator. PrimeOrderCalculator switched to partial factoring on GPU. 2025-11-26 03:16:39 +01:00
mlemanczyk b9ca95bf8c PrimeOrderCalculatorAccelerator.Rent is now created outside of the loops and re-used for all calculations. 2025-11-24 22:51:53 +01:00
mlemanczyk 070e2a14fd MontgomeryDivisorData converted to a pooled class to limit GC pressure. MontgomeryDivisorDataGpu added for GPU operations. PrimeOrderCalculator kernels precompiled during warmup. 2025-11-24 15:14:31 +01:00
mlemanczyk 497b1fcf89 Kernels replaced with pre-compiled actions for better performance 2025-11-20 03:00:11 +01:00
mlemanczyk df04ba601c Various small optimizations and cleanups. Methods made static, where possible. Duplicated & slow PrimeTester.BinaryGcd implementation removed. Optimized version was used instead. 2025-11-20 01:43:29 +01:00
mlemanczyk 66ca969929 Naming improvements and small cleanup 2025-11-18 03:43:52 +01:00
mlemanczyk bf7c4bab39 Accelerator buffers integrated 2025-11-18 01:13:12 +01:00
mlemanczyk f630bfb598 HeuristicCombinedPrimeTesterAccelerator integrated with PrimeOrderCalculatorAccelerator. 2025-11-17 17:38:23 +01:00
mlemanczyk 183b147135 Heuristic tables split into 2 groups 2025-11-17 16:04:27 +01:00
mlemanczyk c413ee1162 Revert "Stream handling simplified to avoid dictionary lookups in favor of array lookups with known indexes."
This reverts commit a84445ef2a.
2025-11-16 17:14:48 +01:00
mlemanczyk a84445ef2a Stream handling simplified to avoid dictionary lookups in favor of array lookups with known indexes. 2025-11-16 15:01:51 +01:00
mlemanczyk be435b7760 Kernels made part of the accelerators for better performance. 2025-11-13 18:52:46 +01:00
mlemanczyk 0d2a88c45f GpuPrimeWorkLimiter.Acquire() / .Release() removed to save time on the hot-path with billions of calls. We'll rely on AcceleratorStreamPool limits and synchronization. 2025-11-13 17:52:13 +01:00
mlemanczyk 0de9871529 Functionality and classes separated. Kernel initialization made dependent on a flag. Cleanup. 2025-11-10 18:35:50 +01:00
mlemanczyk d0b1639a5d GPU stabilization improvements to prevent calculation crashes 2025-11-09 21:52:16 +01:00
mlemanczyk de2a78b27b Streams added to all kernels and GPU operations to separate threads from each other. 2025-11-06 18:53:55 +01:00
mlemanczyk 64d615c402 Various optimizations to separate non-static data between threads and resolve read/write access issue. 2025-11-04 20:45:56 +01:00
Marek Lemańczyk 4c4d4243fb Merge remote-tracking branch 'github/codex/optimize-evenperfectbitscanner-for-static-arrays-khd9w8' into work
# Conflicts:
#	PerfectNumbers.Core/Gpu/GpuContextPool.cs
#	PerfectNumbers.Core/Gpu/GpuKernelLease.cs
#	PerfectNumbers.Core/Gpu/GpuKernelPool.cs
#	PerfectNumbers.Core/Gpu/GpuStaticTableInitializer.cs
#	PerfectNumbers.Core/Gpu/Kernels/PrimeOrderSpecialMaxKernels.cs
#	PerfectNumbers.Core/PrimeOrderCalculator.Cpu.cs
#	PerfectNumbers.Core/PrimeOrderCalculator.Gpu.cs
#	PerfectNumbers.Core/PrimeTester.cs
2025-11-03 23:59:12 +01:00
Marek Lemańczyk 76dfe108a9 Address feedback on GPU pooling and heuristic factoring 2025-11-02 11:22:49 +01:00
Marek Lemańczyk ab6a416de2 Warm GPU resources before thread startup 2025-11-02 11:22:28 +01:00
mlemanczyk 2281d9535e Revert "Merge pull request #251 from mlemanczyk/codex/refactor-prime-checking-on-gpu-n5t2pm"
This reverts commit 936ce239db, reversing
changes made to e14b77e504.
2025-11-02 11:22:14 +01:00
Marek Lemańczyk 8c662c5c85 Address feedback on GPU pooling and heuristic factoring 2025-10-31 21:47:42 +01:00
Marek Lemańczyk 6864b316d5 Warm GPU resources before thread startup 2025-10-31 16:56:25 +01:00
mlemanczyk e14b77e504 Batch size made dynamic - dependent on the value 2025-10-30 02:43:15 +01:00
mlemanczyk fc5700f82c IsPrime with cancellation token removed. 2025-10-29 22:31:28 +01:00
Marek Lemańczyk f9504a6a19 Use atomic flag writes in heuristic trial division 2025-10-29 20:40:40 +01:00
Marek Lemańczyk 5ac05489c1 Use precomputed divisor squares in heuristic prime tester 2025-10-29 20:22:41 +01:00
Marek Lemańczyk f7a0627ce5 Align heuristic prime testers with squared limits 2025-10-29 19:35:59 +01:00
Marek Lemańczyk a4ac82e74d Inline GPU kernel state into prime tester leases 2025-10-29 18:13:51 +01:00
Marek Lemańczyk aab785650d Manage GPU lease buffers without kernel scratch pool 2025-10-29 16:53:22 +01:00
Marek Lemańczyk 13b59abb1c Embed GPU scratch buffers in context leases 2025-10-29 16:25:38 +01:00
Marek Lemańczyk b0158a844a Use divisor squares to bound heuristic combined trial division 2025-10-29 15:13:54 +01:00
mlemanczyk 4c79c4087e Various optimizations 2025-10-29 14:00:38 +01:00
Marek Lemańczyk f49963c4f6 Restore Math.Sqrt heuristic bound 2025-10-29 01:43:12 +01:00
Marek Lemańczyk 5a9e103bd5 Replace heuristic sqrt with log2-based estimate 2025-10-29 01:29:12 +01:00
Marek Lemańczyk eeeff42be6 Replace heuristic sqrt with integer algorithm 2025-10-29 01:02:31 +01:00
Marek Lemańczyk c693a05708 Add reusable group B divisor tables without trailing-three primes 2025-10-28 21:56:18 +01:00
Marek Lemańczyk 1e5eadac34 Refine heuristic prime tester integration 2025-10-26 18:15:27 +01:00
Marek Lemańczyk 55554d9565 Inline legacy GPU sieve and update heuristic fallbacks 2025-10-26 17:06:13 +01:00
Marek Lemańczyk 43c7bafd5d Restore CPU PrimeTester usage and rename fallback helpers 2025-10-26 15:19:49 +01:00