Added static IsPrimeGpu

This commit is contained in:
mlemanczyk committed 2025-10-21 04:09:26 +02:00
1 parent ea11db6d0f
commit 31a0b8d706
1 file changed
+4 -2
+4 -2
View File
@@ -15,8 +15,10 @@ public sealed class PrimeTester(bool useInternal = false)
// indirection shows up when we sieve millions of candidates per second.
IsPrimeInternal(n, ct);
// Optional GPU-assisted primality: batched small-prime sieve on device.
public bool IsPrimeGpu(ulong n, CancellationToken ct)
public static bool IsPrimeGpu(ulong n) => new PrimeTester().IsPrimeGpu(n, CancellationToken.None);
// Optional GPU-assisted primality: batched small-prime sieve on device.
public bool IsPrimeGpu(ulong n, CancellationToken ct)
{
if (GpuContextPool.ForceCpu)
{