This commit is contained in:
mlemanczyk committed 2025-11-25 00:50:18 +01:00
1 parent e8b4c1fc83
commit 47521e327a
3 files changed
+3 -12

No files matched your search

@@ -168,16 +168,6 @@ public sealed class HeuristicCombinedPrimeTester
return HeuristicTrialDivisionCpu(n, maxDivisorSquare, nMod10);
}
// public static bool IsPrimeGpu(ulong n)
// {
// byte nMod10 = (byte)n.Mod10();
// ulong maxDivisorSquare = ComputeHeuristicDivisorSquareLimit(n);
// var gpu = PrimeOrderCalculatorAccelerator.Rent(1);
// bool isPrime = IsPrimeGpu(gpu, n, maxDivisorSquare, nMod10);
// PrimeOrderCalculatorAccelerator.Return(gpu);
// return isPrime;
// }
public static bool IsPrimeGpu(PrimeOrderCalculatorAccelerator gpu, ulong n)
{
byte nMod10 = (byte)n.Mod10();
@@ -180,6 +180,7 @@ public sealed class MersenneNumberTester(
{
tmp[i] = (GpuUInt128)qs[offset + i];
}
// Copy only the populated elements to the device buffer to avoid overrun on pooled arrays.
qBuffer.View.CopyFromCPU(stream, ref tmp[0], count);
gpuUInt128Pool.Return(tmp);