Commit Graph
79 Commits
Author SHA1 Message Date
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 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 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 cd7636ddbe Manual accelerator stream creations replaced with pool 2025-11-15 13:45:24 +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 9537addf38 ArrayPool<T> replaced with ThreadStaticPools 2025-11-07 00:46: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
mlemanczyk fc5700f82c IsPrime with cancellation token removed. 2025-10-29 22:31:28 +01:00
mlemanczyk 0850227881 Switched to heuristic GPU for a better performance than the standard one. 2025-10-28 22:15:33 +01:00
mlemanczyk bead40713c Switching .IsPrime check to CPU for much higher performance. 2025-10-28 20:49:11 +01:00
Marek Lemańczyk 6dd5cea79f Remove temporary by-divisor review documents 2025-10-28 02:01:28 +01:00
Marek Lemańczyk bd0727131f Merge pull request #238 from mlemanczyk/codex/optimize-evenperfectbitscanner-loops-kit1so
Hoist prime order thresholds in CPU heuristics
2025-10-27 21:31:23 +01:00
Marek Lemańczyk 94a4ed8328 Hoist prime order thresholds in CPU heuristics 2025-10-27 21:24:43 +01:00
mlemanczyk 50d66a5186 Switched to GPU version in some places. 2025-10-27 15:30:10 +01:00
mlemanczyk f2ce40ade9 Additional logging added. 2025-10-26 20:00:32 +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 1e5eadac34 Refine heuristic prime tester integration 2025-10-26 18:15:27 +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 fab9ba0413 Restore reviewed divisor heuristics 2025-10-24 19:50:32 +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
Marek Lemańczyk 1e5a9128cb Split CPU and GPU exponent steppers 2025-10-24 08:49:53 +02:00
Marek Lemańczyk 7feeb08943 Clarify Pollard-Rho parity guard and seed CPU batches 2025-10-23 19:50:39 +02:00
Marek Lemańczyk a226ae10cb Stop clearing pooled buffers inside rent helpers 2025-10-21 20:52:21 +02:00
Marek Lemańczyk 7baf3b619f Simplify exception guards in CPU remainder paths 2025-10-21 20:52:14 +02:00
Marek Lemańczyk 6adf78faf6 Streamline CPU remainder buffers 2025-10-21 20:52:09 +02:00
Marek Lemańczyk c15405e3b1 Reuse stack buffers when lowering divisor exponents 2025-10-21 18:22:56 +02:00
Marek Lemańczyk 8acccce471 Add cycle cache hit tracking instrumentation 2025-10-20 19:28:06 +02:00
Marek Lemańczyk 1a4818c794 Add diagnostics for removed factorization cache 2025-10-20 19:22:02 +02:00
Marek Lemańczyk 28ff9292b8 Remove per-thread factorization cache 2025-10-20 19:08:44 +02:00
Marek Lemańczyk da6ea25729 Address windowed pow2 review feedback 2025-10-20 18:37:29 +02:00
Marek Lemańczyk 481d1010e8 Retire outdated windowed pow2 TODOs 2025-10-20 18:37:21 +02:00
Marek Lemańczyk 75f815567d Remove try/finally from GPU Montgomery executor 2025-10-19 06:03:39 +02:00
Marek Lemańczyk 6217ea7888 Document GPU kernel audit progress 2025-10-18 17:42:33 +02:00
Marek Lemańczyk 8428e6c5bd Clarify skip heuristic guard and tighten order factor init 2025-10-17 15:05:11 +02:00
mlemanczyk 56e413064a Using cleanup 2025-10-17 02:40:51 +02:00