Commit Graph
137 Commits
Author SHA1 Message Date
mlemanczyk 74837a407e MersenneDivisorCycles converted to device template. 2025-12-19 04:03:27 +01:00
mlemanczyk 2abc6aae49 --mersenne=bydivisor testers and sessions integrated and converted to structs. 2025-12-18 05:07:31 +01:00
mlemanczyk 3c80221105 MontgomeryDivisorDataPool.Rent / .Return removed as we no longer pool Montgomery divisor data. UInt128Extensions.MontgomeryDivisorDataPool variables optimized. 2025-12-16 02:27:29 +01:00
mlemanczyk 260aa19e44 Pools renamed to FixedCapacityPools. Other fixed capacity collections added. Queues, concurrent queues and standard stacks replaced with fixed capacity stacks. MethodImplOptions.AggressiveInlining and .AggressiveOptimization added to simple methods and getters / setters. Variables optimized in few places. 2025-12-11 21:10:19 +01:00
mlemanczyk 5df2cc7f9b using cleaned up. 2025-12-10 23:59:04 +01:00
mlemanczyk 6887111128 BigInteger-friendly steppers added. MersenneResidueStepper converted to struct. Manual residue tracking replaced with steppers. Modulo operations replaced with steppers. 2025-12-07 19:16:45 +01:00
mlemanczyk 86f20ed083 Support for q > 2^64 added in --mersenne=bydivisor mode 2025-12-05 23:33:21 +01:00
mlemanczyk 86192a71b0 Divisor checking optimized to only flag if divisor was found or not without returning complete array of hits. We'll now also track residues for 13, 17 & 19 as the most frequent ones. 2025-12-03 00:57:25 +01:00
mlemanczyk f43c67c86f Tasks will now save calculations progress and resume calculation upon restart. 2025-12-02 00:42:38 +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 a296e62d4d --min-k command-line argument added. Partial factoring switched back to CPU. 2025-11-26 22:03:52 +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 07efd5d2a1 Accelerator locks removed 2025-11-23 14:59:29 +01:00
mlemanczyk 6d1ff1372e Factoring switched to PrimeTester.IsPrime for the best performance. PrimeOrderCalculator.PartialFactor switched to GPU factorization. Every so often it will send work to GPU instead of CPU. BatchedResources renamed to MersenneNumberDivisorByDivisorAccelerator for consistency and moved to its own file. It now uses array instead of dictionary for lookup free performance. 2025-11-23 00:07:03 +01:00
mlemanczyk 9939c5d562 Divisor will now be saved to CSV file 2025-11-19 22:14:28 +01:00
mlemanczyk 5cac51479e GPU memory allocations protected with lock to prevent shared memory access issues. GPU usage limited for the best performance. 2025-11-19 16:49:01 +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 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 0540411cad Accelerator index added for dictionary-less use-cases 2025-11-15 02:21:45 +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 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 f4e365194d GpuContextPool removed, because we share context and accelerator between threads, using streams to separate. 2025-11-07 12:52:20 +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
mlemanczyk 07be671726 Various small optimizations 2025-11-02 11:24:18 +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 5536dc4865 Fix GPU by-divisor hang for small primes 2025-10-29 19:21:41 +01:00
mlemanczyk 4c79c4087e Various optimizations 2025-10-29 14:00:38 +01:00
Marek Lemańczyk 6dd5cea79f Remove temporary by-divisor review documents 2025-10-28 02:01:28 +01:00
Marek Lemańczyk 94a4ed8328 Hoist prime order thresholds in CPU heuristics 2025-10-27 21:24:43 +01:00
Marek Lemańczyk 3758524450 Extract divisor validator and rename legacy CPU prime helper 2025-10-26 18:59:07 +01:00
Marek Lemańczyk c01abbd03a Restore legacy by-divisor scans for Mersenne testers 2025-10-26 16:04:09 +01:00
Marek Lemańczyk 43c7bafd5d Restore CPU PrimeTester usage and rename fallback helpers 2025-10-26 15:19:49 +01:00
Marek Lemańczyk 15c229665d Add heuristic prime sieves for cached divisor sequences 2025-10-26 03:21:29 +01:00
Marek Lemańczyk 2d103a9662 Compute initial divisor remainders inside GPU kernel 2025-10-25 05:41:05 +02:00
Marek Lemańczyk 32f9f25e9b Share GPU by-divisor batch resources across accelerators 2025-10-25 05:03:16 +02:00
Marek Lemańczyk 3735a1cf0f Gate GPU by-divisor scans to a single accelerator 2025-10-25 05:00:54 +02:00
Marek Lemańczyk 6b1c2d0665 Reuse GPU by-divisor buffers to curb host allocations 2025-10-25 03:45:46 +02:00
Marek Lemańczyk 4e9d57df4b Unify GPU divisor kernels with stepper path 2025-10-24 20:50:52 +02:00
Marek Lemańczyk 868c7a4fd2 Tighten GPU divisor heuristics and stepper usage 2025-10-24 20:50:46 +02:00
Marek Lemańczyk bbe0c02069 Use bit masks for divisor heuristics 2025-10-24 19:50:27 +02:00
Marek Lemańczyk 46a2178d65 Remove Montgomery data from GPU divisor flow 2025-10-24 18:56:28 +02:00
Marek Lemańczyk 69acd3dad9 Cache GPU divisor partial data on GPU path 2025-10-24 18:56:21 +02:00