Extract divisor validator and rename legacy CPU prime helper

This commit is contained in:
Marek Lemańczyk committed 2025-10-26 18:59:07 +01:00
1 parent 1e5eadac34
commit 3758524450
11 files changed
+67 -61

No files matched your search

+2 -2
View File
@@ -93,10 +93,10 @@ public sealed class PrimeTester
bool gpuReportedPrime = !forceCpu && !belowGpuRange && outFlags[0] != 0;
bool requiresCpuFallback = forceCpu || belowGpuRange || !gpuReportedPrime;
return requiresCpuFallback ? IsPrimeCp(n, ct) : true;
return requiresCpuFallback ? IsPrimeCpu(n, ct) : true;
}
public static bool IsPrimeCp(ulong n, CancellationToken ct)
public static bool IsPrimeCpu(ulong n, CancellationToken ct)
{
// Preserve the legacy entry point for callers that bypass the thread-local caches.
return Exclusive.IsPrime(n, ct);