Added static IsPrimeGpu
This commit is contained in:
1 parent
ea11db6d0f
commit
31a0b8d706
1 file changed
+4
-2
@@ -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)
|
||||
{
|
||||
|
||||
Reference in new issue
Block a user