Prime testing using divisor tables depending on the last digit separated to its own class. PrimeTester switched back to standard endings.

This commit is contained in:
mlemanczyk committed 2025-11-27 16:45:02 +01:00
1 parent a296e62d4d
commit c311b27dcc
12 files changed
+526 -215

No files matched your search

@@ -80,21 +80,17 @@ internal static class PrimeTesterKernels
public static void HeuristicTrialCombinedDivisionKernel(
Index1D index,
byte nMod10,
// byte nMod10,
ArrayView<int> resultFlag,
ulong n,
ulong maxDivisorSquare,
HeuristicCombinedGpuViews tables)
ArrayView<ulong> divisors,
ArrayView<ulong> divisorSquares)
{
var (divisors, divisorSquares) = tables.SelectDivisorsAndSquares(nMod10);
// var (divisors, divisorSquares) = tables.SelectDivisorsAndSquares(nMod10);
int threadIndex = index;
if (divisorSquares[threadIndex] > maxDivisorSquare)
{
return;
}
if (n % divisors[threadIndex] == 0UL)
if (divisorSquares[threadIndex] <= maxDivisorSquare && (n % divisors[threadIndex] == 0UL))
{
Atomic.Exchange(ref resultFlag[0], 1);
}