Various micro- and medium- optimizations

This commit is contained in:
Marek Lemańczyk committed 2025-10-07 22:14:34 +02:00
1 parent 2eb622030e
commit cd1debe9d6
25 files changed
+4403 -3210

No files matched your search

+4
View File
@@ -1,3 +1,5 @@
using PerfectNumbers.Core.Gpu;
namespace PerfectNumbers.Core
{
public static class UInt128Numbers
@@ -9,6 +11,8 @@ namespace PerfectNumbers.Core
public static readonly UInt128 OneShiftedLeft64 = UInt128.One << 64;
public static readonly UInt128 OneShiftedLeft64x2 = Two * OneShiftedLeft64;
public static readonly GpuUInt128 TwoGpu = new(2UL);
// TODO: Populate this table from the UInt128 residue benchmarks so GPU kernels can pull precomputed constants
// without re-deriving them at runtime.
// TODO: Extend the table with cached Mod3/Mod5 folding constants so both CPU and GPU residue helpers can reuse