Commit Graph
48 Commits
Author SHA1 Message Date
mlemanczyk 1b3882addc PrimeOrderCalculator.PartialFactorCpu variables optimized. Removed constant parameter from AddFactorToCollector. 2025-12-13 15:36:32 +01:00
mlemanczyk ec080ade7f PendingEntry renamed to PartialFactorPendingEntry and moved to its own file. PrimeOrderCalculator.PartialFactor partially optimized to use fixed buffers factors & exponents. 2025-12-13 05:11:02 +01:00
mlemanczyk 8fbe248a49 Revert "Reusable buffers introduced."
This reverts commit 39a66fdef1.
2025-12-13 04:17:30 +01:00
mlemanczyk 39a66fdef1 Reusable buffers introduced. 2025-12-13 04:16:05 +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 131b3265bc PrimeOrderCalculator.Cpu cleaned up - hybrid & GPU related methods moved to their corresponding files. 2025-12-11 00:00:12 +01:00
mlemanczyk 05d3061c47 MethodImplOptions.AggressiveOptimization & MethodImplOptions.AggressiveInlining optimized. Small optimizations. 2025-12-10 19:59:51 +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 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 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 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 497b1fcf89 Kernels replaced with pre-compiled actions for better performance 2025-11-20 03:00:11 +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 56be12ab95 Cleanup & compilation fixes. 2025-11-18 04:45:18 +01:00
mlemanczyk 801b1be3e3 Cleanup 2025-11-18 04:22:39 +01:00
mlemanczyk bf7c4bab39 Accelerator buffers integrated 2025-11-18 01:13:12 +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 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 c53aa517f7 GpuScratchBuffer / -Pool naively integrated with PriemOrderCalculatorAccelerator (formerly Pow2MontgomeryAccelerator). FactorEntry replaced with 2 arrays - unused field removed. Small cleanup. 2025-11-13 14:41:27 +01:00
mlemanczyk 43863d03fb Performance improvements 2025-11-13 00:51:32 +01:00
mlemanczyk 5bc65464d0 Initial PollardRho implementation for GPU. Added pool for accelerator streams shared across the threads. GPU processing performance and stabilization improvements. GpuUInt128.BinaryGcd switched to the version which outperformed other in benchmarks. 2025-11-12 21:18:30 +01:00
mlemanczyk cf5f78c2ef PrimeTesterByLastDigitAccelerator integrated into Pow2MontgomeryGpuCalculator for better performance. 2025-11-11 13:36:21 +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 fa89958736 Stabilization improvements. Stream will be released when releasing GPU lease to prevent application crashes. 2025-11-10 14:30:30 +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
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 de7ddd8db3 Remove GPU context creation lock 2025-10-28 13:26:20 +01:00
Marek Lemańczyk 6dd5cea79f Remove temporary by-divisor review documents 2025-10-28 02:01:28 +01:00
mlemanczyk ea11db6d0f Restored the Dictionary parameter instead of arrays 2025-10-21 04:08:48 +02:00
mlemanczyk fddec17b3f Various try-out changes 2025-10-17 06:53:54 +02:00
Marek Lemańczyk 67ad36420a Add GPU kernel for small prime factoring 2025-10-17 05:31:07 +02:00
mlemanczyk 56e413064a Using cleanup 2025-10-17 02:40:51 +02:00
Marek Lemańczyk ca0f498d0d Recycle small prime stepper arrays 2025-10-17 02:34:41 +02:00