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.

This commit is contained in:
mlemanczyk committed 2025-11-12 21:18:30 +01:00
1 parent 735bfa1557
commit 5bc65464d0
15 files changed
+386 -136

No files matched your search

@@ -4,6 +4,7 @@ using System.Numerics;
using UInt128 = System.UInt128;
using ILGPU;
using System.Buffers;
using PerfectNumbers.Core.Cpu;
namespace PerfectNumbers.Core;
@@ -362,8 +363,8 @@ public static class MersennePrimeFactorTester
return 0UL;
}
c = (DeterministicRandom.NextUInt64() % (n - 1UL)) + 1UL;
x = (DeterministicRandom.NextUInt64() % (n - 2UL)) + 2UL;
c = (DeterministicRandomCpu.NextUInt64() % (n - 1UL)) + 1UL;
x = (DeterministicRandomCpu.NextUInt64() % (n - 2UL)) + 2UL;
y = x;
d = 1UL;
@@ -505,8 +506,8 @@ public static class MersennePrimeFactorTester
return 0;
}
c = (DeterministicRandom.NextUInt128() % (n - 1)) + 1;
x = (DeterministicRandom.NextUInt128() % (n - 2)) + 2;
c = (DeterministicRandomCpu.NextUInt128() % (n - 1)) + 1;
x = (DeterministicRandomCpu.NextUInt128() % (n - 2)) + 2;
y = x;
d = 1;