Commit Graph
56 Commits
Author SHA1 Message Date
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 49e47b161d Tiny cleanup. Namespace updated. 2025-12-12 00:56:33 +01:00
mlemanczyk 7a242b3bfa PrimeOrderCalculator.PartialFactorCpu simplified to work only with spans and throw exception if the number of factors is exceeded. PrimeOrderMode removed in favor of bool flag. 2025-12-10 12:47:25 +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 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 57a50e2a37 Pow2Mod kernel specific methods moved to Pow2MontgomeryKernels. 2025-11-24 18:04:07 +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 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 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
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
mlemanczyk fc5700f82c IsPrime with cancellation token removed. 2025-10-29 22:31:28 +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 4e9d57df4b Unify GPU divisor kernels with stepper path 2025-10-24 20:50:52 +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 fa6f75c158 Document GPU sieve invariants 2025-10-22 00:38:51 +02:00
Marek Lemańczyk 1809ba95b3 Inline GpuUInt128 Mul64 helper 2025-10-20 13:30:34 +02:00
Marek Lemańczyk 79e8706644 Restore original guard comments in pow2 helpers 2025-10-19 20:21:09 +02:00
Marek Lemańczyk 405436988f Update GPU pow2 tests to use realistic exponents 2025-10-19 01:49:12 +02:00
Marek Lemańczyk 6217ea7888 Document GPU kernel audit progress 2025-10-18 17:42:33 +02:00
mlemanczyk 56e413064a Using cleanup 2025-10-17 02:40:51 +02:00
Marek Lemańczyk c9ae56a5ec Remove default prime order overloads 2025-10-10 21:51:41 +02:00
Marek Lemańczyk cd1debe9d6 Various micro- and medium- optimizations 2025-10-07 22:14:34 +02:00
Marek Lemańczyk 20120f5bc0 Fix odd power table updates in GPU heuristics 2025-10-05 16:55:27 +02:00
Marek Lemańczyk 0bc97937aa Restore GPU-backed UInt128 pow2 Montgomery helper 2025-10-05 02:13:31 +02:00
Marek Lemańczyk 38df505f4f Implement GPU pow2 heuristics with safe fallbacks 2025-10-04 22:40:12 +02:00
Marek Lemańczyk ea08d3f71f Inline GPU overflow tracking helpers 2025-10-04 22:40:07 +02:00
Marek Lemańczyk 6adac6b7a7 Consolidate multiply helpers and guard GPU fallbacks 2025-10-04 21:20:29 +02:00
Marek Lemańczyk 84ebbed98b Add shift-first multiply helper and document benchmarks 2025-10-04 20:01:10 +02:00
Marek Lemańczyk 604e91b3e3 Return scalar MulMod results and benchmark native reducers 2025-10-01 00:41:27 +02:00
Marek Lemańczyk 9becb8df67 using cleanup. 2025-09-23 22:00:31 +02:00