Commit Graph
114 Commits
Author SHA1 Message Date
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 9939c5d562 Divisor will now be saved to CSV file 2025-11-19 22:14:28 +01:00
mlemanczyk 801b1be3e3 Cleanup 2025-11-18 04:22:39 +01:00
mlemanczyk 342eff2726 GpuKernelPool.GetOrAddKernels removed in --mersenne=bydivisor mode. PartialFactorResult.WithAdditionalPrime will now modify the current instance instead of creating new copy for better performance. SmallPrimeFactorViews renamed to SmallPrimeFactorGpuTables for consistency with other static tables. 2025-11-17 23:33:59 +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 cd7636ddbe Manual accelerator stream creations replaced with pool 2025-11-15 13:45:24 +01:00
mlemanczyk 42447c4e43 BinaryGcd switched to the best performing variant according to benchmarks. 2025-11-14 11:43:16 +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 8e779c5c9e GpuKernelLease removed 2025-11-07 15:36:45 +01:00
mlemanczyk 0410fd2c91 PooledContext removal - continuation. GpuKernelLease prepared for removal. 2025-11-07 14:13:11 +01:00
mlemanczyk 119690086a ConcurrentDictionary removed. Kernel made dependent on the shared GPU context. 2025-11-07 10:16:33 +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
mlemanczyk 07be671726 Various small optimizations 2025-11-02 11:24:18 +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
mlemanczyk 22f20bfe98 Various small optimizations 2025-11-01 03:42:36 +01:00
Marek Lemańczyk 6864b316d5 Warm GPU resources before thread startup 2025-10-31 16:56:25 +01:00
mlemanczyk fc5700f82c IsPrime with cancellation token removed. 2025-10-29 22:31:28 +01:00
Marek Lemańczyk f7a0627ce5 Align heuristic prime testers with squared limits 2025-10-29 19:35:59 +01:00
mlemanczyk 4c79c4087e Various optimizations 2025-10-29 14:00:38 +01:00
Marek Lemańczyk eeeff42be6 Replace heuristic sqrt with integer algorithm 2025-10-29 01:02:31 +01:00
Marek Lemańczyk b2cb17a96f Return to one-A-one-B combined schedule 2025-10-29 00:44:39 +01:00
Marek Lemańczyk f993561cd5 Eagerly build combined divisors and restore two-A-one-B default 2025-10-28 23:43:15 +01:00
Marek Lemańczyk e8d163f595 Add three-A-two-B combined divisor schedule 2025-10-28 23:22:16 +01:00
Marek Lemańczyk 465b40bf35 Add three-A-one-B schedule to combined tester 2025-10-28 23:09:41 +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 1792349bad Make GPU sieve results authoritative 2025-10-28 20:14:22 +01:00
Marek Lemańczyk c53966e481 Enable residue-aware GPU sieve in PrimeTester 2025-10-28 18:39:18 +01:00
Marek Lemańczyk 6dd5cea79f Remove temporary by-divisor review documents 2025-10-28 02:01:28 +01:00
Marek Lemańczyk 9a0e328995 Reintroduce MulHigh CPU helper and tighten GPU sieve loop 2025-10-26 23:41:14 +01:00
Marek Lemańczyk 0e1212aa1c Split MulHigh extensions into CPU and GPU variants 2025-10-26 22:42:21 +01:00
Marek Lemańczyk 3d458fc6da Use precomputed small prime squares in GPU sieve 2025-10-26 22:28:04 +01:00
Marek Lemańczyk 6458f6740d Add GPU prime tester overload for preallocated buffers 2025-10-26 20:30:44 +01:00
Marek Lemańczyk 21d645fcf0 Comment out legacy PrimeTester guards 2025-10-26 18:15:22 +01:00
Marek Lemańczyk a83ae56caf Use LastDigit enum across Mersenne scanners 2025-10-26 16:04:05 +01:00
Marek Lemańczyk 8e5a1cd4c7 Batch by-divisor GPU tasks across prime ranges 2025-10-25 05:58:50 +02:00
Marek Lemańczyk 4e9d57df4b Unify GPU divisor kernels with stepper path 2025-10-24 20:50:52 +02:00
Marek Lemańczyk fbd6235316 Handle zero-cycle GPU divisor sessions with heuristics 2025-10-24 06:40:33 +02:00
Marek Lemańczyk 8a258f7536 Collapse GPU by-divisor batching to a single launch 2025-10-24 01:23:38 +02:00
Marek Lemańczyk 40d3b4b3ac Fuse GPU by-divisor candidate filtering into one kernel 2025-10-24 01:23:25 +02:00
Marek Lemańczyk ab1a069e57 Optimize GPU divisor heuristics pipeline 2025-10-24 00:29:26 +02:00
Marek Lemańczyk dda53581c0 Merge pull request #225 from mlemanczyk/codex/analyze-evenperfectbitscanner-for-gpu-optimization
Add GPU candidate generation for divisor scanning
2025-10-23 00:52:59 +02:00
Marek Lemańczyk ea01585892 Convert divisor session results to hits on the GPU 2025-10-23 00:34:17 +02:00
Marek Lemańczyk f2070a0f64 Document CPU sieve invariants and cache boolean guards 2025-10-22 00:56:17 +02:00